mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.38k stars 1.32k forks source link

LocalGlyphRasterizer does not accept font-per-writing script #15659

Open dstrebe-tableau opened 5 years ago

dstrebe-tableau commented 5 years ago

Platform: Mapbox SDK version:

This is a whitebox bug report. The conditions to reproduce the bug are complicated and require particular font configurations on the host desktop. The bug expresses as placename text being rendered via fallback fonts, often with two or more fonts per placename, giving an erratic appearance.

LocalGlyphRasterizer permits a single font face to be designated for rendering locally. A single font is insufficient; Windows and Linux have no font normally installed that adequately handles the CCJK suite of glyphs properly, and even when it can render the glyph, the rendering can be wrong for the locale.

In order to render reasonably, the API needs to accept a writing script and locale per render context, and pick a local font based on that. See Tableau branch for current fix in play.

Another benefit of this kind of fix is that fallback font selection can be made consistent from glyph to glyph even if the preferred font is not available. In order to enable this benefit, the code needs to stop treating the UTF-16 character code as an indicator of language.

stale[bot] commented 4 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.