Re: Pango Rendering API
- From: soheil hassas yeganeh <hassas ce sharif edu>
- To: <gtk-app-devel-list gnome org>
- Subject: Re: Pango Rendering API
- Date: Mon, 18 Aug 2003 14:30:03 +0430 (IRST)
Dear All
I made an XftDraw as noah said, and I drew a Rectangle on that Draw so I
think my XftDraw is a correct XftDraw but when I call pango_xft_render()
it did not render anything on that draw.
And I call pango_itemize and pango_shape before the rendering API, they
did their job well and created correct glyphs for me but when I passed
these correct structs (XftDraw, Color, Font, GlyphString , ... ) to
pango_xft_render() it did not work well for me.
I'm sure that these font is handeled buy Xft section of pango API
context = gtk_widget_create_pango_context(widget);
list = pango_itemize(context,
x,
0,
4,
attrs,
NULL);
item = list->data;
if(list)
{
if(item->analysis.shape_engine)
{
printf("%x\n", item->analysis.font);
gls = pango_glyph_string_new();
pango_shape(x, 4, &(item->analysis) , gls);
}
}
font = pango_context_load_font
(context, pango_font_description_from_string("serif 20"));
pango_xft_render (xftdraw,
&color,
font,
gls,
100,
100);
On Sat, 2003-08-16 at 08:20, soheil hassas yeganeh wrote:
Dear All
I call the pango rendering API directly from a gtk+ application
I first user pango_itemize routine, after, pango_shape routine, and
after i call the pango_xft_render, but i doesn't show anything on the
main frame !!!
Look at the docs for gdk_window_get_internal_paint_info()
What can i do to render the text directly by pango API ????
If you are using it in a GTK+ program, just use gdk_draw_layout(), it's
the same as using the low level calls but:
- Takes care of drawing to the right target; it knows about
double buffering.
- It uses the right backend - pango_xft_render(), pango_win32_render()
or whatever is appropriate.
- It creates the XftDraw automatically.
Regards,
Owen
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]