2.4.4 • Published 3 months ago

mapbox-to-css-font v2.4.4

Weekly downloads
35,444
License
BSD-2-Clause
Repository
github
Last release
3 months ago

Mapbox to CSS Font

Utility to convert Mapbox GL Style fontstacks or fonts names to CSS compatible font definitions.

For fontstacks, the style and weight of the primary font (first font in the fontstack) will also be used for the fallback fonts.

The "Klokantech Noto Sans" font is recognized and returned as "Noto Sans", so it can be loaded as web font from Google fonts.

Usage

var parseFont = require('mapbox-to-css-font');
parseFont('Open Sans Regular', 16, 1.2);
// returns 'normal 400 16px/1.2 "Open Sans"'

API

Parameters

Returns string CSS font definition, e.g. 'normal 400 16px/1.2 "Open Sans"'.

2.4.3

3 months ago

2.4.4

3 months ago

2.4.2

1 year ago

2.4.1

2 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago