Nutritious Potato Munchies

    This package has been deprecated

    Author message:

    fontmachine is deprecated, which means it is no longer maintained and will not receive updates. Instead of this library, we recommend using node-fontnik directly

    @mapbox/fontmachine

    0.3.0 • Public • Published

    @mapbox/fontmachine

    Build Status codecov

    Make GL-ready pbfs and metadata for usage in fontstack API.

    makeGlyphs(opts, opts.font, opts.filetype, [opts.concurrency], callback)

    Make all metadata (codepoints) and SDF PBFs necessary for Mapbox GL fontstacks.

    Parameters

    parameter type description
    opts Object Options object with required font and filetype properties, and any optional parameters.
    opts.font Buffer The font file as a Buffer.
    opts.filetype string Type of font (e.g. '.ttf' or '.otf').
    [opts.concurrency] number optional: Concurrency to use when processing font into PBFs. If undefined, concurrency is unbounded.
    callback function(err, result) Callback takes arguments (error, result).

    Callback result

    property type description
    name string The name of this font (concatenated family_name + style_name).
    stack Array<{name: string, data: Buffer}> An array of 256 {name: filename, data: buffer} objects with SDF PBFs covering points 0-65535.
    metadata {family_name: string, style_name: string} Metadata about the font.
    codepoints Array<int> Array of codepoints covered by the font.
    original {name: string, data: Buffer} An object containing the original font file (named 'original<filetype>')

    Installation

    Requires nodejs.

    $ npm install @mapbox/fontmachine

    Tests

    $ npm test

    Keywords

    none

    Install

    npm i @mapbox/fontmachine

    DownloadsWeekly Downloads

    2

    Version

    0.3.0

    License

    ISC

    Unpacked Size

    10.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • mapbox-admin
    • mapbox-machine-user
    • mapbox-npm
    • mapbox-npm-01
    • mapbox-npm-02
    • mapbox-npm-03
    • mapbox-npm-04
    • mapbox-npm-05
    • mapbox-npm-06
    • mapbox-npm-07
    • mapbox-npm-08
    • mapbox-npm-09
    • mapbox-npm-advanced-actions
    • mapbox-npm-ci