Needs fontconfig integration

Bug #1576303 reported by Sebastien Bacher
88
This bug affects 18 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Medium
Unassigned
snapd (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Seems that those variables are needed for fontconfig to work, ideally snapcraft would handle them for you

# Not good, needed for fontconfig
export XDG_DATA_HOME=$SNAP/usr/share

# Font Config
export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d
export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapcraft (Ubuntu):
status: New → Confirmed
Revision history for this message
Bruno Nova (brunonova) wrote :

I confirm that these are needed, at least for Java Swing applications.
They crash without this with a NullPointerException at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264).

Revision history for this message
Bruno Nova (brunonova) wrote :

I also needed to add these variables to package a Racket/Scheme game that I made several years ago.

I also needed to bundle some fonts with the snap, namely fonts-dejavu. Without them, instead of letters, only rectangles were displayed. In case of Java, it didn't even start.

Snapcraft should handle these variables.
I also think that snapd should grant access to the fonts and fontconfig directories/files of the system and user. That would be really useful for things like LibreOffice.

Changed in snapcraft (Ubuntu):
importance: Undecided → Medium
Revision history for this message
QkiZ (qkiz) wrote :

Snapcraft applications should use their own fontconfig files, not from host system because of compatibility issues. I made a snap for application that is no longer in repositories. My host OS is 20.04 and snap base OS is 18.04. This causes incompatibilities between snaps and system.

Revision history for this message
QkiZ (qkiz) wrote :

Workaround for this issue:
(in apps section)
apps:
  some_app:
    command: some_app
    environment:
      XDG_DATA_HOME: $SNAP/usr/share
      FONTCONFIG_PATH: $SNAP/etc/fonts/conf.d
      FONTCONFIG_FILE: $SNAP/etc/fonts/fonts.conf

Of course this only works in devmode. After switching to strict mode program in snap ends with error that it can't reach /etc/fonts/fonts.conf file. I think should be resolved by adding interface.

affects: snapcraft (Ubuntu) → snapd (Ubuntu)
affects: snapcraft → snapd
Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

This will probably be a part of larger work related to picking up bits of /etc from the host.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.