alacritty: Incorrect cell size with FreeType fonts containing SVG glyphs
I’m running a mixed-DPI system on Wayland, and since a recent system upgrade have noticed that Alacritty’s cell size and scaling is incorrect, leading to rendering issues.
I note the cell size has a row height of 1 even after scaling calculation. I also not an erroneous scale factor of 2.0 even though the display has a custom scale of 1.6 set.
System
OS: Linux 5.18-rc5, Sway/Wayland (git head) Version: Version 0.11.0-dev (ad3ebba5)
Logs
alacritty -vv
[0.000000513s] [INFO ] [alacritty] Welcome to Alacritty
[0.000020223s] [INFO ] [alacritty] Version 0.11.0-dev (ad3ebba5)
[0.000030320s] [INFO ] [alacritty] Running on Wayland
[0.000350593s] [INFO ] [alacritty] Configuration files loaded from:
"/home/ryan/.config/alacritty/alacritty.yml"
[0.000450505s] [DEBUG] [alacritty] Loading "Source Code Pro" font
[0.003180789s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.003799465s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.004404253s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.005029226s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.005298649s] [DEBUG] [alacritty] Estimated scaling factor: 1
[0.005303348s] [DEBUG] [alacritty] Estimated window size: None
[0.005305826s] [DEBUG] [alacritty] Estimated cell size: 9 x 1
[0.023991131s] [INFO ] [alacritty] Running on AMD Radeon VII (vega20, LLVM 14.0.0, DRM 3.46, 5.18.0-rc5-crackotage+)
[0.024007439s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.026859802s] [INFO ] [alacritty] Display scale factor: 1
[0.026870120s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.032727780s] [INFO ] [alacritty] Cell size: 9 x 1
[0.032743722s] [INFO ] [alacritty] Padding: 0 x 0
[0.032746229s] [INFO ] [alacritty] Width: 800, Height: 600
[0.033171900s] [INFO ] [alacritty] PTY dimensions: 600 x 88
[0.037461805s] [INFO ] [alacritty] Initialisation complete
[0.045797019s] [DEBUG] [alacritty_terminal] New num_cols is 141 and num_lines is 1313
[0.049704101s] [INFO ] [alacritty] Padding: 0 x 0
[0.049720087s] [INFO ] [alacritty] Width: 1272, Height: 1313
[0.060586549s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.061197837s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.061779894s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.062400138s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold Italic, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[0.062679153s] [INFO ] [alacritty] Font size changed to Size(21) with scale factor of 2
[0.065081724s] [INFO ] [alacritty] Cell size: 9 x 1
[0.065093098s] [DEBUG] [alacritty_terminal] New num_cols is 282 and num_lines is 2626
[0.074493851s] [INFO ] [alacritty] Padding: 0 x 0
[0.074508658s] [INFO ] [alacritty] Width: 2544, Height: 2626
swaymsg -t get_outputs
Output DP-1 'Dell Inc. DELL P2415Q D3C8X4C50E8L'
Current mode: 3840x2160 @ 59.997 Hz
Position: 0,270
Scale factor: 2.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 1
Max render time: 3 ms
Adaptive sync: disabled
Available modes:
3840x2160 @ 59.997 Hz
2560x1440 @ 59.951 Hz
1920x1200 @ 59.885 Hz
1920x1080 @ 60.000 Hz
1920x1080 @ 60.000 Hz
1920x1080 @ 59.940 Hz
1920x1080 @ 50.000 Hz
1920x1080 @ 30.000 Hz
1920x1080 @ 29.970 Hz
1920x1080 @ 25.000 Hz
1920x1080 @ 24.000 Hz
1920x1080 @ 23.976 Hz
1600x1200 @ 60.000 Hz
1680x1050 @ 59.997 Hz
1600x900 @ 60.000 Hz
1280x1024 @ 75.025 Hz
1280x1024 @ 60.020 Hz
1440x900 @ 59.997 Hz
1280x800 @ 59.997 Hz
1152x864 @ 75.000 Hz
1280x720 @ 60.000 Hz
1280x720 @ 59.940 Hz
1280x720 @ 50.000 Hz
1024x768 @ 75.029 Hz
1024x768 @ 60.004 Hz
800x600 @ 75.000 Hz
800x600 @ 60.317 Hz
720x576 @ 50.000 Hz
720x480 @ 60.000 Hz
720x480 @ 60.000 Hz
720x480 @ 59.940 Hz
720x480 @ 59.940 Hz
640x480 @ 75.000 Hz
640x480 @ 60.000 Hz
640x480 @ 59.940 Hz
640x480 @ 59.940 Hz
720x400 @ 70.082 Hz
Output DP-2 'Eizo Nanao Corporation MX315W 0x00009D25' (focused)
Current mode: 4096x2160 @ 59.983 Hz
Position: 1920,0
Scale factor: 1.600000
Scale filter: linear
Subpixel hinting: unknown
Transform: normal
Workspace: 3
Max render time: 3 ms
Adaptive sync: disabled
Available modes:
4096x2160 @ 59.983 Hz
3840x2160 @ 59.997 Hz
1920x1200 @ 59.983 Hz
1920x1080 @ 59.983 Hz
1600x1200 @ 60.000 Hz
1680x1050 @ 59.983 Hz
1280x1024 @ 60.020 Hz
1440x900 @ 59.983 Hz
1280x800 @ 59.983 Hz
1280x720 @ 59.983 Hz
1024x768 @ 60.004 Hz
800x600 @ 60.317 Hz
640x480 @ 59.940 Hz
720x400 @ 70.082 Hz
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 29 (10 by maintainers)
Hi, could you change the title to “Incorrect cell size with Source Code Pro font after update” or something similar? I was just about to file another issue, but only after digging into logs and this thread I realized it would be a duplicate. Thanks
Debian does not have Source Code Pro available from package repositories so I have installed it manually from fonts.google.com. Updated my two year old copy and current version works with alacritty. But Fira Code looked quite nice so I’ll stick with it for easier maintenance.