galileo icon indicating copy to clipboard operation
galileo copied to clipboard

Text rendering

Open Maximkaaa opened this issue 1 year ago • 14 comments

To support labels on the map, we need a mechanism to render shaped text onto the map. This includes:

  • [ ] Gliph rendering
    • [ ] Raster fonts decoding and building glyph map textures
    • [ ] Vector fonts tessellating
  • [ ] Text shaping - at this point we only need single-line shaping
  • [ ] Text measuring

Rendering a text along a path would be desirable, but we can do it separately later.

At the first glance, https://github.com/grovesNL/glyphon library can cover all our needs. iced uses it for text shaping, so it must be mature enough to support our use cases.

We would also need test cases for complex cases:

  • RTL, vertical (?)
  • Arabic, hindu scripts
  • Devanagari scripts (see https://github.com/maplibre/maplibre-gl-js/issues/50 )

Must have options for initial implemenation:

  • text size
  • text style (bold, italic, underline)
  • vertical and horizontal alignment
  • offset

Maximkaaa avatar Feb 10 '24 08:02 Maximkaaa