Re: PangoFont -> GnomeFont



Le mar 27/01/2004 à 12:25, Jatin Nansi a écrit :
> Hi all
> 
> I am trying to print some devanagari text.
> How do I pass the font that pango uses for display to libgnomeprint?
> Currently i do a strncmp on the font family names and try doing this on
> a best guess basis.
> i.e. is there an easy way to convert from a PangoFont instance to a
> GnomeFont instance?

Hi,

Here is the code I use in GChemPaint (libgcpcanvas/gnome-print-pango.c)
where pango_font is a PangoFont*:

GnomeFont *font;
PangoFontDescription *desc;
desc = pango_font_describe (pango_font);
face = gnome_font_face_find_closest_from_weight_slant (
	pango_font_description_get_family (desc),
	(GnomeFontWeight) pango_font_description_get_weight (desc),
	(pango_font_description_get_style (desc) != 			PANGO_STYLE_NORMAL));
font =	gnome_font_face_get_font (face,
	  pango_font_description_get_size(desc) / PANGO_SCALE, 72, 72);

The whole file can be accessed at:
http://savannah.nongnu.org/cgi-bin/viewcvs/gchempaint/gchempaint/libgcpcanvas/gnome-print-pango.c

Best regards,

Jean Brefort

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]