-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from googlefonts/test_strings
Add test strings (attempt 2)
- Loading branch information
Showing
8 changed files
with
170 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"GF_Latin_Kernel": { | ||
"Letter Groups": [ | ||
"EFHIJLTU", | ||
"AVWXZ", | ||
"KMNY", | ||
"COQS", | ||
"BPRDG", | ||
"fijltr", | ||
"kvwxyz", | ||
"hmnu", | ||
"ceogs", | ||
"abdpq" | ||
], | ||
"Spacing": [ | ||
"HHOHHOOHOO HIHOIO", | ||
"uuonouonoo ninoioolonlniuo", | ||
"010 080 030 020 050 060 070" | ||
], | ||
"Kerning": [ | ||
"HHAVAHH WAFAPATAUAYALYTJĿLVÆ HH", | ||
"TiTíTîTïTìTĭTīTĩT Vă Tä Tü Tõ Tŭ Tř", | ||
"HHTan oTo yTy vAv oVo eYe Ly Ky Ac", | ||
"nin non nvn ovo oxo ayn fl fi fj ft gj ko rento", | ||
"ďá ďu ŀl gj ľk włw yły ółr fħ ílïlîl", | ||
"H.Y-Y.T,F.P,V:Y„V-T-A*A’A“A’A-AL–L—L-", | ||
"n.r.r,y.y,(o)(i)(d)(j)(f)[j]{f}", | ||
"080 076 474 973 94 7078", | ||
"P4T47A .47,9.7-»4", | ||
"42°21′29″N 71°03′49″W", | ||
"d² m³ 15°C/26°F", | ||
"0/0\\0" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from glyphsets import _GFGlyphData, _TestDocData | ||
from fontTools.ttLib import TTFont | ||
import os | ||
import pytest | ||
|
||
DATA_FP = os.path.join(os.path.dirname(__file__), "data") | ||
|
||
glyphs_data = { | ||
"glyphs": [ | ||
{ | ||
"nice_name": "A", | ||
"production_name": "A", | ||
"character": "A", | ||
"unicode": 65, | ||
"glyphsets": [ | ||
"GFLatinIPA", | ||
"GFLatinAfrican", | ||
"GFLatinCore", | ||
"GFLatinKernel", | ||
"GFLatinMinorities", | ||
"GFLatinPlus", | ||
"GFLatinVietnamese", | ||
], | ||
}, | ||
{ | ||
"nice_name": "brevecomb_acutecomb", | ||
"production_name": "uni03060301", | ||
"character": None, | ||
"unicode": None, | ||
"glyphsets": ["GFLatinVietnamese"], | ||
}, | ||
{ | ||
"nice_name": "fdotaccent", | ||
"production_name": "uni1E1F", | ||
"character": "\u1e1f", | ||
"unicode": 7711, | ||
"glyphsets": ["GFLatinAfrican"], | ||
}, | ||
] | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def glyph_data(): | ||
return _GFGlyphData(glyphs_data) | ||
|
||
|
||
@pytest.fixture | ||
def test_string_data(): | ||
data = { | ||
"GFLatinKernel": { | ||
"Spacing": ["AAA"], | ||
}, | ||
"GFLatinAfrican": { | ||
"Spacing": ["BBB"], | ||
}, | ||
} | ||
return _TestDocData(data, _GFGlyphData(glyphs_data)) | ||
|
||
|
||
@pytest.fixture | ||
def ttFont(): | ||
fp = os.path.join(DATA_FP, "MavenPro[wght].ttf") | ||
return TTFont(fp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pytest | ||
from . import * | ||
|
||
|
||
def test_test_strings_in_font(test_string_data, ttFont): | ||
res = test_string_data.test_strings_in_font(ttFont) | ||
assert "GFLatinKernel" in res | ||
|
||
# Drop threshold so we pick up GFLatinAfrican | ||
res = test_string_data.test_strings_in_font(ttFont, 0.4) | ||
assert "GFLatinAfrican" in res |
File renamed without changes.