Skip to content

Commit

Permalink
cv: use text.stretch - fix Roboto font
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 27, 2024
1 parent 4b3bddd commit fb8ef8a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
26 changes: 21 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<usWidthClass value=\"5\"/>" "<usWidthClass value=\"3\"/>"
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
];
};
Expand Down
16 changes: 16 additions & 0 deletions src/cv/common/lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
11 changes: 5 additions & 6 deletions src/cv/cv-theme.typ
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
set text(
font: body-font,
size: font.normal,
weight: 400,
stretch: 75%,
lang: "en",
hyphenate: true,
)
Expand Down Expand Up @@ -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%)
]
]
]
Expand Down

0 comments on commit fb8ef8a

Please sign in to comment.