Oregami
Repositories/oxedyne/fe2o3

oxedyne/fe2o3/fe2o3_font/src/lib.rs

1.2 KiB, 12 runs

created by r1870400018:35698, which is this file's identity for as long as the history lasts, whatever it is later renamed to

download · who wrote it · its history

1//! The font layer: parse a font file, shape a string, measure it, and draw a glyph's outline.
2//!
3//! Extracted from Kiln. Shaping is handed to `harfrust` and glyph outlines to `skrifa`; everything
4//! either hands back is turned into this crate's own types at once, so the rest of the stack never
5//! sees them and either could be replaced without a line changing outside this crate.
6//!
7//! # A font is a chain, not a file
8//!
9//! No typeface holds every character: a face chosen for how it reads lacks the arrows, the summation
10//! signs and the Arabic that a face chosen for coverage carries, and asking one file to be both gives
11//! a page of tofu or a page that reads like a fallback. So a [`Font`](crate::font::Font) here is not a
12//! file but a chain of [`Face`](crate::face::Face)s, the first that can draw a character drawing it,
13//! as a browser does. The head of the chain can then be chosen purely for how it reads -- the chain
14//! behind it means a change of face never costs coverage -- and each [`Glyph`](crate::shape::Glyph)
15//! remembers which face drew it, so the caller still asks for a role and gets a run back.
16
17pub mod face;
18pub mod font;
19pub mod prelude;
20pub mod set;
21pub mod shape;