pub struct HtmlContext {
pub font_name: String,
pub names: Vec<String>,
pub styles: String,
pub codepoints: HashMap<String, u32>,
pub variants: Option<Vec<TemplateVariant>>,
pub variant_class_prefix: Option<String>,
pub default_weight: Option<u32>,
pub font_style: Option<String>,
}Expand description
Fields supplied to an htmlContext callback. Additional keys
from user-supplied templateOptions are merged into the same object at
runtime, so the JS-side type widens this with an open-ended index signature.
Fields§
§font_name: StringName of the generated font, mirroring the fontName option.
names: Vec<String>Glyph names in declaration order, after any rename callback has been
applied. Useful for iterating over icons in a preview template.
styles: StringPre-rendered CSS (the same string the engine writes to the .css
output) so HTML templates can embed it inline for self-contained
previews without an external stylesheet reference.
codepoints: HashMap<String, u32>Map from glyph name to its assigned codepoint as a numeric value
(e.g. "add" -> 0xF101). Use the CSS context’s hex form if you need a
string for embedding into CSS content declarations.
variants: Option<Vec<TemplateVariant>>Ordered resolved variants; absent in ordinary mode unless supplied by template options. The mode-independent Node declaration is unknown because ordinary template data is arbitrary.
variant_class_prefix: Option<String>Modifier class prefix, supplied in variant mode.
default_weight: Option<u32>Resolved default weight, supplied in variant mode.
font_style: Option<String>Resolved font style, supplied in variant mode.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HtmlContext
impl RefUnwindSafe for HtmlContext
impl Send for HtmlContext
impl Sync for HtmlContext
impl Unpin for HtmlContext
impl UnsafeUnpin for HtmlContext
impl UnwindSafe for HtmlContext
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.