pub struct TextStyle {
pub bold: bool,
pub italic: bool,
pub mono: bool,
pub link: bool,
}Expand description
How a run of text should be set.
bold and italic are synthesised from the regular face rather than loaded
as separate files. That is a deliberate choice, not a shortcut: this is a
Bangla-first reader, so a bundled Latin bold would leave Bengali, Devanagari,
Arabic, CJK and Thai with no emphasis at all, and mixing a second family’s
letterforms into a Noto line reads as two fonts colliding mid-sentence.
Synthesis keeps every script consistent with its own body face and costs no
binary size.
mono is the opposite case and is a real font: code is meant to look
different from prose, and no amount of emboldening gives a proportional face
the fixed advances that make columns line up.
Fields§
§bold: bool§italic: bool§mono: bool§link: boolImplementations§
Trait Implementations§
impl Copy for TextStyle
impl Eq for TextStyle
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.