docker-baseimage-gui icon indicating copy to clipboard operation
docker-baseimage-gui copied to clipboard

Provide mechanism for custom fonts on startup.

Open r-pufky opened this issue 5 years ago • 2 comments

It would be great to enable the use of loading custom fonts when the image is stared. My thought is something like this:

  • Load font files in a unique namespace in the config mountpoint: /config/baseimage/fonts
  • Setup an environment variable that will trigger loading if enabled, e.g. ENABLE_CUSTOM_FONTS=1
  • On container start, the startup script checks the environment variable, and runs a font cache update: fc-cache -f -v -y /config/baseimage/fonts

This would enable end user custom fonts to be install simply by placing them in the correct location, ensuring it is enabled and restarting the docker container.

r-pufky avatar May 25 '19 23:05 r-pufky

From what I've learned, it's not really possible to offer an universal way to "select" the font to use. This highly depends on the implemented application. The way an application selects the font is not the same and depends in part on which framework it is based on: GTK, Qt, Java, etc. Also, some applications don't follow the "standard" way and have their own font selection mechanism.

jlesage avatar May 26 '19 01:05 jlesage

Yup -- that is correct.

This just provides a mechanism for consumers of baseimage-gui to load fonts on the docker container's font cache for usage at start. The consumers of the image would be responsible for setting the font correctly in whatever they run on top of the baseimage, and where they load it from (font cache, or directly from the files themselves).

r-pufky avatar May 26 '19 19:05 r-pufky