Skip to content

Commit

Permalink
Replaced youseedee with unicodedataplus
Browse files Browse the repository at this point in the history
  • Loading branch information
yanone committed May 15, 2024
1 parent f2b026e commit af1532b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
11 changes: 4 additions & 7 deletions Lib/fontbakery/checks/shared_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,14 @@ def has_feature(font, featureTag):
return False


def characters_per_script(ttFont, script, category=None):
def characters_per_script(ttFont, target_script, target_category=None):
"""Return the number of characters in a font for a given script"""
from youseedee import ucd_data
from unicodedataplus import script, category

characters = []
for codepoint in ttFont.getBestCmap().keys():
data = ucd_data(codepoint)
if (
"Script" in data
and data["Script"] == script
and (not category or data["General_Category"] == category)
if script(chr(codepoint)) == target_script and (
not target_category or category(chr(codepoint)) == target_category
):
characters.append(codepoint)

Expand Down
2 changes: 0 additions & 2 deletions Lib/fontbakery/checks/universal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2739,7 +2739,6 @@ def com_google_fonts_check_alt_caron(ttFont):

@check(
id="com.google.fonts/check/case_mapping",
conditions=["network"],
rationale="""
Ensure that no glyph lacks its corresponding upper or lower counterpart
(but only when unicode supports case-mapping).
Expand Down Expand Up @@ -2821,7 +2820,6 @@ def com_google_fonts_check_case_mapping(ttFont):

@check(
id="com.google.fonts/check/missing_small_caps_glyphs",
conditions=["network"],
rationale="""
Ensure small caps glyphs are available if
a font declares smcp or c2sc OT features.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies = [
"uharfbuzz",
"vharfbuzz >= 0.2.0",
"typing_extensions ; python_version < '3.11'",
"youseedee",
"unicodedataplus",
]

[project.optional-dependencies]
Expand Down

0 comments on commit af1532b

Please sign in to comment.