Skip to content

Commit bb2f185

Browse files
yanonefelipesanches
authored andcommitted
case_mapping: Dynamically exclude incomplete Greek glyphs.
'case_mapping' check on Universal profile. (PR #4721)
1 parent 5945364 commit bb2f185

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ A more detailed list of changes is available in the corresponding milestones for
44
## Upcoming release: 0.13.0 (2024-Sep-??)
55
### Changes to existing checks
66
#### On the Universal profile
7+
- **[case_mapping]:** Dynamically exclude incomplete Greek glyphs (PR #4721)
78
- **[missing_small_caps_glyphs]:** Rewrote it from scratch, marked it as **experimental** (issue #4713)
89
- **[name/family_and_style_max_length"]:** Use nameID 16 (Typographic family name) to determine name length if it exists. (PR #4811)
910

Lib/fontbakery/checks/glyphset.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,15 @@
2323
)
2424
def check_case_mapping(ttFont):
2525
"""Ensure the font supports case swapping for all its glyphs."""
26-
from fontbakery.utils import markdown_table
26+
from fontbakery.utils import markdown_table, characters_per_script
2727

2828
# These are a selection of codepoints for which the corresponding case-swap
2929
# glyphs are missing way too often on the Google Fonts library,
3030
# so we'll ignore for now:
3131
EXCEPTIONS = [
3232
0x0192, # ƒ - Latin Small Letter F with Hook
3333
0x00B5, # µ - Micro Sign
34-
0x03C0, # π - Greek Small Letter Pi
3534
0x2126, # Ω - Ohm Sign
36-
0x03BC, # μ - Greek Small Letter Mu
37-
0x03A9, # Ω - Greek Capital Letter Omega
38-
0x0394, # Δ - Greek Capital Letter Delta
3935
0x0251, # ɑ - Latin Small Letter Alpha
4036
0x0261, # ɡ - Latin Small Letter Script G
4137
0x00FF, # ÿ - Latin Small Letter Y with Diaeresis
@@ -53,6 +49,13 @@ def check_case_mapping(ttFont):
5349
0x026B, # ɫ - Latin Small Letter L with Middle Tilde
5450
]
5551

52+
# Font has incomplete legacy Greek coverage, so ignore Greek dynamically
53+
# (minimal Greek coverage is 2x24=48 characters, so we assume incomplete
54+
# if coverage is less than half of 48)
55+
greek = characters_per_script(ttFont, "Greek")
56+
if 0 < len(greek) < 24:
57+
EXCEPTIONS.extend(greek)
58+
5659
missing_counterparts_table = []
5760
cmap = ttFont["cmap"].getBestCmap()
5861
for codepoint in cmap:

0 commit comments

Comments
 (0)