mirror of
https://github.com/ryanccn/flake.git
synced 2025-12-06 08:10:43 +01:00
feat(fonts): patch IBM Plex for compliant font weight names
This commit is contained in:
parent
c7fbe30750
commit
0bef7e8133
2 changed files with 42 additions and 0 deletions
|
|
@ -27,6 +27,7 @@
|
|||
inputs.discord-applemusic-rich-presence.overlays.default
|
||||
inputs.nyoom.overlays.default
|
||||
(import ../overlays/ryan-mono-bin.nix)
|
||||
(import ../overlays/ibm-plex.nix)
|
||||
];
|
||||
|
||||
config.allowUnfree = true;
|
||||
|
|
|
|||
41
overlays/ibm-plex.nix
Normal file
41
overlays/ibm-plex.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
(_: prev: {
|
||||
ibm-plex = prev.ibm-plex.overrideAttrs (prev': {
|
||||
postInstall = ''
|
||||
set -eo pipefail
|
||||
PATH="${prev.fd}/bin:${prev.python311Packages.fonttools}/bin:$PATH"
|
||||
|
||||
cd "$out/share/fonts/opentype"
|
||||
|
||||
ansi_dim="\033[2m"
|
||||
ansi_blue="\033[34m"
|
||||
ansi_green="\033[32m"
|
||||
ansi_reset="\033[0m"
|
||||
|
||||
medium_fonts=$(fd --extension=otf Medium)
|
||||
|
||||
for medium_font in $medium_fonts; do
|
||||
echo -e "''${ansi_blue}Patching''${ansi_reset} $medium_font (Medm -> Medium)"
|
||||
|
||||
ttx_path="''${medium_font%.*}.ttx"
|
||||
|
||||
ttx "$medium_font"
|
||||
sed -i 's/Medm/Medium/g' "$ttx_path"
|
||||
ttx -f "$ttx_path"
|
||||
done
|
||||
|
||||
semibold_fonts=$(fd --extension=otf SemiBold)
|
||||
|
||||
for semibold_font in $semibold_fonts; do
|
||||
echo -e "''${ansi_blue}Patching''${ansi_reset} $semibold_font (SmBld -> Semibold)"
|
||||
|
||||
ttx_path="''${semibold_font%.*}.ttx"
|
||||
|
||||
ttx "$semibold_font"
|
||||
sed -i 's/SmBld/Semibold/g' "$ttx_path"
|
||||
ttx -f "$ttx_path"
|
||||
done
|
||||
|
||||
echo -e "''${ansi_green}Done!''${ansi_reset}"
|
||||
'';
|
||||
});
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue