4 releases
0.1.3 | Apr 11, 2020 |
---|---|
0.1.2 | Apr 5, 2020 |
0.1.1 | Apr 5, 2020 |
0.1.0 | Apr 4, 2020 |
#16 in #rendered
233 downloads per month
Used in quicksilver
395KB
326 lines
elefont
A library that handles caching rendered glyphs on the GPU
Elefont is a simple caching layer for a font rendering stack, which abstracts over both the font provider and the output format. It's intended for use mostly in games, but could serve in other applications as well.
Scope of this library:
- DO support various font libraries / types of fonts (TTFs, bitmap fonts)
- DO support whatever backend (rendering to an image, GPU frameworks, etc.)
- DON'T handle complex tasks like shaping. The font stack should handle that elsewhere, and provide this library the glyphs to render
- DON'T handle layout. This can be taken care of by the client application when rendering.
Support is available out-of-the-box for software rendering via image
, rendering via
rusttype
, and performing automatic unicode normalization. All of these are optional features.
lib.rs
:
A library that handles caching rendered glyphs on the GPU
This fits as a layer in your rendering pipeline between font rasterization and shaping and text rendering. In other words, first you turn a string into a series of font glyphs. Each of those glyphs is looked up against the cache, and if it hasn't been rendered, it is turned into a bitmap and uploaded to the GPU. The string is then laid out and rendered by the client application.
Scope of this library:
- DO support various font libraries / types of fonts (TTFs, bitmap fonts)
- DO support whatever backend (rendering to an image, GPU frameworks, etc.)
- DON'T handle complex tasks like shaping. The font stack should handle that elsewhere, and provide this library the glyphs to render
- DON'T handle layout. This can be taken care of by the client application when rendering.
Support is available out-of-the-box for software rendering via image
, rendering via
rusttype
, and performing automatic unicode normalization. All of these are optional features.
Dependencies
~1–1.4MB
~30K SLoC