Error allocating font with tcl/tk

This issue arises when trying to run a snap built for a python tkinter application:

_tkinter.TclError: failed to allocate font due to internal system font engine problem 

Is this a problem that is solved for gtk apps using the gtk3-desktop plug already? Or perhaps it is a bug? I don’t know much about fontconfig or how fonts are found on the system.

This has also been posted on the askubuntu forum but with seemingly no solution:

Here are the parts from my snapcraft.yaml file:

grade: stable 
confinement: devmode
icon: ../img/logo.png
    command: bin/dataexplore
    plugs: [home,x11,unity7]
    plugin: python
    python-version: python3
    source: ../
  files: #to deal with problem finding init.tcl
    plugin: dump
    source: /usr/share/tcltk/
        '*': ./usr/lib/
1 Like

here is a snap i did before the dektop launchers existed, take a look at the wrapper script and stage-packages …

(you might want to add a font as well to stage-packages like “fonts-dejavu-core” )

The answer is just to use the desktop launcher. Using desktop-glib-only is sufficient to allow the snap to run. Adding the fonts to stage-packages is also needed. Cheers.

1 Like