Skip to content

Commit

Permalink
Improve fsselection_matches_macstyle reporting
Browse files Browse the repository at this point in the history
Mention relevant bit values on the log messages.

com.adobe.fonts/check/fsselection_matches_macstyle
On the Open Type profile.

(PR #4570)
  • Loading branch information
simoncozens authored and felipesanches committed Mar 5, 2024
1 parent a5f7804 commit 3aeab50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions Lib/fontbakery/checks/opentype/os2.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,19 @@ 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
if head_italic != os2_italic:
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, (
Expand Down

0 comments on commit 3aeab50

Please sign in to comment.