-
Notifications
You must be signed in to change notification settings - Fork 259
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
Thai font collapse when using more than 1 tone marks #459
Comments
Thank you for reporting this. This looks like a duplicate of #365 and maybe #458 There is currently an effort to change our font-parsing code: #418 Of course, any other suggestion or contribution to improve the situation is welcome 😊 |
Makes you wonder why it comes out correctly with one font... Note that in the example, the "more elaborate" fonts all show the characters in the same bland shape, with slightly varying thickness. Now look at how Prompt Thin should really look like:
Just being a font with "Unicode support" does not garantee for any range of characters to actually be present in a font file (otherwise, every Unicode font would be 20+ MB large). You'll have to check which languages resp. writing systems it actually supports. In the case of Prompt Thin, support is indicated for "latin" only. Indeed, the rendered text looks mostly like latin characters. Does fpdf2 actually do some substitution for non-existing glyphs? Or do the/some PDF viewers do that? Solution for @hackinteach: Find and use fonts that actually include glyph data for the Thai script, and everything will be fine. 🇹🇭 👍 |
@gmischler Thank you for your suggestion. I did some more finding on Thai fonts and found the ones working now (I should have go deeper link in the Unicode documentation). Might be useful for someone in the future, I download the fonts from Fonts-TLWG using this link and the results are as follow: |
Great, thank you for your answer @gmischler! @hackinteach / @gmischler : would you like to contribute a PR on docs/Unicode.md to add a mention of this? 😊 |
Sure, my pleasure :) |
I don't think this is specific to the Thai language. |
FYI @hackinteach, @andersonhc PR #820 has been merged today. Thai text is now better supported! To test it, you can install
|
Describe the bug
According to this documentation, adding font with Unicode support works with Thai language as well. Unfortunately, when using more elaborate font other than Waree from the example, the tone marks collapse when having 2 marks in 1 words, for example:
ที่ นั้น นี่ ทั้ง มั้ง บุหรี่
Minimal code
Please include some minimal Python code reproducing your issue:
Generated sample shown below, Waree (the working font) is in the green box:
Environment
fpdf2
version used 2.5.5The text was updated successfully, but these errors were encountered: