Skip to content

Commit 0d9c352

Browse files
committed
Revert "Deprecate opentype/dsig"
This reverts commit 83966c8. (issue #4990)
1 parent 2d7b061 commit 0d9c352

7 files changed

Lines changed: 68 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ A more detailed list of changes is available in the corresponding milestones for
1010
#### Moved from Universal to OpenType profile
1111
- **[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)
1212

13+
### New checks
14+
#### Added to the OpenType profile
15+
- **[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)
16+
1317
### Changes to existing checks
1418
### On the OpenType profile
1519
- **[opentype/unwanted_aat_tables]:** EBSC is not an AAT table. (issue #4992)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from fontbakery.callable import check
2+
from fontbakery.status import WARN
3+
from fontbakery.message import Message
4+
5+
6+
@check(
7+
id="opentype/dsig",
8+
rationale="""
9+
Microsoft Office 2013 and below products expect fonts to have a digital
10+
signature declared in a DSIG table in order to implement OpenType features.
11+
The EOL date for Microsoft Office 2013 products was 4/11/2023.
12+
13+
This issue does not impact Microsoft Office 2016 and above products. It is now considered better to completely remove the table.
14+
15+
But if you still want your font to support OpenType features on Office 2013,
16+
then you may find it handy to add a fake signature on a placeholder DSIG table
17+
by running one of the helper scripts provided at
18+
https://github.com/googlefonts/gftools
19+
20+
Reference: https://github.com/fonttools/fontbakery/issues/1845
21+
""",
22+
proposal=[
23+
"https://github.com/fonttools/fontbakery/issues/3398",
24+
"https://github.com/fonttools/fontbakery/issues/4829", # legacy check
25+
],
26+
)
27+
def check_dsig(ttFont):
28+
"""The font should not need a DSIG table anymore."""
29+
if "DSIG" in ttFont:
30+
yield WARN, Message(
31+
"found-DSIG",
32+
"This font has a digital signature (DSIG table) which"
33+
" is only required - even if only a placeholder"
34+
" - on old programs like MS Office 2013 in order to"
35+
" work properly.\n"
36+
"The current recommendation is to completely"
37+
" remove the DSIG table.",
38+
)

Lib/fontbakery/checks/unwanted_tables.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
def check_unwanted_tables(ttFont):
1414
"""Are there unwanted tables?"""
1515
UNWANTED_TABLES = {
16-
"DSIG": (
17-
"This font has a digital signature (DSIG table) which is only required"
18-
" - even if only a placeholder - on old programs like MS Office 2013"
19-
" in order to work properly.\n"
20-
"The current recommendation is to completely remove the DSIG table."
21-
),
2216
"FFTM": "Table contains redundant FontForge timestamp info",
2317
"TTFA": "Redundant TTFAutohint table",
2418
"TSI0": "Table contains data only used in VTT",

Lib/fontbakery/profiles/adobefonts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"notofonts/unicode_range_bits", # so maybe there's still some change they may be considered useful here?
2929
#
3030
"opentype/caret_slope",
31+
"opentype/dsig",
3132
"opentype/fsselection",
3233
"opentype/fvar/axis_ranges_correct",
3334
"opentype/gdef_mark_chars",

Lib/fontbakery/profiles/opentype.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"opentype/cff_call_depth",
99
"opentype/cff_deprecated_operators",
1010
"opentype/code_pages",
11+
"opentype/dsig",
1112
"opentype/family/bold_italic_unique_for_nameid1",
1213
"opentype/family/consistent_family_name",
1314
"opentype/family/equal_font_versions",

tests/test_checks_opentype_dsig.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from fontTools.ttLib import TTFont
2+
3+
from fontbakery.codetesting import (
4+
assert_PASS,
5+
assert_results_contain,
6+
CheckTester,
7+
TEST_FILE,
8+
)
9+
from fontbakery.status import WARN
10+
11+
12+
def test_check_dsig():
13+
"""Does the font have a DSIG table ?"""
14+
check = CheckTester("opentype/dsig")
15+
16+
# Our reference Cabin Regular font is bad (theres a DSIG table declared):
17+
ttFont = TTFont(TEST_FILE("cabin/Cabin-Regular.ttf"))
18+
assert_results_contain(
19+
check(ttFont), WARN, "found-DSIG", "with a font containing a DSIG table..."
20+
)
21+
22+
# Then we remove the DSIG table and it should now PASS the check:
23+
del ttFont["DSIG"]
24+
assert_PASS(check(ttFont), "with a good font...")

tests/test_checks_unwanted_tables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def newTable(tag):
2121
def test_check_unwanted_tables(check):
2222
"""Are there unwanted tables ?"""
2323
unwanted_tables = [
24-
"DSIG",
2524
"FFTM", # FontForge
2625
"TTFA", # TTFAutohint
2726
"TSI0", # TSI* = VTT

0 commit comments

Comments
 (0)