pub struct HtmlContext {
pub font_name: String,
pub names: Vec<String>,
pub styles: String,
pub codepoints: HashMap<String, u32>,
}Expand description
Guaranteed 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.
Trait Implementations§
Source§impl Clone for HtmlContext
impl Clone for HtmlContext
Source§fn clone(&self) -> HtmlContext
fn clone(&self) -> HtmlContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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,
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.