Fonts display wrong in chromium

hello everyone, im new for ubuntu-mate.

here i find that the css style for fonts in my chromium browser is invalid.

the image would show more detail.

you could see that the css style set as monospace font but it does not display right.


and the issue not occur in firefox. but i can not put another image here since i am a new user. :slight_smile:

sorry for my poor english, im not good at it.

due to some reasons, i cannot contact with the chromium/chrome team, so i put this issue here.

could anyone give me some suggestion or where should i go to ask this question?

thanks a lot.

Hello and welcome!

Try checking the font settings within Chromium to confirm the monospace font is set correctly.

: → Settings → Customise fonts

image

image

thanks for your advise, but unfortunately, it doesn't work.

fixed-width font is set as Monospace as default, i try to change it to Ubuntu Mono, but nothing happened.

Was the "quick brown fox" correctly shown in monospace as seen in my screenshot above?

If so, that leads me to wonder if one of the fonts haven't loaded correctly and renders a Sans Serif style font instead.

In the DevTools, try removing the first one from the font-family, like so:

  • SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace
  • Consolas,Liberation Mono,Menlo,monospace
  • Liberation Mono,Menlo,monospace
  • Menlo,monospace
  • monospace

Let me know if one of the combinations "fixes" the monospace. This would confirm one of the fonts is improperly loading.

Firefox is easier in comparison as it underlines the font that is currently in use.

Screenshot_20191028_191751

oh, thanks a lot for your patience for this issue.

under your advice, i have found the point. i remove SFMono-Regular from font-family, the font display is fixed. but i dont find any font named like SFMono* installed on my system, why does chromium not load the next (or next to the next) font?

Website developers choose an order for fonts, so if one isn't present then it will try the next until "monospace" which is the default one in Chromium's settings.

GitHub's website uses a font order that gives each platform the best chances of using their native mono fonts. Neither Apple (SFMono) or Windows (Consolas) fonts are pre-installed on Ubuntu, so "Liberation Mono" should be the one that's used.

Different browsers support different font formats, so Firefox may not support or find the font that's providing "SFMono".


Bizarrely, SFMono is Apple's San Francisco Mono font :confused: It may not be a package, so try checking these hidden home folders:

  • ~/.fonts/
  • ~/.local/share/fonts/

You can use this command to specifically list a font containing the name "SF":

fc-list | grep SF

It could be under a different name, the DevTools should tell you the name of the font that is being rendered (it's under Styles → bottom of the right sidebar).

image

Once finding the erroneous font, try moving/deleting it and restart the browser.

Finally I’ve found the problem. The issue is due to my Locale setting.

When I change my Locale setting to United Kingdom, the problem is just solved.

It’s interesting that Chromium just takes the Locale setting and ignores the CSS Style.

I tried to set as China or Japan, the font displayed incorrectly (the loaded font is Noto Sans), but it displayed correctly when I set it as Korean. This is also interesting, and, emmm... a little weird.

So I still could not recognize clearly the way how Chromium decides to load the font.

For a supplement, I found, that in the DevTools, the right sidebar of Styles is only shown when I directly open it by F12, and it will not be shown when I right click and Inspect the element. So I just didn’t know that there is a right sidebar of the Styles.

Good to know. :slight_smile: It does seem odd that this affects the first font SFMono-Regular as earlier confirmed that removing this one 'fixes' the monospace font too.

If you just need to set the locale for this one application, you can edit the launcher for Chromium in MATE's :memo: Main Menu editor.

env LANG=en_GB.UTF-8 chromium

It might be worth testing Ubuntu Kylin (Chinese version of Ubuntu) which also uses the MATE Desktop, to see if the problem happens there or if they have additional packages to support the use of Latin fonts.

I just add the env variable before chromium, it works. Thank you.

About Ubuntu Kylin, I have just try it, and it suprises me that the font display correctly in its pre-installed Chromium.

But I dont think it's Ubuntu Kylin Team works for it.

'Cause I found that maybe this team just replace the word MATE with UKUI and then prounounce that the UKUI is just their independent work.

It's shameful.

It makes me disgusting.

Maybe Mate Team should file them a legal complaint... I know it's not feasible. It's just a self-talking.

sorry for far from the issue, it really makes me uncomfortable.

Ah, I didn't realise UKUI was a fork of MATE. So while it is based on MATE, the freedom of the license (GPL) makes it perfectly within their rights to fork it and make changes as they please, as long they provide the source code (which they do). MATE developers can take UKUI's code too, if MATE developers wanted.

Since it's an official Ubuntu flavour, it's bound to use the same packages in regards to Chromium. I'm wondering if they have additional font packages installed that do not have the problem that could be installed in Ubuntu MATE. Both flavours share the same repository, after all.

The font Chromium loaded on Ubuntu Kylin is just
Liberation Mono, which is on your screenshot and installed on my system too.

So…

I tried to reproduce the issue, but Chromium appears to work normally in both Ubuntu MATE 19.10 and Ubuntu Kylin 19.10 from a live session and installed (Chinese) system. I did learn that Chromium is now distributed as a snap package.

Both distros have identical fonts installed, so I'm just as baffled why it happens! The upside is that the en_GB.UTF-8 workaround works. :slight_smile:

So maybe I’m the only lucky guy who meet this issue? It’s… interesting.

I’ll try to reproduce this issue too.