Edit: copying the font to /usr/local/share/fonts/ fixed it. (I downloaded Debian Xfce a while ago because of how much I dislike Snap, so I’ll soon replace Xubuntu with it.)

I recently installed the font “Atkinson Hyperlegible” on Xubuntu 22.04.3 (via right click, Fonts 41.0), and I use it as the Xfce UI font and the default in Mousepad and LibreOffice without any problems.

However in Firefox 120.0.1 (64-bit), Snap for Ubuntu, canonical-002 - 1.0; it’s not listed at Edit, Settings, Fonts; or Fonts, Advanced…

When I view an HTML page where the CSS’ body has font-family:"Atkinson Hyperlegible",sans-serif; it also doesn’t use the Atkinson font. That page also doesn’t use Atkinson in the (Epiphany GNOME) Web 45.1 browser.

Any ideas on how to get Firefox and Epiphany to see it?

  • Mike@sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    11 months ago

    I don’t know anything about how Firefox is packaged for snap, but snap’s “sandboxing” might interfere with getting all fonts.

    You might want to try using Firefox without snap (which has some other benefits, especially around startup time) or adding ~/.local/share/fonts (which is where fonts are supposed to be installed for users) to some sort of allowlist.

  • Chinstrap@lemmy.ml
    link
    fedilink
    English
    arrow-up
    8
    ·
    11 months ago

    If the fonts are installed as systemwide snap or flatpak applications may not be able to see them. Since they are allowed only to the user directories by default.

    You can copy the fonts to user directory

    cp /usr/share/fonts/your-font ~/.local/share/fonts/

  • Jack@lemmy.caOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    11 months ago

    Thanks for the comments. Based on them I found https://github.com/snapcrafters/gimp/issues/21 which suggested copying the font to ~/.fonts/ (which didn’t work) and to /usr/local/share/fonts/ which fixed it - Epiphany can now see the font, and I can now set it as default in Firefox (tho Firefox is ignoring it in a page’s CSS).

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    Snap and Flatpak use sandboxing technology to limit exposure to certain paths, so it’s possible the installed font doesn’t get loaded.

    If you installed the font into the system font store (i.e. you were asked for your password during installation), there’s a good chance the container maps its own font directory over the system one. In that case, try putting the font into your user folder instead ($HOME/.local/share/fonts, create the directory if necessary). These user overrides are usually picked up even by sandboxed software.

    If that doesn’t work either, try using the Flatpak version instead (sudo apt install flatpak && flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo to install Flatpak, flatpak install org.gnome.Epiphany to install Gnome Web). I know from experience that user fonts work in the Flatpak version of Epiphany.

    Unfortunately, since Ubuntu moved their Software store to a Snap package, installing Flatpaks from the GUI is no longer possible. You can try installing the apt version of the Gnome Software store and adding the Flatpak plugin to that, but you’ll end up with two versions both named “Software”, one of which will support Flatpaks and apt packages, the other will support Snaps (and perhaps apt packages?). You can thank Canonical for that one.

    This forum topic seems to run into similar issues with a Snap package (LibreOffice this time). The first answer suggests using a non-standard $HOME/.fonts folder, which I wouldn’t recommend, but they do have commands you can run that may get the snap version running. This forum topic has the same issue with Firefox’ font support on Snap. It appears that Snap doesn’t load user font config so it’s possible that this is why your normal installation didn’t work.