flathub / org.chromium.Chromium

https://flathub.org/apps/details/org.chromium.Chromium
45 stars 25 forks source link

Japanese font not rendered correctly #280

Open carif opened 1 year ago

carif commented 1 year ago

Hi there,

I'm using Chromium with Fedora Silverblue and since the last update, Japanese font's don't render correctly. Downgrading to Chromium Version 111.0.5563.146 (Official Build) (64-bit) resolves the issue.

It's also a problem with Chromium alone. All other software can display Japanese characters fine (e.g. Firefox from fedoraproject.org and not flathub).

Here's an example of the problem: image

In case it's relevant, the OS language is English.

refi64 commented 1 year ago

All other software can display Japanese characters fine (e.g. Firefox from fedoraproject.org and not flathub)

What if you test with other apps on Flathub specifically? Fedora Flatpaks use an entirely different Flatpak runtime.

Erick555 commented 1 year ago

If this happens in whole flathub then perhaps it's https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1563 . Fix will be available in next runtime release.

carif commented 1 year ago

All other software can display Japanese characters fine (e.g. Firefox from fedoraproject.org and not flathub)

What if you test with other apps on Flathub specifically? Fedora Flatpaks use an entirely different Flatpak runtime.

$ flatpak install flathub org.mozilla.firefox
Looking for matches…

org.mozilla.firefox permissions:
    ipc              network          cups               pcsc
    pulseaudio       wayland          x11                devices
    file access [1]  dbus access [2]  bus ownership [3]  system dbus access [4]

    [1] xdg-download
    [2] org.a11y.Bus, org.freedesktop.FileManager1,
        org.freedesktop.Notifications, org.freedesktop.ScreenSaver,
        org.gnome.SessionManager, org.gtk.vfs.*
    [3] org.mozilla.firefox.*, org.mozilla.firefox_beta.*,
        org.mpris.MediaPlayer2.firefox.*
    [4] org.freedesktop.NetworkManager

        ID                           Branch  Op  Remote   Download
 1. [✓] org.mozilla.firefox.Locale   stable  i   flathub  960.5 kB / 49.3 MB
 2. [✓] org.mozilla.firefox          stable  i   flathub   93.3 MB / 90.4 MB

$ flatpak run org.mozilla.firefox

Opening for example a Japanese YouTube video on Firefox (from flathub) works. The font's get displayed correctly.

I also tested the com.google.Chrome package from flathub with the following video: https://www.youtube.com/watch?v=WMLQ3sEH0mI image As can be seen, Google Chrome suffers from the same problem. That's how it's displayed via org.mozilla.firefox: image Another website with which I tested it: https://www3.nhk.or.jp/news/ I just did another test, but this time with flatpak run com.microsoft.Edge and the problem occurs in Edge, too.

I also installed Anki (via the GUI from dl.flathub.org as can be seen in the picture below) and there, it worked, too: image LibreOffice Writer and gedit from dl.flathub.org have no problems, too.

EDIT: flatpak update --commit=9b19b68b326673c217aa602a7cee0eaf67cebfaf18b4c01688b11dc8e7b93aa2 org.chromium.Chromium When entering this command, it only lists Chromium as the changed package and no runtime:

Looking for updates…

        ID                       Branch    Op   Remote    Download
 1. [✓] org.chromium.Chromium    stable    u    flathub   117.6 MB / 129.2 MB

Updating… ████████████████████ 100%  19.6 MB/s  00:00
Note that '/var/lib/flatpak/exports/share' is not in the search path
set by the XDG_DATA_HOME and XDG_DATA_DIRS
environment variables, so applications may not
be able to find it until you set them. The
directories currently searched are:

- /root/.local/share
        ID                       Branch    Op   Remote    Download
 1. [✓] org.chromium.Chromium    stable    u    flathub   117.6 MB / 129.2 MB

Updates complete.

And after restarting Chromium, it works (until Fedora auto-updates again to the latest version). The stuff about /var/lib/flatpak/exports/share seems to only pop-up when downgrading. Not when installing, removing or updating apps.

wjt commented 1 year ago

I'm seeing a similar problem. With org.chromium.Chromium commit 9b19b68b326673c217aa602a7cee0eaf67cebfaf18b4c01688b11dc8e7b93aa2 (built from Git commit 8cf8c036), the tabs correctly use my host's font, Lato:

Screenshot from 2023-04-21 10-11-28

But with commit 6de5f74bd269f54f1df76a0b9ac687af3b3a150064761e9dfb708d0d40ecdf30 (built from Git commit daf09b4a) or newer, I see a fallback Sans Serif font:

