Compare commits

...

6 commits

10 changed files with 69 additions and 33 deletions

View file

@ -14,9 +14,49 @@
"Noto Sans CJK TC"
];
serif = [ "Noto Serif CJK TC" ];
monospace = [ "Iosevka-Normal-PT-Mono" ];
monospace = [ "IosevkaPTMono" ];
emoji = [ "Noto Color Emoji" ];
};
configFile = {
thick-iosevka = {
enable = true;
# https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
# https://gist.github.com/yuttie/adb22a6c07ef8e75d82e48d5484b7ad8
# https://github.com/N1k3YB/CS2FontChanger_ru/blob/5f1d8189220f42286d773c536ff83a49b2556da2/app.py#L227
#
# Use the following script to test
# for size in (seq 9 15)
# echo
# echo
# for weight in {regular,medium,bold}
# echo "weight=$weight:size=$size"
# fc-match "mono:weight=$weight:size=$size"
# end
# end | less
text = /* xml */ ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="family" compare="contains"><string>Iosevka</string></test>
<edit name="weight" mode="assign" binding="strong">
<if> <eq><name>weight</name><const>bold</const></eq> <!-- then --> <const>bold</const>
<if> <eq><name>weight</name><const>medium</const></eq> <!-- then --> <const>medium</const>
<!-- not bold nor medium -->
<if> <more><name>size</name><double>15</double></more> <!-- then --> <const>regular</const>
<if> <more><name>size</name><double>10</double></more> <!-- then --> <const>medium</const>
<!-- else --> <const>bold</const>
</if>
</if>
</if>
</if>
</edit>
</match>
</fontconfig>
'';
};
};
};
home.packages = [
pkgs.noto-fonts
@ -26,7 +66,7 @@
pkgs.noto-fonts-color-emoji
pkgs.noto-fonts-emoji-blob-bin
pkgs.ubuntu-classic
pkgs.iosevka-normal-pt-mono
pkgs.IosevkaPTMono
];
home.file = {

View file

@ -54,7 +54,7 @@ config =
-- For framework 13
, dpi = 150
, font = "Iosevka-Normal-PT-Mono 8"
, font = "IosevkaPTMono 8"
, fgColor = "#FFFFFF"
, bgColor = "#000000"
, position = BottomH 24

View file

@ -351,9 +351,7 @@ keybinds =
-- Launcher
++ (let launchFirefox = "zen"
-- dmenu doesn't find the right font, but it falls back to the right one
-- https://bbs.archlinux.org/viewtopic.php?id=139829
launchDmenu = "dmenu_run -i -nb \"#36363a\" -nf \"#e2e2e4\" -sb \"#f7f7f8\" -sf \"#36363a\" -l 10"
launchDmenu = "dmenu_run -i -fn \"IosevkaPTMono-18\" -nb \"#36363a\" -nf \"#e2e2e4\" -sb \"#f7f7f8\" -sf \"#36363a\" -l 10"
lock = "xscreensaver-command -lock"
in [ ((controlMask .|. altMask, xK_m), namedScratchpadAction myScratchpads "cmus" )
, ((controlMask .|. altMask, xK_t), namedScratchpadAction myScratchpads "btop" )

View file

@ -10,7 +10,7 @@ in
{
config = lib.mkIf cfg.enable {
home.packages = [
pkgs.nerd-fonts.iosevka-term-pt-mono
pkgs.nerd-fonts.IosevkaTermPTMono
];
programs.ghostty.settings = {

View file

@ -1,6 +1,6 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.iosevka-normal-pt-mono ];
home.packages = [ pkgs.IosevkaPTMono ];
services.wired = {
config = "${./wired.ron}";
};

View file

@ -122,7 +122,7 @@
offset: Vec2(x: 0.0, y: 0.0),
params: ScrollingTextBlock((
text: "%s",
font: "Iosevka-Normal-PT-Mono 24",
font: "IosevkaPTMono 24",
color: Color(hex: "#fafafa"),
padding: Padding(left: 7.0, right: 7.0, top: 1.0, bottom: 0.0),
width: (min: 400, max: 400),
@ -140,7 +140,7 @@
offset: Vec2(x: 0.0, y: -3.0),
params: ScrollingTextBlock((
text: "%b",
font: "Iosevka-Normal-PT-Mono 18",
font: "IosevkaPTMono 18",
color: Color(hex: "#fafafa"),
padding: Padding(left: 7.0, right: 7.0, top: 3.0, bottom: 7.0),
width: (min: 400, max: 400),

View file

@ -38,7 +38,7 @@ let
]
)
[
(import ./spacings.nix { inherit lib; })
(import ./spacings.nix)
([ identityOverlay ] ++ import ./variants.nix)
];
@ -46,9 +46,8 @@ let
overlay:
let
mergedConfig = lib.fix (lib.extends overlay iosevkaConfig);
toKebabCase = x: builtins.replaceStrings [ " " ] [ "-" ] (lib.toLower x);
in
lib.nameValuePair (toKebabCase mergedConfig.family) (mkIosevka mergedConfig)
lib.nameValuePair mergedConfig.family (mkIosevka mergedConfig)
);
iosevka-nerds = builtins.mapAttrs (_: mkNerdFont) iosevkas;

View file

@ -26,10 +26,12 @@
};
weights = {
# Build 580, but indicate 400 in output
Regular.shape = 580;
Regular.shape = 400;
Regular.menu = 400;
Regular.css = 400;
Medium.shape = 500;
Medium.menu = 500;
Medium.css = 500;
Bold.shape = 700;
Bold.menu = 700;
Bold.css = 700;
@ -39,9 +41,6 @@
Normal.shape = 500;
Normal.menu = 5;
Normal.css = "normal";
Extended.shape = 600;
Extended.menu = 7;
Extended.css = "expanded";
};
slopes = {

View file

@ -1,24 +1,24 @@
{ lib }:
let
list = [
{ spacing = "normal"; }
{
adjustFamily = old: old;
spacing = "normal";
}
# Iosevka + Ghostty makes "…" display in a odd way.
# We use "term" width to avoid this.
# https://github.com/ghostty-org/ghostty/discussions/10335
{ spacing = "term"; }
{
adjustFamily = old: old + "Term";
spacing = "term";
}
];
in
map (
{ spacing }@cfg:
let
name = lib.toSentenceCase spacing;
in
final: prev:
cfg
// {
family = prev.family + "-${name}";
{ adjustFamily, spacing }:
final: prev: {
family = adjustFamily prev.family;
inherit spacing;
}
) list

View file

@ -82,10 +82,10 @@ in
map (
{ name, code }:
let
kebabName = builtins.replaceStrings [ " " ] [ "-" ] name;
shortName = builtins.replaceStrings [ " " ] [ "" ] name;
in
final: prev: {
family = prev.family + "-${kebabName}";
family = prev.family + "${shortName}";
variants = prev.variants // {
inherits = code;
};