alacritty: OpenType Bitmap fonts crashes alacritty
The latest versions of pango dropped support for X11 bitmap fonts (pcf / psf stuff). Thus, existing bitmap fonts are being converted to OTB, which is still supported. However, setting up alacritty for an OTB font produces the following error message:
Alacritty encountered an unrecoverable error:
Invalid size handle
System
OS: NixOS (Linux) Version: 0.4.0 X11 i3
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 52 (39 by maintainers)
Commits related to this issue
- Make fontconfig fallback to use fallback lists computed from font_sort Fixes #3134. Fixes #2657. Fixes #1560. Fixes #965. Fixes Linux/BSD parts of #511. — committed to kchibisov/alacritty by kchibisov 4 years ago
- Make fontconfig fallback to use fallback lists computed from font_sort Fixes #3134. Fixes #2657. Fixes #1560. Fixes #965. Fixes Linux/BSD parts of #511. — committed to kchibisov/alacritty by kchibisov 4 years ago
- Rework Fontconfig fallback to use cached list from font_sort Previous implementation was querying Fontconfig using `charset` in a pattern, which was leading to unpredictable fallbacks in some cases,... — committed to roychoo/alacritty by kchibisov 4 years ago
- Rework Fontconfig fallback to use cached list from font_sort Previous implementation was querying Fontconfig using `charset` in a pattern, which was leading to unpredictable fallbacks in some cases,... — committed to boxofrox/alacritty by kchibisov 4 years ago
@dnkl Hmm, it’ll probably make sense, I’ll try to take a look on it, once I finish my other things in our font crate…
Annnd here is the result, thanks for the patch!
Nah, let’s try to see if we fail somewhere silently. @multun just try this patch, forget about previous one.
patch.txt
As long as
face.non_scalable
isSome(_)
, yeah.If we would fail here, we’d immediately leave the
font
crate though. And we’re getting an error from a system font library, not unwrapping a RustResult<_, _>
.I think this is related to the font size selected. In the test program provided by @multun (where we all get error 0x24), I get error 0x17 from the
FT_Set_Char_Size()
call.I can make it work by selecting a different size, known to exist in the font, by replacing the call to
FT_Set_Char_Size()
with a call toFT_Set_Pixel_Sizes()
, which takes an explicit pixel size instead of a point size.In short, I believe when selecting size in a freetype face object that is backed by a bitmap-only font file, one must select a (pixel)size that exists in the font.
I’m fairly sure
FT_Set_Char_Size()
is supposed to work too, assuming you give it a point size + DPI value that translates to a pixel size that actually exists in the font file.FWIW I also can’t repro the issue with freetype 2.10.1.
@multun it’s
2.9.1
. As you can see the error is from freetype, so I don’t think alacritty can do something about it?P.s. I can try recent freetype tbh, let me see whether I can repro with it.
I mean we still need a proper backtrace from alacritty, could you post
bt full
fromgdb
?I just tried with another font, and I think all OTB fonts fail something super strange also happens when there’s a font available in both pcf and otb format. alacritty then opens, but display no characters (only the cursor)