Defect: We use a counter to break cycles in the font-fallback resolution strategy (attempts), so that we don't get in an infinite loop when we shape, fallback to a font, and then try shaping again.
However, in this case, we had a hole spanning multiple unicode characters - the heart (2764) would resolve correctly, but then the modifiers would not discover a fallback font. In this case, we were resetting the attempts counter, and would fail to completely resolve the hole, causing us to spin.
The rendering still isn't completely correct for this, as we use unresolved glyphs for the modifiers. We should be smart enough to recognize grapheme clusters and that these modifiers should not be drawn as unresolved glyphs. This fix, though, does prevent us from hanging in this case.
Fix: Don't reset attempts in this case. Add test case covering this sort of emoji.
Issue: While working on https://github.com/onivim/oni2/pull/2563, I observed a hang in the editor some emojis, like the 'heart on fire' emoji:
From these cases: https://unicode.org/Public/emoji/13.1/emoji-test.txt
Defect: We use a counter to break cycles in the font-fallback resolution strategy (
attempts
), so that we don't get in an infinite loop when we shape, fallback to a font, and then try shaping again.However, in this case, we had a hole spanning multiple unicode characters - the heart (
2764
) would resolve correctly, but then the modifiers would not discover a fallback font. In this case, we were resetting theattempts
counter, and would fail to completely resolve the hole, causing us to spin.The rendering still isn't completely correct for this, as we use unresolved glyphs for the modifiers. We should be smart enough to recognize grapheme clusters and that these modifiers should not be drawn as unresolved glyphs. This fix, though, does prevent us from hanging in this case.
Fix: Don't reset
attempts
in this case. Add test case covering this sort of emoji.