Screenshot from 2023-04-21 10-15-04

Other apps using the 22.08 runtime, such as app/org.pulseaudio.pavucontrol/x86_64/stable, correctly use Lato. So I don't believe this is https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1563. I think something has changed in Chromium itself.

refi64 commented 1 year ago

It looks like 112 bumped fontconfig from here to here, which includes...quite a few changes.

That being said, it is extremely not clear what exactly here broke everything, esp because I can't actually repro this locally.

wjt commented 1 year ago

What version of fontconfig do you have on the host system, refi64? I have 2.14.1-4endless1bem1

carif commented 1 year ago

Mine is version 2.14.1 with the following cjk fonts installed:

$ fc-list | grep cjk
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK TC,Noto Sans CJK TC DemiLight:style=DemiLight,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Light.ttc: Noto Sans CJK SC,Noto Sans CJK SC Light:style=Light,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Medium.ttc: Noto Sans CJK JP,Noto Sans CJK JP Medium:style=Medium,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc: Noto Sans CJK SC,Noto Sans CJK SC Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Thin.ttc: Noto Sans CJK SC,Noto Sans CJK SC Thin:style=Thin,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Medium.ttc: Noto Sans CJK TC,Noto Sans CJK TC Medium:style=Medium,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc: Noto Sans CJK TC,Noto Sans CJK TC Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Thin.ttc: Noto Sans CJK TC,Noto Sans CJK TC Thin:style=Thin,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans CJK HK:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans CJK KR:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans CJK JP:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Medium.ttc: Noto Sans CJK KR,Noto Sans CJK KR Medium:style=Medium,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK SC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK TC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans CJK SC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans CJK TC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK JP:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK HK:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK KR:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Light.ttc: Noto Sans CJK HK,Noto Sans CJK HK Light:style=Light,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Light.ttc: Noto Sans CJK KR,Noto Sans CJK KR Light:style=Light,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK JP,Noto Sans CJK JP DemiLight:style=DemiLight,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Light.ttc: Noto Sans CJK TC,Noto Sans CJK TC Light:style=Light,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans CJK JP:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans CJK HK:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans CJK KR:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc: Noto Sans CJK KR,Noto Sans CJK KR Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans CJK SC:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans CJK TC:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc: Noto Sans CJK HK,Noto Sans CJK HK Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK SC:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK TC:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK HK:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK KR:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK JP:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc: Noto Sans CJK JP,Noto Sans CJK JP Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK HK,Noto Sans CJK HK DemiLight:style=DemiLight,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Thin.ttc: Noto Sans CJK JP,Noto Sans CJK JP Thin:style=Thin,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Medium.ttc: Noto Sans CJK SC,Noto Sans CJK SC Medium:style=Medium,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Thin.ttc: Noto Sans CJK HK,Noto Sans CJK HK Thin:style=Thin,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Thin.ttc: Noto Sans CJK KR,Noto Sans CJK KR Thin:style=Thin,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Medium.ttc: Noto Sans CJK HK,Noto Sans CJK HK Medium:style=Medium,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Light.ttc: Noto Sans CJK JP,Noto Sans CJK JP Light:style=Light,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK KR,Noto Sans CJK KR DemiLight:style=DemiLight,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK SC,Noto Sans CJK SC DemiLight:style=DemiLight,Regular

I just tested it on a Manjaro based system and the problem is not there. Manjaro comes with fontconfig version 2.14.2 and flatpak version 1.15.4 (Fedora 37 has 1.14.4).

After upgrading to the Fedora 38, the problem is still there. fontconfig is at version 2.14.2 and flatpak at version 1.15.4. @refi64 Maybe you could tell us what information you need to identify the problem.

wjt commented 1 year ago

On https://github.com/flathub/com.google.Chrome/issues/202#issuecomment-1542537060 the suggestion is to refresh the fontconfig cache. For me, just running:

flatpak run --command=fc-cache org.chromium.Chromium -v -f

did not solve the problem, but nuking the cache at ~/.var/app/org.chromium.Chromium/cache/fontconfig and then running fc-cache did. (I have restored the old ~/.var/app/org.chromium.Chromium/cache/fontconfig/fontconfig from backup to reintroduce the problem since evidently whatever is meant to be automatically invalidating & refreshing the cache is not working.)

benkei-kuruma commented 1 year ago

On flathub/com.google.Chrome#202 (comment) the suggestion is to refresh the fontconfig cache. For me, just running:

flatpak run --command=fc-cache org.chromium.Chromium -v -f

