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" '';