-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to define wrapmode="CHAR" within a template #1159
Comments
Welcome to fpdf2, @carlhiggs ! Yes, this is one of the many limitations that currently plague our template system (as evicenced eg. by #1119). But for the time being, adding arguments to records that are only accessible through literal dict definitions is perfectly acceptable. |
Hi @gmischler thanks for getting back to me and the pointers for how this could be addressed --- I'll have a look later this week to see if this is something I can figure out; if I can make some progress, I'll make a PR. Its a great project, and if I am able to make a contribution, would love to. |
Great! Thank you for considering a contribution to |
Please explain your intent
I am using fpdf2 to produce reports using verified translations in multiple languages, using the template features to define the report layout. One of my collaborators validating our Japanese language report advised that inappropriate line breaks were occurring. Investigating this, I see that is because there are not spaces in this language, and wrapping should be by character not word.
I see there is functionality to optionally support word wrapping based on character instead of word when using the non-template approach to pdf construction with
multicell()
orwrite()
using the optionwrapmode="CHAR"
(as per fpdf2 documentation). However, I don't believe this is configurable when using a template to define the PDF layout, or if it is I don't believe this is documented.Describe the solution you'd like
Allowing the option to set
wrapmode="CHAR"
within a template, or providing guidance on how to achieve this effect would be greatly appreciated and very useful. This could be another parameter, e.g. like 'align' or 'rotate'. It need only be used for the relevant text formatting types, and have a default of 'word' but option to set otherwise (i.e. to 'CHAR', for scripts like Chinese and Japanese, etc).I'm hopeful this could be relatively straightforward to implement, given the existing technical functionality to do this (which is great, thank you!).
The text was updated successfully, but these errors were encountered: