Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement DDS for
text-letter-spacing
property (#5071)
- Loading branch information
Nicki Dlugash
committed
Aug 1, 2017
1 parent
076aa81
commit 1fe5c95
Showing
6 changed files
with
137 additions
and
2 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
Binary file added
BIN
+10.5 KB
test/integration/render-tests/text-letter-spacing/property-function/expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions
63
test/integration/render-tests/text-letter-spacing/property-function/style.json
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,63 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 128, | ||
"width": 512 | ||
} | ||
}, | ||
"center": [ 0, 0 ], | ||
"zoom": 0, | ||
"sources": { | ||
"point": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { "spacing": -0.15, "text": "Very tight letter spacing" }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ -100, 0 ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { "spacing": 2, "text": "Very loose letter spacing" }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 75, 0 ] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "white" | ||
} | ||
}, | ||
{ | ||
"id": "text", | ||
"type": "symbol", | ||
"source": "point", | ||
"layout": { | ||
"text-field": "{text}", | ||
"text-letter-spacing": { | ||
"type": "identity", | ||
"property": "spacing" | ||
}, | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+16.7 KB
...ration/render-tests/text-letter-spacing/zoom-and-property-function/expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions
69
...egration/render-tests/text-letter-spacing/zoom-and-property-function/style.json
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,69 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 256, | ||
"width": 256 | ||
} | ||
}, | ||
"center": [ 0, 0 ], | ||
"zoom": 1.5, | ||
"sources": { | ||
"point": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { "spacing": "varying" }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, 15 ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { "spacing": "fixed" }, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ 0, -15 ] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "white" | ||
} | ||
}, | ||
{ | ||
"id": "text", | ||
"type": "symbol", | ||
"source": "point", | ||
"layout": { | ||
"text-field": "These lines have the same letter spacing", | ||
"text-letter-spacing": { | ||
"type": "categorical", | ||
"property": "spacing", | ||
"stops": [ | ||
[{"zoom": 0, "value": "varying"}, 0], | ||
[{"zoom": 0, "value": "fixed"}, 0.8], | ||
[{"zoom": 2, "value": "varying"}, 1.6], | ||
[{"zoom": 2, "value": "fixed"}, 0.8] | ||
] | ||
}, | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
] | ||
} | ||
} | ||
] | ||
} |