[−][src]Struct rofi::pango::Pango
Structure for writing Pango markup spans
Implementations
impl<'a> Pango<'a>
[src]
pub fn new(content: &'a str) -> Pango
[src]
Generate a new pango class
Usage
use rofi::pango; let t = pango::Pango::new("test").build(); assert_eq!(t, "test");
pub fn with_capacity(content: &'a str, size: usize) -> Pango
[src]
Generate a new pango class with options capacity
Usage
use rofi::pango; let t = pango::Pango::with_capacity("test", 0).build(); assert_eq!(t, "test");
pub fn build(&mut self) -> String
[src]
Generate the pango string
Usage
use rofi::pango; let t = pango::Pango::new("test") .slant_style(pango::SlantStyle::Italic) .size(pango::FontSize::Small) .build(); assert!(t == "<span style='italic' size='small'>test</span>" || t == "<span size='small' style='italic'>test</span>");
pub fn font_description(&mut self, font: &'a str) -> &mut Self
[src]
Set the font
Usage
use rofi::pango; let t = pango::Pango::new("test") .font_description("Sans Italic 12") .build(); assert_eq!(t, "<span font_desc='Sans Italic 12'>test</span>");
pub fn font_family(&mut self, family: FontFamily) -> &mut Self
[src]
set the font family
Usage
use rofi::pango; let t = pango::Pango::new("test") .font_family(pango::FontFamily::Monospace) .build(); assert_eq!(t, "<span face='monospace'>test</span>");
pub fn size(&mut self, size: FontSize) -> &mut Self
[src]
Set the size of the font, relative to the configured font size
Usage
use rofi::pango; let t = pango::Pango::new("test") .size(pango::FontSize::Huge) .build(); assert_eq!(t, "<span size='x-large'>test</span>");
pub fn slant_style(&mut self, style: SlantStyle) -> &mut Self
[src]
Set the slant style (italic / oblique / normal)
Usage
use rofi::pango; let t = pango::Pango::new("test") .slant_style(pango::SlantStyle::Oblique) .build(); assert_eq!(t, "<span style='oblique'>test</span>");
pub fn weight(&mut self, weight: Weight) -> &mut Self
[src]
Set the font weight
Usage
use rofi::pango; let t = pango::Pango::new("test") .weight(pango::Weight::Bold) .build(); assert_eq!(t, "<span weight='bold'>test</span>");
pub fn alpha(&mut self, alpha: &'a str) -> &mut Self
[src]
Set the alpha of the text Important: alpha must be fo the form: XX%, where XX is a number between 0 and 100.
Usage
use rofi::pango; let t = pango::Pango::new("test") .alpha("50%") .build(); assert_eq!(t, "<span alpha='50%'>test</span>");
pub fn small_caps(&mut self) -> &mut Self
[src]
Use smallcaps
Usage
use rofi::pango; let t = pango::Pango::new("test") .small_caps() .build(); assert_eq!(t, "<span variant='smallcaps'>test</span>");
pub fn stretch(&mut self, stretch: FontStretch) -> &mut Self
[src]
Set the stretch (expanded or condensed)
Usage
use rofi::pango; let t = pango::Pango::new("test") .stretch(pango::FontStretch::Condensed) .build(); assert_eq!(t, "<span stretch='condensed'>test</span>");
pub fn fg_color(&mut self, color: &'a str) -> &mut Self
[src]
Set the foreground color
Usage
use rofi::pango; let t = pango::Pango::new("test") .fg_color("#00FF00") .build(); assert_eq!(t, "<span foreground='#00FF00'>test</span>");
pub fn bg_color(&mut self, color: &'a str) -> &mut Self
[src]
Set the background color
Usage
use rofi::pango; let t = pango::Pango::new("test") .bg_color("#00FF00") .build(); assert_eq!(t, "<span background='#00FF00'>test</span>");
pub fn underline(&mut self, underline: Underline) -> &mut Self
[src]
Set the underline style
Usage
use rofi::pango; let t = pango::Pango::new("test") .underline(pango::Underline::Double) .build(); assert_eq!(t, "<span underline='double'>test</span>");
pub fn strike_through(&mut self) -> &mut Self
[src]
set the font to strike through
Usage
use rofi::pango; let t = pango::Pango::new("test") .strike_through() .build(); assert_eq!(t, "<span strikethrough='true'>test</span>");
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Pango<'a>
impl<'a> Send for Pango<'a>
impl<'a> Sync for Pango<'a>
impl<'a> Unpin for Pango<'a>
impl<'a> UnwindSafe for Pango<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,