From fb8ef8aa7c884f24bba4e0defeff84cf3cf3e52c Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Fri, 27 Dec 2024 18:09:58 +0100 Subject: [PATCH] cv: use `text.stretch` - fix Roboto font See https://github.com/googlefonts/roboto-3-classic/pull/131 and https://github.com/NixOS/nixpkgs/pull/368615 --- flake.nix | 26 +++++++++++++++++++++----- src/cv/common/lib.typ | 16 ++++++++++++++++ src/cv/cv-theme.typ | 11 +++++------ 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index b14f025..8c4e2af 100644 --- a/flake.nix +++ b/flake.nix @@ -33,17 +33,33 @@ # Change here to typst-dev if needed typst = pkgs.nixpkgs-unstable.typst; - robotoCondensed = pkgs.roboto.overrideAttrs (finalAttrs: { - postInstall = finalAttrs.postInstall or "" + '' - rm -rf $out/share/fonts/truetype/Roboto-* - ''; + robotoFixed = pkgs.roboto.overrideAttrs (finalAttrs: { + nativeBuildInputs = [ + pkgs.python3Packages.fonttools + ]; + + installPhase = '' + runHook preInstall + + 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 + ''; }); fontsConf = pkgs.symlinkJoin { name = "typst-fonts"; paths = with pkgs; [ font-awesome - robotoCondensed + robotoFixed newcomputermodern ]; }; diff --git a/src/cv/common/lib.typ b/src/cv/common/lib.typ index c69707c..6a8e536 100644 --- a/src/cv/common/lib.typ +++ b/src/cv/common/lib.typ @@ -149,3 +149,19 @@ ) } } + +#let LaTeX = { + [L];box(move( + dx: -4.2pt, dy: -1.2pt, + box(scale(65%)[A]) + ));box(move( + dx: -5.7pt, dy: 0pt, + [T] +));box(move( + dx: -7.0pt, dy: 2.7pt, + box(scale(100%)[E]) +));box(move( + dx: -8.0pt, dy: 0pt, + [X] +));h(-8.0pt) +} diff --git a/src/cv/cv-theme.typ b/src/cv/cv-theme.typ index 6105299..ce22152 100644 --- a/src/cv/cv-theme.typ +++ b/src/cv/cv-theme.typ @@ -11,7 +11,7 @@ set text( font: body-font, size: font.normal, - weight: 400, + stretch: 75%, lang: "en", hyphenate: true, ) @@ -104,15 +104,14 @@ solutions that harmoniously balance aesthetics and functionality. ][ #box()[ - #featureBar(title: "Linux/NixOS/FreeBSD", value: 95%) + #featureBar(title: "Linux / NixOS / FreeBSD", value: 95%) #featureBar(title: "Object Oriented Programming", value: 90%) - #featureBar(title: "PHP/Python", value: 87%) + #featureBar(title: "PHP / Python", value: 87%) #featureBar(title: "Functional Programming", value: 85%) - #featureBar(title: "Git/Jujutsu", value: 85%) + #featureBar(title: "Git / Jujutsu", value: 85%) #featureBar(title: "Algorithm", value: 85%) #featureBar(title: "Docker", value: 75%) - #featureBar(title: "Typst", value: 70%) - #featureBar(title: "LaTeX", value: 65%) + #featureBar(title: [Typst / #LaTeX], value: 70%) ] ] ]