[][src]Trait pango::FontMapExt

pub trait FontMapExt: 'static {
    fn changed(&self);
fn create_context(&self) -> Option<Context>;
fn get_serial(&self) -> u32;
fn list_families(&self) -> Vec<FontFamily>;
fn load_font(
        &self,
        context: &Context,
        desc: &FontDescription
    ) -> Option<Font>;
fn load_fontset(
        &self,
        context: &Context,
        desc: &FontDescription,
        language: &Language
    ) -> Option<Fontset>; }

Trait containing all FontMap methods.

Implementors

FontMap

Required methods

fn changed(&self)

Forces a change in the context, which will cause any Context using this fontmap to change.

This function is only useful when implementing a new backend for Pango, something applications won't do. Backends should call this function if they have attached extra data to the context and such data is changed.

fn create_context(&self) -> Option<Context>

Creates a Context connected to self. This is equivalent to Context::new followed by Context::set_font_map.

If you are using Pango as part of a higher-level system, that system may have it's own way of create a Context. For instance, the GTK+ toolkit has, among others, gdk_pango_context_get_for_screen, and gtk_widget_get_pango_context. Use those instead.

Returns

the newly allocated Context, which should be freed with gobject::Object::unref.

fn get_serial(&self) -> u32

Returns the current serial number of self. The serial number is initialized to an small number larger than zero when a new fontmap is created and is increased whenever the fontmap is changed. It may wrap, but will never have the value 0. Since it can wrap, never compare it with "less than", always use "not equals".

The fontmap can only be changed using backend-specific API, like changing fontmap resolution.

This can be used to automatically detect changes to a FontMap, like in Context.

Returns

The current serial number of self.

fn list_families(&self) -> Vec<FontFamily>

List all families for a fontmap.

families

location to store a pointer to an array of FontFamily *. This array should be freed with g_free.

n_families

location to store the number of elements in families

fn load_font(&self, context: &Context, desc: &FontDescription) -> Option<Font>

Load the font in the fontmap that is the closest match for desc.

context

the Context the font will be used with

desc

a FontDescription describing the font to load

Returns

the newly allocated Font loaded, or None if no font matched.

fn load_fontset(
    &self,
    context: &Context,
    desc: &FontDescription,
    language: &Language
) -> Option<Fontset>

Load a set of fonts in the fontmap that can be used to render a font matching desc.

context

the Context the font will be used with

desc

a FontDescription describing the font to load

language

a Language the fonts will be used for

Returns

the newly allocated Fontset loaded, or None if no font matched.

Loading content...

Implementors

impl<O: IsA<FontMap>> FontMapExt for O[src]

Loading content...