did not solve the problem, but nuking the cache at ~/.var/app/org.chromium.Chromium/cache/fontconfig and then running fc-cache did. (I have restored the old ~/.var/app/org.chromium.Chromium/cache/fontconfig/fontconfig from backup to reintroduce the problem since evidently whatever is meant to be automatically invalidating & refreshing the cache is not working.)

Cross-posting from that Chrome issue to say thanks, since:

~/.var/app/org.chromium.Chromium/cache/fontconfig and then running fc-cache

fixed the issue here.

Unfortunately (and perhaps related), several other flatpaks (namely Steam client on my end) are still having the CJK font issue. FWIW to anybody, I tried applying this fix to com.valvesoftware.Steam and it didn't work.

wjt commented 1 year ago

On Matrix, https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1576 came up as potentially related. However that is a fix in the runtime, and as noted in https://github.com/flathub/org.chromium.Chromium/issues/280#issuecomment-1517531358 I bisected this issue to a particular Chromium update... I wonder if a similar file in the bundled fontconfig needs a similar cache seed change to that change in the SDK?

wjt commented 1 year ago

@tagoh do you have any ideas for how to track down this problem, which seems very similar in symptom to https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1576? Chromium bundles its own fontconfig. The change in https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/12749 etc. has no effect.

lumingzh commented 1 year ago

On flathub/com.google.Chrome#202 (comment) the suggestion is to refresh the fontconfig cache. For me, just running:

flatpak run --command=fc-cache org.chromium.Chromium -v -f

did not solve the problem, but nuking the cache at ~/.var/app/org.chromium.Chromium/cache/fontconfig and then running fc-cache did. (I have restored the old ~/.var/app/org.chromium.Chromium/cache/fontconfig/fontconfig from backup to reintroduce the problem since evidently whatever is meant to be automatically invalidating & refreshing the cache is not working.)

Cross-posting from that Chrome issue to say thanks, since:

~/.var/app/org.chromium.Chromium/cache/fontconfig and then running fc-cache

fixed the issue here.

Unfortunately (and perhaps related), several other flatpaks (namely Steam client on my end) are still having the CJK font issue. FWIW to anybody, I tried applying this fix to com.valvesoftware.Steam and it didn't work.

This fix works for me on my flatpak steam.

lumingzh commented 1 year ago

@benkei-kuruma Shit, not works for all. The text of game name in left panel and text in game page and download page are still tofus.

tagoh commented 1 year ago

@tagoh do you have any ideas for how to track down this problem, which seems very similar in symptom to https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1576? Chromium bundles its own fontconfig. The change in https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/merge_requests/12749 etc. has no effect.

No idea. I just tried to do flatpak install org.chromium.Chromium though, it works for me.

$ flatpak info org.chromium.Chromium                      

Chromium Web Browser - The web browser from Chromium project

          ID: org.chromium.Chromium
         Ref: app/org.chromium.Chromium/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 113.0.5672.63
     License: BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL 
and (MPL-1.1 or GPL-2.0 or LGPL-2.0)
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 343.2 MB
     Runtime: org.freedesktop.Platform/x86_64/22.08
         Sdk: org.freedesktop.Sdk/x86_64/22.08

      Commit: 82df691cfb5204510a5209e0ab1c58507213f05a3002881d6ffc814515e3928f
      Parent: 92e856f2b15770f00de1b3c70ae26e10997ef2aba1d7bdbc6a6fac79cbbc1e7e
     Subject: Revert broken Wayland fractional scaling implementation (eea7af90)
        Date: 2023-05-04 03:39:22 +0000
$ flatpak info org.freedesktop.Platform

Freedesktop Platform - Shared libraries

          ID: org.freedesktop.Platform
         Ref: runtime/org.freedesktop.Platform/x86_64/22.08
        Arch: x86_64
      Branch: 22.08
     Version: 22.08.11
     License: MIT
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 575.0 MB

      Commit: 4ba47479a973c9a243112c43f8f58244af34457611e2a26bba8595d08a2b31d7
      Parent: f1a428ba14b620db7164070ec6a444c0132f2a3f854913c5c6755db2393e4f83
     Subject: Export org.freedesktop.Platform
        Date: 2023-04-20 17:36:18 +0000

I tried this on my Silverblue 38.

What if some of you who can reproduce this tries:

