I started move to Ubuntu 20.04 but when i install chromium form Snap
apt install chromium-browser
Chromium cannot read /etc/fonts/conf.d/65-ubuntu-font-family-arabic.conf
that contain
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="family" compare="eq">
<string>Ubuntu</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu Sans</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu Serif</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu Serif</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Ubuntu Arabic</string>
</edit>
</match>
<alias>
<family>DejaVu Serif</family>
<prefer>
<family>Ubuntu Arabic</family>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>DejaVu Sans</family>
<prefer>
<family>Ubuntu Arabic</family>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>DejaVu</family>
<prefer>
<family>Ubuntu Arabic</family>
<family>DejaVu</family>
</prefer>
</alias>
</fontconfig>
font source: https://launchpad.net/ubuntu/+source/ubuntu-font-family-sources/0.84~mono0.83+arabicfontconfig-0ubuntu1
How i can make snap package read that files?
If you notice, Chromium and Ubuntu Software not use default system fonts
Gedit, Firefox and Files use System fonts correctly
Chromium binary works well
oSoMoN
April 20, 2020, 1:45pm
4
Sorry for the late feedback @SYaslem .
If you’re willing to re-install the chromium snap to help us diagnose and fix the problem, could you run it and in parallel have the following command running in a separate terminal window:
journalctl -f | grep DEN
Then please share the output here. Thanks in advance!
2 Likes
oSoMoN
April 20, 2020, 1:48pm
5
أبريل 20 18:59:02 syaslem audit[665]: USER_AVC pid=665 uid=100 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=4077 label="snap.chromium.chromium"
أبريل 20 18:59:02 syaslem kernel: audit: type=1107 audit(1587398342.076:77): pid=665 uid=100 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=4077 label="snap.chromium.chromium
oSoMoN
April 20, 2020, 4:13pm
7
Thanks. There is no denial on /etc/fonts/
. I’ll see if I can reproduce the bug in a VM.
oSoMoN
April 20, 2020, 4:27pm
8
Pardon my ignorance, how did you manage to get that font installed in 20.04? It appears it was in xenial only, not available in later versions, and when I download the deb to manually install it, I get a conflict with fonts-ubuntu
.
install fonts manual in
/usr/local/share/fonts
then create /etc/fonts/conf.avail/65-ubuntu-font-family-arabic.conf
contains
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="family" compare="eq">
<string>Ubuntu</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu Sans</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu Serif</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Ubuntu Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="eq">
<string>DejaVu Serif</string>
</test>
<test name="lang" compare="contains">
<string>ar</string>
</test>
<edit name="family" mode="assign" binding="strong">
<string>Ubuntu Arabic</string>
</edit>
</match>
<alias>
<family>DejaVu Serif</family>
<prefer>
<family>Ubuntu Arabic</family>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>DejaVu Sans</family>
<prefer>
<family>Ubuntu Arabic</family>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>DejaVu</family>
<prefer>
<family>Ubuntu Arabic</family>
<family>DejaVu</family>
</prefer>
</alias>
</fontconfig>
and create syslink for it in /etc/fonts/conf.d/
ogra
April 20, 2020, 5:29pm
10
have you tried putting the font into
~/.local/share/fonts/
might be that snapd’s desktop interface simply does not allow access to /usr/local/share/fonts …
ppd
April 20, 2020, 6:06pm
11
ogra
April 20, 2020, 6:19pm
12
ah i had only checked the snapd source, not the apparmor font abstraction …
# other interfaces (eg, wayland). #include <abstractions/dbus-strict> #include <abstractions/dbus-session-strict> # Allow finding the DBus session bus id (eg, via dbus_bus_get_id()) dbus (send) bus=session path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetId peer=(name=org.freedesktop.DBus, label=unconfined), #include <abstractions/fonts> owner @{HOME}/.local/share/fonts/{,**} r, /var/cache/fontconfig/ r, /var/cache/fontconfig/** mr, # some applications are known to mmap fonts /usr/{,local/}share/fonts/** m, # subset of gnome abstraction
the issue not read fonts
chromium can found “Ubuntu Arabic” but cannot read conf.d that make it replace to "DejaVu "
oSoMoN
April 22, 2020, 1:18pm
15
Can you try the following? Edit ~/snap/chromium/current/.config/fontconfig/fonts.conf
to add the following line:
<include ignore_missing="yes">/etc/fonts/conf.d</include>
Then save the file and restart chromium.
I’m not really sure what to expect visually, but I can tell that when stracing the snap, adding that line allowed the app to find and read your custom fonts configuration file.
2 Likes
Thank you, that work great!
how i can do it globally?
oSoMoN
April 22, 2020, 2:27pm
17
@jamesh is this something we should consider for addition to the desktop helpers?
1 Like
after restart the changes removed
oSoMoN
April 24, 2020, 12:12pm
20
Ah, that’s quite unfortunate… Indeed the fontconfig file is regenerated everytime there’s an update (a new revision) to the snap. We need a way for users to define custom configs that stick.
Create an empty fontconfig-user.conf
if it doesn’t exist for <include>
? Only touch that file if it doesn’t exist, so that the fontconfig ruleset doesn’t break by it potentially not being present, allowing the user to add their custom rules in this separate non-generated file.
1 Like