Skip to content

Commit

Permalink
Add underscore to the set of characters allowed in PostScript name st…
Browse files Browse the repository at this point in the history
…rings (#90)
  • Loading branch information
miguelsousa authored Dec 1, 2023
2 parents 483fc6f + ceb24c8 commit 2352996
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `com.google.fonts/check/family_naming_recommendations`: Two validations of PostScript name were moved out of this check and into separate new checks `com.adobe.fonts/check/postscript_name_characters` and `com.adobe.fonts/postscript_name_hyphens` which yield FAIL (https://github.com/miguelsousa/openbakery/pull/62).
- `com.google.fonts/check/cjk_not_enough_glyphs`: This check is now only run when a font has CJK codepages or ranges declared in the `OS/2` table. Other CJK-related checks are run on fonts with a minimum of 150 CJK glyphs (https://github.com/fonttools/fontbakery/issues/3846).
- `com.google.fonts/check/family/panose_familytype` and `com.google.fonts/check/family/panose_proportion`: Failures have been downgraded to warnings (https://github.com/fonttools/fontbakery/issues/4192).
- `com.adobe.fonts/check/postscript_name_characters`: Added underscore (`_` U+005F) to the set of characters allowed in PostScript name strings (https://github.com/miguelsousa/openbakery/pull/90).

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions Lib/openbakery/profiles/name.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@ def com_google_fonts_check_name_match_familyname_fullfont(ttFont):
proposal="https://github.com/miguelsousa/openbakery/issues/62",
)
def com_adobe_fonts_check_postscript_name_characters(ttFont):
"""PostScript name contains only allowed characters a-ZA-Z and hyphen?"""
"""PostScript name contains only allowed characters?"""
import re
from openbakery.utils import get_name_entry_strings

bad_entry_count = 0

# <Postscript name> may contain only a-zA-Z0-9
bad_psname = re.compile("[^A-Za-z0-9-]")
# <Postscript name> may contain only the characters a-z A-Z 0-9 - and _
bad_psname = re.compile("[^A-Za-z0-9-_]")
for string in get_name_entry_strings(ttFont, NameID.POSTSCRIPT_NAME):
if bad_psname.search(string):
bad_entry_count += 1
Expand Down

0 comments on commit 2352996

Please sign in to comment.