Struct elmesque::text::Text [−] [src]

pub struct Text {
    pub sequence: Vec<TextUnit>,
}

Drawable Text.

Fields

sequence

Methods

impl Text

fn from_string(string: String) -> Text

Convert a string into text which can be styled and displayed.

fn empty() -> Text

Text with nothing in it.

fn append(self, other: Text) -> Text

Put two chunks of text together.

fn concat(texts: Vec<Text>) -> Text

Put many chunks of text together.

fn join(separator: Text, texts: Vec<Text>) -> Text

Put many chunks of text together with a separator.

fn style(self, style: Style) -> Text

Set the style of some text. For example, if you design a Style called foorter_style that is specifically for the bottom of your page, you could apply it to text like this:

style(footer_style, from_string("the old prince / 2007"))

fn typeface(self, path: PathBuf) -> Text

Provide a path of a typeface to be used for some text.

fn monospace(self) -> Text

Switch to a monospace typeface. Good for code snippets.

monospace(from_string("(0..3).fold(0, |a, b| a + b)"))

fn height(self, h: f64) -> Text

Set the height of some text in pixels.

fn color(self, color: Color) -> Text

Set the color of some text.

fn bold(self) -> Text

Make the text bold.

fn italic(self) -> Text

Make the text italic.

fn line(self, line: Line) -> Text

Put lines on text.

Trait Implementations

Derived Implementations

impl Debug for Text

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Text

fn clone(&self) -> Text

fn clone_from(&mut self, source: &Self)