Skip to content

Commit

Permalink
fix: font config detection for snap (microsoft#232713)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 authored Oct 31, 2024
1 parent 54d1a4d commit b62b416
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions resources/linux/snap/electron-launch
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function can_open_file() {
# Preserve system variables that get modified below
copy_env_variable XDG_CONFIG_DIRS
copy_env_variable XDG_DATA_DIRS
copy_env_variable XDG_DATA_HOME
copy_env_variable LOCPATH
copy_env_variable GIO_MODULE_DIR
copy_env_variable GSETTINGS_SCHEMA_DIR
Expand Down Expand Up @@ -167,6 +168,18 @@ fi
# Keep an array of data dirs, for looping through them
IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS"

# Font Config
export FONTCONFIG_PATH="/etc/fonts"
export FONTCONFIG_FILE="/etc/fonts/fonts.conf"

if [ "$needs_update" = true ]; then
rm -rf "$XDG_DATA_HOME"/fonts

if [ -d "$SNAP_REAL_HOME/.local/share/fonts" ]; then
ln -s "$SNAP_REAL_HOME/.local/share/fonts" "$XDG_DATA_HOME/fonts"
fi
fi

# Build mime.cache needed for gtk and qt icon
# TODO(deepak1556): Re-enable this once we move to core22
# Refs https://github.com/microsoft/vscode/issues/230454#issuecomment-2418352959
Expand Down

0 comments on commit b62b416

Please sign in to comment.