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.
A few fixes for layer text.
Text rendering
Text is rendered on there layer by using an ImGui context for each layer. A separate context is used in
MapWidget
to render tooltips and to ensure that all fonts are loaded.This works because MapLibre mostly renders layers from bottom to top. It does also use
GL_DEPTH_TEST
. ImGui's OpenGL backend explicitly disables this, so rendering is not perfect. In particular, the opaque layers of the map underlay are always rendered first, so putting a layer under this keeps the text on top of it. This is still much better than what we had before.OpenType
I added OpenType CFF fonts for ImGui. This seems to be the most common OpenType format. This should enable the usage of most fonts on Linux systems.
RFC's
MapWidget
toMapContext
in order forimgui_impl_qt
to work. I think this is mostly inevitable, but maybe it should be done in a different way. (I am mostly worried about race conditions when shutting down).