~ap4sc


#37 Add fill color for frames 9 months ago

on ~ireas/genpdf-rs

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?

#39 Hide outer bullet point when List is nested within a List 3 years ago

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 a LinearLayout

#50 Descending characters not accounted for in Paragraph spacing 3 years ago

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

Just noticed this issue with the fix for #21

1

This is three paragraphs with a single string pushed to each of font sizes 12 - 60 - 12.

#31 Text alignment differs between font sizes 3 years ago

Comment by ~ap4sc on ~ireas/genpdf-rs

Sounds good, I pushed those changes to the above branch

#31 Text alignment differs between font sizes 3 years ago

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

#39 Hide outer bullet point when List is nested within a List 3 years ago

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

#39 Hide outer bullet point when List is nested within a List 3 years ago

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?

1

I think I could figure out how to implement this one if it's fine to add.

#38 Support rounded corners for frames 3 years ago

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

#21 Calculate line height per line in paragraphs 3 years ago

Comment by ~ap4sc on ~ireas/genpdf-rs

Finished here:

https://git.sr.ht/~ap4sc/genpdf-rs/commit/67eb37c4cccba82a0a1330c0e357a7aff4ada4e1

However setting with_line_spacing on the Paragraph still doesn't seem to do anything. I'm not sure where to add this calculation in Paragraph render()

#37 Add fill color for frames 3 years ago

Comment by ~ap4sc on ~ireas/genpdf-rs

Works great, the text draws in front of the color now