xref: /aosp_15_r20/external/cronet/third_party/rust/chromium_crates_io/vendor/skrifa-0.15.5/src/lib.rs (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 //! A robust, ergonomic, high performance crate for OpenType fonts.
2 //!
3 //! Skrifa is a mid level library that provides access to various types
4 //! of [`metadata`](MetadataProvider) contained in a font as well as support
5 //! for loading glyph [`outlines`](outline).
6 //!
7 //! It is described as "mid level" because the library is designed to sit
8 //! above low level font parsing (provided by [`read-fonts`](https://crates.io/crates/read-fonts))
9 //! and below a higher level text layout engine.
10 //!
11 //! See the [readme](https://github.com/googlefonts/fontations/blob/main/skrifa/README.md)
12 //! for additional details.
13 
14 /// Expose our "raw" underlying parser crate.
15 pub extern crate read_fonts as raw;
16 
17 pub mod attribute;
18 pub mod charmap;
19 pub mod color;
20 pub mod font;
21 pub mod instance;
22 pub mod metrics;
23 pub mod outline;
24 #[doc(hidden)]
25 pub mod scale;
26 pub mod setting;
27 pub mod string;
28 
29 mod provider;
30 mod small_array;
31 mod variation;
32 
33 #[doc(inline)]
34 pub use outline::{OutlineGlyph, OutlineGlyphCollection};
35 pub use variation::{Axis, AxisCollection, NamedInstance, NamedInstanceCollection};
36 
37 /// Useful collection of common types suitable for glob importing.
38 pub mod prelude {
39     #[doc(no_inline)]
40     pub use super::{
41         font::{FontRef, UniqueId},
42         instance::{LocationRef, NormalizedCoord, Size},
43         GlyphId, MetadataProvider, Tag,
44     };
45 }
46 
47 pub use read_fonts::{
48     types::{GlyphId, Tag},
49     FontRef,
50 };
51 
52 #[doc(inline)]
53 pub use provider::MetadataProvider;
54 
55 /// Limit for recursion when loading TrueType composite glyphs.
56 const GLYF_COMPOSITE_RECURSION_LIMIT: usize = 32;
57