Re-visit choice of font library #16

Open
opened 2022-02-20 16:41:51 +00:00 by glfmn · 4 comments
glfmn commented 2022-02-20 16:41:51 +00:00 (Migrated from github.com)

There are alternatives to rusttype such as ab_glyph and fontdue and msdfgen. Compare them to each-other to see which one might be best to use for immediate mode.

There are alternatives to `rusttype` such as `ab_glyph` and `fontdue` and [`msdfgen`](https://crates.io/crates/msdfgen). Compare them to each-other to see which one might be best to use for immediate mode.
glfmn commented 2022-08-13 18:11:48 +00:00 (Migrated from github.com)

Another possibility is to use glyph-brush, or part of it, to integrate font-atlas functionality.

Another possibility is to use [`glyph-brush`](https://github.com/alexheretic/glyph-brush), or part of it, to integrate font-atlas functionality.
glfmn commented 2022-08-13 18:23:13 +00:00 (Migrated from github.com)

glyph_brush_draw_cache Seems to be a promising replacement for my currently lackluster font atlas, and has features I was hoping to support, like queuing glyphs to be rasterized later in frame. I may also consider adopting glyph_brush_layout in the future to support better text layout.

Update:
Upon further investigation, glyphs that are cached cannot be allocated in the texture separately from being rasterized; they are queued for rasterization when they are looked up and not found in the cache. I was hoping for behavior where the glyphs are allocated into the texture upon lookup if it isn't cached, and then rasterization happens at the end of frame.

[`glyph_brush_draw_cache`] Seems to be a promising replacement for my currently lackluster font atlas, and has features I was hoping to support, like queuing glyphs to be rasterized later in frame. I may also consider adopting [`glyph_brush_layout`] in the future to support better text layout. Update: Upon further investigation, glyphs that are cached cannot be allocated in the texture separately from being rasterized; they are queued for rasterization when they are looked up and not found in the cache. I was hoping for behavior where the glyphs are allocated into the texture upon lookup if it isn't cached, and then rasterization happens at the end of frame. [`glyph_brush_draw_cache`]: https://github.com/alexheretic/glyph-brush/tree/master/draw-cache [`glyph_brush_layout`]: https://github.com/alexheretic/glyph-brush/tree/master/layout
glfmn commented 2022-10-06 18:28:41 +00:00 (Migrated from github.com)

I have settled on:

I have settled on: - [fontdb](https://crates.io/crates/fontdb) to store font data and support multiple fonts - [ttf_parser](https://crates.io/crates/ttf-parser) for font parsing - [msdfgen_rs](https://crates.io/crates/msdfgen) for rasterizing - [guillotiere](https://crates.io/crates/guillotiere) to implement texture packing in the glyph texture atlas
glfmn commented 2022-10-10 00:07:25 +00:00 (Migrated from github.com)

It could be fun to add rich-text like functionality through ANSI escape codes

It could be fun to add rich-text like functionality through [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
Sign in to join this conversation.
No description provided.