Struct radiant_rs::Font[][src]

pub struct Font { /* fields omitted */ }

A font used for writing on a Layer.

Use Font::builder() to create a new font from a registered system font or a local file. The Font::from_file() is a shortcut to achieve the latter.

In addition to the usual properties of a font, radiant also assigns a fixed size to each font object. Instead of modifying this value, you can clone a new font with a different size using Font::with_size().

Methods

impl Font
[src]

Returns a font builder for font construction.

Examples

let my_font = Font::builder(&rendercontext).family("Arial").size(16.0).build().unwrap();

Creates a font instance from a file.

Important traits for Vec<u8>

Returns the names of all available system fonts.

Returns a query builder to retrieve the names of all available system fonts with the given properties (e.g. monospace).

Examples

let monospace_fonts = Font::query().monospace().italic().fetch();

Returns a new font instance with given size.

Write to given layer.

Write to given layer. Breaks lines after max_width pixels.

Write to given layer. Breaks lines after max_width pixels and applies given rotation and scaling.

Returns the font wrapped in an std::Arc.

Trait Implementations

impl Clone for Font
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Font
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Font

impl Sync for Font