$ flatpak run --command=/bin/sh org.chromium.Chromium
$ fc-match -b sans-serif:lang=ja
wjt commented 1 year ago
[📦 org.chromium.Chromium ~]$ fc-match -b sans-serif:lang=ja
Pattern has 39 elts (size 48)
    family: "Noto Sans CJK JP"(w)
    familylang: "en"(s)
    style: "Regular"(s)
    stylelang: "en"(s)
    fullname: "Noto Sans CJK JP"(w)
    fullnamelang: "en"(s)
    slant: 0(i)(s)
    weight: 80(f)(s)
    width: 100(f)(s)
    size: 12(f)(s)
    pixelsize: 12.5(f)(s)
    foundry: "GOOG"(s)
    antialias: True(w)
    hintstyle: 1(i)(w)
    hinting: True(s)
    verticallayout: False(s)
    autohint: False(s)
    globaladvance: True(s)
    file: "/run/host/fonts/opentype/noto/NotoSansCJK-Regular.ttc"(s)
    index: 0(i)(w)
    outline: True(s)
    scalable: True(s)
    dpi: 75(f)(s)
    rgba: 5(i)(w)
    scale: 1(f)(s)
    fontversion: 131203(i)(s)
    capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:hang otlayout:hani otlayout:kana otlayout:latn"(w)
    fontformat: "CFF"(s)
    embeddedbitmap: True(s)
    decorative: False(s)
    lcdfilter: 1(i)(w)
    namelang: "en"(s)
    prgname: "fc-match"(s)
    postscriptname: "NotoSansCJKjp-Regular"(s)
    color: False(s)
    symbol: False(s)
    variable: False(s)
    fonthashint: False(s)
    order: 0(i)(s)
tagoh commented 1 year ago

Hmm? that looks like working properly as expected. what font does Chrome select to render a Japanese characters then? Had anyone ever tried to see Rendered Fonts in computed section on the developer tools?

tagoh commented 1 year ago

Also, please make sure if fontconfig in Chromium loads /etc/fonts/conf.d/05-flatpak-fontpath.conf, /etc/fonts/conf.d/50-flatpak.conf, and /run/host/font-dirs.xml. try to run Chromium with FC_DEBUG=1024. if those files aren't loaded, they may not be able to use a font on host.

carif commented 1 year ago

Also, please make sure if fontconfig in Chromium loads /etc/fonts/conf.d/05-flatpak-fontpath.conf, /etc/fonts/conf.d/50-flatpak.conf, and /run/host/font-dirs.xml. try to run Chromium with FC_DEBUG=1024. if those files aren't loaded, they may not be able to use a font on host.

Below is my entire output of the commands you used and about the conf files chromium loads:

$ flatpak info org.chromium.Chromium

Chromium Web Browser - The web browser from Chromium project

          ID: org.chromium.Chromium
         Ref: app/org.chromium.Chromium/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 113.0.5672.63
     License: BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 343.2 MB
     Runtime: org.freedesktop.Platform/x86_64/22.08
         Sdk: org.freedesktop.Sdk/x86_64/22.08

      Commit: 82df691cfb5204510a5209e0ab1c58507213f05a3002881d6ffc814515e3928f
      Parent: 92e856f2b15770f00de1b3c70ae26e10997ef2aba1d7bdbc6a6fac79cbbc1e7e
     Subject: Revert broken Wayland fractional scaling implementation (eea7af90)
        Date: 2023-05-04 03:39:22 +0000

$ flatpak info org.freedesktop.Platform

Freedesktop Platform - Shared libraries

          ID: org.freedesktop.Platform
         Ref: runtime/org.freedesktop.Platform/x86_64/22.08
        Arch: x86_64
      Branch: 22.08
     Version: 22.08.11
     License: MIT
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 575.0 MB

      Commit: 4ba47479a973c9a243112c43f8f58244af34457611e2a26bba8595d08a2b31d7
      Parent: f1a428ba14b620db7164070ec6a444c0132f2a3f854913c5c6755db2393e4f83
     Subject: Export org.freedesktop.Platform
        Date: 2023-04-20 17:36:18 +0000
[📦 org.chromium.Chromium ~]$ fc-match -b sans-serif:lang=ja
Pattern has 39 elts (size 48)
    family: "Noto Sans CJK JP"(w)
    familylang: "en"(s)
    style: "Regular"(s)
    stylelang: "en"(s)
    fullname: "Noto Sans CJK JP Regular"(w)
    fullnamelang: "en"(s)
    slant: 0(i)(s)
    weight: 80(f)(s)
    width: 100(f)(s)
    size: 12(f)(s)
    pixelsize: 12.5(f)(s)
    foundry: "ADBO"(s)
    antialias: True(w)
    hintstyle: 1(i)(w)
    hinting: True(s)
    verticallayout: False(s)
    autohint: False(s)
    globaladvance: True(s)
    file: "/run/host/fonts/google-noto-sans-cjk-vf-fonts/NotoSansCJK-VF.ttc"(s)
    index: 262144(i)(w)
    outline: True(s)
    scalable: True(s)
    dpi: 75(f)(s)
    rgba: 5(i)(w)
    scale: 1(f)(s)
    fontversion: 131334(i)(s)
    capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:hang otlayout:hani otlayout:kana otlayout:latn"(w)
    fontformat: "CFF"(s)
    embeddedbitmap: True(s)
    decorative: False(s)
    lcdfilter: 1(i)(w)
    namelang: "en"(s)
    prgname: "fc-match"(s)
    postscriptname: "Noto-Sans-CJK-JP"(s)
    color: False(s)
    symbol: False(s)
    variable: False(s)
    fonthashint: False(s)
    order: 0(i)(s)

