Skip to main content

StaticMetadata

Struct StaticMetadata 

Source
pub struct StaticMetadata {
Show 13 fields pub units_per_em: u16, pub all_source_axes: Axes, pub axes: Axes, pub named_instances: Vec<NamedInstance>, pub variation_model: VariationModel, pub number_values: HashMap<NormalizedLocation, BTreeMap<SmolStr, OrderedFloat<f64>>>, pub names: HashMap<NameKey, String>, pub postscript_names: Option<PostscriptNames>, pub italic_angle: OrderedFloat<f64>, pub build_vertical: bool, pub misc: MiscMetadata, pub gdef_categories: GdefCategories, pub variations: Option<VariableFeature>, /* private fields */
}
Expand description

Global font info that cannot vary across the design space.

For example, upem, axis definitions, etc, as distinct from metadata that varies across design space such as ascender/descender.

Fields§

§units_per_em: u16§all_source_axes: Axes

Every axis used by the font being compiled, including point axes.

This is relatively rarely what you want.

§axes: Axes

Every variable (non-point) axis used by the font being compiled.

If empty this is a static font.

§named_instances: Vec<NamedInstance>

Named locations in variation space

§variation_model: VariationModel

A model of how variation space is split into regions that have deltas.

This copy includes all locations used in the entire font. That is, every location any glyph has an instance. Use of a location not in the global model is an error. This model enforces the no delta at the default location constraint used in things like gvar.

§number_values: HashMap<NormalizedLocation, BTreeMap<SmolStr, OrderedFloat<f64>>>

Glyphsapp only; named numbers defined per-master

§names: HashMap<NameKey, String>§postscript_names: Option<PostscriptNames>§italic_angle: OrderedFloat<f64>

Italic angle in counter-clockwise degrees from the vertical. Zero for upright fonts, negative for right-leaning fonts. See https://learn.microsoft.com/en-us/typography/opentype/spec/post.

§build_vertical: bool

Records whether this font contains sufficient non-default vertical data to warrant building a vhea and vmtx table. (The criteria for Glyphs and UFO sources is different.)

§misc: MiscMetadata

Miscellaneous font-wide data that didn’t seem worthy of top billing

§gdef_categories: GdefCategories§variations: Option<VariableFeature>

Feature variation rules

Implementations§

Source§

impl StaticMetadata

Source

pub fn new( units_per_em: u16, names: HashMap<NameKey, String>, axes: Vec<Axis>, named_instances: Vec<NamedInstance>, global_locations: HashSet<NormalizedLocation>, postscript_names: Option<PostscriptNames>, italic_angle: f64, gdef_categories: GdefCategories, glyphsapp_number_values: Option<HashMap<NormalizedLocation, BTreeMap<SmolStr, OrderedFloat<f64>>>>, build_vertical: bool, ) -> Result<StaticMetadata, VariationModelError>

Source

pub fn default_location(&self) -> &NormalizedLocation

The default on all variable axes.

Source

pub fn axis(&self, tag: &Tag) -> Option<&Axis>

Source

pub fn reverse_names(&self) -> HashMap<&str, BTreeSet<NameId>>

Calculate a mapping of existing name text to the sorted set of name ID(s) that provide it.

Trait Implementations§

Source§

impl Clone for StaticMetadata

Source§

fn clone(&self) -> StaticMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StaticMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StaticMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for StaticMetadata

Source§

impl PartialEq for StaticMetadata

Source§

fn eq(&self, other: &StaticMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Persistable for StaticMetadata

Source§

fn read(from: &mut dyn Read) -> Self

Source§

fn write(&self, to: &mut dyn Write)

Source§

impl Serialize for StaticMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StaticMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.