From 3aeab5037f6935eb8d519a4e710eaceb8db137cc Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Fri, 1 Mar 2024 17:35:23 +0000 Subject: [PATCH] Improve fsselection_matches_macstyle reporting Mention relevant bit values on the log messages. com.adobe.fonts/check/fsselection_matches_macstyle On the Open Type profile. (PR #4570) --- CHANGELOG.md | 1 + Lib/fontbakery/checks/opentype/os2.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61cffefcba..b8ec658aaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ A more detailed list of changes is available in the corresponding milestones for - **[com.google.fonts/check/mac_style]:** Skip if font style can not be determined. (issue #4349) - **[com.google.fonts/check/family/panose_familytype]:** Add rationale and improve message when there are inconsistencies. (PR #4570) - **[com.google.fonts/check/xavgcharwidth]:** Added rationale. Also, when glyphs needed to compute xAvgCharWidth are missing, it is considered critical, so it is now results in a FATAL-level result. (PR #4570) + - **[com.adobe.fonts/check/fsselection_matches_macstyle]:** Improve log messages to include the bit values. (PR #4570) ## 0.12.0a2 (2024-Feb-21) diff --git a/Lib/fontbakery/checks/opentype/os2.py b/Lib/fontbakery/checks/opentype/os2.py index e032d0e77c..aafb92691b 100644 --- a/Lib/fontbakery/checks/opentype/os2.py +++ b/Lib/fontbakery/checks/opentype/os2.py @@ -199,7 +199,9 @@ def com_adobe_fonts_check_fsselection_matches_macstyle(ttFont): failed = True yield FAIL, Message( "fsselection-macstyle-bold", - "The OS/2.fsSelection and head.macStyle bold settings do not match.", + "The OS/2.fsSelection and head.macStyle bold settings do not match:\n\n" + f"* OS/2.fsSelection: BOLD is {'not ' if not os2_bold else ''}set\n" + f"* head.macStyle: BOLD is {'not ' if not head_bold else ''}set", ) head_italic = (ttFont["head"].macStyle & MacStyle.ITALIC) != 0 os2_italic = (ttFont["OS/2"].fsSelection & FsSelection.ITALIC) != 0 @@ -207,7 +209,9 @@ def com_adobe_fonts_check_fsselection_matches_macstyle(ttFont): failed = True yield FAIL, Message( "fsselection-macstyle-italic", - "The OS/2.fsSelection and head.macStyle italic settings do not match.", + "The OS/2.fsSelection and head.macStyle italic settings do not match.\n\n" + f"* OS/2.fsSelection: ITALIC is {'not ' if not os2_italic else ''}set\n" + f"* head.macStyle: ITALIC is {'not ' if not head_italic else ''}set", ) if not failed: yield PASS, (