Youtube.com -> Rendered Fonts within the Computed section of the dev tools: Liberation Sans—Local file(39 glyphs) YouTube Sans Light 48pt—Network resource(3 glyphs)

The text is mostly Japanese, but contains some English words, too.

In the comment section (all Japanese): Liberation Sans—Local file(54 glyphs) Roboto—Network resource(6 glyphs)

On another Japanese comment: Liberation Sans—Local file(32 glyphs) Noto Color Emoji—Local file(1 glyph)

Regarding the conf files with FC_DEBUG=1024: They appear to load correctly.

$ flatpak run --env=FC_DEBUG=1024 org.chromium.Chromium
FC_DEBUG=1024
    Loading config file from /etc/fonts/fonts.conf
    Scanning config dir /etc/fonts/conf.d
    Loading config file from /etc/fonts/conf.d/05-flatpak-fontpath.conf
    Loading config file from /etc/fonts/conf.d/05-flatpak-fontpath.conf done
    Loading config file from /etc/fonts/conf.d/10-hinting-slight.conf
    Loading config file from /etc/fonts/conf.d/10-hinting-slight.conf done
    Loading config file from /etc/fonts/conf.d/10-scale-bitmap-fonts.conf
    Loading config file from /etc/fonts/conf.d/10-scale-bitmap-fonts.conf done
    Loading config file from /etc/fonts/conf.d/10-sub-pixel-none.conf
    Loading config file from /etc/fonts/conf.d/10-sub-pixel-none.conf done
    Loading config file from /etc/fonts/conf.d/10-yes-antialias.conf
    Loading config file from /etc/fonts/conf.d/10-yes-antialias.conf done
    Loading config file from /etc/fonts/conf.d/11-lcdfilter-default.conf
    Loading config file from /etc/fonts/conf.d/11-lcdfilter-default.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-vera.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-vera.conf done
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-caladea.conf
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-caladea.conf done
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-carlito.conf
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-carlito.conf done
    Loading config file from /etc/fonts/conf.d/30-metric-aliases.conf
    Loading config file from /etc/fonts/conf.d/30-metric-aliases.conf done
    Loading config file from /etc/fonts/conf.d/30-tex-gyre.conf
    Loading config file from /etc/fonts/conf.d/30-tex-gyre.conf done
    Loading config file from /etc/fonts/conf.d/40-nonlatin.conf
    Loading config file from /etc/fonts/conf.d/40-nonlatin.conf done
    Loading config file from /etc/fonts/conf.d/45-generic.conf
    Loading config file from /etc/fonts/conf.d/45-generic.conf done
    Loading config file from /etc/fonts/conf.d/45-latin.conf
    Loading config file from /etc/fonts/conf.d/45-latin.conf done
    Loading config file from /etc/fonts/conf.d/48-spacing.conf
    Loading config file from /etc/fonts/conf.d/48-spacing.conf done
    Loading config file from /etc/fonts/conf.d/49-sansserif.conf
    Loading config file from /etc/fonts/conf.d/49-sansserif.conf done
    Loading config file from /etc/fonts/conf.d/50-flatpak.conf
    Loading config file from /run/host/font-dirs.xml
    Loading config file from /run/host/font-dirs.xml done
    Loading config file from /etc/fonts/conf.d/50-flatpak.conf done
    Loading config file from /etc/fonts/conf.d/50-user.conf
    Loading config file from /etc/fonts/conf.d/50-user.conf done
    Loading config file from /etc/fonts/conf.d/51-local.conf
    Loading config file from /etc/fonts/conf.d/51-local.conf done
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans-mono.conf
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans-mono.conf done
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans.conf
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans.conf done
    Loading config file from /etc/fonts/conf.d/57-dejavu-serif.conf
    Loading config file from /etc/fonts/conf.d/57-dejavu-serif.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-mono.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-mono.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-narrow.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-narrow.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-sans.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-sans.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-serif.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-serif.conf done
    Loading config file from /etc/fonts/conf.d/60-generic.conf
    Loading config file from /etc/fonts/conf.d/60-generic.conf done
    Loading config file from /etc/fonts/conf.d/60-latin.conf
    Loading config file from /etc/fonts/conf.d/60-latin.conf done
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-caladea.conf
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-caladea.conf done
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-carlito.conf
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-carlito.conf done
    Loading config file from /etc/fonts/conf.d/65-fonts-persian.conf
    Loading config file from /etc/fonts/conf.d/65-fonts-persian.conf done
    Loading config file from /etc/fonts/conf.d/65-nonlatin.conf
    Loading config file from /etc/fonts/conf.d/65-nonlatin.conf done
    Loading config file from /etc/fonts/conf.d/69-gnu-free-mono.conf
    Loading config file from /etc/fonts/conf.d/69-gnu-free-mono.conf done
    Loading config file from /etc/fonts/conf.d/69-gnu-free-sans.conf
    Loading config file from /etc/fonts/conf.d/69-gnu-free-sans.conf done
    Loading config file from /etc/fonts/conf.d/69-gnu-free-serif.conf
    Loading config file from /etc/fonts/conf.d/69-gnu-free-serif.conf done
    Loading config file from /etc/fonts/conf.d/69-unifont.conf
    Loading config file from /etc/fonts/conf.d/69-unifont.conf done
    Loading config file from /etc/fonts/conf.d/80-delicious.conf
    Loading config file from /etc/fonts/conf.d/80-delicious.conf done
    Loading config file from /etc/fonts/conf.d/90-synthetic.conf
    Loading config file from /etc/fonts/conf.d/90-synthetic.conf done
    Loading config file from /etc/fonts/fonts.conf done
