Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 //! API for loading, scaling, positioning and rasterizing OpenType font glyphs.
2 //!
3 //! # Example
4 //! ```
5 //! use ab_glyph::{point, Font, FontRef, Glyph};
6 //!
7 //! # fn main() -> Result<(), ab_glyph::InvalidFont> {
8 //! let font = FontRef::try_from_slice(include_bytes!("../../dev/fonts/Exo2-Light.otf"))?;
9 //!
10 //! // Get a glyph for 'q' with a scale & position.
11 //! let q_glyph: Glyph = font
12 //! .glyph_id('q')
13 //! .with_scale_and_position(24.0, point(100.0, 0.0));
14 //!
15 //! // Draw it.
16 //! if let Some(q) = font.outline_glyph(q_glyph) {
17 //! q.draw(|x, y, c| { /* draw pixel `(x, y)` with coverage: `c` */ });
18 //! }
19 //! # Ok(()) }
20 //! ```
21 #![warn(missing_debug_implementations)]
22 #![cfg_attr(not(feature = "std"), no_std)]
23
24 extern crate allocrust-analyzer cargo ab_glyph 0.2.32 alloc/;
25
26 mod codepoint_idsrust-analyzer cargo ab_glyph 0.2.32 codepoint_ids/;
27 mod errrust-analyzer cargo ab_glyph 0.2.32 err/;
28 mod fontrust-analyzer cargo ab_glyph 0.2.32 font/;
29 #[cfg(target_has_atomic = "ptr")]
30 mod font_arcrust-analyzer cargo ab_glyph 0.2.32 font_arc/;
31 mod glyphrust-analyzer cargo ab_glyph 0.2.32 glyph/;
32 #[cfg(all(feature = "libm", not(feature = "std")))]
33 mod nostd_float;
34 mod outlinedrust-analyzer cargo ab_glyph 0.2.32 outlined/;
35 mod scalerust-analyzer cargo ab_glyph 0.2.32 scale/;
36 mod ttfprust-analyzer cargo ab_glyph 0.2.32 ttfp/;
37 #[cfg(feature = "variable-fonts")]
38 mod variablerust-analyzer cargo ab_glyph 0.2.32 variable/;
39
40 #[cfg(target_has_atomic = "ptr")]
41 pub use craterust-analyzer cargo ab_glyph 0.2.32 crate/::font_arcrust-analyzer cargo ab_glyph 0.2.32 font_arc/::*;
42 #[allow(deprecated)]
43 pub use craterust-analyzer cargo ab_glyph 0.2.32 crate/::{
44 codepoint_idsrust-analyzer cargo ab_glyph 0.2.32 codepoint_ids/::*,
45 errrust-analyzer cargo ab_glyph 0.2.32 err/::*,
46 fontrust-analyzer cargo ab_glyph 0.2.32 font/::*,
47 glyphrust-analyzer cargo ab_glyph 0.2.32 glyph/::*,
48 outlinedrust-analyzer cargo ab_glyph 0.2.32 outlined/::*,
49 scalerust-analyzer cargo ab_glyph 0.2.32 scale/::*,
50 ttfprust-analyzer cargo ab_glyph 0.2.32 ttfp/::{FontRefrust-analyzer cargo ab_glyph 0.2.32 ttfp/FontRef#, FontVecrust-analyzer cargo ab_glyph 0.2.32 ttfp/FontVec#},
51 };
52 pub use ab_glyph_rasterizerrust-analyzer cargo ab_glyph_rasterizer 0.1.10 crate/::{pointrust-analyzer cargo ab_glyph_rasterizer 0.1.10 geometry/point()., Pointrust-analyzer cargo ab_glyph_rasterizer 0.1.10 geometry/Point#};
53 #[cfg(feature = "variable-fonts")]
54 pub use variablerust-analyzer cargo ab_glyph 0.2.32 variable/::*;