~soruh


#19 Explicit line breaks inside of paragraphs 3 years ago

Comment by ~soruh on ~ireas/genpdf-rs

Ah, that makes sense.

#23 Allow downcasting dyn Element or take Box<dyn Elements> 3 years ago

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.

#23 Allow downcasting dyn Element or take Box<dyn Elements> 3 years ago

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.

#23 Allow downcasting dyn Element or take Box<dyn Elements> 3 years ago

Ticket created by ~soruh on ~ireas/genpdf-rs

Applications currently cannot dynamically generate different types of Elements as they need to be passed to a function that is generic over E: Element and it is not possible for a library user to downcast a dyn Element to a specific Element.

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.

#19 Explicit line breaks inside of paragraphs 3 years ago

Comment by ~soruh on ~ireas/genpdf-rs

Would it make sense / be possible to allow pushing any Element into a Paragraph?

#19 Explicit line breaks inside of paragraphs 3 years ago

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 a Break 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?

#11 Extract style module into its own crate 3 years ago

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.

#11 Extract style module into its own crate 3 years ago

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 FIXED

#11 Extract style module into its own crate 3 years ago

Ticket created by ~soruh on ~ireas/genpdf-rs

I have started using genpdf as my pdf backend and really like the StyledString and Style types. 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-string crate for it.

P.s.: Thank you for your work on this