Skip to content

Commit da619ca

Browse files
committed
Add note about style and weight
1 parent 8065c35 commit da619ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Mapbox to CSS Font
22

3-
Utility to convert Mapbox GL Style font names to CSS compatible font definitions.
3+
Utility to convert Mapbox GL Style fontstacks or fonts names to CSS compatible font definitions.
4+
5+
For fontstacks, the style and weight of the primary font (first font in the fontstack) will also be used for the fallback fonts.
46

57
The ["Klokantech Noto Sans"](https://github.com/klokantech/klokantech-gl-fonts) font is recognized and returned as "Noto Sans", so it can be loaded as web font from Google fonts.
68

@@ -16,7 +18,7 @@ parseFont('Open Sans Regular', 16);
1618

1719
**Parameters**
1820

19-
- `font` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Mapbox GL Style font name, e.g. `'Open Sans Regular'`.
21+
- `fonts` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)|[Array(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** Mapbox GL Style fontstack or single font, e.g. `['Open Sans Regular', 'Arial Unicode MS Regular']` or `'Open Sans Regular'`.
2022

2123
- `size` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Font size in pixels.
2224

0 commit comments

Comments
 (0)