Skip to content

Commit

Permalink
[test_font] Add test_font_get_missing_glyphs_cmap_encoding_0
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Oct 8, 2023
1 parent ecdb59a commit 6648181
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Binary file added tests/fonts/font_cmap_encoding_0.ttf
Binary file not shown.
19 changes: 19 additions & 0 deletions tests/test_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ def test_font_without_axis_value():
assert fonts == expected_fonts


def test_font_get_missing_glyphs_cmap_encoding_0():

font_cmap_encoding_0 = os.path.join(dir_path, "fonts", "font_cmap_encoding_0.ttf")

font = Font.from_font_path(font_cmap_encoding_0)
assert len(font) == 1
font = font[0]

# Verify is the optional param is the right value
missing_glyphs = font.get_missing_glyphs("Έκθεση για Απασχόληση Dream Top Co. Οι επιλογές À a")
assert missing_glyphs == set("À")

missing_glyphs = font.get_missing_glyphs("Έκθεση για Απασχόληση Dream Top Co. Οι επιλογές À a", False)
assert missing_glyphs == set("À")

missing_glyphs = font.get_missing_glyphs("Έκθεση για Απασχόληση Dream Top Co. Οι επιλογές À a", True)
assert missing_glyphs == set("ΈκθεσηγιαπασχόλησηΟιεπιλογέςÀΑ")


def test_font_get_missing_glyphs_cmap_encoding_1():

font_cmap_encoding_1 = os.path.join(dir_path, "fonts", "font_cmap_encoding_1.TTF")
Expand Down

0 comments on commit 6648181

Please sign in to comment.