pub struct TypgFontFaceMeta {
pub names: Vec<String>,
pub axis_tags: Vec<Tag>,
pub feature_tags: Vec<Tag>,
pub script_tags: Vec<Tag>,
pub table_tags: Vec<Tag>,
pub codepoints: Vec<char>,
pub is_variable: bool,
pub weight_class: Option<u16>,
pub width_class: Option<u16>,
pub family_class: Option<(u8, u8)>,
pub creator_names: Vec<String>,
pub license_names: Vec<String>,
}Expand description
Everything we know about a single font face, extracted from its binary tables.
One font file may contain multiple faces (in a TTC/OTC collection), and
each face gets its own TypgFontFaceMeta. This struct is the unit of
comparison — every query filter is evaluated against one of these.
All tag vectors are sorted and deduplicated after extraction, so you can safely use set-intersection logic against them.
Fields§
§names: Vec<String>Human-readable names for this font face.
Collected from the font’s name table: family name (“Helvetica”),
typographic family name (“Helvetica Neue”), full name (“Helvetica Neue
Bold”), PostScript name (“HelveticaNeue-Bold”), and subfamily
(“Bold”). The file stem (e.g., “HelveticaNeue-Bold” from the filename)
is always appended as a fallback, because some fonts have empty or
broken name tables.
Sorted, deduplicated, trimmed of whitespace.
Variation axis tags. Empty for static (non-variable) fonts.
Common axes: wght (weight: 100=Thin, 400=Regular, 700=Bold, 900=Black),
wdth (width: 75=Condensed, 100=Normal, 125=Expanded),
opsz (optical size: adjusts stroke contrast for small/large rendering),
ital (italic: 0=Upright, 1=Italic),
slnt (slant: oblique angle in degrees).
Read from the font’s fvar (font variations) table.
OpenType layout feature tags from GSUB and GPOS tables.
These control typographic behavior: liga (standard ligatures — fi, fl
become single glyphs), smcp (small capitals), onum (oldstyle
numerals), kern (kerning — fine-tuned spacing between specific letter
pairs), calt (contextual alternates), dlig (discretionary ligatures).
GSUB features handle glyph substitution (replacing one glyph with another). GPOS features handle glyph positioning (adjusting placement). Both are merged here because the query doesn’t distinguish them.
Script tags declaring which writing systems this font supports.
Read from GSUB and GPOS script lists. Common values: latn (Latin),
arab (Arabic), cyrl (Cyrillic), grek (Greek), hani (CJK
ideographs), deva (Devanagari), thai (Thai).
A font can render characters from a script’s Unicode range without declaring script support here — the script tag means the font has shaping rules (substitutions, positioning) specifically for that writing system.
Every top-level table present in the font file.
Useful for structural queries: does this font have CFF (PostScript
outlines) or glyf (TrueType outlines)? Does it have SVG (color
SVG glyphs) or COLR (color layer glyphs)? Does it have fvar
(variable font axes)?
Read directly from the font’s table directory — the index at the start of every OpenType file.
codepoints: Vec<char>Unicode codepoints this font can render, from its cmap table.
The cmap (character map) is the font’s promise: “give me this
Unicode codepoint, I’ll give you a glyph.” If U+00F1 (ñ) is in
this list, the font has a glyph for it.
Sorted and deduplicated. Can be large — a CJK font may cover 20,000+ codepoints.
is_variable: boolWhether this font has an fvar table, making it a variable font.
Variable fonts contain continuous design axes (weight, width, etc.) instead of discrete named instances. A single variable font file can replace an entire family of static fonts.
weight_class: Option<u16>OS/2 usWeightClass value. Indicates visual weight on a 1–1000 scale.
Standard values: 100=Thin, 200=ExtraLight, 300=Light, 400=Regular,
500=Medium, 600=SemiBold, 700=Bold, 800=ExtraBold, 900=Black.
None if the font has no OS/2 table (rare in modern fonts).
width_class: Option<u16>OS/2 usWidthClass value. Indicates visual width on a 1–9 scale.
Values: 1=UltraCondensed, 2=ExtraCondensed, 3=Condensed,
4=SemiCondensed, 5=Normal, 6=SemiExpanded, 7=Expanded,
8=ExtraExpanded, 9=UltraExpanded.
None if the font has no OS/2 table.
family_class: Option<(u8, u8)>OS/2 sFamilyClass split into (major class, subclass).
The major class groups fonts by general style: 0=No classification, 1=Oldstyle Serifs, 2=Transitional Serifs, 3=Modern Serifs, 4=Clarendon Serifs, 5=Slab Serifs, 7=Freeform Serifs, 8=Sans Serif, 9=Ornamentals, 10=Scripts, 12=Symbolic.
The subclass provides finer detail within each major class. For example, within Sans Serif (8): 1=IBM Neo-Grotesque Gothic, 2=Humanist, 3=Low-x Round Geometric, etc.
None if the font has no OS/2 table.
creator_names: Vec<String>Creator and provenance strings from the font’s name table.
Includes: copyright notice (name ID 0), trademark (7), manufacturer (8), designer (9), description (10), vendor URL (11), designer URL (12), license description (13), license URL (14).
Useful for searching by foundry (“Adobe”), designer (“Matthew Carter”), or license type (“OFL”).
license_names: Vec<String>License-specific strings from the font’s name table.
A subset of creator info focused on licensing: copyright notice (name ID 0), license description (13), license info URL (14).
Useful for compliance checks: “show me all fonts with an SIL Open Font License” or “find fonts with no license URL.”
Trait Implementations§
Source§impl Clone for TypgFontFaceMeta
impl Clone for TypgFontFaceMeta
Source§fn clone(&self) -> TypgFontFaceMeta
fn clone(&self) -> TypgFontFaceMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TypgFontFaceMeta
impl Debug for TypgFontFaceMeta
Source§impl<'de> Deserialize<'de> for TypgFontFaceMeta
impl<'de> Deserialize<'de> for TypgFontFaceMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TypgFontFaceMeta
impl RefUnwindSafe for TypgFontFaceMeta
impl Send for TypgFontFaceMeta
impl Sync for TypgFontFaceMeta
impl Unpin for TypgFontFaceMeta
impl UnsafeUnpin for TypgFontFaceMeta
impl UnwindSafe for TypgFontFaceMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more