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

Text rendering #36

Open
FabianWildgrube opened this issue Apr 24, 2022 · 8 comments
Open

Text rendering #36

FabianWildgrube opened this issue Apr 24, 2022 · 8 comments
Assignees
Labels
feature-request Request for a new feature

Comments

@FabianWildgrube
Copy link
Collaborator

We need to add support for rendering arbitrary text (labels, street names, etc.). An ideal solution would have the following properties:

  • Supports all languages (obvious -> we show a map of the entire world)
  • Renders completely on the GPU as part of the map (otherwise we defeat the purpose of this project: truly cross-platform maps)
  • Renders nicely at arbitrary font sizes
  • Renders correctly with regards to arbitrary 3-d transformations
  • Supports styling (i.e. color, different fonts, etc.)

This poses numerous challenges and likely no solution exists that fulfils all of these criteria. But since this is a clean-slate project we might as well try 🤷 😉

@FabianWildgrube
Copy link
Collaborator Author

First tests added, see PR #35

@nyurik
Copy link
Member

nyurik commented Apr 25, 2022

Hi @FabianWildgrube, thx for working on this! One minor thing -- please don't create new branches in the maplibre/maplibre-rs -- it is better to create new branches in your own FabianWildgrube/maplibre-rs repo, and create PRs against the main one. Thx!

@FabianWildgrube
Copy link
Collaborator Author

Oh I see. Sorry about that! I'll close the PR and delete the branch here and open a new PR from my fork instead 👍

@FabianWildgrube
Copy link
Collaborator Author

New draft PR from my Fork is open: #40

@nyurik
Copy link
Member

nyurik commented Apr 25, 2022

Thanks @FabianWildgrube :)

@maxammann maxammann added the feature-request Request for a new feature label Apr 26, 2022
@DerKarlos
Copy link

@maxammann In your Publication [maplibre-rs: toward portable map renderers], the table includes this Rust project:
https://github.com/dfyz/osm-renderer
It solves text rendering, but not in the GPU, as far as I see.
(It renders nice, may be, some solutions could help maplibre-rs)

@maxammann
Copy link
Collaborator

@maxammann In your Publication [maplibre-rs: toward portable map renderers], the table includes this Rust project: https://github.com/dfyz/osm-renderer It solves text rendering, but not in the GPU, as far as I see. (It renders nice, may be, some solutions could help maplibre-rs)

Definitely interesting project, indeed! The challenge of text rendering is quite different though when rasterizing on the CPU instead of the GPU. The other interesting challenge is text rendering is text shaping (text rendering = glyph rendering + text shaping).

It seems like a naive text shaping is used though: https://github.com/dfyz/osm-renderer/blob/bf95b10885ef09d99b251e243fa2d17b0c693e96/src/draw/font/text_placer.rs

@maxammann
Copy link
Collaborator

Here is some comparision between libraries used in bevy: https://hackmd.io/-0nNajS9QaGNu9FWg41ziA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants