]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
Revert "Add our own parse function for exemplars"
authorSimon Cozens <simon@simon-cozens.org>
Wed, 1 May 2024 13:38:26 +0000 (14:38 +0100)
committerSimon Cozens <simon@simon-cozens.org>
Wed, 1 May 2024 13:38:26 +0000 (14:38 +0100)
This reverts commit b57fdba5341a7f65e284583412d463baf56ff3ca.

Lib/gflanguages/__init__.py

index c7b0bc61817a8b2466504419f6394cdb31257e55..2957742e93f3858dee6cdea1074b3e722116b31c 100644 (file)
@@ -21,7 +21,6 @@ data on the Google Fonts collection.
 """
 import glob
 import os
-import unicodedata
 
 from gflanguages import languages_public_pb2
 from google.protobuf import text_format
@@ -72,18 +71,3 @@ def LoadRegions(base_dir=DATA_DIR):
             region = text_format.Parse(f.read(), languages_public_pb2.RegionProto())
             regions[region.id] = region
     return regions
-
-
-def parse(exemplars: str):
-    """Parses a list of exemplar characters into a set of codepoints."""
-    codepoints = set()
-    for chars in exemplars.split():
-        if len(chars) > 1:
-            chars = chars.lstrip("{").rstrip("}")
-        normalized_chars = unicodedata.normalize("NFC", chars)
-        if normalized_chars != chars:
-            for char in normalized_chars:
-                codepoints.add(char)
-        for char in chars:
-            codepoints.add(char)
-    return codepoints