Skip to content

Is it possible to retrieve every font used in mapbox-gl-js for every charset-range? #809

Closed

Description

@fnicollet

Hi,

I am trying to make mapbox work partially offline and I would like to be able to save the fonts locally. When navigating the map, it makes requests to PBF files such as:

https://a.tiles.mapbox.com/v4/fontstack/Open Sans Italic, Arial Unicode MS Regular/0-255.pbf?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q

With a range of characters I believe, such as 0-255 or when you go to china 39424-39679.pbf and so on.
It seems like the request is made when needed, surely to avoid downloading complete fonts before anything gets displayed. In my case, I wouldn't mind if the files were big, as they would be stored locally. If there a way to either:

  • Load the whole fonts locally so that they don't get requested again
  • Download every PBF for every charset range for each fonts (they are not part of the project so I don't know where to find them)

Thanks!
Fabien

Activity

  1. yhahn commented on Nov 5, 2014

    @yhahn
    Contributor

    @fnicollet the project you're looking for is node-fontnik -- it's what's used in the Mapbox API to generate glyph PBFs for a set of fonts.

    You can use the script included with it here to generate glyph PBF files for your project for all the charset ranges: https://github.com/mapbox/node-fontnik/blob/master/bin/build-glyphs.

  2. fnicollet commented on Nov 5, 2014

    @fnicollet
    ContributorAuthor

    Thanks a lot !!

  3. fnicollet commented on Nov 5, 2014

    @fnicollet
    ContributorAuthor

    Added an issue on the other project, I can't seem to make the script work properly, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions