makepad_rustybuzz/
lib.rs

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 fallback;
21mod glyph_set;
22mod normalize;
23mod shape;
24mod plan;
25mod face;
26mod tag;
27mod tag_table;
28mod text_parser;
29mod unicode;
30mod unicode_norm;
31mod complex;
32mod ot;
33pub use makepad_ttf_parser as ttf_parser;
34
35pub use crate::ttf_parser::Tag;
36
37pub use crate::buffer::{
38    GlyphPosition, GlyphInfo, BufferClusterLevel,
39    SerializeFlags, UnicodeBuffer, GlyphBuffer
40};
41pub use crate::common::{Direction, Script, Language, Feature, Variation, script};
42pub use crate::face::Face;
43pub use crate::shape::shape;
44
45type Mask = u32;
46
47fn round(x: f32) -> f32 {
48    #[cfg(feature = "std")]
49    {
50        x.round()
51    }
52    #[cfg(not(feature = "std"))]
53    {
54        libm::roundf(x)
55    }
56}