summaryrefslogtreecommitdiff
path: root/lib/gui
diff options
context:
space:
mode:
authorClaudine Peyrat <88194877+claudinepeyrat06@users.noreply.github.com>2025-06-25 10:30:24 +0200
committerGitHub <noreply@github.com>2025-06-25 10:30:24 +0200
commita0a3fab4c9578027ae9af4aa2eec0b3a363df20c (patch)
tree4985e5ddd1a2bec476df65b97e613f435f4b998b /lib/gui
parent2134897db8f0893c8e9a64286eeb76c770790639 (diff)
switch from NFKC to NFC normalization form in the lettering tool (#3828)
* switch from NFKC to NFC * Additional normalization. --------- Co-authored-by: CapellanCitizen <>
Diffstat (limited to 'lib/gui')
-rw-r--r--lib/gui/lettering/main_panel.py7
1 files changed, 4 insertions, 3 deletions
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: