Struct i_slint_core::graphics::FontRequest
source · pub struct FontRequest {
pub family: Option<SharedString>,
pub weight: Option<i32>,
pub pixel_size: Option<LogicalLength>,
pub letter_spacing: Option<LogicalLength>,
pub italic: bool,
}
Expand description
FontRequest collects all the developer-configurable properties for fonts, such as family, weight, etc.
It is submitted as a request to the platform font system (i.e. CoreText on macOS) and in exchange the
backend returns a Box<dyn Font>
.
Fields§
§family: Option<SharedString>
The name of the font family to be used, such as “Helvetica”. An empty family name means the system default font family should be used.
weight: Option<i32>
If the weight is None, the system default font weight should be used.
pixel_size: Option<LogicalLength>
If the pixel size is None, the system default font size should be used.
letter_spacing: Option<LogicalLength>
The additional spacing (or shrinking if negative) between glyphs. This is usually not submitted to the font-subsystem but collected here for API convenience
italic: bool
Whether to select an italic face of the font family.
Implementations§
source§impl FontRequest
impl FontRequest
sourcepub fn to_fontdb_query(&self) -> Query<'_>
pub fn to_fontdb_query(&self) -> Query<'_>
Returns the relevant properties of this FontRequest propagated into a fontdb Query.
Trait Implementations§
source§impl Clone for FontRequest
impl Clone for FontRequest
source§fn clone(&self) -> FontRequest
fn clone(&self) -> FontRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FontRequest
impl Debug for FontRequest
source§impl Default for FontRequest
impl Default for FontRequest
source§fn default() -> FontRequest
fn default() -> FontRequest
source§impl PartialEq for FontRequest
impl PartialEq for FontRequest
source§fn eq(&self, other: &FontRequest) -> bool
fn eq(&self, other: &FontRequest) -> bool
self
and other
values to be equal, and is used
by ==
.