pdfme / pdfme

A TypeScript based PDF generator library, made with React.
https://pdfme.com
MIT License
2.19k stars 194 forks source link

Dynamic font sizing - Fit options #230

Closed peteward closed 9 months ago

peteward commented 9 months ago

Implemented roughly as per comments on #222

Before I tidy up and update tests, @hand-dot please can you confirm that you are happy with the behavior - especially around height:

https://github.com/pdfme/pdfme/assets/7068515/e279afd2-8742-4bcf-89c6-0f00cdc8324e

hand-dot commented 9 months ago

@peteward

This behavior is perfect...! It's really cool.

CleanShot 2023-08-14 at 22 47 27@2x CleanShot 2023-08-14 at 22 47 09@2x

I've been confused about the default values, between vertical and horizontal. What do you think?

peteward commented 9 months ago

Confused about whether it should default to vertical or horizontal? In our use case we would more likely use vertical, but to avoid BC we might need to go for horizontal?

hand-dot commented 9 months ago

Confused about whether it should default to vertical or horizontal? In our use case we would more likely use vertical, but to avoid BC we might need to go for horizontal?

Originally, we should set the default to horizontal, considering backward compatibility (BC), but I have been thinking that the default might be better as vertical since other users would primarily use vertical as well...

There is no backward compatibility, but since this is a feature that has only been released for about two weeks, and we have provided a 'fit' configuration option, we can still accommodate the horizontal use case. Can we set the default to vertical, please?

I apologize for changing my opinion partway through.

peteward commented 9 months ago

no problem 😄

peteward commented 9 months ago

updated for review now with tests

peteward commented 9 months ago

updated

hand-dot commented 9 months ago

@peteward thank you!