pub enum RelativeFontSize {
Larger,
Smaller,
XxSmall,
XSmall,
Small,
Medium,
Large,
XLarge,
XxLarge,
}Expand description
Relative font-size values (keywords)
Based on CSS Fonts Module Level 3 specification section 3.5
Variants§
Larger
larger - multiply parent font size by 1.2
Smaller
smaller - divide parent font size by 1.2
XxSmall
xx-small - absolute keyword (9pt)
XSmall
x-small - absolute keyword (10pt)
Small
small - absolute keyword (13pt)
Medium
medium - absolute keyword (16pt, default)
Large
large - absolute keyword (18pt)
XLarge
x-large - absolute keyword (24pt)
XxLarge
xx-large - absolute keyword (32pt)
Implementations§
Source§impl RelativeFontSize
impl RelativeFontSize
Sourcepub fn resolve(&self, parent_size: Length) -> Length
pub fn resolve(&self, parent_size: Length) -> Length
Resolve to an absolute font size
For larger/smaller, requires parent font size For absolute keywords, ignores parent and returns fixed size
Sourcepub fn is_relative(&self) -> bool
pub fn is_relative(&self) -> bool
Check if this is a relative size (larger/smaller)
Sourcepub fn is_absolute_keyword(&self) -> bool
pub fn is_absolute_keyword(&self) -> bool
Check if this is an absolute keyword size
Trait Implementations§
Source§impl Clone for RelativeFontSize
impl Clone for RelativeFontSize
Source§fn clone(&self) -> RelativeFontSize
fn clone(&self) -> RelativeFontSize
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelativeFontSize
impl Debug for RelativeFontSize
Source§impl PartialEq for RelativeFontSize
impl PartialEq for RelativeFontSize
impl Copy for RelativeFontSize
impl StructuralPartialEq for RelativeFontSize
Auto Trait Implementations§
impl Freeze for RelativeFontSize
impl RefUnwindSafe for RelativeFontSize
impl Send for RelativeFontSize
impl Sync for RelativeFontSize
impl Unpin for RelativeFontSize
impl UnsafeUnpin for RelativeFontSize
impl UnwindSafe for RelativeFontSize
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