Closed khaledhosny closed 4 weeks ago
@madig, since @khaledhosny requested you to review this PR, I'll wait your OK before merging this. Let me know what you think.
This is for testing one specific location?
This is for testing one specific location?
For testing arbitrary locations in general. I build variable fonts that has don’t always have named instances for locations I want to test.
Here is an example TOML file from the project I needed this for. The only fvar
instance has MSHQ=10
, but I want to test its extreme as well:
[input.variations]
MSHQ = 100
[input]
script = "arab"
direction = "rtl"
text = [
"ص ص ص ص",
"ض ض ض ض",
]
With this PR, it generates this JSON file:
{
"tests": [
{
"only": "Astrolabe.ttf",
"input": "ص ص ص ص",
"expectation": "uni0635.fina=10+1750|space=8+0|space=8+0|space=6+0|uni0635.medi=6+1350|space=4+0|space=4+0|space=2+0|uni0635.init=2+1350|space=1+0|uni0635=0+1700",
"script": "arab",
"direction": "rtl",
"variations": {
"MSHQ": 100
}
},
{
"only": "Astrolabe.ttf",
"input": "ض ض ض ض",
"expectation": "dotabovear=10@672,250+0|uni0635.fina=10+1750|space=8+0|space=8+0|space=6+0|dotabovear=6@262,250+0|uni0635.medi=6+1350|space=4+0|space=4+0|space=2+0|dotabovear=2@661,250+0|uni0635.init=2+1350|space=1+0|dotabovear=0@1037,250+0|uni0635=0+1700",
"script": "arab",
"direction": "rtl",
"variations": {
"MSHQ": 100
}
}
]
Without setting input.variations
, it will be "MSHQ": 10.0
.
If input.variations is explicitly set, it will be used instead of using instance coordinates from fvar table.
Checklist
CHANGELOG.md