Skip to content

Commit 4fcf706

Browse files
committed
omnissa-horizon-client: fix blank desktop tile labels
Prior to this change, the omnissa-horizon-client renders server labels as empty boxes, while the rest of the UI renders fine (using GTK theme font). With this change the server labels render correctly. Horizon renders its server labels with "DejaVu Sans" but fails to load the font when fontconfig resolves it to a symlinked file, which is what it finds if dejavu-fonts-minimal is installed on the host. This fix points the client at a fontconfig which maps DejaVu Sans to a font bundled in the FHS sandbox (Liberation Sans).
1 parent 7a1a647 commit 4fcf706

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

pkgs/by-name/om/omnissa-horizon-client/package.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
makeDesktopItem,
99
makeWrapper,
1010
opensc,
11+
liberation_ttf,
12+
writeText,
1113
writeTextDir,
1214
configText ? "",
1315
}:
@@ -26,11 +28,42 @@ let
2628

2729
mainProgram = "horizon-client";
2830

31+
# Horizon renders its broker/desktop launch-item (tile) labels with
32+
# "DejaVu Sans", but fails to instantiate the font when fontconfig resolves it
33+
# to a symlinked file -- which is exactly what nixpkgs' dejavu_fonts provides
34+
# (it is a symlink tree into dejavu-fonts-minimal). The labels then render as
35+
# blank boxes; the rest of the UI uses the GTK theme font and is unaffected.
36+
# Other toolkits load the same symlinked font without issue, so this is
37+
# specific to the client's font handling.
38+
#
39+
# The FHS sandbox bind-mounts the host's /etc/fonts, so the FHS environment's
40+
# own fontconfig does not apply. Point the client at a config that keeps the
41+
# host's fonts but maps "DejaVu Sans" onto a bundled, regular-file font
42+
# (Liberation Sans). This is deterministic and independent of the host's
43+
# font configuration.
44+
fontconfigFile = writeText "omnissa-horizon-fontconfig.conf" ''
45+
<?xml version="1.0"?>
46+
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
47+
<fontconfig>
48+
<include ignore_missing="yes">/etc/fonts/fonts.conf</include>
49+
<dir>${liberation_ttf}/share/fonts</dir>
50+
<match target="pattern">
51+
<test name="family" qual="any">
52+
<string>DejaVu Sans</string>
53+
</test>
54+
<edit name="family" mode="assign" binding="same">
55+
<string>Liberation Sans</string>
56+
</edit>
57+
</match>
58+
</fontconfig>
59+
'';
60+
2961
# This forces the default GTK theme (Adwaita) because Horizon is prone to
3062
# UI usability issues when using non-default themes, such as Adwaita-dark.
3163
wrapBinCommands = path: name: ''
3264
makeWrapper "$out/${path}/${name}" "$out/bin/${name}_wrapper" \
3365
--set GTK_THEME Adwaita \
66+
--set FONTCONFIG_FILE "${fontconfigFile}" \
3467
--suffix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
3568
--suffix LD_LIBRARY_PATH : "$out/lib/omnissa/horizon/crtbora:$out/lib/omnissa"
3669
'';

0 commit comments

Comments
 (0)