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: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Below are the noteworthy changes from each release.
A more detailed list of changes is available in the corresponding milestones for each release in the Github issue tracker (https://github.com/googlefonts/fontbakery/milestones?state=closed).

## Upcoming release: 0.13.3 (2025-Feb-??)
## Upcoming release: 0.13.3 (2025-Apr-??)

### Migration of checks
#### 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 OpenYype profile instead of the Universal profile. (issue #4991)
Expand All @@ -13,6 +14,7 @@ A more detailed list of changes is available in the corresponding milestones for
### On the Universal profile
- **[unwanted_tables]:** Remove checking for 'prop' because it is an AAT table. (issue #4989)
- **[base_has_width]:** Examine non-mark glyphs rather than mark glyphs; ignore PUA. (issue #5007)
- **[typographic_family_name]:** Fix for support families with RIBBI and non-RIBBI styles. (PR #5012)


## 0.13.2 (2025-Feb-03)
Expand Down
13 changes: 7 additions & 6 deletions Lib/fontbakery/checks/typographic_family_name.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fontbakery.prelude import check, FAIL
from fontbakery.prelude import check, FAIL, Message


@check(
Expand All @@ -15,11 +15,12 @@ def check_typographic_family_name(ttFonts):
for ttFont in ttFonts:
name_record = ttFont["name"].getName(16, 3, 1, 0x0409)
if name_record is None:
values.add("<no value>")
else:
values.add(name_record.toUnicode())
name_record = ttFont["name"].getName(1, 3, 1, 0x0409)

values.add(name_record.toUnicode())
if len(values) != 1:
yield FAIL, (
yield FAIL, Message(
"incosistent-family-name",
f"Name ID 16 (Typographic Family name) is not consistent "
f"across fonts. Values found: {sorted(values)}"
f"across fonts. Values found: {sorted(values)}",
)
50 changes: 45 additions & 5 deletions tests/test_checks_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,46 @@ def test_ttFont():
return TTFont(TEST_FILE("selawik/Selawik-fvar-test-VTT.ttf"), lazy=True)


@pytest.fixture
def montserrat_ttFonts():
paths = [
TEST_FILE("montserrat/Montserrat-Black.ttf"),
TEST_FILE("montserrat/Montserrat-BlackItalic.ttf"),
TEST_FILE("montserrat/Montserrat-Bold.ttf"),
TEST_FILE("montserrat/Montserrat-BoldItalic.ttf"),
TEST_FILE("montserrat/Montserrat-ExtraBold.ttf"),
TEST_FILE("montserrat/Montserrat-ExtraBoldItalic.ttf"),
TEST_FILE("montserrat/Montserrat-ExtraLight.ttf"),
TEST_FILE("montserrat/Montserrat-ExtraLightItalic.ttf"),
TEST_FILE("montserrat/Montserrat-Italic.ttf"),
TEST_FILE("montserrat/Montserrat-Light.ttf"),
TEST_FILE("montserrat/Montserrat-LightItalic.ttf"),
TEST_FILE("montserrat/Montserrat-Medium.ttf"),
TEST_FILE("montserrat/Montserrat-MediumItalic.ttf"),
TEST_FILE("montserrat/Montserrat-Regular.ttf"),
TEST_FILE("montserrat/Montserrat-SemiBold.ttf"),
TEST_FILE("montserrat/Montserrat-SemiBoldItalic.ttf"),
TEST_FILE("montserrat/Montserrat-Thin.ttf"),
TEST_FILE("montserrat/Montserrat-ThinItalic.ttf"),
]
return [TTFont(path) for path in paths]


@pytest.fixture
def cabin_ttFonts():
paths = [
TEST_FILE("cabin/Cabin-BoldItalic.ttf"),
TEST_FILE("cabin/Cabin-Bold.ttf"),
TEST_FILE("cabin/Cabin-Italic.ttf"),
TEST_FILE("cabin/Cabin-MediumItalic.ttf"),
TEST_FILE("cabin/Cabin-Medium.ttf"),
TEST_FILE("cabin/Cabin-Regular.ttf"),
TEST_FILE("cabin/Cabin-SemiBoldItalic.ttf"),
TEST_FILE("cabin/Cabin-SemiBold.ttf"),
]
return [TTFont(path) for path in paths]


@check_id("name_id_1")
def test_check_name_id_1(check, test_ttFont):
"""Font has a name with ID 1."""
Expand Down Expand Up @@ -46,15 +86,15 @@ def test_check_name_length_req(check, test_ttFont):


@check_id("typographic_family_name")
def test_check_typographic_family_name(check, test_ttFont):
def test_check_typographic_family_name(check, cabin_ttFonts, montserrat_ttFonts):
"""Typographic Family name consistency."""

family = [
test_ttFont, # FIXME: This must be tested with more than a single font file!
]
family = montserrat_ttFonts
assert_PASS(check(family), "with a good family...")

# TODO: test a FAIL case
assert_results_contain(
check([cabin_ttFonts, montserrat_ttFonts]), FAIL, "incosistent-family-name"
)


@check_id("name/char_restrictions")
Expand Down
Loading