Add nerd-font patched version of custom Iosevka to fonts

Move all of the logic for configuring and building the custom fonts to
iosevka.nix, to keep everything relevant in one place.
This commit is contained in:
Evie Litherland-Smith 2024-03-02 15:04:35 +00:00
parent 5260689aec
commit 7a10373030
2 changed files with 109 additions and 87 deletions

View file

@ -1,56 +1,109 @@
{ {
noCvSs = true; stdenv,
exportGlyphNames = false; iosevka,
ligations.inherits = "dlig"; nerd-font-patcher,
weights = { }: let
Regular = { customBuildPlan = {
shape = 400; noCvSs = true;
menu = 400; exportGlyphNames = false;
css = 400; ligations.inherits = "dlig";
weights = {
Regular = {
shape = 400;
menu = 400;
css = 400;
};
Bold = {
shape = 700;
menu = 700;
css = 700;
};
}; };
Bold = { variants.design = {
shape = 700; capital-g = "toothless-corner-serifless-hooked";
menu = 700; capital-j = "serifed-both-sides";
css = 700; capital-q = "crossing";
capital-r = "curly-serifless";
e = "rounded";
f = "tailed";
g = "double-storey-open";
i = "tailed-serifed";
j = "serifed";
k = "cursive-serifless";
l = "tailed-serifed";
q = "diagonal-tailed-serifless";
y = "cursive-serifless";
z = "straight-serifless-with-horizontal-crossbar";
lower-delta = "flat-top";
lower-lambda = "tailed-turn";
lower-xi = "flat-top";
lower-chi = "semi-chancery-straight";
zero = "tall-slashed";
one = "no-base";
two = "straight-neck";
three = "flat-top";
four = "semi-open";
five = "oblique-arched";
six = "open-contour";
seven = "bend-serifless-crossbar";
eight = "two-circles";
nine = "open-contour";
ampersand = "closed";
at = "fourfold";
percent = "dots";
lig-ltgteq = "flat";
lig-neq = "more-slanted";
lig-equal-chain = "without-notch";
lig-hyphen-chain = "without-notch";
lig-double-arrow-bar = "without-notch";
lig-single-arrow-bar = "without-notch";
}; };
}; };
variants.design = { in {
capital-g = "toothless-corner-serifless-hooked"; etoile = rec {
capital-j = "serifed-both-sides"; name = "Iosevka Custom Etoile";
capital-q = "crossing"; package = iosevka.override {
capital-r = "curly-serifless"; set = "etoile";
e = "rounded"; privateBuildPlan = {
f = "tailed"; inherit (customBuildPlan) noCvSs exportGlyphNames variants weights;
g = "double-storey-open"; family = name;
i = "tailed-serifed"; spacing = "quasi-proportional";
j = "serifed"; serifs = "slab";
k = "cursive-serifless"; };
l = "tailed-serifed"; };
q = "diagonal-tailed-serifless"; };
y = "cursive-serifless"; aile = rec {
z = "straight-serifless-with-horizontal-crossbar"; name = "Iosevka Custom Aile";
lower-delta = "flat-top"; package = iosevka.override {
lower-lambda = "tailed-turn"; set = "aile";
lower-xi = "flat-top"; privateBuildPlan = {
lower-chi = "semi-chancery-straight"; inherit (customBuildPlan) noCvSs exportGlyphNames variants weights;
zero = "tall-slashed"; family = name;
one = "no-base"; spacing = "quasi-proportional";
two = "straight-neck"; serifs = "sans";
three = "flat-top"; };
four = "semi-open"; };
five = "oblique-arched"; };
six = "open-contour"; nerdfont = let
seven = "bend-serifless-crossbar"; font = iosevka.override {
eight = "two-circles"; set = "custom";
nine = "open-contour"; privateBuildPlan = {
ampersand = "closed"; inherit (customBuildPlan) noCvSs exportGlyphNames variants weights;
at = "fourfold"; family = "Iosevka Custom";
percent = "dots"; spacing = "normal";
lig-ltgteq = "flat"; serifs = "sans";
lig-neq = "more-slanted"; };
lig-equal-chain = "without-notch"; };
lig-hyphen-chain = "without-notch"; in {
lig-double-arrow-bar = "without-notch"; name = "IosevkaCustomNerdFont";
lig-single-arrow-bar = "without-notch"; package = stdenv.mkDerivation {
name = "${font.name}-nerd-font-patched";
src = font;
nativeBuildInputs = [nerd-font-patcher];
buildPhase = ''
find \( -name \*.ttf -o -name \*.otf \) -execdir nerd-font-patcher -c {} \;
'';
installPhase = "cp -a . $out";
};
}; };
} }

View file

@ -26,7 +26,9 @@
name = "Catppuccin-${catppuccinVariant}-Dark-Cursors"; name = "Catppuccin-${catppuccinVariant}-Dark-Cursors";
}; };
fonts = let fonts = let
iosevkaCustomBuildPlan = import ./iosevka.nix; iosevkaCustom = import ./iosevka.nix {
inherit (pkgs) stdenv iosevka nerd-font-patcher;
};
in { in {
sizes = { sizes = {
applications = 16; applications = 16;
@ -34,42 +36,9 @@
popups = 20; popups = 20;
terminal = 16; terminal = 16;
}; };
serif = rec { serif = {inherit (iosevkaCustom.etoile) name package;};
name = "Iosevka Custom Etoile"; sansSerif = {inherit (iosevkaCustom.aile) name package;};
package = pkgs.iosevka.override { monospace = {inherit (iosevkaCustom.nerdfont) name package;};
set = "etoile";
privateBuildPlan = {
inherit (iosevkaCustomBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "quasi-proportional";
serifs = "slab";
};
};
};
sansSerif = rec {
name = "Iosevka Custom Aile";
package = pkgs.iosevka.override {
set = "aile";
privateBuildPlan = {
inherit (iosevkaCustomBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "quasi-proportional";
serifs = "sans";
};
};
};
monospace = rec {
name = "Iosevka Custom";
package = pkgs.iosevka.override {
set = "custom";
privateBuildPlan = {
inherit (iosevkaCustomBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "normal";
serifs = "sans";
};
};
};
emoji = { emoji = {
name = "Noto Color Emoji"; name = "Noto Color Emoji";
package = pkgs.noto-fonts-emoji; package = pkgs.noto-fonts-emoji;