Issue: Font-fallback can hang, when the fallback font does not have a glyph for a character.
Defect: We assume that, if we get a fallback-font from Skia for a particular character, that it will be able to provide a glyph for that character. If it doesn't - we end up spinning in an infinite loop. It looks like there are cases where we can ask for a fallback font for a character, and get a font, but the font won't actually provide the character.
Fix:
Add an abstraction for the strategy of falling back - none, constant, skia - this can help us test this scenario in a consistent way cross-platform (without this abstraction, we always use the skia matchCharacterFamilyStyle API, which will give results on different platforms).
Add test case to exercise this - it's straightforward by using the Strategy.constant(someFont) where someFont doesn't have a particular character defined.
Add a more involved test case - to verify shaping results specifically, to ensure no regression.
Add a 'circuit-breaker` - if we try to fallback again after a fallback font, stop - we should just end up with an invalid glyph ID.
TODO:
[x] Add license for font files
[ ] Can we replace attempts with a bool? Might need a better test case to ensure no regressions
[x] Should we not bother falling-back for ASCII characters?
Issue: Font-fallback can hang, when the fallback font does not have a glyph for a character.
Defect: We assume that, if we get a fallback-font from Skia for a particular character, that it will be able to provide a glyph for that character. If it doesn't - we end up spinning in an infinite loop. It looks like there are cases where we can ask for a fallback font for a character, and get a font, but the font won't actually provide the character.
Fix:
none
,constant
,skia
- this can help us test this scenario in a consistent way cross-platform (without this abstraction, we always use the skia matchCharacterFamilyStyle API, which will give results on different platforms).Strategy.constant(someFont)
wheresomeFont
doesn't have a particular character defined.TODO:
attempts
with abool
? Might need a better test case to ensure no regressionsFix for https://github.com/onivim/oni2/issues/2286