Skip to main content

mln_engine/text/
mod.rs

1//! Text shaping and glyphs.
2//!
3//! Font faces shape with HarfRust and draw their glyphs from skrifa's
4//! hinted outlines. `shaper.rs` says where HarfRust's shaping differs from
5//! the C++ core's HarfBuzz. Arabic text drawn with glyph PBFs takes
6//! presentation forms instead (`arabic.rs`).
7//!
8//! Glyph requests (`glyph_store`), the font-face engine
9//! ([`font_face_engine`]) and the device's fonts ([`system_fonts`], with the
10//! `system-fonts` feature) are the engine's own.
11
12mod arabic;
13#[rustfmt::skip]
14mod arabic_tables;
15pub mod atlas;
16mod bidi;
17#[rustfmt::skip]
18mod bidi_mirroring;
19#[cfg(target_family = "wasm")]
20pub mod browser_glyph_rasterizer;
21pub mod constants;
22mod face;
23pub mod font_face_engine;
24#[cfg(any(feature = "system-fonts", target_family = "wasm"))]
25pub(crate) mod font_name;
26pub(crate) mod font_stack;
27pub mod glyph;
28pub(crate) mod glyph_cache;
29pub mod glyph_pbf;
30pub(crate) mod glyph_store;
31mod line_breaks;
32pub mod local_fonts;
33mod rasterize;
34mod shaper;
35pub mod shaping;
36#[cfg(test)]
37mod shaping_test;
38#[cfg(feature = "system-fonts")]
39pub mod system_fonts;
40pub mod tagged_string;
41pub mod tiny_sdf;
42pub(crate) mod weight;
43mod woff;
44
45pub use arabic::shape_arabic;
46pub use bidi::{BiDiRun, starts_right_to_left, visual_runs};
47#[cfg(all(feature = "system-fonts", not(target_family = "wasm")))]
48pub(crate) use face::FontFile;
49pub use glyph::{
50    Bounds, Glyph, GlyphID, GlyphIDType, GlyphMap, GlyphMetrics, GlyphPosition, GlyphPositions, GlyphRange,
51    PositionedGlyph, PositionedLine, ShapeResults, Shaping,
52};
53pub use glyph_cache::GlyphCache;
54pub use shaper::{GlyphAdjust, ShapedText, Shaper};
55pub use shaping::{PositionedIcon, ShapingOptions, anchor_alignment, anchor_justification, shape_text};
56pub use tagged_string::{SectionOptions, TaggedString};
57
58#[cfg(test)]
59mod tests;