Struct fontconfig::Pattern[][src]

#[repr(C)]
pub struct Pattern<'fc> { pub pat: *mut FcPattern, // some fields omitted }

A safe wrapper around fontconfig’s FcPattern.

Fields

pat: *mut FcPattern

Raw pointer to FcPattern

Implementations

impl<'fc> Pattern<'fc>[src]

pub fn new(fc: &Fontconfig) -> Pattern<'_>[src]

Create a new Pattern.

pub fn from_pattern(fc: &Fontconfig, pat: *mut FcPattern) -> Pattern<'_>[src]

Create a Pattern from a raw fontconfig FcPattern pointer. The pattern is referenced.

pub fn add_string(&mut self, name: &CStr, val: &CStr)[src]

Add a key-value pair to this pattern.

See useful keys in the fontconfig reference.

pub fn get_string<'a>(&'a self, name: &'a CStr) -> Option<&'a str>[src]

Get string the value for a key from this pattern.

pub fn get_int(&self, name: &CStr) -> Option<i32>[src]

Get the integer value for a key from this pattern.

pub fn print(&self)[src]

Print this pattern to stdout with all its values.

pub fn font_match(&mut self) -> Pattern<'_>[src]

Get the best available match for this pattern, returned as a new pattern.

pub fn name(&self) -> Option<&str>[src]

Get the “fullname” (human-readable name) of this pattern.

pub fn filename(&self) -> Option<&str>[src]

Get the “file” (path on the filesystem) of this font pattern.

pub fn face_index(&self) -> Option<i32>[src]

Get the “index” (The index of the font within the file) of this pattern.

pub fn slant(&self) -> Option<i32>[src]

Get the “slant” (Italic, oblique or roman) of this pattern.

pub fn weight(&self) -> Option<i32>[src]

Get the “weight” (Light, medium, demibold, bold or black) of this pattern.

pub fn width(&self) -> Option<i32>[src]

Get the “width” (Condensed, normal or expanded) of this pattern.

pub fn format(&self) -> Result<FontFormat, UnknownFontFormat>[src]

Get the “fontformat” (“TrueType” “Type 1” “BDF” “PCF” “Type 42” “CID Type 1” “CFF” “PFR” “Windows FNT”) of this pattern.

Trait Implementations

impl<'fc> Clone for Pattern<'fc>[src]

impl<'fc> Debug for Pattern<'fc>[src]

impl<'fc> Drop for Pattern<'fc>[src]

Auto Trait Implementations

impl<'fc> RefUnwindSafe for Pattern<'fc>

impl<'fc> !Send for Pattern<'fc>

impl<'fc> !Sync for Pattern<'fc>

impl<'fc> Unpin for Pattern<'fc>

impl<'fc> UnwindSafe for Pattern<'fc>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.