Gtk-Message: 21:51:56.142: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:51:56.143: Failed to load module "canberra-gtk-module"
FC_DEBUG=1024
    Loading config file from /etc/fonts/fonts.conf
    Scanning config dir /etc/fonts/conf.d
    Loading config file from /etc/fonts/conf.d/05-flatpak-fontpath.conf
    Loading config file from /etc/fonts/conf.d/05-flatpak-fontpath.conf done
    Loading config file from /etc/fonts/conf.d/10-hinting-slight.conf
    Loading config file from /etc/fonts/conf.d/10-hinting-slight.conf done
    Loading config file from /etc/fonts/conf.d/10-scale-bitmap-fonts.conf
    Loading config file from /etc/fonts/conf.d/10-scale-bitmap-fonts.conf done
    Loading config file from /etc/fonts/conf.d/10-sub-pixel-none.conf
    Loading config file from /etc/fonts/conf.d/10-sub-pixel-none.conf done
    Loading config file from /etc/fonts/conf.d/10-yes-antialias.conf
    Loading config file from /etc/fonts/conf.d/10-yes-antialias.conf done
    Loading config file from /etc/fonts/conf.d/11-lcdfilter-default.conf
    Loading config file from /etc/fonts/conf.d/11-lcdfilter-default.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf done
    Loading config file from /etc/fonts/conf.d/20-unhint-small-vera.conf
    Loading config file from /etc/fonts/conf.d/20-unhint-small-vera.conf done
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-caladea.conf
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-caladea.conf done
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-carlito.conf
    Loading config file from /etc/fonts/conf.d/30-0-google-crosextra-carlito.conf done
    Loading config file from /etc/fonts/conf.d/30-metric-aliases.conf
    Loading config file from /etc/fonts/conf.d/30-metric-aliases.conf done
    Loading config file from /etc/fonts/conf.d/30-tex-gyre.conf
    Loading config file from /etc/fonts/conf.d/30-tex-gyre.conf done
    Loading config file from /etc/fonts/conf.d/40-nonlatin.conf
    Loading config file from /etc/fonts/conf.d/40-nonlatin.conf done
    Loading config file from /etc/fonts/conf.d/45-generic.conf
    Loading config file from /etc/fonts/conf.d/45-generic.conf done
    Loading config file from /etc/fonts/conf.d/45-latin.conf
    Loading config file from /etc/fonts/conf.d/45-latin.conf done
    Loading config file from /etc/fonts/conf.d/48-spacing.conf
    Loading config file from /etc/fonts/conf.d/48-spacing.conf done
    Loading config file from /etc/fonts/conf.d/49-sansserif.conf
    Loading config file from /etc/fonts/conf.d/49-sansserif.conf done
    Loading config file from /etc/fonts/conf.d/50-flatpak.conf
    Loading config file from /run/host/font-dirs.xml
    Loading config file from /run/host/font-dirs.xml done
    Loading config file from /etc/fonts/conf.d/50-flatpak.conf done
    Loading config file from /etc/fonts/conf.d/50-user.conf
    Loading config file from /etc/fonts/conf.d/50-user.conf done
    Loading config file from /etc/fonts/conf.d/51-local.conf
    Loading config file from /etc/fonts/conf.d/51-local.conf done
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans-mono.conf
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans-mono.conf done
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans.conf
    Loading config file from /etc/fonts/conf.d/57-dejavu-sans.conf done
    Loading config file from /etc/fonts/conf.d/57-dejavu-serif.conf
    Loading config file from /etc/fonts/conf.d/57-dejavu-serif.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-mono.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-mono.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-narrow.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-narrow.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-sans.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-sans.conf done
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-serif.conf
    Loading config file from /etc/fonts/conf.d/59-liberation-fonts-serif.conf done
    Loading config file from /etc/fonts/conf.d/60-generic.conf
    Loading config file from /etc/fonts/conf.d/60-generic.conf done
    Loading config file from /etc/fonts/conf.d/60-latin.conf
    Loading config file from /etc/fonts/conf.d/60-latin.conf done
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-caladea.conf
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-caladea.conf done
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-carlito.conf
    Loading config file from /etc/fonts/conf.d/62-google-crosextra-carlito.conf done
    Loading config file from /etc/fonts/conf.d/65-fonts-persian.conf
    Loading config file from /etc/fonts/conf.d/65-fonts-persian.conf done
    Loading config file from /etc/fonts/conf.d/65-nonlatin.conf
    Loading config file from /etc/fonts/conf.d/65-nonlatin.conf done
    Loading config file from /etc/fonts/conf.d/69-gnu-free-mono.conf
    Loading config file from /etc/fonts/conf.d/69-gnu-free-mono.conf done
    Loading config file from /etc/fonts/conf.d/69-gnu-free-sans.conf
    Loading config file from /etc/fonts/conf.d/69-gnu-free-sans.conf done
    Loading config file from /etc/fonts/conf.d/69-gnu-free-serif.conf
    Loading config file from /etc/fonts/conf.d/69-gnu-free-serif.conf done
    Loading config file from /etc/fonts/conf.d/69-unifont.conf
    Loading config file from /etc/fonts/conf.d/69-unifont.conf done
    Loading config file from /etc/fonts/conf.d/80-delicious.conf
    Loading config file from /etc/fonts/conf.d/80-delicious.conf done
    Loading config file from /etc/fonts/conf.d/90-synthetic.conf
    Loading config file from /etc/fonts/conf.d/90-synthetic.conf done
    Loading config file from /etc/fonts/fonts.conf done
    Scanning config dir /etc/fonts/conf.avail
    Scanning config file from /etc/fonts/conf.avail/05-reset-dirs-sample.conf
    Scanning config file from /etc/fonts/conf.avail/05-reset-dirs-sample.conf done
    Scanning config file from /etc/fonts/conf.avail/09-autohint-if-no-hinting.conf
    Scanning config file from /etc/fonts/conf.avail/09-autohint-if-no-hinting.conf done
    Scanning config file from /etc/fonts/conf.avail/10-autohint.conf
    Scanning config file from /etc/fonts/conf.avail/10-autohint.conf done
    Scanning config file from /etc/fonts/conf.avail/10-hinting-full.conf
    Scanning config file from /etc/fonts/conf.avail/10-hinting-full.conf done
    Scanning config file from /etc/fonts/conf.avail/10-hinting-medium.conf
    Scanning config file from /etc/fonts/conf.avail/10-hinting-medium.conf done
    Scanning config file from /etc/fonts/conf.avail/10-hinting-none.conf
    Scanning config file from /etc/fonts/conf.avail/10-hinting-none.conf done
    Scanning config file from /etc/fonts/conf.avail/10-no-antialias.conf
    Scanning config file from /etc/fonts/conf.avail/10-no-antialias.conf done
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-bgr.conf
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-bgr.conf done
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-rgb.conf
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-rgb.conf done
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-vbgr.conf
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-vbgr.conf done
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-vrgb.conf
    Scanning config file from /etc/fonts/conf.avail/10-sub-pixel-vrgb.conf done
    Scanning config file from /etc/fonts/conf.avail/10-unhinted.conf
    Scanning config file from /etc/fonts/conf.avail/10-unhinted.conf done
    Scanning config file from /etc/fonts/conf.avail/11-lcdfilter-legacy.conf
    Scanning config file from /etc/fonts/conf.avail/11-lcdfilter-legacy.conf done
    Scanning config file from /etc/fonts/conf.avail/11-lcdfilter-light.conf
    Scanning config file from /etc/fonts/conf.avail/11-lcdfilter-light.conf done
    Scanning config file from /etc/fonts/conf.avail/25-unhint-nonlatin.conf
    Scanning config file from /etc/fonts/conf.avail/25-unhint-nonlatin.conf done
    Scanning config file from /etc/fonts/conf.avail/35-lang-normalize.conf
    Scanning config file from /etc/fonts/conf.avail/35-lang-normalize.conf done
    Scanning config file from /etc/fonts/conf.avail/65-khmer.conf
    Scanning config file from /etc/fonts/conf.avail/65-khmer.conf done
    Scanning config file from /etc/fonts/conf.avail/70-no-bitmaps.conf
    Scanning config file from /etc/fonts/conf.avail/70-no-bitmaps.conf done
    Scanning config file from /etc/fonts/conf.avail/70-yes-bitmaps.conf
    Scanning config file from /etc/fonts/conf.avail/70-yes-bitmaps.conf done
