-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fixed CJK characters not rendering in new Label Engine [sc-24364] #14235
base: master
Are you sure you want to change the base?
Conversation
This pull request has been linked to Shortcut Story #24364: Asian (possibly more) characters don't display on labels. |
PR Summary
|
I hate this solution, but I hate literally everything else we've talked through more :( |
a5be851
to
dafbabf
Compare
@uberbrady this has conflicts now - do we maybe want to re-target this to v7? |
Although it's designed to be a non-breaking change - yes, I think retargeting it is probably a smart move. "But it's a non-breaking change!" is probably how most laments begin. |
This is a surprisingly hard problem to solve for some reason I don't fully understand. But because the new Label rendering engine actually generates PDF's based on fonts that are installed as part of the TCPDF library, not just rendering web pages.
So this solution - while terrible - is an approach that will, in the end, solve the problem. It presents two additional drop-down selects in the Label engine settings, defaulting them to what the current font choices are. There's one for your choice of fixed-width font, and one for your variable-width font. In there, if you pick 'cid0cs' as your font, they will render correctly, for Simplified Chinese. Similarly you can use 'cid0ct' for Traditional Chinese, 'cid0jp' for Japanese, and 'cid0kr' for Korean. (Lovely font names by the way; very intuitive).
There are a ton of other fonts available as well, so for now I've included them all. If we decide to go another way on this - possibly auto-detecting characters from different languages, or something else - we can change it - possibly just showing 'useful' subsets, or maybe doing something else entirely.
But this already is useful because you can quickly test out different font choices and see how the characters render when you do. Additionally, if you 'import' a new font, it should show up on the list (as it's dynamically generated). So if we find new fonts to play with, we can at least try them out.
I have not added the additional translation strings yet because we aren't even convinced we're going to go in this direction. If we do decide to go with this approach, I'll need to get all of those translation strings set up. (Interestingly, we can recommend different font choices for different languages, maybe? Or maybe that's the trick - the fonts you get are based on the language you're configured for? Not sure.)