GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

working with text and fonts

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
roberthuff@rcn.com
Familiar Face


Joined: 06 Aug 2008
Posts: 21

PostPosted: Wed Aug 20, 2008 2:04 pm    Post subject: working with text and fonts Reply with quote

1) If I don't like the default font, I can use GtkFontSelection and friends to get a new one.

If I do like the default font ... how do I find out what it is?

2) given a font - either as a string or as a font descriptor - and a string, how do I figure out the height and width in pixels? I'm guessing it involves pango, but pango_? I have no idea.
Back to top
Mk27
GTK+ Geek


Joined: 07 Aug 2008
Posts: 70
Location: NYC

PostPosted: Sun Aug 24, 2008 1:06 am    Post subject: Reply with quote

Declare a new font:
PangoFontDescription *Nfont = pango_font_description_from_string("lucida bold italic 12");

apply the font to a widget:
gtk_widget_modify_font(Nwidget,Nfont);
pango_font_description_free(Nfont);


works fine for me.
Back to top
roberthuff@rcn.com
Familiar Face


Joined: 06 Aug 2008
Posts: 21

PostPosted: Sun Aug 24, 2008 2:28 am    Post subject: Reply with quote

Mk27 wrote:
Declare a new font:
PangoFontDescription *Nfont = pango_font_description_from_string("lucida bold italic 12");

apply the font to a widget:
gtk_widget_modify_font(Nwidget,Nfont);
pango_font_description_free(Nfont);


works fine for me.


Thank you for the response, but it doesn't actually answer either of the questions.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP