Skip to content
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

Riot defaults to non-standard font for Japanese text #12914

Closed
ChanoSan opened this issue Mar 28, 2020 · 8 comments
Closed

Riot defaults to non-standard font for Japanese text #12914

ChanoSan opened this issue Mar 28, 2020 · 8 comments

Comments

@ChanoSan
Copy link

Description

When the client displays Japanese text, it defaults to a non-standard font. In the example provided, the client defaults to "Nagurigaki Crayon" font, a third party TTF font I downloaded and installed on this system.

riotbug

The font in question is stylistic and not suited for easy reading, particularly not at the size Riot displays. All other programs in the desktop environment display Japanese text in normal, readable font, so this behavior appears to be isolated to Riot.

Steps to reproduce

  • have Japanese input enabled in Ubuntu 18.04
  • have Nagurigaki Crayon TTF font file in ./font in the Home folder
  • install Riot Desktop Client snap package via the Ubuntu Software installer
  • Japanese text appears in non-standard font

Logs being sent: yes

Version information

Riot Desktop Client, Ubuntu 18.04, snap package (installed via the Software Installer, from Snap Store)
riot-web version: 1.5.13
olm version: 3.1.3

@ChanoSan
Copy link
Author

In particular, if there's a way to change the font in some kind of settings file, I'd like to know... trying to read crayon scribble font to use Riot Desktop is making my eyes hurt.

@dbkr
Copy link
Member

dbkr commented Mar 31, 2020

It looks like none of the font-families Riot specifies match any of the japanese fonts ubuntu comes with, so chrome is picking one arbitrarily, and that one happens to be the one you installed.

Riot should probably specify a CJK font family.

@nadonomy
Copy link
Contributor

Can we fix this by declaring a system font stack for certain language/character sets, deferring the font choice to the browser/OS?

@ara4n
Copy link
Member

ara4n commented Mar 31, 2020

I don't think CJK specific CSS system fonts are a thing - the OS should already be providing a sensible fallback. Failing that, we could specify Noto Sans as an explicit fallback and pray that the user has it installed, to try to stop it picking a random one. We can't ship Noto Sans in Riot though because it's hundreds of MB, iirc - so if the user doesn't have it installed, either they'll need to install it, or we'd have to use a font server like fonts.google.com. We don't want to use a font server though due to privacy, and due to it breaking deployments without internet connectivity.

So, TL;DR: append "Noto Sans" to the end of the font list and pray.

Nice to have would be:

  • Detect if you're in a CJK language, but it failed to load Noto Sans, advising you to install it on your system from https://www.google.com/get/noto/
  • Setting toggle to explicitly opt in to using Google Fonts to serve fonts if your system doesn't haven them installed

@ChanoSan
Copy link
Author

ChanoSan commented May 1, 2020

Follow-Up:
I noticed a similar issue in VLC (video title displayed in Nagurigaki Crayon font) so I did some reading on how to set up Asian fonts in Ubuntu/Debian.

After following the instructions here (intended for PrizmDoc, but I took a stab in the dark and tried it anyway) the issue has been resolved. Riot now displays Japanese in a standard, easily readable font.

I'm leaving this issue open for now because this may still be something Riot devs want to work on, but if my solution constitutes a fix in the eyes of the Riot devs then I'll understand if this issue can be considered closed.

@jryans
Copy link
Collaborator

jryans commented May 4, 2020

Good to hear you've got it fixed on your system! It may still make sense for us to specify a fallback as @ara4n describes above, so I think it's reasonable to keep this open to track that.

@ara4n
Copy link
Member

ara4n commented Jun 16, 2020

I think matrix-org/matrix-react-sdk#4761 may solve this?

@turt2live
Copy link
Member

I think this is indeed solved by the above PR, with the new edition of the bug being #15072

@jryans jryans added I18n and removed A-I18n labels Mar 5, 2021
t3chguy pushed a commit that referenced this issue Oct 17, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants