Comment by ~soruh on ~ireas/genpdf-rs
Ah, that makes sense.
Comment by ~soruh on ~ireas/genpdf-rs
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.
Comment by ~soruh on ~ireas/genpdf-rs
Actually, it would be possible for a user to do this by creating a new, downcastable, trait and implementing it for every instance of
Element
so feel free to close this issue if you feel that this is the most appropriate solution.
Ticket created by ~soruh on ~ireas/genpdf-rs
Applications currently cannot dynamically generate different types of
Element
s as they need to be passed to a function that is generic overE: Element
and it is not possible for a library user todowncast
adyn Element
to a specificElement
.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.
Comment by ~soruh on ~ireas/genpdf-rs
Would it make sense / be possible to allow
push
ing anyElement
into a Paragraph?
Ticket created by ~soruh on ~ireas/genpdf-rs
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
push
aBreak
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?
Comment by ~soruh on ~ireas/genpdf-rs
Thank you very much. I'm okay with tracking master for now, so do the next release when you think it makes sense.
Comment by ~soruh on ~ireas/genpdf-rs
For now I want to emit to ansi term and probably html so
text-style
should work great for me. I might want to use fonts in the future but that is very low priority for now.
REPORTED
RESOLVED FIXEDTicket created by ~soruh on ~ireas/genpdf-rs
I have started using genpdf as my pdf backend and really like the
StyledString
andStyle
types. I would like to also use them for my other backends, unfortunately using them requires pulling in all ofgenpdf
's dependencies so I think it would make sense to make a newstyled-string
crate for it.P.s.: Thank you for your work on this