ghostty: scale font on darwin (#1988)

Link: https://github.com/nix-community/stylix/pull/1988

Reviewed-by: Ian Holloway <72767437+IanHollow@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Vidhan Bhatt 2025-11-20 12:12:54 -05:00 committed by GitHub
parent c27bc6e9f9
commit 83ff4d112b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
# Documentation is available at:
# - https://ghostty.org/docs/config/reference
# - `man 5 ghostty`
{ mkTarget, ... }:
{ mkTarget, pkgs, ... }:
mkTarget {
name = "ghostty";
humanName = "Ghostty";
@ -15,7 +15,16 @@ mkTarget {
fonts.monospace.name
fonts.emoji.name
];
font-size = fonts.sizes.terminal;
# Ghostty font-size is specified in points (pt) on all platforms.
# Ghostty's default DPI is 96 on Linux and 72 on macOS.
# fonts.sizes.terminal is in pt size so no changes on Linux are needed,
# but to match visual size on macOS we scale it by 4/3 = 96/72.
font-size =
if pkgs.stdenv.hostPlatform.isDarwin then
fonts.sizes.terminal * 4.0 / 3.0
else
fonts.sizes.terminal;
};
}
)