Skip to content

Commit 29ed4cf

Browse files
kitty: consider (half) pixel grid in font sizes
1 parent b1e7578 commit 29ed4cf

2 files changed

Lines changed: 49 additions & 14 deletions

File tree

kitty/calvin.conf

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,53 @@
1-
# Font size is specified in pt, or rather "pt". The issue is that GNOME sets Xft.dpi = 96, but the
2-
# true monitor DPI is 161.5. Therefore, to get 1 true pt, one most enter 1.682292 "pt".
1+
# Font sizes are specified in pt (1/72 in). Or rather in "pt", with quotes, since GNOME always sets
2+
# Xft.dpi = 96, regardless of the true monitor DPI.
3+
#
4+
# Calvin's 4K monitor true DPI is 161.5. Therefore, for 1 true pt one most enter 1.682292 "pt".
5+
#
6+
# 6 pt == 10.093752 "pt"
7+
# 7 pt == 11.776044 "pt"
8+
# 8 pt == 13.458336 "pt"
9+
# 9 pt == 15.140628 "pt"
10+
# 12 pt == 20.187504 "pt"
11+
#
12+
# At the same time, at a fixed 96 DPI, 1 px == 0.75 "pt" ≈ 0.44 pt.
13+
#
14+
# ~6 pt == 9.75 "pt" == 13 px ≈ 5.8 pt
15+
# 10.50 "pt" == 14 px ≈ 6.2 pt
16+
# 11.25 "pt" == 15 px ≈ 6.7 pt
17+
# ~7 pt == 12.00 "pt" == 16 px ≈ 7.1 pt
18+
# ~8 pt == 13.50 "pt" == 18 px ≈ 8.0 pt
19+
# ~9 pt == 15.00 "pt" == 20 px ≈ 8.9 pt
20+
# ~12 pt == 20.25 "pt" == 27 px ≈ 12.0 pt
21+
#
22+
# Note: kitty cell sizes appear to always fit a _half_ pixel grid. For reference: 0.375 "pt" ≈ 0.23
23+
# pt. This also means that it isn't necessary to manually fit the font size to the (half) pixel grid
24+
# exactly, but it's still useful to keep the following values in mind:
25+
#
26+
# 9.750 "pt" == 13.0 px ≈ 5.8 pt
27+
# ~6 pt == 10.125 "pt" == 13.5 px ≈ 6.0 pt
28+
# 10.500 "pt" == 14.0 px ≈ 6.2 pt
29+
# 10.875 "pt" == 14.5 px ≈ 6.5 pt
30+
# 11.250 "pt" == 15.0 px ≈ 6.7 pt
31+
# 11.625 "pt" == 15.5 px ≈ 6.9 pt
32+
# ~7 pt == 12.000 "pt" == 16.0 px ≈ 7.1 pt
333

434
font_family Fira Code
5-
font_size 10.093752
35+
font_size 10.125
636

737
# font_family ShureTechMono Nerd Font
8-
# font_size 11.776044
38+
# font_size 11.625
939

10-
# /// Example.
40+
# /// Example. ▀ ▄ █ · ×
1141
# fn test(x: &mut [i32; 4]) -> impl Iterator<Item=u8> {
1242
# let x = x.as_ptr();
1343
# todo!()
1444
# }
1545

16-
map kitty_mod+minus change_font_size current -1.682292
17-
map kitty_mod+equal change_font_size current +1.682292
18-
map kitty_mod+kp_subtract change_font_size current -5.046876
19-
map kitty_mod+kp_add change_font_size current +5.046876
46+
map kitty_mod+equal change_font_size current +1.50
47+
map kitty_mod+minus change_font_size current -1.50
48+
49+
map kitty_mod+kp_add change_font_size current +4.50
50+
map kitty_mod+kp_subtract change_font_size current -4.50
2051

2152
enabled_layouts fat:bias=55,tall:bias=75,tall:bias=68,tall:bias=50,vertical,horizontal,grid,stack
2253

kitty/hobbes.conf

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
# Font sizes are specified in pt (1/72 in). Or rather in "pt", with quotes, since GNOME always sets
2+
# Xft.dpi = 96, regardless of the true monitor DPI. See `kitty/calvin.conf` for more information.
3+
14
font_family Fira Code Medium
25
font_size 9.0
36

4-
# /// Example.
7+
# /// Example. ▀ ▄ █ · ×
58
# fn test(x: &mut [i32; 4]) -> impl Iterator<Item=u8> {
69
# let x = x.as_ptr();
710
# todo!()
811
# }
912

10-
map kitty_mod+minus change_font_size current -1.0
11-
map kitty_mod+equal change_font_size current +1.0
12-
map kitty_mod+kp_subtract change_font_size current -1.0
13-
map kitty_mod+kp_add change_font_size current +1.0
13+
map kitty_mod+equal change_font_size current +0.75
14+
map kitty_mod+minus change_font_size current -0.75
15+
16+
map kitty_mod+kp_add change_font_size current +0.75
17+
map kitty_mod+kp_subtract change_font_size current -0.75
1418

1519
enabled_layouts fat:bias=55,tall:bias=66,tall:bias=50,vertical,horizontal,grid,stack
1620

0 commit comments

Comments
 (0)