Skip to content
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

Vector tile glyph support #46588

Open
blacha opened this issue Dec 21, 2021 · 3 comments
Open

Vector tile glyph support #46588

blacha opened this issue Dec 21, 2021 · 3 comments

Comments

@blacha
Copy link

blacha commented Dec 21, 2021

Feature description

When importing vector tiles that have custom fonts, the fonts are not imported from the glyphs

Additional context

When importing vector tiles a warning is given if a font is missing on the base system rather than importing the font from the supplied glyph url

Housenumber: Referenced font Roboto Bold Italic is not available on system

Example stylejson: https://basemaps.linz.govt.nz/v1/tiles/topographic/EPSG:3857/style/topographic.json?api=d01fn790hgwf9w552d462epyste

which has glyphs of
"https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf"

which has the following glyphs https://github.com/orangemug/font-glyphs/tree/gh-pages/glyphs

which include "Roboto Bold Italic" https://github.com/orangemug/font-glyphs/tree/gh-pages/glyphs/Roboto%20Bold%20Italic

@nyalldawson
Copy link
Collaborator

This is a very tricky one -- Qt itself has no way to render pbf fonts, so we'd need to write our own renderer for these.

@blacha
Copy link
Author

blacha commented Dec 21, 2021

I have been doing some research on this recently as we have been looking to generate some PBF fonts for some of our (Land Information New Zealand) cartographic fonts.

The PBF files here have been generated by mapbox's fontnik which encodes the glyphs as
https://en.wikipedia.org/wiki/Signed_distance_function

related background: https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-mapbox-gl-b0933af6f817

I do not know much (anything :D) about QT but a quick google around distance field rendering in QT, gave me https://doc.qt.io/qt-5/qtdistancefieldgenerator-index.html I wonder if this is related.

@nyalldawson
Copy link
Collaborator

https://doc.qt.io/qt-5/qtdistancefieldgenerator-index.html I wonder if this is related.

That's a different beast. For a start it's using some other format (not pbf), and it's also for QML based rendering only (which QGIS doesn't use -- it uses QPainter)

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 16, 2022
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
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 16, 2022
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
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 20, 2022
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
nyalldawson added a commit that referenced this issue Jun 20, 2022
This is an alternative approach to solving #46588, where we avoid the
issues which arise from trying to render vector tile PBF fonts.

Refs #46588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants