Use Drupal 11.4 fonts key for bundled font preloading#830
Merged
Conversation
jjroelofs
commented
Jul 8, 2026
jjroelofs
left a comment
Collaborator
Author
There was a problem hiding this comment.
Thanks for the cleanup here. I found two issues that should be addressed before merging:
dxpr_theme.libraries.yml: the newfontsentries are YAML lists, but Drupal 11.4 expects font paths as keys with options, e.g.
fonts:
fonts/leaguegothic/league_gothic-webfont.woff:
preload: trueAs written, core will not produce the intended font preload metadata and can hit missing/invalid font asset data during attachment processing. The Drupal change record documents the keyed structure: https://www.drupal.org/node/3585574.
features/sooper-fonts/fonts-theme-settings-controller.inc: bundled fonts now bypass_dxpr_theme_add_local_font()for all installs, butdxpr_theme.info.ymlstill advertises Drupal^9.3 || ^10 || ^11. On Drupal versions before 11.4, thefontskey is not processed, so LeagueGothic/ChunkFive lose the previous manual preload behavior. Either the core requirement needs to move to Drupal 11.4+, or this should keep a version-guarded fallback for older supported cores.
I also checked the current PR state: CI is green, and php -l plus git diff --check pass locally.
Use keyed format with preload option for the fonts library key instead of list format, as required by Drupal 11.4. Add a version check so the library approach is only used on Drupal 11.4+, falling back to _dxpr_theme_add_local_font() on older versions.
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.
Linked issues
Solution
Add Drupal 11.4
fontskey to library definitions for the bundled LeagueGothic and ChunkFive fonts, enabling correct browser preloading. Update the font loading code to attach these as standard Drupal libraries instead of injecting raw HTML head elements. Also fix the missingcrossoriginattribute on preload links for user-uploaded fonts.Checklist