Skip to main content

GenerateWebfontsFromSourcesOptions

Struct GenerateWebfontsFromSourcesOptions 

Source
pub struct GenerateWebfontsFromSourcesOptions {
Show 36 fields pub cache: Option<Vec<u8>>, pub fallback_ts: Option<i64>, pub sources: Vec<SvgSource>, pub variants: Option<Vec<SourceFontVariant>>, pub css_template: Option<String>, pub html_template: Option<String>, pub color_glyphs: Option<ColorGlyphSelection>, pub color_slots: Option<HashMap<String, String>>, pub ascent: Option<f64>, pub center_horizontally: Option<bool>, pub center_vertically: Option<bool>, pub css: Option<bool>, pub codepoints: Option<HashMap<String, u32>>, pub css_fonts_url: Option<String>, pub descent: Option<f64>, pub fixed_width: Option<bool>, pub format_options: Option<FormatOptions>, pub html: Option<bool>, pub ts: Option<bool>, pub incremental: Option<bool>, pub font_height: Option<f64>, pub font_name: Option<String>, pub font_style: Option<String>, pub font_weight: Option<String>, pub ligature: Option<bool>, pub missing_glyphs: Option<MissingGlyphOptions>, pub normalize: Option<bool>, pub order: Option<Vec<FontType>>, pub optimize_output: Option<bool>, pub preserve_aspect_ratio: Option<bool>, pub round: Option<f64>, pub start_codepoint: Option<u32>, pub template_options: Option<Map<String, Value>>, pub threads: Option<NonZeroUsize>, pub types: Option<Vec<FontType>>, pub variant_class_prefix: Option<String>,
}
Expand description

Filesystem-free generation settings. Defaults match the file API’s GenerateWebfontsOptions. Templates are text (Some("") renders empty), not paths. No output is written. Deserializes camelCase fields, rejecting unknown fields and defaulting omitted settings.

Fields§

§cache: Option<Vec<u8>>

Enable the persistent cache with bytes from an earlier result’s cache_bytes, or an empty vector to start cold. Unchanged icons skip parsing and processing, and unchanged formats are reused. Output is byte-identical to an uncached run. Bytes from another engine version or other settings are ignored. Not deserialized: pass binary data directly.

§fallback_ts: Option<i64>

TTF head timestamp used when formatOptions.ttf.ts is unset, for environments without a system clock (WebAssembly). Unlike ts it isn’t part of cache keys, so cached fonts keep the timestamp of the run that created them. Not deserialized.

§sources: Vec<SvgSource>

Ordered sources for ordinary generation; empty when variants is supplied.

§variants: Option<Vec<SourceFontVariant>>

Ordered variant designs, using the same font encoders as file generation.

§css_template: Option<String>

Optional CSS Handlebars source; compiled on first CSS render.

§html_template: Option<String>

Optional HTML Handlebars source; compiled on first HTML render.

§color_glyphs: Option<ColorGlyphSelection>

Color glyph selection; supports TTF, WOFF and WOFF2.

§color_slots: Option<HashMap<String, String>>

Named #RRGGBB palette slots, indexed in ASCII name order; requires active color glyphs.

§ascent: Option<f64>

Font ascent.

§center_horizontally: Option<bool>

Center glyphs horizontally.

§center_vertically: Option<bool>

Center glyphs vertically.

§css: Option<bool>

Include CSS in collected outputs (default true).

§codepoints: Option<HashMap<String, u32>>

Explicit glyph name to Unicode assignments.

§css_fonts_url: Option<String>

URL prefix; absent means relative font filenames in both CSS and HTML.

§descent: Option<f64>

Font descent.

§fixed_width: Option<bool>

Use a common advance width.

§format_options: Option<FormatOptions>

Format-specific encoding settings.

§html: Option<bool>

Include HTML in collected outputs (default false).

§ts: Option<bool>

Include the fixed TypeScript source module in collected outputs. Defaults to false.

§incremental: Option<bool>

Retain geometry and encoder caches for subsequent source updates.

§font_height: Option<f64>

Output font height.

§font_name: Option<String>

Logical font name (default iconfont).

§font_style: Option<String>

Font style.

§font_weight: Option<String>

Ordinary font weight; incompatible with variants.

§ligature: Option<bool>

Enable name ligatures (default true).

§missing_glyphs: Option<MissingGlyphOptions>

Variant missing-glyph policy.

§normalize: Option<bool>

Normalize glyph dimensions (default true).

§order: Option<Vec<FontType>>

CSS font format preference order.

§optimize_output: Option<bool>

Optimize SVG output paths.

§preserve_aspect_ratio: Option<bool>

Preserve source aspect ratios.

§round: Option<f64>

Coordinate rounding precision.

§start_codepoint: Option<u32>

First automatic codepoint (default U+F101).

§template_options: Option<Map<String, Value>>

Additional template context values.

§threads: Option<NonZeroUsize>

How many threads do glyph work at once (never more than CPU cores), including later source updates. WOFF2’s Brotli worker isn’t counted. Unset uses Rayon’s global pool (RAYON_NUM_THREADS applies). Output is identical for every value. Not deserialized.

§types: Option<Vec<FontType>>

Requested formats; ordinary defaults EOT/WOFF/WOFF2, variants WOFF/WOFF2.

§variant_class_prefix: Option<String>

Variant CSS modifier prefix (default icon--).

Trait Implementations§

Source§

impl Clone for GenerateWebfontsFromSourcesOptions

Source§

fn clone(&self) -> Self

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 Default for GenerateWebfontsFromSourcesOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for GenerateWebfontsFromSourcesOptions

Source§

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

Deserialize this value from the given Serde deserializer. Read more

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<T> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool