diff --git a/pkgs/by-name/ro/roboto/package.nix b/pkgs/by-name/ro/roboto/package.nix index b22a68fde945..b2b7880f9726 100644 --- a/pkgs/by-name/ro/roboto/package.nix +++ b/pkgs/by-name/ro/roboto/package.nix @@ -2,6 +2,7 @@ lib, stdenvNoCC, fetchzip, + python3Packages, }: stdenvNoCC.mkDerivation rec { @@ -14,9 +15,24 @@ stdenvNoCC.mkDerivation rec { hash = "sha256-ue3PUZinBpcYgSho1Zrw1KHl7gc/GlN1GhWFk6g5QXE="; }; + nativeBuildInputs = [ + python3Packages.fonttools + ]; + installPhase = '' runHook preInstall + # The RobotoCondensed fonts have a usWidthClass value of 5, which is + # incorrect. It should be 3. + # See the corresponding issue at https://github.com/googlefonts/roboto-3-classic/issues/130 + for file in RobotoCondensed*; do + fontname=$(echo $file | sed 's/\.ttf//') + ttx -v -o $fontname.xml $file + substituteInPlace $fontname.xml \ + --replace-fail "" "" + ttx $fontname.xml -o $fontname.ttf + done + install -Dm644 *.ttf -t $out/share/fonts/truetype runHook postInstall