Repository navigation
Conversation
This was referenced Oct 29, 2026
ahocevar
requested changes
Nov 1, 2026
ahocevar
left a comment
Member
There was a problem hiding this comment.
Please address my inline comments, and simplify the tests accordingly, avoiding test bloat.
Comment on lines
+102
to
+103
| fonts use the browser's fallback. A style can also set `metadata['ol:webfonts']` to `false` to | ||
| disable automatic loading for that style. |
Member
There was a problem hiding this comment.
I'd rather not support metadata['ol:webfonts'] set to false.
| getFonts(fonts, templateUrl), | ||
| getFonts( | ||
| fonts, | ||
| options.webfonts === false ? false : templateUrl, |
Member
There was a problem hiding this comment.
templateUrl already has the value of options.webfonts here, so this change is not necessary.
pjeweb
force-pushed
the
feat/disable-webfonts
branch
from
November 2, 2026 00:23
2d871dd to
769214d
Compare
Author
|
I removed the metadata opt-out and redundant |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1563.
Currently
When a font in a style's
text-fontis not available, ol-mapbox-style loads a stylesheet for it from Fontsource on jsDelivr. Applications can redirect or reduce these requests, but not turn them off:ol:webfontsto fonts it hosts, as the README describes. basemap.de, for example, does not do this yet.webfontsoption to its own server. Every face it does not host is still requested there and fails with a 404, once per face and page load.text-fontvalues to fonts it already has. A face that a style update adds or renames is then fetched from the CDN again.Wanted
A switch that lets an application turn automatic font loading off:
Implemented Change
With
webfonts: falsepassed toapply()orapplyStyle():text-font.ol:webfontsmetadata are the exception: their fonts still load from that location.Without the option, nothing changes, so maps keep their intended fonts.