pub struct FontRequest {
    pub family: Option<SharedString>,
    pub weight: Option<i32>,
    pub pixel_size: Option<LogicalLength>,
    pub letter_spacing: Option<LogicalLength>,
}
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

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.