meshtext/
lib.rs

1#![doc(html_favicon_url = "https://raw.githubusercontent.com/FrankenApps/meshtext/master/logo.png")]
2#![doc(html_logo_url = "https://raw.githubusercontent.com/FrankenApps/meshtext/master/logo.png")]
3//! Generate 2D or 3D triangle meshes from text.
4//!
5//! Generate vertices or indices and vertices for a
6//! [vertex-vertex mesh](https://en.wikipedia.org/wiki/Polygon_mesh#Vertex-vertex_meshes).
7//!
8//! - Supports [TrueType](https://docs.microsoft.com/en-us/typography/truetype/),
9//!   [OpenType](https://docs.microsoft.com/en-us/typography/opentype/spec/)
10//!   and [AAT](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6AATIntro.html)
11//!   fonts
12//! - Handles caching of characters that were already triangulated
13//! - Allows transforming text sections
14//! - Fully customizable to easily integrate in your rendering pipeline
15
16/// Contains the various errors that may occur
17/// while using this crate.
18pub mod error;
19
20// Re-export the faces.
21#[cfg(feature = "owned")]
22pub use owned_ttf_parser::OwnedFace;
23#[cfg(not(feature = "owned"))]
24pub use ttf_parser::Face;
25
26mod mesh_generator;
27pub use mesh_generator::MeshGenerator;
28
29mod types {
30    mod bounding_box;
31    pub use bounding_box::BoundingBox;
32
33    mod cache_type;
34    pub use cache_type::CacheType;
35
36    mod glyph_outline;
37    pub(crate) use glyph_outline::GlyphOutline;
38
39    mod indexed_mesh_text;
40    pub use indexed_mesh_text::*;
41
42    mod mesh_text;
43    pub use mesh_text::*;
44
45    mod quality_settings;
46    pub use quality_settings::QualitySettings;
47
48    mod traits {
49        mod font_face;
50        pub(crate) use font_face::*;
51
52        mod glyph;
53        pub use glyph::*;
54
55        mod triangle_mesh;
56        pub use triangle_mesh::*;
57
58        mod text_section;
59        pub use text_section::*;
60    }
61    pub use traits::*;
62}
63pub use types::*;
64
65pub(crate) mod util {
66    mod glam_conversions;
67    pub(crate) use glam_conversions::*;
68
69    mod mesh_to_flat_2d;
70    pub(crate) use mesh_to_flat_2d::*;
71
72    mod outline_builder;
73    pub(crate) use outline_builder::GlyphOutlineBuilder;
74
75    mod raster_to_mesh;
76    pub(crate) use raster_to_mesh::*;
77
78    mod text_mesh;
79    pub(crate) use text_mesh::*;
80
81    mod triangulation;
82    pub(crate) use triangulation::*;
83}