Package Exports
- mapbox-to-css-font
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mapbox-to-css-font) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mapbox to CSS Font
Utility to convert Mapbox GL Style font names to CSS compatible font definitions.
API
parseFont
Utility to convert Mapbox GL Style font names to CSS font definitions.
Parameters
fontstring Mapbox GL Style font name, e.g.'Open Sans Regular'.
Returns Array Parts of the CSS font definition, i.e. [font-style font-weight font-size font-family]. The size will be 16. Call
asCss with this array and a size to get a CSS font definition string.
asCss
Applies a size to an array of CSS font definition parts and returns a CSS font definition string.
Parameters
cssDataArray Parts of the CSS font definition, i.e.[font-style font-weight font-size font-family].sizenumber Font size in pixels.
Returns string CSS font definition, e.g. 'normal 400 16px Open Sans'.