1 | /*! |
2 | A 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" )))] |
9 | compile_error!("You have to activate either the `std` or the `libm` feature." ); |
10 | |
11 | #[cfg (feature = "std" )] |
12 | extern crate std; |
13 | |
14 | extern crate alloc; |
15 | |
16 | #[macro_use ] |
17 | mod buffer; |
18 | mod aat; |
19 | mod common; |
20 | mod complex; |
21 | mod face; |
22 | mod fallback; |
23 | mod glyph_set; |
24 | mod normalize; |
25 | mod ot; |
26 | mod plan; |
27 | mod shape; |
28 | mod tag; |
29 | mod tag_table; |
30 | mod text_parser; |
31 | mod unicode; |
32 | mod unicode_norm; |
33 | |
34 | pub use ttf_parser; |
35 | |
36 | pub use ttf_parser::Tag; |
37 | |
38 | pub use crate::buffer::{ |
39 | BufferClusterLevel, BufferFlags, GlyphBuffer, GlyphInfo, GlyphPosition, SerializeFlags, |
40 | UnicodeBuffer, |
41 | }; |
42 | pub use crate::common::{script, Direction, Feature, Language, Script, Variation}; |
43 | pub use crate::face::Face; |
44 | pub use crate::plan::ShapePlan; |
45 | pub use crate::shape::{shape, shape_with_plan}; |
46 | |
47 | type Mask = u32; |
48 | |
49 | fn 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 | |