pub struct CssContext {
pub color_slots: HashMap<String, u32>,
pub font_name: String,
pub src: String,
pub codepoints: HashMap<String, String>,
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 a cssContext 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§
§color_slots: HashMap<String, u32>Named palette slot indices in ASCII name order. Empty when no slots are configured.
font_name: StringName of the generated font, mirroring the fontName option.
src: StringPre-rendered value for the CSS @font-face src: descriptor — a
comma-separated list of url(...) format(...) entries derived from the
configured types, order, and cssFontsUrl.
codepoints: HashMap<String, String>Map from glyph name to its assigned codepoint as a hex-encoded string
(e.g. "add" -> "f101"), suitable for use inside CSS content
declarations like content: "\f101".
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 CssContext
impl RefUnwindSafe for CssContext
impl Send for CssContext
impl Sync for CssContext
impl Unpin for CssContext
impl UnsafeUnpin for CssContext
impl UnwindSafe for CssContext
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.