FreeCAD / FreeCAD-snap

The official Snap package of the FreeCAD project
https://snapcraft.io/freecad
8 stars 9 forks source link

Fonts are not rendered #106

Open furgo16 opened 9 months ago

furgo16 commented 9 months ago

While a list of available system fonts is displayed whenever there is a font selector in the GUI, selecting any given font does not seem to have any effect. The font remains always the same.

Fonts

Steps to reproduce

  1. Create a new document and select the Draft workbench
  2. Create a text annotation (T, E)
  3. With the text selected, go to the View tab in the Combo View panel
  4. Change the Font Name property: select any font from the combo box

Expected:

Actual:

furgo16 commented 2 months ago

Asked for help on the Snapcrafters forum: https://forum.snapcraft.io/t/fixing-fonts-on-the-freecad-snap/40026

soumyaDghosh commented 2 months ago

@furgo16 Can you kindly share some logs by running the app from the terminal?

furgo16 commented 2 months ago

@soumyaDghosh thanks. Are you looking for something specific? There is not much of an output running from the terminal and following the steps to reproduce:

freecad
FreeCAD 0.22.0, Libs: 0.22.0devR37472 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2024
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Adding snap-specific PYTHONPATH to sys.path: $HOME/snap/freecad/common/.local/lib/python3.10/site-packages:/snap/freecad/1031/lib/python3.10/site-packages:/snap/freecad/1031/usr/lib/python3/dist-packages
Qt: Session management error: Could not open network socket
This version of FreeCAD (0.22-37472) is not compatible with Assembly4
You may encounter erors, it is rather suggested to use the stable 0.21 branch
connect failed: No such file or directory
soumyaDghosh commented 2 months ago

Can't find any snap specific logs! @chennes @ppd I think this is something with paths or similar. Please kindly look into this.

furgo16 commented 1 month ago

Information on how to add font support to snaps seems inexistent, or at least I'm unable to find it. The closest I found was this comment from a bug report:

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.

These environment variables are not defined in FreeCAD's snapcraft.yaml file. On my system:

Digging deeper, it seems that fonts should be handled by the kde-neon extension, as defined in snapcraft.yaml