feat: generate avatars for display name with chinese characters#42534
feat: generate avatars for display name with chinese characters#42534
Conversation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
43758ee to
16bf72a
Compare
|
@kesselb can you tell a bit about the state of the PR? 😊 |
|
@AndyScherzinger Added some context to the pull request. I never got feedback in the forums if the suggested patch works, and therefore did not continue. This font topic is a rather complicated one, and I have no idea if that's a sane approach. |
|
Tested and worked fine. As traditional Chinese users, we've been overriding fonts with Noto Sans TC to display Chinese characters properly. Here's the catch: Noto Sans SC uses some Simplified Chinese glyphs (probably GB18030 standard with "List of Commonly Used Standard Chinese Characters"), but the same character actually has different strokes in:
e.g.: for I recommend we just merge this commit. Since:
Maybe we could handle the glyph differences with languange/location setting for CJK fonts matching later. Trivia: Lots of websites/devices secretly use LCSCC glyphs for all Chinese text. The stroke differences are super subtle (mostly like 1-2 pen strokes!), which is why most traditional Chinese users never even notice! 😉 |
|
Hi @Phreeman33, Many thanks for your feedback—it's much appreciated! 🙏 Thanks for taking the initiative and sending a reworked version of the PR to improve the avatar situation for users with Chinese characters. |
|
Overrules by #51855 |


Summary
We are using NotoSans-Regular for generating avatars.
If the character is not supported by NotoSans-Regular the users end up with an avatar like below:
The pull request here adds another font and uses a poor regex to flip out the font when chinese characters are detected. The font actually should cover even more characters.
@danxuliu did a deep dive into the topic a while ago and wrote down everything you need to know: #25529
TODO
Checklist