From a0a3fab4c9578027ae9af4aa2eec0b3a363df20c Mon Sep 17 00:00:00 2001 From: Claudine Peyrat <88194877+claudinepeyrat06@users.noreply.github.com> Date: Wed, 25 Jun 2025 10:30:24 +0200 Subject: switch from NFKC to NFC normalization form in the lettering tool (#3828) * switch from NFKC to NFC * Additional normalization. --------- Co-authored-by: CapellanCitizen <> --- lib/gui/lettering/main_panel.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/gui') diff --git a/lib/gui/lettering/main_panel.py b/lib/gui/lettering/main_panel.py index 64312b5a..f0532560 100644 --- a/lib/gui/lettering/main_panel.py +++ b/lib/gui/lettering/main_panel.py @@ -5,6 +5,7 @@ import json from base64 import b64decode +import unicodedata import inkex import wx @@ -126,11 +127,11 @@ class LetteringPanel(wx.Panel): filter_glyph = self.options_panel.font_glyph_filter.GetValue() filter_category = self.options_panel.font_category_filter.GetSelection() - 1 - # glyph filter string without spaces - glyphs = [*self.options_panel.text_editor.GetValue().replace(" ", "").replace("\n", "")] + # Set of all glyphs in input string (except whitespace characters), normalized in the same way that we normalize font glyphs + glyphs = set(*unicodedata.normalize("NFC", self.options_panel.text_editor.GetValue().replace(r"\s", ""))) for font in self.font_list: - if filter_glyph and glyphs and not set(glyphs).issubset(font.available_glyphs): + if filter_glyph and glyphs and not glyphs.issubset(font.available_glyphs): continue if filter_category != -1: -- cgit v1.2.3