jorisschellekens / borb

borb is a library for reading, creating and manipulating PDF files in python.
https://borbpdf.com/
Other
3.4k stars 147 forks source link

Letter Spacing #153

Open sourceful-wing opened 1 year ago

sourceful-wing commented 1 year ago

Is your feature request related to a problem? Please describe. Many fonts need letter spacing adjustments especially if you want to add text to an existing PDF that already has a certain style. It's great to have font support, colours and sizing support but letter spacing is an important addition for consistency.

Describe the solution you'd like An ability to specify the letter spacing in % terms (e.g. -2% or 5%)

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. I've not been able to find a way to do it with the library. I thought about trying to generate TTF variables with updated letter spacings but I don't think that's a user friendly solution.

Additional context Add any other context or screenshots about the feature request here. I really like the library!

jorisschellekens commented 1 year ago

This is going to be tricky. For now, the easiest option would be to give you a parameter character_spacing that adds/subtracts a few extra units whenever characters are being rendered.

And even that option would require me to run that parameter through (almost) every LayoutElement.

I'll have to think about this.

Kind regards, Joris Schellekens