Repository navigation
Add same-origin Fontsource fonts and mapFonts transforms - #15
Merged
Merged
Conversation
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.
OpenLayers consumes browser fonts rather than Mapbox PBF glyphs, so proxied styles could still trigger direct jsDelivr requests. Rewritten styles now always supply a same-origin
ol:webfontstemplate. Unconfigured faces return empty CSS and fall back to browser fonts; configured Fontsource families use pinned versions, allow-listed upstream URLs and the existing server cache for CSS/WOFF2 assets.Add
mapFontsfor reusing host font names in text-font stacks, literal expressions and formatted-text overrides. Support selected subsets and weight aliases, preserve Unicode ranges and rewrite font sources to local WOFF2 routes. Document configuration, font licenses and client CSS cache invalidation. Keep the changelog entries under Unreleased above the existing 2.6.1 release.Behavior to review: upstream
ol:webfontsmetadata is deliberately replaced, including when no fallback faces are configured. Existing external web-font behavior changes to browser fallback until a local face policy is configured.Validation: 163 tests pass on PHP 8.2.35 and 8.5.4; PHPStan passes. Tests cover local metadata, unknown-face fallback, pinned cached assets, subset rejection, upstream allow-list enforcement, font expression mapping, pinned versions, missing CSS subsets and italic weight aliases. Existing environmental skips and one existing PHPUnit warning remain. No live font download is required by tests.
Prepared for review only; no merge or release of this feature is requested.