manpagez: man pages & more
html files: pygtk
Home | html | info | man
pangocairo.CairoFontMap — object providing support for using font maps with Cairo (new in PyGTK 2.8)

Synopsis

class pangocairo.CairoFontMap(pangocairo.CairoFontMap):
    pangocairo.CairoFontMap()
def set_resolution(dpi)
def get_resolution()
def create_context()
Functions

    def pangocairo.cairo_font_map_get_default()

Ancestry

+-- gobject.GObject
  +-- pango.FontMap
    +-- pangocairo.CairoFontMap

Description

pangocairo.CairoFontMap is an interface exported by font maps for use with Cairo. The actual type of the font map will depend on the particular font technology Cairo was compiled to use.

Cairo is a graphics library that supports vector graphics and image compositing that can be used with PyGTK. Since 2.8, GTK+ and Pango do most of their drawing using Cairo. The Cairo drawing model and primitives are similar to PostScript which uses an imaging model of painting on a two dimensional surface.

Constructor

    pangocairo.CairoFontMap()

Returns :

a new pangocairo.CairoFontMap object

Creates a new pangocairo.CairoFontMap object; a fontmap is used to cache information about available fonts, and holds certain global parameters such as the resolution. In most cases, you can use the pangocairo.cairo_font_map_get_default() function instead.

Note that the type of the returned object will depend on the particular font backend Cairo was compiled to use; You generally should only use the pango.FontMap and pangocairo.CairoFontMap interfaces on the returned object.

Methods

pangocairo.CairoFontMap.set_resolution

    def set_resolution(dpi)

dpi :

the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.)

Note

This method is available in PyGTK 2.8 and above.

The set_resolution() method sets the resolution for the fontmap to the value specified by dpi. This is a scale factor between the points specified in a pango.FontDescription and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).

pangocairo.CairoFontMap.get_resolution

    def get_resolution()

Returns :

the resolution in "dots per inch"

Note

This method is available in PyGTK 2.8 and above.

The get_resolution() method returns the resolution for the fontmap. See the set_resolution() method for more information.

pangocairo.CairoFontMap.create_context

    def create_context()

Returns :

a new pango.Context object

Note

This method is available in PyGTK 2.8 and above.

The create_context() method creates a new pango.Context object.

Functions

pangocairo.cairo_font_map_get_default

    def pangocairo.cairo_font_map_get_default()

Returns :

the default Cairo fontmap for Pango.

Note

This function is available in PyGTK 2.8 and above.

The pangocairo.cairo_font_map_get_default() function returns the default font map to use with Cairo.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.