Skip to content

Commit

Permalink
Merge pull request #78 from googlefonts/use-gsLayerID-for-layerName
Browse files Browse the repository at this point in the history
Use gsLayer.layerId for layerName + update fontra referenceFont
  • Loading branch information
ollimeier authored Jan 22, 2025
2 parents 89e4c52 + b2dbd52 commit 5763733
Show file tree
Hide file tree
Showing 13 changed files with 1,067 additions and 1,067 deletions.
2 changes: 1 addition & 1 deletion src/fontra_glyphs/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ async def getGlyph(self, glyphName: str) -> VariableGlyph | None:
sourceName = f"{masterName} / {gsLayer.name}"
else:
sourceName = gsLayer.name or masterName
layerName = f"{sourceName} (layer #{i})"
layerName = gsLayer.layerId

location = {
**self.locationByMasterID[gsLayer.associatedMasterId],
Expand Down
158 changes: 79 additions & 79 deletions tests/data/GlyphsUnitTestSans3.fontra/glyphs/A^1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@
"sources": [
{
"name": "Light",
"layerName": "Light (layer #0)",
"layerName": "C4872ECA-A3A9-40AB-960A-1DB2202F16DE",
"location": {
"Weight": 17
}
},
{
"name": "Regular",
"layerName": "Regular (layer #1)",
"layerName": "3E7589AA-8194-470F-8E2F-13C1C581BE24",
"location": {
"Weight": 90
}
},
{
"name": "Bold",
"layerName": "Bold (layer #2)",
"layerName": "BFFFD157-90D3-4B85-B99D-9A2F366F03CA",
"location": {
"Weight": 220
}
}
],
"layers": {
"Bold (layer #2)": {
"3E7589AA-8194-470F-8E2F-13C1C581BE24": {
"glyph": {
"path": {
"contours": [
{
"points": [
{
"x": 733,
"x": 617,
"y": 0
},
{
"x": 555,
"x": 412,
"y": 700
},
{
"x": 205,
"x": 248,
"y": 700
},
{
"x": 20,
"x": 40,
"y": 0
},
{
"x": 253,
"x": 134,
"y": 0
},
{
"x": 356,
"y": 470
"x": 313,
"y": 610
},
{
"x": 385,
"y": 470
"x": 342,
"y": 610
},
{
"x": 491,
"x": 521,
"y": 0
}
],
Expand All @@ -68,85 +68,82 @@
{
"points": [
{
"x": 600,
"y": 268
"x": 514,
"y": 269
},
{
"x": 162,
"y": 268
"x": 150,
"y": 269
},
{
"x": 154,
"y": 103
"x": 148,
"y": 178
},
{
"x": 596,
"y": 103
"x": 510,
"y": 178
}
],
"isClosed": true
}
]
},
"xAdvance": 753,
"xAdvance": 657,
"anchors": [
{
"name": "bottom",
"x": 377,
"x": 329,
"y": 0
},
{
"name": "ogonek",
"x": 678,
"x": 591,
"y": 10
},
{
"name": "top",
"x": 377,
"x": 329,
"y": 700
}
]
}
},
"Light (layer #0)": {
"BFFFD157-90D3-4B85-B99D-9A2F366F03CA": {
"glyph": {
"path": {
"contours": [
{
"points": [
{
"x": 548,
"x": 733,
"y": 0
},
{
"x": 321,
"y": 700,
"attrs": {
"name": "Hello World"
}
"x": 555,
"y": 700
},
{
"x": 275,
"x": 205,
"y": 700
},
{
"x": 45,
"x": 20,
"y": 0
},
{
"x": 65,
"x": 253,
"y": 0
},
{
"x": 289,
"y": 679
"x": 356,
"y": 470
},
{
"x": 307,
"y": 679
"x": 385,
"y": 470
},
{
"x": 527,
"x": 491,
"y": 0
}
],
Expand All @@ -155,82 +152,85 @@
{
"points": [
{
"x": 467,
"y": 225
"x": 600,
"y": 268
},
{
"x": 128,
"y": 225
"x": 162,
"y": 268
},
{
"x": 123,
"y": 207
"x": 154,
"y": 103
},
{
"x": 472,
"y": 207
"x": 596,
"y": 103
}
],
"isClosed": true
}
]
},
"xAdvance": 593,
"xAdvance": 753,
"anchors": [
{
"name": "bottom",
"x": 297,
"x": 377,
"y": 0
},
{
"name": "ogonek",
"x": 548,
"y": 0
"x": 678,
"y": 10
},
{
"name": "top",
"x": 297,
"x": 377,
"y": 700
}
]
}
},
"Regular (layer #1)": {
"C4872ECA-A3A9-40AB-960A-1DB2202F16DE": {
"glyph": {
"path": {
"contours": [
{
"points": [
{
"x": 617,
"x": 548,
"y": 0
},
{
"x": 412,
"y": 700
"x": 321,
"y": 700,
"attrs": {
"name": "Hello World"
}
},
{
"x": 248,
"x": 275,
"y": 700
},
{
"x": 40,
"x": 45,
"y": 0
},
{
"x": 134,
"x": 65,
"y": 0
},
{
"x": 313,
"y": 610
"x": 289,
"y": 679
},
{
"x": 342,
"y": 610
"x": 307,
"y": 679
},
{
"x": 521,
"x": 527,
"y": 0
}
],
Expand All @@ -239,41 +239,41 @@
{
"points": [
{
"x": 514,
"y": 269
"x": 467,
"y": 225
},
{
"x": 150,
"y": 269
"x": 128,
"y": 225
},
{
"x": 148,
"y": 178
"x": 123,
"y": 207
},
{
"x": 510,
"y": 178
"x": 472,
"y": 207
}
],
"isClosed": true
}
]
},
"xAdvance": 657,
"xAdvance": 593,
"anchors": [
{
"name": "bottom",
"x": 329,
"x": 297,
"y": 0
},
{
"name": "ogonek",
"x": 591,
"y": 10
"x": 548,
"y": 0
},
{
"name": "top",
"x": 329,
"x": 297,
"y": 700
}
]
Expand Down
Loading

0 comments on commit 5763733

Please sign in to comment.