[2:2:0511/215156.205157:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[2:2:0511/215157.941583:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.NotSupported: This method is not implemented
[37:37:0511/215159.162835:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[37:37:0511/215200.440481:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[37:37:0511/215217.497764:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

OS: Fedora Linux 38.20230511.0 (Silverblue) 64-bit [updated from 37.20230401.0 (Silverblue) 64-bit] Gnome: 44.1 Windowing system: Wayland Kernel: Linux 6.2.14-300.fc38.x86_64 Flatpak 1.15.4

EDIT: Deleting the fontconfig cache folder of org.chromium.Chromium followed by running fc-cache resolves the issue for me.

$ rm -r ~/.var/app/org.chromium.Chromium/cache/fontconfig
$ fc-cache
tagoh commented 1 year ago

Deleting the fontconfig cache folder of org.chromium.Chromium followed by running fc-cache resolves the issue for me.

Indeed, /app/cache/fontconfig has a higher priority than host caches. if you have something there, that could messed up. Unfortunately there are no way to avoid this situation on flatpak on ostree-based systems. fontconfig relies on mtime to detect updates though, both sets 0 to mtime. So even if fonts updated, outdated caches still keeps alive. Anyway, no need to generate caches at app specific directory unless they have own fonts installed. If removing them doesn't help, there might be another outdated caches somewhere else.

wjt commented 1 year ago

There is no /app/cache/fontconfig, presumably you meant ~/.var/app/org.chromium.Chromium/cache/fontconfig.

This problem doesn't seem to be triggered by any change on the host system: in https://github.com/flathub/org.chromium.Chromium/issues/280#issuecomment-1517531358 I identified the first build of Chromium with this problem. The fonts on my host system aren't changing. And I don't believe Chromium bundles any font.

Erick555 commented 1 year ago

Anyway, no need to generate caches at app specific directory unless they have own fonts installed.

For most flatpaks cache is automatically generated on app startup in~/.var/app/<app-id>/cache/fontconfig though.

As users noted above this regression seems irrelevant for runtime changes but was bisected to specific chromium update which included massive (3.5 years of development history) bump for fontconfig version (from 2019 to 2023) which may be related.

refi64 commented 1 year ago

@wjt ultimate necro-reply: I'm on 2.14.2, but some other people on Fedora can repro this so I'm not sure if that's related...

I looked a bit into this, apparently the cache is version-specific. The fontconfig version in the runtime is on cache v8, old Chromium is on v7, and new Chromium is on v9. What this also means is that their caches should not be shared at all, so it's not clear why removing the old version's cache files would affect the new version?

@wjt any chance you could email over your cache files that aren't working?

wjt commented 1 year ago

Emailed!

tagoh commented 1 year ago

I looked a bit into this, apparently the cache is version-specific. The fontconfig version in the runtime is on cache v8, old Chromium is on v7, and new Chromium is on v9. What this also means is that their caches should not be shared at all, so it's not clear why removing the old version's cache files would affect the new version?

Ah, wait. well, in general, this isn't the case because fontconfig reads valid caches only they know. so it doesn't matter even if cache directories contains different version of caches. HOWEVER, the version 7 of cache might be broken. see https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/5d84745e7209d4c612302652723f92addfbb3364

tagoh commented 1 year ago

And... one more thing. I'm really surprised that Chromium is picking up fontconfig from git main branch, which contains non-released code yet. the version 9 of cache isn't yet released and incompatible changes might be still added. In that case, the user of "new Chromium" may see strange problem then.

Erick555 commented 1 year ago

They needed CFI fix which isn't part of any released version.