Mlterm uses FC_PIXEL_SIZE for fontconfig font size in cairo and Xft type engines. This means the fontsize config value is interpreted as absolute pixels, ignoring the system DPI setting (Xft.dpi).
Other terminal emulators (gnome-terminal, wezterm, alacritty) use FC_SIZE (point size), which makes fonts scale correctly with the display DPI. This causes mlterm's font to appear at a different physical size than other terminals when Xft.dpi is set to a non-default value.
For example, on a system with Xft.dpi: 307:
- gnome-terminal with "DejaVu Sans Mono 10" (10pt) renders at ~43px:
10 * 307 / 72
- mlterm with
fontsize=10 renders at 10px (tiny)
- mlterm with
fontsize=43 renders at 43px but column widths may be wrong
The fix is to change fc_size_type from FC_PIXEL_SIZE to FC_SIZE in uitoolkit/libtype/ui_font_ft.c. See the get_fc_col_width() function which already handles both modes correctly with DPI-based calculations for FC_SIZE.
Proposed change:
-static const char *fc_size_type = FC_PIXEL_SIZE;
+static const char *fc_size_type = FC_SIZE;
Mlterm uses
FC_PIXEL_SIZEfor fontconfig font size in cairo and Xft type engines. This means thefontsizeconfig value is interpreted as absolute pixels, ignoring the system DPI setting (Xft.dpi).Other terminal emulators (gnome-terminal, wezterm, alacritty) use
FC_SIZE(point size), which makes fonts scale correctly with the display DPI. This causes mlterm's font to appear at a different physical size than other terminals whenXft.dpiis set to a non-default value.For example, on a system with
Xft.dpi: 307:10 * 307 / 72fontsize=10renders at 10px (tiny)fontsize=43renders at 43px but column widths may be wrongThe fix is to change
fc_size_typefromFC_PIXEL_SIZEtoFC_SIZEinuitoolkit/libtype/ui_font_ft.c. See theget_fc_col_width()function which already handles both modes correctly with DPI-based calculations forFC_SIZE.Proposed change: