contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.3k stars 100 forks source link

Fix font rendering for long glyphs #1501

Closed Yaraslaut closed 2 months ago

Yaraslaut commented 2 months ago

Closes https://github.com/contour-terminal/contour/issues/1349

Bug is happening due to bad offset of the glyph that is positioned after the glyph with non-standard advance

for MonaspiceKrNerdFont

====================================
tryShape: font=0, codepoints="===a"
gpos: (10113+0+0|32+0)
gpos: (66+0+0|10+0)
====================================
tryShape: font=0, codepoints="===a:"
gpos: (10113+0+0|32+0)
gpos: (66+0+0|10+0)
gpos: (27+0+0|10+0)

While for CascadiaCode

====================================
tryShape: font=0, codepoints="===a"
gpos: (2665+0+0|10+0)
gpos: (3125+0+0|10+0)
gpos: (3125+0+0|10+0)
gpos: (225+0+0|10+0)
====================================
tryShape: font=0, codepoints="===a:"
gpos: (2665+0+0|10+0)
gpos: (3125+0+0|10+0)
gpos: (3125+0+0|10+0)
gpos: (225+0+0|10+0)
gpos: (1864+0+0|10+0)

So while for CascadiaCode ligature is represented as separate codepoints, Monaspice merges them together with bigger advance