pub struct InstanceBuilder {
font: SharedFont,
coords: SmallVec<[NormalizedCoord; 12]>,
type1_blend: SmallVec<[Fixed; 4]>,
}Expand description
Builder for configuring a font instance.
Fields§
§font: SharedFont§coords: SmallVec<[NormalizedCoord; 12]>§type1_blend: SmallVec<[Fixed; 4]>The blend coordinates of a Type 1 multiple master location, which
coords holds rounded to 2.14. The weights are computed from these.
Implementations§
Source§impl InstanceBuilder
impl InstanceBuilder
Sourcepub fn variations<V>(self, variations: V) -> Self
pub fn variations<V>(self, variations: V) -> Self
Sets the variations for the font instance from an unordered sequence of variations in user space.
Omitted axes will be set to their default values. Unsupported axes are ignored. If an axis is specified multiple times, the last value is used.
This will overwrite any previous variation settings.
Sourcepub fn normalized_coords(
self,
coords: impl IntoIterator<Item = NormalizedCoord>,
) -> Self
pub fn normalized_coords( self, coords: impl IntoIterator<Item = NormalizedCoord>, ) -> Self
Sets the variations for the font instance from an ordered sequence of normalized coordinates.
If the number of provided coordinates is less than the number of axes, the remaining axes will be set to their default values. If the number of provided coordinates is greater than the number of axes, the extra coordinates will be ignored.
This will overwrite any previous variation settings.
Sourcepub fn named_instance(self, index: u32) -> Self
pub fn named_instance(self, index: u32) -> Self
Sets the variations for the font instance from a named instance.
If the given named instance index is invalid, then variation settings will be reset to default.
This will overwrite any previous variation settings.
Sourcepub fn named_instance_with_overrides<V>(self, index: u32, overrides: V) -> Self
pub fn named_instance_with_overrides<V>(self, index: u32, overrides: V) -> Self
Sets the variations for the font instance from a named instance, with additional overrides.
If the given named instance index is invalid, then it is ignored and only overrides are applied.
This will overwrite any previous variation settings.
Source§impl InstanceBuilder
impl InstanceBuilder
fn set_variations<V>(&mut self, variations: V)
fn set_coords(&mut self, coords: impl IntoIterator<Item = NormalizedCoord>)
Sourcefn set_type1_blend(&mut self, blend: SmallVec<[Fixed; 4]>)
fn set_type1_blend(&mut self, blend: SmallVec<[Fixed; 4]>)
Sets the location of a Type 1 multiple master font.
Every blend is kept, even all zeros, which is a master rather than the font’s default.
The weights are computed from blend itself. The coordinates are
those the weights give back, which rounding in the weights can move
from blend by the smallest step, as FreeType reports them.