From a3ec4bb22b4beec274f4eedfd800b57f70211f99 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Wed, 10 May 2023 11:09:16 +0200 Subject: [PATCH] font-patcher: Fix vanishing fi ligature [why] With Ubuntu-Regular the fi and fl ligatures are replaced by some font awesome icons. The problem is that the font uses the non-standard F001 and F002 codepoints as intermediate referencve to create the actual ligatures that are at codepoints FB01 to FB04. [how] All the normal ligature codepoints (FB00-FB06) are added to the glyph reference checker and codepoints that are referenced by these are not patched. This means that F001 and F002 stay on the original ligatures and the Font Awesome icons are missing, but this can not be fixed automatically and would need to 'rewrite' the references inside the font. Fixes: #1221 Signed-off-by: Fini Jastrow --- font-patcher | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/font-patcher b/font-patcher index 6eb4207d2..c6e1b50cf 100755 --- a/font-patcher +++ b/font-patcher @@ -1086,10 +1086,11 @@ class font_patcher: # Sometimes basic glyphs are constructed from multiple other glyphs. # Find out which other glyphs are also needed to keep the basic # glyphs intact. - # 0x00-0x17f is the Latin Extended-A range + # 0x0000-0x017f is the Latin Extended-A range + # 0xfb00-0xfb06 are 'fi' and other ligatures basic_glyphs = set() # Collect substitution destinations - for glyph in range(0x21, 0x17f + 1): + for glyph in [*range(0x21, 0x17f + 1), *range(0xfb00, 0xfb06 + 1)]: if not glyph in self.sourceFont: continue basic_glyphs.add(glyph)