-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for "user" fonts, and automatically downloading freely licensed fonts #49020
Conversation
c484d65
to
e60a588
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!
to configure a set of automatic font name replacements to use when loading projects or styles Allows users/administrators to configure a list of alternative fonts to automatically match when a font referenced by a project/style is not available on the current system.
available for use in QGIS Allows for use of fonts which aren't installed system-wide in QGIS, e.g. when the user does not have permission to install fonts on a system.
And populate hardcoded list with a bunch of known fonts available from Google Fonts
all installed user fonts
This is an alternative approach to solving qgis#46588, where we avoid the issues which arise from trying to render vector tile PBF fonts. Refs qgis#46588
and make opt-in for non-app clients There's a tricky initialization balancing act happening here -- but if we try to load the default style on a system missing the fonts referenced in that style, then we risk trying to download those fonts before the QgsNetworkAccessManager is ready. So play it safe and defer all font download handling until the QGIS app is fully launched.
e14a9cb
to
2859bae
Compare
Hi, I really like this feature, thank you for this @nyalldawson. |
Yes, they just need to have:
You basically just need to add logic to QgsFontManager::urlForFontDownload to return the correct download url for the desired font names. |
Hi @nyalldawson, it seems something changed in https://fonts.google.com/download. Please see https://trac.osgeo.org/osgeo4w/ticket/824 and google/fonts#7481. |
@agiudiceandrea not an easy fix. I'll look into it later this month. |
It looks like the fonts are available via GitHub too without any need for API keys (until Microsoft decides otherwise): https://github.com/google/fonts/tree/main/ofl |
This PR works towards an alternative solution to #46588 (adding support for vector tile font glyphs). (This approach was selected because supporting vector font glyphs is an extremely difficult task, which ultimately would result only in poor-quality rasterised text rendering.)
In full, this adds a new "Fonts" panel to the settings dialog, with support for:
Funded by Toitū Te Whenua Land Information New Zealand