1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! Font selection and loading
//!
//! Fonts are managed by the [`FontLibrary`], of which a static singleton
//! exists and can be accessed via [`library()`].
//!
//! ### Font sizes
//!
//! Typically, font sizes are specified in "Points". Several other units and
//! measures come into play here. Lets start with those dating back to the
//! early printing press:
//!
//! - 1 *Point* = 1/72 inch (~0.35mm), by the usual DTP standard
//! - 1 *Em* is the width of a capital `M` (inclusive of margin) in a font
//! - The *point size* of a font refers to the number of *points* per *em*
//! in this font
//!
//! Thus, with a "12 point font", one 'M' occupies 12/72 of an inch on paper.
//!
//! In digital typography, one must translate to/from pixel sizes. Here we have:
//!
//! - DPI (Dots Per Inch) is the number of pixels per inch
//! - A *scale factor* is a measure of the number of pixels relative to a
//! standard DPI, usually 96
//!
//! We introduce two measures used by this library:
//!
//! - DPP (Dots Per Point): `dpp = dpi / 72 = scale_factor × (96 / 72)`
//! - DPEM (Dots Per Em): `dpem = point_size × dpp`
//!
//! Warning: on MacOS and Apple systems, a *point* sometimes refers to a
//! (virtual) pixel, yielding `dpp = 1` (or `dpp = 2` on Retina screens, or
//! something else entirely on iPhones). On any system, DPI/DPP/scale factor
//! values may be set according to the user's taste rather than physical
//! measurements.
//!
//! Finally, note that digital font files have an internally defined unit
//! known as the *font unit*. We introduce one final unit:
//!
//! - [`crate::DPU`]: pixels per font unit
use crateGlyphId;
pub use ;
pub use ;
pub use GenericFamily;
pub use ;
pub use *;