Pango, true type fonts, gdk_font_from_description



Hi,

Let me define my setup before expaining the problem.
I have installed the following as shared libraries in a non-standard 
directory using prefex=mydirpath when I ran the ./configure files: 
gtk+-2.0.1, pango-1.0.1, glib-2.0.1, atk+-2.0.1.  I can compile and link run 
my test app with all shared libraries resolved. 

Problem:
I am using the function gdk_font_from_description() to create a GdkFont using 
a true type font face name.  I can create a GdkFont when I use "Times New 
Roman" with a point size of 12.
Code:
PangoFontDescription* pfd = pango_font_description_from_string("Times New 
Roman");
pango_font_description_set_size( pfd, 12);
GdkFont* gdkFont = gdk_font_from_description( pfd ); // gdkFont is non-NULL

However when I set a weight of bold into the PangoFontDescription, it fails.
Code:

PangoFontDescription* pfd = pango_font_description_from_string("Times New 
Roman");
pango_font_description_set_weight( pfd, PANGO_WEIGHT_BOLD);
pango_font_description_set_size( pfd, 12);
GdkFont* gdkFont = gdk_font_from_description( pfd );  // ERROR gdkFont is 
NULL on return

I have set the GDK_USE_XFT=1 ( not sure if this matters )
I am at a loss.  Do I need to modify the pangowin32.alias files?  If so - 
how? If not then what?

Thanks



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