I have a variety of questions revolving around the use of fonts
in pyGTK.  The basic thing I want to do is boldify and/or italicize
an existing font in a label -- this was asked a couple of weeks ago,
and the reply said "there is no easy way", and pointed to GTK+ v2.0
and pango.  


  My question is:  What is the hard way?  It seems that if you 
could find out what font was used in the first place, and get its 
XLFD string, then you could substitute "i" for "r" and/or 
"bold" for "medium" (or "normal") in the appropriate fields, and
attempt to load a new font using your new, modified XLFD string.  This
might fail, of course, in which case you have to figure out something
else to do, but *if* it succeeds, you're done, you can assign
the .font attribute of the (copy of the) GtkStyle and get what 
you want.  This has the design advantage of leaving initial font
selection in the hands of the user through the themes mechanism,
which is where it belongs.

  What I cannot figure out is whether or not it is possible
to translate a GdkFont object from an existing GtkStyle object 
into an XLFD string.  Is this possible?  If not, presumably 
at start-up time, somebody somewhere has to get font information
from the server in order to set up the initial GtkStyle object
that all the widgets use.  Are there hooks in this process that
can be used to retrieve the font data in XLFD form?

                                -- A.
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to