You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the TextLayer only supports packing font atlas locally on the client side. Although the process is usually pretty fast (~6ms for the default ascii character set, ~60ms if sdf:true), there are also some limitations:
Auto packing relies on CSS font settings, which may silently fail if a web font is not yet loaded or fails to load. Additional steps are required to make it work in the documentation
We have observed significant platform-dependent variation when it comes to text rendering, including the handling of baseline position, antialiasing, etc. As of now, TextLayer render tests are disabled because we are unable to get it to work consistently across dev environments.
Proposal
Allow TextLayer to use a pre-packed font atlas.
Link to a tool in the documentation to generate and save a font atlas: prototype. A pre-packed font atlas is a JSON consisting:
source: the packed image as base64-encoded PNG
mapping: the character definitions
version: the deck.gl version used to generate the file
settings: the font settings used to generate the file
attribution: optional font licensing information
Add a new prop fontAtlas to TextLayer which points to a statically hosted font atlas. If this prop is supplied, the FontAtlasManager will skip packing and use information from the file instead.
The text was updated successfully, but these errors were encountered:
default fonts - it is great that fonts can be generated in advance by users, however it is a somewhat messy step to integrate into an application build workflow. Can we find some fonts whose atlases we can host without getting into license troubles)
separate font module (@deck.gl/fonts) or (@luma.gl/fonts) - the fonts functionality getting quite extensive (and overwhelming for someone just looking at the text layer). I feel that the font generation is a great candidate for breaking into a separate module, with a small clean general purpose interface. I think it could even go into luma.gl as it would not need to have any deck dependencies, but even in deck.gl it would make sense to be able to work this functionality separately.
Also, I suspect that there is extensive prior art, perhaps some projects have formats that could be supported?
Target Use Case
Currently, the TextLayer only supports packing font atlas locally on the client side. Although the process is usually pretty fast (~6ms for the default ascii character set, ~60ms if
sdf:true
), there are also some limitations:Proposal
Allow TextLayer to use a pre-packed font atlas.
source
: the packed image as base64-encoded PNGmapping
: the character definitionsversion
: the deck.gl version used to generate the filesettings
: the font settings used to generate the fileattribution
: optional font licensing informationfontAtlas
toTextLayer
which points to a statically hosted font atlas. If this prop is supplied, the FontAtlasManager will skip packing and use information from the file instead.The text was updated successfully, but these errors were encountered: