[Bug 2017076] Re: default Chinese font in snap apps is ugly

Gunnar Hjalmarsson 2017076 at bugs.launchpad.net
Fri Apr 21 12:43:52 UTC 2023


I had an IRC conversion with Sebastien Bacher and learned that things no
longer work as I thought they did. Unlike what I thought, the snaps do
no longer honor the font configuration of the host system, but live in
their own world in this respect.

https://github.com/ubuntu/gnome-sdk/issues/49#issuecomment-1216321729

So, what's determining the default font for a snap application is this
list:

https://github.com/ubuntu/gnome-sdk/pull/72/files

There is an apparent need to reconsider that list, but that's a separate
thing. Let's first try to understand how the specific issue reported in
this bug could happen.

The list includes the fonts-noto-cjk package, which also installs
70-fonts-noto-cjk.conf. The latter includes:

    <match target="pattern">
        <test name="lang">
            <string>zh-cn</string>
        </test>
        <test name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Sans CJK SC</string>
        </edit>
    </match>

Well, fonts-arphic-uming is also included currently, and it installs
65-fonts-arphic-uming.conf which includes:

    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>AR PL UMing CN</family>
            <family>AR PL UMing HK</family>
            <family>AR PL UMing TW</family>
        </prefer>
    </alias>

Note that this one is not language guarded, so it's effective
irrespective of locale.

But still, with the zh_CN.UTF-8 locale 70-fonts-noto-cjk.conf should
safely result in Noto Sans CJK SC being preferred over AR PL UMing CN.
To confirm that I installed the Chinese (Simplified) language in 23.04
and purged language-selector-common (which made gnome-control-center
being uninstalled...). And yes:

$ LC_CTYPE=zh_CN.UTF-8 fc-match
NotoSansCJK-Regular.ttc: "Noto Sans CJK SC" "Regular"

More playing with fc-match:

$ LC_CTYPE=zh_CN.UTF-8 fc-match -a | grep -iE 'cjk sc|uming cn' | head -3
NotoSansCJK-Regular.ttc: "Noto Sans CJK SC" "Regular"
NotoSansCJK-Bold.ttc: "Noto Sans CJK SC" "Bold"
uming.ttc: "AR PL UMing CN" "Light"
$ LC_CTYPE=en_US.UTF-8 fc-match -a | grep -iE 'cjk sc|uming cn' | head -3
uming.ttc: "AR PL UMing CN" "Light"
NotoSansCJK-Regular.ttc: "Noto Sans CJK SC" "Regular"
NotoSansCJK-Regular.ttc: "Noto Sans Mono CJK SC" "Regular"

So I now have a (vague) theory about what happens when you install
Ubuntu using the zh_CN.UTF-8 locale:

While it honors the locale when determining which packages get installed
(apparently, since fonts-arphic-uming is there), the locale is not
properly taken into account at the stage when the default Chinese
(Simplified) font of the snaps is determined.

** Bug watch added: github.com/ubuntu/gnome-sdk/issues #49
   https://github.com/ubuntu/gnome-sdk/issues/49

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to fontconfig in Ubuntu.
https://bugs.launchpad.net/bugs/2017076

Title:
  default Chinese font in snap apps is ugly

Status in Snappy:
  New
Status in fontconfig package in Ubuntu:
  New
Status in language-selector package in Ubuntu:
  New

Bug description:
  After installs Ubuntu 23.04 with Chinese language selected, the
  default font is chosen to AR PL UMing CN, which is very ugly.

  ProblemType: Bug
  DistroRelease: Ubuntu 23.04
  Package: fontconfig 2.14.1-3ubuntu3
  ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6
  Uname: Linux 6.2.0-20-generic x86_64
  ApportVersion: 2.26.1-0ubuntu2
  Architecture: amd64
  CasperMD5CheckResult: pass
  CloudArchitecture: x86_64
  CloudID: none
  CloudName: none
  CloudPlatform: none
  CloudSubPlatform: config
  CurrentDesktop: ubuntu:GNOME
  Date: Thu Apr 20 14:18:45 2023
  InstallationDate: Installed on 2023-04-20 (0 days ago)
  InstallationMedia: Ubuntu 23.04 "Lunar Lobster" - Release amd64 (20230418)
  ProcEnviron:
   LANG=zh_CN.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=xterm-256color
   XDG_RUNTIME_DIR=<set>
  SourcePackage: fontconfig
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/snappy/+bug/2017076/+subscriptions




More information about the foundations-bugs mailing list