qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.6k stars 3.01k forks source link

Allow for automatically downloading fonts from metadata tags for Vector Tiles #58957

Open MattMauser opened 1 month ago

MattMauser commented 1 month ago

Feature description

Allow for reading a metadata tag from the Vector Tile style for the location to download missing fonts, similar to the OpenLayers Font Handling.

Additional context

The current solution to the Glyphs issue, 46588, is this pull request, 49020, which automatically downloads available OpenFonts replacements and allows users to specify which fonts should be used as a replacement. But, most of the fonts we use do not have a replacement, so we'd like to point to where they are served so they can be downloaded automatically.

nyalldawson commented 1 month ago

Have you got an example of a vector tiles style which uses this?

MattMauser commented 1 month ago

Yes, for sure. Here's an example of a layer hosted in AGOL: https://arcgis.com/home/item.html?id=800d755712e8415aab301b9d55bc2800

And here is a link to it's JSON style: https://arcgis.com/sharing/rest/content/items/800d755712e8415aab301b9d55bc2800/resources/styles/root.json?f=pjson

The metadata key with the "ol:webfonts" key is at the bottom of the JSON: "metadata": { "ol:webfonts": "https://nronk1awvasp036.nrn.nrcan.gc.ca/fgpv/map/fonts/{font-family}/{fontweight}{-fontstyle}.css" }