6 releases

0.3.1 Oct 6, 2024
0.3.0 Jan 7, 2023
0.2.2 Jan 6, 2023
0.2.1 Nov 27, 2022
0.1.1 Mar 24, 2022

#205 in Game dev

Download history 183/week @ 2024-07-20 184/week @ 2024-07-27 162/week @ 2024-08-03 221/week @ 2024-08-10 71/week @ 2024-08-17 38/week @ 2024-08-24 43/week @ 2024-08-31 41/week @ 2024-09-07 151/week @ 2024-09-14 228/week @ 2024-09-21 108/week @ 2024-09-28 278/week @ 2024-10-05 161/week @ 2024-10-12 93/week @ 2024-10-19 98/week @ 2024-10-26 84/week @ 2024-11-02

460 downloads per month
Used in wpp

MIT/Apache

96KB
1.5K SLoC

Meshtext

Crates.io docs.rs

Meshtext is a font triangulation tool for 3D scenes.

⚠️ Versions <= 0.3 of this crate focus on correctness and less on speed. ⚠️

The idea is to have a feature complete Proof-of-Concept first and then start optimizing.

Features

  • Generates indexed or non-indexed meshes
  • Automatically caches glyphs (also supports preloading)
  • Flat 2D text (in 3D space) or 3D text
  • Supports custom transformation of text sections

Limitations

  • Linebreaks and wrapping must be handled manually
  • Does not support bevels, because there is only one depth segment
  • There is no support for subscripts and superscripts

TODO

  • Add a 2D mesh generator where each vertex is composed of two coordinates
  • Implement an optimizer that removes redundant vertices and triangles
  • Add proper benchmarks
  • Optimize for speed
  • Evaluate no-std support

Caveats

It is not recommended to use the font included in the crate. It is only included for the purpose of testing and the character set has been limited, in order to keep the size of the crate small.

Cargo Features

Name Description
owned Uses owned_ttf_parser instead of ttf-parser so that the font resources do not need to have a static lifetime.

Attribution

  • Depends heavily on cdt for triangulation.
  • Uses ttf-parser for font loading.
  • Uses glam for performing basic linear algebra.

License

All code in this repository is dual-licensed under either:

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Screenshot

Meshtext Logo

Dependencies

~6MB
~175K SLoC