From 17a6a2f6a0f9b3f0b0df35d805aa32e5f07b5d81 Mon Sep 17 00:00:00 2001 From: Carl Zulauf Date: Mon, 29 Jun 2026 15:03:30 -0500 Subject: [PATCH] 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). Assisted-by: Claude Code (Claude Opus 4.8) --- .../om/omnissa-horizon-client/package.nix | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/pkgs/by-name/om/omnissa-horizon-client/package.nix b/pkgs/by-name/om/omnissa-horizon-client/package.nix index bcc6acb420eb..a29d00151f07 100644 --- a/pkgs/by-name/om/omnissa-horizon-client/package.nix +++ b/pkgs/by-name/om/omnissa-horizon-client/package.nix @@ -8,6 +8,8 @@ makeDesktopItem, makeWrapper, opensc, + liberation_ttf, + writeText, writeTextDir, configText ? "", }: @@ -26,11 +28,42 @@ let mainProgram = "horizon-client"; + # Horizon renders its broker/desktop launch-item (tile) labels with + # "DejaVu Sans", but fails to instantiate the font when fontconfig resolves it + # to a symlinked file -- which is exactly what nixpkgs' dejavu_fonts provides + # (it is a symlink tree into dejavu-fonts-minimal). The labels then render as + # blank boxes; the rest of the UI uses the GTK theme font and is unaffected. + # Other toolkits load the same symlinked font without issue, so this is + # specific to the client's font handling. + # + # The FHS sandbox bind-mounts the host's /etc/fonts, so the FHS environment's + # own fontconfig does not apply. Point the client at a config that keeps the + # host's fonts but maps "DejaVu Sans" onto a bundled, regular-file font + # (Liberation Sans). This is deterministic and independent of the host's + # font configuration. + fontconfigFile = writeText "omnissa-horizon-fontconfig.conf" '' + + + + /etc/fonts/fonts.conf + ${liberation_ttf}/share/fonts + + + DejaVu Sans + + + Liberation Sans + + + + ''; + # This forces the default GTK theme (Adwaita) because Horizon is prone to # UI usability issues when using non-default themes, such as Adwaita-dark. wrapBinCommands = path: name: '' makeWrapper "$out/${path}/${name}" "$out/bin/${name}_wrapper" \ --set GTK_THEME Adwaita \ + --set FONTCONFIG_FILE "${fontconfigFile}" \ --suffix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \ --suffix LD_LIBRARY_PATH : "$out/lib/omnissa/horizon/crtbora:$out/lib/omnissa" '';