X Rendering

Name

X Rendering -- Functions for Rendering Pango objects on X displays.

Synopsis



#define     PANGO_RENDER_TYPE_X
PangoContext* pango_x_get_context           (Display *display);
void        pango_x_context_set_funcs       (PangoContext *context,
                                             PangoGetGCFunc get_gc_func,
                                             PangoFreeGCFunc free_gc_func);
GC          (*PangoGetGCFunc)               (PangoContext *context,
                                             PangoAttrColor *color,
                                             GC base_gc);
void        (*PangoFreeGCFunc)              (PangoContext *context,
                                             GC gc);
void        pango_x_render                  (Display *display,
                                             Drawable d,
                                             GC gc,
                                             PangoFont *font,
                                             PangoGlyphString *glyphs,
                                             gint x,
                                             gint y);
void        pango_x_render_layout_line      (Display *display,
                                             Drawable drawable,
                                             GC gc,
                                             PangoLayoutLine *line,
                                             int x,
                                             int y);
void        pango_x_render_layout           (Display *display,
                                             Drawable drawable,
                                             GC gc,
                                             PangoLayout *layout,
                                             int x,
                                             int y);

Description

The functions in this system are used to take the output of the shaping modules and render that on the screen.

Details

PANGO_RENDER_TYPE_X

#define PANGO_RENDER_TYPE_X "PangoRenderX"

PANGO_RENDER_TYPE_X is a string constant that is used to identify shaping modules for the X Window System.


pango_x_get_context ()

PangoContext* pango_x_get_context           (Display *display);

Retrieves a PangoContext appropriate for rendering with X fonts on the given display.

display : an X display (As returned by XOpenDisplay().)
Returns : the new PangoContext


pango_x_context_set_funcs ()

void        pango_x_context_set_funcs       (PangoContext *context,
                                             PangoGetGCFunc get_gc_func,
                                             PangoFreeGCFunc free_gc_func);

Sets the functions that will be used to get GC's in various colors when rendering layouts with this context.

context : a PangoContext.
get_gc_func : function called to create a new GC for a given color.
free_gc_func : function called to free a GC created with get_gc_func.


PangoGetGCFunc ()

GC          (*PangoGetGCFunc)               (PangoContext *context,
                                             PangoAttrColor *color,
                                             GC base_gc);

Used to represent a function which is called when a new GC must be created to draw something other than the default color when rendering a layout. The function used here will typically retrieve information from the context with pango_context_get_data().

context :the PangoContext
color :color attribute representing the desired color
base_gc :default GC used for rendering. The function will typically copy attributes such as clip region from the GC
Returns :the new GC


PangoFreeGCFunc ()

void        (*PangoFreeGCFunc)              (PangoContext *context,
                                             GC gc);

Used to represent a function which is called to free a GC created with the corresponding PangoGetGCFunc. The function used here will typically retrieve information from the context with pango_context_set_data().

context :the PangoContext
gc :the GC to free


pango_x_render ()

void        pango_x_render                  (Display *display,
                                             Drawable d,
                                             GC gc,
                                             PangoFont *font,
                                             PangoGlyphString *glyphs,
                                             gint x,
                                             gint y);

Render a PangoGlyphString onto an X drawable

display : the X display
d : the drawable on which to draw string
gc : the graphics context
font : the font in which to draw the string
glyphs : the glyph string to draw
x : the x position of start of string (in pixels)
y : the y position of baseline (in pixels)


pango_x_render_layout_line ()

void        pango_x_render_layout_line      (Display *display,
                                             Drawable drawable,
                                             GC gc,
                                             PangoLayoutLine *line,
                                             int x,
                                             int y);

Render a PangoLayoutLine onto an X drawable

display : the X display
drawable : the drawable on which to draw string
gc : GC to use for uncolored drawing
line : a PangoLayoutLine
x : the x position of start of string (in pixels)
y : the y position of baseline (in pixels)


pango_x_render_layout ()

void        pango_x_render_layout           (Display *display,
                                             Drawable drawable,
                                             GC gc,
                                             PangoLayout *layout,
                                             int x,
                                             int y);

Render a PangoLayoutLine onto an X drawable

display : the X display
drawable : the drawable on which to draw string
gc : GC to use for uncolored drawing
layout : a PangoLayout
x : the X position of the left of the layout (in pixels)
y : the Y position of the top of the layout (in pixels)