Skip to content

Commit ae7e17d

Browse files
1ec5louwers
andauthored
Relax requirement for glyphs when using text-field (#1068)
* Relaxed requirement for glyphs when using text-field Also clarified the interpretation of text-font when glyphs is set versus unset. * Updated changelog * Added compatibility table for omitting glyphs * add sdk-support table to main topics --------- Co-authored-by: Bart Louwers <[email protected]>
1 parent 83be248 commit ae7e17d

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## main
22

33
### ✨ Features and improvements
4-
- _...Add new stuff here..._
4+
- `glyphs` is now optional even if a symbol layer specifies `text-field`; if it is unset, `text-font` is interpreted as a fallback font list ([#1068](https://github.com/maplibre/maplibre-style-spec/pull/1068))
55

66
### 🐞 Bug fixes
77
- Fix RuntimeError class, make it inherited from Error ([#983](https://github.com/maplibre/maplibre-style-spec/issues/983))

build/generate-docs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ function createMainTopics() {
534534
content += convertPropertyToMarkdown(subKey, subValue as JsonObject);
535535
}
536536
}
537+
if (value['sdk-support']) {
538+
content += '\n---\n';
539+
content += sdkSupportToMarkdown(value['sdk-support']);
540+
}
541+
537542
fs.writeFileSync(`${BASE_PATH}/${key}.md`, content);
538543
}
539544
}

src/reference/v8.json

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,20 @@
183183
},
184184
"glyphs": {
185185
"type": "string",
186-
"doc": "A URL template for loading signed-distance-field glyph sets in PBF format. \n\nThe URL must include:\n\n - `{fontstack}` - When requesting glyphs, this token is replaced with a comma separated list of fonts from a font stack specified in the text-font property of a symbol layer. \n\n - `{range}` - When requesting glyphs, this token is replaced with a range of 256 Unicode code points. For example, to load glyphs for the Unicode Basic Latin and Basic Latin-1 Supplement blocks, the range would be 0-255. The actual ranges that are loaded are determined at runtime based on what text needs to be displayed.\n\nThis property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
187-
"example": "https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf"
186+
"doc": "A URL template for loading signed-distance-field glyph sets in PBF format.\n\nIf this property is set, any text in the `text-field` layout property is displayed in the font stack named by the `text-font` layout property based on glyphs located at the URL specified by this property. Otherwise, font faces will be determined by the `text-font` property based on the local environment.\n\nThe URL must include:\n\n - `{fontstack}` - When requesting glyphs, this token is replaced with a comma separated list of fonts from a font stack specified in the `text-font` property of a symbol layer. \n\n - `{range}` - When requesting glyphs, this token is replaced with a range of 256 Unicode code points. For example, to load glyphs for the Unicode Basic Latin and Basic Latin-1 Supplement blocks, the range would be 0-255. The actual ranges that are loaded are determined at runtime based on what text needs to be displayed.\n\nThe URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
187+
"example": "https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",
188+
"sdk-support": {
189+
"basic functionality": {
190+
"js": "0.0.16",
191+
"android": "0.1.1",
192+
"ios": "0.1.0"
193+
},
194+
"omit to use local fonts": {
195+
"js": "https://github.com/maplibre/maplibre-gl-js/issues/3302",
196+
"android": "https://github.com/maplibre/maplibre-native/issues/165",
197+
"ios": "https://github.com/maplibre/maplibre-native/issues/165"
198+
}
199+
}
188200
},
189201
"transition": {
190202
"type": "transition",
@@ -1889,7 +1901,7 @@
18891901
"Open Sans Regular",
18901902
"Arial Unicode MS Regular"
18911903
],
1892-
"doc": "Font stack to use for displaying text.",
1904+
"doc": "Fonts to use for displaying text. If the `glyphs` root property is specified, this array is joined together and interpreted as a font stack name. Otherwise, it is interpreted as a cascading fallback list of local font names.",
18931905
"requires": [
18941906
"text-field"
18951907
],
@@ -1903,6 +1915,11 @@
19031915
"js": "0.43.0",
19041916
"android": "6.0.0",
19051917
"ios": "4.0.0"
1918+
},
1919+
"local fonts": {
1920+
"js": "https://github.com/maplibre/maplibre-gl-js/issues/3302",
1921+
"android": "https://github.com/maplibre/maplibre-native/issues/165",
1922+
"ios": "https://github.com/maplibre/maplibre-native/issues/165"
19061923
}
19071924
},
19081925
"expression": {

0 commit comments

Comments
 (0)