Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Dec 30, 2023

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:

image

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

  • Testing Testing
  • Do we want to ship another font
  • Extend regex to match supported characters for NotoSC font

Checklist

@kesselb kesselb added this to the Nextcloud 29 milestone Dec 30, 2023
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@AndyScherzinger AndyScherzinger force-pushed the enh/noid/avatar-chinese branch from 43758ee to 16bf72a Compare May 23, 2024 05:44
@AndyScherzinger
Copy link
Member

@kesselb can you tell a bit about the state of the PR? 😊

@kesselb
Copy link
Contributor Author

kesselb commented May 23, 2024

@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.

This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
@skjnldsv skjnldsv marked this pull request as draft November 15, 2024 13:08
@skjnldsv skjnldsv added this to the Nextcloud 32 milestone Jan 30, 2025
@Phreeman33
Copy link
Contributor

Phreeman33 commented Mar 16, 2025

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:

  1. Traditional Chinese (Taiwan)
  2. Traditional Chinese (Hong Kong/Macau)
  3. Japanese
  4. Korean

e.g.: for \u89d2
In TC:
角-TC
In SC:
角-SC

I recommend we just merge this commit. Since:

  1. This PR already fixes avatar display for most cases in Chinese characters.
  2. The glyph differences only affect a small number of characters.

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! 😉

@kesselb
Copy link
Contributor Author

kesselb commented Apr 3, 2025

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.

@skjnldsv
Copy link
Member

skjnldsv commented Apr 4, 2025

Overrules by #51855

@skjnldsv skjnldsv closed this Apr 4, 2025
@kesselb kesselb deleted the enh/noid/avatar-chinese branch April 4, 2025 10:40
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants