fix broken forced case (#3509)

pull/3513/head
Claudine Peyrat 2025-02-14 20:23:08 +01:00 zatwierdzone przez GitHub
rodzic 2e4830ea3a
commit a0433db1f3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -363,16 +363,16 @@ class Font(object):
skip = []
previous_is_binding = True
# forced letter case
if self.letter_case == "upper":
word = word.upper()
elif self.letter_case == "lower":
word = word.lower()
for i, character in enumerate(word):
if i in skip:
continue
# forced letter case
if self.letter_case == "upper":
character = character.upper()
elif self.letter_case == "lower":
character = character.lower()
glyph, glyph_len, binding = glyph_set.get_next_glyph(word, i, previous_is_binding)
previous_is_binding = binding

Wyświetl plik

@ -143,7 +143,7 @@ class FontVariant(object):
# after a non binding letter a letter can only be in isol or fina shape.
# binding glyph only have two shapes, isol and fina
non_binding_char = ['ا', 'أ', '', 'آ', 'ٱ', 'د', 'ذ', 'ر', 'ز', 'و','ؤ']
non_binding_char = ['ا', 'أ', '', 'آ', 'ٱ', 'د', 'ذ', 'ر', 'ز', 'و', 'ؤ']
normalized_non_binding_char = [normalize('NFKC', letter) for letter in non_binding_char]
return not (character in normalized_non_binding_char)