Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ A more detailed list of changes is available in the corresponding milestones for
#### Moved from Universal to OpenType profile
- **[opentype/unwanted_aat_tables]:** AAT is as legitimate as OpenType and Apple ships and actively develop AAT fonts. Such check belongs to the OpenType profile instead of the Universal profile. (issue #4991)

### New checks
#### Added to the OpenType profile
- **[opentype/dsig]:** Reintroduce this check that had been recently deprecated. It is considered by users to be easier to disable this dedicated check, instead of having the DSIG table checking happen inside of the broader 'unwanted_tables' check. (issue #4990)

### Changes to existing checks
### On the OpenType profile
- **[opentype/unwanted_aat_tables]:** EBSC is not an AAT table. (issue #4992)
Expand Down
38 changes: 38 additions & 0 deletions Lib/fontbakery/checks/opentype/dsig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from fontbakery.callable import check
from fontbakery.status import WARN
from fontbakery.message import Message


@check(
id="opentype/dsig",
rationale="""
Microsoft Office 2013 and below products expect fonts to have a digital
signature declared in a DSIG table in order to implement OpenType features.
The EOL date for Microsoft Office 2013 products was 4/11/2023.

This issue does not impact Microsoft Office 2016 and above products. It is now considered better to completely remove the table.

But if you still want your font to support OpenType features on Office 2013,
then you may find it handy to add a fake signature on a placeholder DSIG table
by running one of the helper scripts provided at
https://github.com/googlefonts/gftools

Reference: https://github.com/fonttools/fontbakery/issues/1845
""",
proposal=[
"https://github.com/fonttools/fontbakery/issues/3398",
"https://github.com/fonttools/fontbakery/issues/4829", # legacy check
],
)
def check_dsig(ttFont):
"""The font should not need a DSIG table anymore."""
if "DSIG" in ttFont:
yield WARN, Message(
"found-DSIG",
"This font has a digital signature (DSIG table) which"
" is only required - even if only a placeholder"
" - on old programs like MS Office 2013 in order to"
" work properly.\n"
"The current recommendation is to completely"
" remove the DSIG table.",
)
6 changes: 0 additions & 6 deletions Lib/fontbakery/checks/unwanted_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
def check_unwanted_tables(ttFont):
"""Are there unwanted tables?"""
UNWANTED_TABLES = {
"DSIG": (
"This font has a digital signature (DSIG table) which is only required"
" - even if only a placeholder - on old programs like MS Office 2013"
" in order to work properly.\n"
"The current recommendation is to completely remove the DSIG table."
),
"FFTM": "Table contains redundant FontForge timestamp info",
"TTFA": "Redundant TTFAutohint table",
"TSI0": "Table contains data only used in VTT",
Expand Down
1 change: 1 addition & 0 deletions Lib/fontbakery/profiles/adobefonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"notofonts/unicode_range_bits", # so maybe there's still some change they may be considered useful here?
#
"opentype/caret_slope",
"opentype/dsig",
"opentype/fsselection",
"opentype/fvar/axis_ranges_correct",
"opentype/gdef_mark_chars",
Expand Down
1 change: 1 addition & 0 deletions Lib/fontbakery/profiles/opentype.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"opentype/cff_call_depth",
"opentype/cff_deprecated_operators",
"opentype/code_pages",
"opentype/dsig",
"opentype/family/bold_italic_unique_for_nameid1",
"opentype/family/consistent_family_name",
"opentype/family/equal_font_versions",
Expand Down
24 changes: 24 additions & 0 deletions tests/test_checks_opentype_dsig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from fontTools.ttLib import TTFont

from fontbakery.codetesting import (
assert_PASS,
assert_results_contain,
CheckTester,
TEST_FILE,
)
from fontbakery.status import WARN


def test_check_dsig():
"""Does the font have a DSIG table ?"""
check = CheckTester("opentype/dsig")

# Our reference Cabin Regular font is bad (theres a DSIG table declared):
ttFont = TTFont(TEST_FILE("cabin/Cabin-Regular.ttf"))
assert_results_contain(
check(ttFont), WARN, "found-DSIG", "with a font containing a DSIG table..."
)

# Then we remove the DSIG table and it should now PASS the check:
del ttFont["DSIG"]
assert_PASS(check(ttFont), "with a good font...")
1 change: 0 additions & 1 deletion tests/test_checks_unwanted_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def newTable(tag):
def test_check_unwanted_tables(check):
"""Are there unwanted tables ?"""
unwanted_tables = [
"DSIG",
"FFTM", # FontForge
"TTFA", # TTFAutohint
"TSI0", # TSI* = VTT
Expand Down