Skip to content

Commit

Permalink
Add various other check rationales
Browse files Browse the repository at this point in the history
com.google.fonts/check/maxadvancewidth
com.google.fonts/check/loca/maxp_num_glyphs
com.google.fonts/check/name/no_copyright_on_description
com.adobe.fonts/check/postscript_name
com.google.fonts/check/family_naming_recommendations
On the Open Type Profile.

(PR #4570)
  • Loading branch information
simoncozens authored and felipesanches committed Mar 5, 2024
1 parent db522f6 commit 3462660
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ A more detailed list of changes is available in the corresponding milestones for
- **[com.google.fonts/check/glyf_unused_data]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/points_out_of_bounds]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/gpos_kerning_info]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/maxadvancewidth]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/loca/maxp_num_glyphs]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/name/no_copyright_on_description]:** Added rationale. (PR #4570)
- **[com.adobe.fonts/check/postscript_name]:** Added rationale. (PR #4570)
- **[com.google.fonts/check/family_naming_recommendations]:** Added rationale. (PR #4570)


## 0.12.0a2 (2024-Feb-21)
Expand Down
10 changes: 9 additions & 1 deletion Lib/fontbakery/checks/opentype/hhea.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
from fontbakery.message import Message


@check(id="com.google.fonts/check/maxadvancewidth", proposal="legacy:check/073")
@check(
id="com.google.fonts/check/maxadvancewidth",
proposal="legacy:check/073",
rationale="""
The 'hhea' table contains a field which specifies the maximum
advance width. This value should be consistent with the maximum
advance width of all glyphs specified in the 'hmtx' table.
""",
)
def com_google_fonts_check_maxadvancewidth(ttFont):
"""MaxAdvanceWidth is consistent with values in the Hmtx and Hhea tables?"""

Expand Down
7 changes: 7 additions & 0 deletions Lib/fontbakery/checks/opentype/loca.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
id="com.google.fonts/check/loca/maxp_num_glyphs",
conditions=["is_ttf"],
proposal="legacy:check/180",
rationale="""
The 'maxp' table contains various statistics about the font, including the
number of glyphs in the font. The 'loca' table contains the offsets to the
locations of the glyphs in the font. The number of offsets in the 'loca' table
should match the number of glyphs in the 'maxp' table. A failure here indicates
a problem with the font compiler.
""",
)
def com_google_fonts_check_loca_maxp_num_glyphs(ttFont):
"""Does the number of glyphs in the loca table match the maxp table?"""
Expand Down
16 changes: 16 additions & 0 deletions Lib/fontbakery/checks/opentype/name.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def com_adobe_fonts_check_name_empty_records(ttFont):
@check(
id="com.google.fonts/check/name/no_copyright_on_description",
proposal="legacy:check/031",
rationale="""
The name table in a font file contains strings about the font;
there are entries for a copyright field and a description. If the
copyright entry is being used correctly, then there should not
be any copyright information in the description entry.
""",
)
def com_google_fonts_check_name_no_copyright_on_description(ttFont):
"""Description strings in the name table must not contain copyright info."""
Expand Down Expand Up @@ -417,6 +423,11 @@ def com_google_fonts_check_name_match_familyname_fullfont(ttFont):
@check(
id="com.adobe.fonts/check/postscript_name",
proposal="https://github.com/miguelsousa/openbakery/issues/62",
rationale="""
The PostScript name is used by some applications to identify the font.
It should only consist of characters from the set A-Z, a-z, 0-9, and hyphen.
""",
)
def com_adobe_fonts_check_postscript_name(ttFont):
"""PostScript name follows OpenType specification requirements?"""
Expand Down Expand Up @@ -453,6 +464,11 @@ def com_adobe_fonts_check_postscript_name(ttFont):
@check(
id="com.google.fonts/check/family_naming_recommendations",
proposal="legacy:check/071",
rationale="""
This check ensures that the length of various family name and style
name strings in the name table are within the maximum length
recommended by the OpenType specification.
""",
)
def com_google_fonts_check_family_naming_recommendations(ttFont):
"""Font follows the family naming recommendations?"""
Expand Down

0 comments on commit 3462660

Please sign in to comment.