pub struct FontDescriptor {
pub family: String,
pub weight: i32,
pub is_italic: bool,
pub charset: i32,
pub data: Arc<[u8]>,
}Expand description
A font descriptor containing pre-loaded font data.
Use Arc<[u8]> for zero-copy sharing when caching fonts in memory.
Fields§
§family: StringFont family name (e.g., “Arial”, “Roboto”)
weight: i32Font weight (400 = normal, 700 = bold)
is_italic: boolWhether the font is italic
charset: i32Character set for the font. Common values:
- 0 = ANSI charset (Western)
- 128 = Shift-JIS charset (Japanese)
- 134 = GB2312 charset (Simplified Chinese)
- 136 = Hangeul charset (Korean)
data: Arc<[u8]>Raw font file bytes (TrueType or OpenType). Use Arc for zero-copy sharing across multiple font provider instances.
Trait Implementations§
Source§impl Clone for FontDescriptor
impl Clone for FontDescriptor
Source§fn clone(&self) -> FontDescriptor
fn clone(&self) -> FontDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FontDescriptor
impl RefUnwindSafe for FontDescriptor
impl Send for FontDescriptor
impl Sync for FontDescriptor
impl Unpin for FontDescriptor
impl UnsafeUnpin for FontDescriptor
impl UnwindSafe for FontDescriptor
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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