You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A real cool solution would be the proposed Local Font Access API by Google. Qt did some integration, but the API is only available in Chromium based browsers and behind a flag for the time of writing. So probably not the solution for qgis-js.
What we could do is to scan the uploaded folder for any known/supported font file extensions and add those via addApplicationFontFromData to the runtime.
The text was updated successfully, but these errors were encountered:
I don't think there's an official way to have fonts embedded in a project. But there is support in QGIS settings (see in QGIS options dialog > Fonts) to have user fonts defined (in addition to what is loaded by default in QFontDatabase) and preferred font replacements for missing fonts. In QGIS core there's QgsApplication::fontManager() that returns QgsFontManager to deal with that.
Indeed I would go with something non-standard like you suggest - maybe check for "fonts" subdirectory of the project and try to load any files from there to QFontDatabase...
What we could do is to scan the uploaded folder for any known/supported font file extensions and add those via addApplicationFontFromData to the runtime.
That sounds good to me. Should we go for the separate "fonts" subdirectory solution? Any ttf or otf font in there would be added?
For the long run I think it would be great if the whole setup would allow for inclusion of extra fonts. I can imagine that many projects provided from the same organizations would standardize around the same standard fonts - an in such case it would be nice if many projects could share the same fonts.
This question came up by @andreasneumann while testing out some own projects. See the notes in the Qt6 WebAssembly reference for context.
A real cool solution would be the proposed Local Font Access API by Google. Qt did some integration, but the API is only available in Chromium based browsers and behind a flag for the time of writing. So probably not the solution for qgis-js.
What we could do is to scan the uploaded folder for any known/supported font file extensions and add those via addApplicationFontFromData to the runtime.
The text was updated successfully, but these errors were encountered: