I’ve added the Area::next_layer on the master branch, so feel free to submit a patch for this feature.
~ireas (and ~ap4sc) would it be ok if I did this?
Comment by ~ap4sc on ~ireas/genpdf-rs
I was thinking of using
Any
to downcast, but you're right there isn't a simple way to do it that accounts for lists within other elements. Might be worth adding a short note in the docs about wrapping inner lists in aLinearLayout
Ticket created by ~ap4sc on ~ireas/genpdf-rs
Just noticed this issue with the fix for #21
This is three paragraphs with a single string pushed to each of font sizes 12 - 60 - 12.
Comment by ~ap4sc on ~ireas/genpdf-rs
Sounds good, I pushed those changes to the above branch
Comment by ~ap4sc on ~ireas/genpdf-rs
Managed to figure this one out, pushed it to my branch for #21:
https://git.sr.ht/~ap4sc/genpdf-rs/log/todo/21
The value we were looking for was
rusttype::HMetrics::left_side_bearing
which is the space between the bounding box and the glyph on the left. It now calculates that for the first character in each paragraph line and subtracts it from the width
Comment by ~ap4sc on ~ireas/genpdf-rs
Thanks, I didn't think of that but that would also work. I do think it would be convenient to have a toggle for it in the struct, since hiding the outer point is the default behavior in most word processing applications
Ticket created by ~ap4sc on ~ireas/genpdf-rs
Would it be possible to disable the outer bullet when a Ordered/UnorderedList is added within another List, either entirely or with a toggle?
I think I could figure out how to implement this one if it's fine to add.
Comment by ~ap4sc on ~ireas/genpdf-rs
I extended my rounded corners implementation to add the ability enable/disable individual sides of the border, set in the new struct
BorderStyle
. The draw function isn't pretty but after several attempts this "manual" mapping method is the most efficient I could think of. On the plus side it simplifies the element code by automatically figuring out which corners need to be connected and rounded.https://git.sr.ht/~ap4sc/genpdf-rs/commit/fbf8656c3d2e25a8aab2f901f4f5bc92ff9b924a
One way to make it more modular in the future could be to move the rounded corners, LineStyle, [and fill color] into a separate RoundedRectangle shape struct for reuse in the shapes drawing feature
Comment by ~ap4sc on ~ireas/genpdf-rs
Finished here:
https://git.sr.ht/~ap4sc/genpdf-rs/commit/67eb37c4cccba82a0a1330c0e357a7aff4ada4e1
However setting
with_line_spacing
on theParagraph
still doesn't seem to do anything. I'm not sure where to add this calculation inParagraph render()