PistonDevelopers / graphics

A library for 2D graphics, written in Rust, that works with multiple back-ends
MIT License
479 stars 55 forks source link

Add a generic `GlyphCache` #1033

Closed bvssvni closed 7 years ago

bvssvni commented 8 years ago

Currently, the graphics back-ends implements their own GlyphCache.

Since this library depends on piston-texture, we could create a generic GlyphCache that worked for all CreateTexture.

bvssvni commented 8 years ago

This would require a dependency on the Freetype binding or RustType. Perhaps this should be a separate library?

mitchmindtree commented 8 years ago

Yeah nice, this sounds great. I'd be happy whether it was in this crate or its own (perhaps it could start in here and be moved out to its own if someone requests it?).

bvssvni commented 8 years ago

We only need a small interface for creating fonts, so perhaps we could add it as a trait?

On the other hand, if we use a separate library we could try different ones and let people choose which font library to use. Could put them in the same repo.

bvssvni commented 8 years ago

Some other ideas:

bvssvni commented 7 years ago

It would be nice to have a GlyphCache that supported multiple fonts.

Another use case is to extract cubic Bezier splines from a glyph and use it for effects.