CoglPango

CoglPango — A Cogl based Pango text renderer

Synopsis

PangoFontMap *      cogl_pango_font_map_new             (CoglContext *context);
void                cogl_pango_font_map_set_resolution  (CoglPangoFontMap *font_map,
                                                         double dpi);
void                cogl_pango_font_map_clear_glyph_cache
                                                        (CoglPangoFontMap *font_map);
void                cogl_pango_ensure_glyph_cache_for_layout
                                                        (PangoLayout *layout);
void                cogl_pango_font_map_set_use_mipmapping
                                                        (CoglPangoFontMap *font_map,
                                                         CoglBool value);
CoglBool            cogl_pango_font_map_get_use_mipmapping
                                                        (CoglPangoFontMap *font_map);
void                cogl_pango_show_layout              (CoglFramebuffer *framebuffer,
                                                         PangoLayout *layout,
                                                         float x,
                                                         float y,
                                                         const CoglColor *color);
void                cogl_pango_show_layout_line         (CoglFramebuffer *framebuffer,
                                                         PangoLayoutLine *line,
                                                         float x,
                                                         float y,
                                                         const CoglColor *color);

Description

Cogl Pango provides a Cogl based Pango renderer that can be used to render text that has been layed out by Pango.

Details

cogl_pango_font_map_new ()

PangoFontMap *      cogl_pango_font_map_new             (CoglContext *context);

Creates a new font map.

context :

A CoglContext

Returns :

the newly created PangoFontMap. [transfer full]

Since 2.0


cogl_pango_font_map_set_resolution ()

void                cogl_pango_font_map_set_resolution  (CoglPangoFontMap *font_map,
                                                         double dpi);

Sets the resolution for the font_map. This is a scale factor between points specified in a PangoFontDescription and Cogl units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).

font_map :

a CoglPangoFontMap

dpi :

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

Since 2.0


cogl_pango_font_map_clear_glyph_cache ()

void                cogl_pango_font_map_clear_glyph_cache
                                                        (CoglPangoFontMap *font_map);

Clears the glyph cache for font_map.

font_map :

a CoglPangoFontMap

Since 1.0


cogl_pango_ensure_glyph_cache_for_layout ()

void                cogl_pango_ensure_glyph_cache_for_layout
                                                        (PangoLayout *layout);

This updates any internal glyph cache textures as necessary to be able to render the given layout.

This api should be used to avoid mid-scene modifications of glyph-cache textures which can lead to undefined rendering results.

layout :

A PangoLayout

Since 1.0


cogl_pango_font_map_set_use_mipmapping ()

void                cogl_pango_font_map_set_use_mipmapping
                                                        (CoglPangoFontMap *font_map,
                                                         CoglBool value);

Sets whether the renderer for the passed font map should use mipmapping when rendering a PangoLayout.

font_map :

a CoglPangoFontMap

value :

TRUE to enable the use of mipmapping

Since 1.0


cogl_pango_font_map_get_use_mipmapping ()

CoglBool            cogl_pango_font_map_get_use_mipmapping
                                                        (CoglPangoFontMap *font_map);

Retrieves whether the CoglPangoRenderer used by font_map will use mipmapping when rendering the glyphs.

font_map :

a CoglPangoFontMap

Returns :

TRUE if mipmapping is used, FALSE otherwise.

Since 1.0


cogl_pango_show_layout ()

void                cogl_pango_show_layout              (CoglFramebuffer *framebuffer,
                                                         PangoLayout *layout,
                                                         float x,
                                                         float y,
                                                         const CoglColor *color);

Draws a solidly coloured layout on the given framebuffer at (x, y) within the framebuffer's current model-view coordinate space.

framebuffer :

A CoglFramebuffer to draw too.

layout :

a PangoLayout

x :

X coordinate to render the layout at

y :

Y coordinate to render the layout at

color :

color to use when rendering the layout

Since 2.0


cogl_pango_show_layout_line ()

void                cogl_pango_show_layout_line         (CoglFramebuffer *framebuffer,
                                                         PangoLayoutLine *line,
                                                         float x,
                                                         float y,
                                                         const CoglColor *color);