1/*!
2A complete [harfbuzz](https://github.com/harfbuzz/harfbuzz) shaping algorithm port to Rust.
3*/
4
5#![no_std]
6#![warn(missing_docs)]
7
8#[cfg(not(any(feature = "std", feature = "libm")))]
9compile_error!("You have to activate either the `std` or the `libm` feature.");
10
11#[cfg(feature = "std")]
12extern crate std;
13
14extern crate alloc;
15
16#[macro_use]
17mod buffer;
18mod aat;
19mod common;
20mod complex;
21mod face;
22mod fallback;
23mod glyph_set;
24mod normalize;
25mod ot;
26mod plan;
27mod shape;
28mod tag;
29mod tag_table;
30mod text_parser;
31mod unicode;
32mod unicode_norm;
33
34pub use ttf_parser;
35
36pub use ttf_parser::Tag;
37
38pub use crate::buffer::{
39 BufferClusterLevel, BufferFlags, GlyphBuffer, GlyphInfo, GlyphPosition, SerializeFlags,
40 UnicodeBuffer,
41};
42pub use crate::common::{script, Direction, Feature, Language, Script, Variation};
43pub use crate::face::Face;
44pub use crate::plan::ShapePlan;
45pub use crate::shape::{shape, shape_with_plan};
46
47type Mask = u32;
48
49fn round(x: f32) -> f32 {
50 #[cfg(feature = "std")]
51 {
52 x.round()
53 }
54 #[cfg(not(feature = "std"))]
55 {
56 libm::roundf(x)
57 }
58}
59