0

I've uploaded my font to mapbox studio. The font has a couple of glyphs added in normally unused uncode ranges. It all worked (works) perfectly in Mapbox GL JS.

Then the requirements have changed, so I changed and re-uploaded the font.

  • Tried uploading font with a different filename
  • Tried changing names and versions in the font properties in FontForge (software I use to edit the font) prior to exporting - see the picture attached
  • Waited for more than 12 hours (so the cache should be invalidated according to the docs
  • Created a token with proper write scope, removed the font using mapbox fonts API and reuploaded it

Nothing seem to work, I'm out of ideas.

Font properties


The simplified map implementation:

// Map initialization
const map = new Map({
    accessToken: *********,
    container: 'mapboxMapContainer',
    style: `${ mapboxConfig.styleURL }`,
    center: mapboxConfig.initialCenter,
    zoom: mapboxConfig.initialZoom,
});

// Defining the glyphs
const UIGlyph = {
    ...
    hub: String.fromCharCode(10296),
    hubBackdrop: String.fromCharCode(10298),
    ...
};

// Layer style configuration
const layerConfig = layout: {
    'text-field': [
        'format',
        ['literal', UIGlyph.hubBackdrop],
        { 'text-color': '#FFFFFF' },
        ['literal', UIGlyph.hub],
        { 'text-color': ['get', 'occupancyColor'] },
        ['get', 'occupancy'],
        { 'font-scale': 0.75 },
    ],
    'text-font': ['PortalUI PortalUI'],
};

// Adding layer
this.map.addLayer({
    ...layerConfig,
    source: sourceId
});

If anymore people want to close my question I'd like to point out that this tag - mapbox is officially recommended as a point of getting support for developers. I fail to see why my post fails to meet community standards. Please give some explanation at least and point me into the right direction.

entio
  • 3,816
  • 1
  • 24
  • 39
  • It's probably being closed because your question doesn't actually have anything to do with programming. And whether or not a third company says SO is a recommended support channel doesn't change anything about whether SO thinks a question is valid. – Steve Bennett Mar 16 '23 at 05:39
  • You also haven't really provided enough details to make this answerable, like how your style is setup etc. In any case, I'd suggest just duplicating the style with a new font. – Steve Bennett Mar 16 '23 at 05:40
  • @SteveBennett Thanks for your comment. Calling API's to remove a font certainly is programming to some extent. Therefore I still don't get why it's been voted to be closed. Anyways, my setup is a generic one, I'll update the question with my setup code. I have uploaded a new font with a new name / id and I it worked, but this is not a sustainable way of updating the assets. I don't want my teammates to be forced into updating the repo and deployemnt just to add a few glyphs to the font, that sounds silly. – entio Mar 16 '23 at 07:57
  • It might be "generic" to you, and you might think you're doing everything standard...but you might be mistaken. And different people's perception of "generic" and standard vary. – Steve Bennett Mar 17 '23 at 00:11
  • Also, if you have feedback for Mapbox, you should give it to Mapbox, not here. – Steve Bennett Mar 17 '23 at 00:12

1 Answers1

0

Some time passed and I've checked again - the font seemed to be updated. I've started digging once more for cache and TTL and at last was able to find previously missed information:

Responses from the Fonts API set both the device and CDN TTLs to 10 days (source)

Can I invalidate the CDN cache?

No, the CDN cache for styles and tilesets cannot be invalidated (source)

entio
  • 3,816
  • 1
  • 24
  • 39