Ah, that makes sense.
Having push_box in some cases but not in others seems a bit unfortunate but I think it makes the most sense. Especially since the Elements need to be unboxed anyways if they are not stored in a Box internally.
Actually, it would be possible for a user to do this by creating a new, downcastable, trait and implementing it for every instance of
Elementso feel free to close this issue if you feel that this is the most appropriate solution.
Applications currently cannot dynamically generate different types of
Elements as they need to be passed to a function that is generic over
E: Elementand it is not possible for a library user to
dyn Elementto a specific
I think it would make sense to implement downcast methods (probably using downcast) or have methods take
Box<dyn Element>directly however the overhead the latter would cause for the case where the discrete type is known may not be acceptable in this case.
Would it make sense / be possible to allow
Elementinto a Paragraph?
It seems to me like there is no way to explicitly terminate a line inside of a paragraph, as "\n" characters are rendered as broken glyphs and there is no way to
Element. Is this due to requirements of the layout process and I should just create a new paragraph if I need a line break or is it possible to implement a way to do this?
Thank you very much. I'm okay with tracking master for now, so do the next release when you think it makes sense.
For now I want to emit to ansi term and probably html so
text-styleshould work great for me. I might want to use fonts in the future but that is very low priority for now.
I have started using genpdf as my pdf backend and really like the
Styletypes. I would like to also use them for my other backends, unfortunately using them requires pulling in all of
genpdf's dependencies so I think it would make sense to make a new
styled-stringcrate for it.
P.s.: Thank you for your work on this