Esempio n. 1
0
void
x11_draw_glyphs( Drawable            drawable,
		         GC                  gc,
		         PangoFont          *font,
		         int                 x,
		         int                 y,
		         PangoGlyphString   *glyphs,
                 wxColour           &colour )
{
#ifdef HAVE_PANGO_XFT
    if (PANGO_XFT_IS_FONT (font))
    {
        Display* xdisplay = wxGlobalDisplay();
        int xscreen = DefaultScreen( xdisplay );
        Visual* xvisual = DefaultVisual( xdisplay, xscreen );

        Colormap xcolormap = DefaultColormapOfScreen( XScreenOfDisplay( xdisplay, xscreen ) );

        XftDraw *draw = XftDrawCreate( xdisplay, drawable, xvisual, xcolormap );
        XftColor color;
        color.pixel = 0;
        color.color.red = colour.Red() << 8;
        color.color.green = colour.Green() << 8;
        color.color.blue = colour.Blue() << 8;
        color.color.alpha = 65000;
        pango_xft_render( draw, &color, font, glyphs, x, y );
        
        XftDrawDestroy( draw );
    }
    else
#endif
    {
        pango_x_render( wxGlobalDisplay(), drawable, gc, font, glyphs, x, y );
    }
}
Esempio n. 2
0
void
x11_draw_glyphs( Drawable       drawable,
		         GC             gc,
		         PangoFont     *font,
		         int            x,
		         int            y,
		         PangoGlyphString *glyphs)
{
    if (PANGO_XFT_IS_FONT (font))
    {
        pango_xft_picture_render( wxGlobalDisplay(), drawable, drawable, font, glyphs, x, y );
    }
    else
    {
        pango_x_render( wxGlobalDisplay(), drawable, gc, font, glyphs, x, y );
    }
}
Esempio n. 3
0
static void
pango_draw_line (XftDraw *draw, Window id, GC gc, XftColor *xft_color,
		 PangoLayoutLine *line, int x, int y)
{
    GSList *p;

    for (p = line->runs; p != NULL; p = p->next)
    {
	PangoLayoutRun *run = p->data;
	PangoFont *font = run->item->analysis.font;
	PangoGlyphString *glyphs = run->glyphs;
	PangoRectangle rect;

	pango_glyph_string_extents (glyphs, font, NULL, &rect);
#ifdef HAVE_PANGO_XFT
	if (PANGO_XFT_IS_FONT (font))
	    pango_xft_render (draw, xft_color, font, glyphs, x, y);
#else
	    pango_x_render (dpy, id, gc, font, glyphs, x, y);
#endif

	x += rect.width / PANGO_SCALE;
    }
}