On Wed, Sep 26, 2001 at 12:10:18PM -0300, Christian Robottom Reis wrote:
> On Wed, 19 Sep 2001, Andrew Reid wrote:
> 
> >   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
> 
> I'm unsure of how to find out the XLFD string to start off with. I know
> hardcoding sucks; one way to do this would be using rc styles and setting
> the rc style dynamically. From my discussion with James on IRC, the XLFD
> might not be obtainable at all from the GdkFont. At least I can't see how
> you can.
> 
  Hardcoding definitely sucks.  As for getting the XLFD string,
I did some more poking around in the GTK+ docs, and it looks like
it's probably possible in native GTK+ if you're willing to misbehave
slightly -- the GtkStyle object has a private member "rc_style" of
type GtkRcStyle, which is supposed to contain info from the
initialization file (hence the "rc".) One of the members of the
GtkRcStyle in turn is "font_name", which looks tantalizingly like 
it might be the XLFD for the default font.  If so, then any widget
that hasn't changed its font should be using that one, I would
think.

  I haven't actually checked this, in part because I think relying
on private members of GTK+ objects is probably not healthy, and in 
fact pyGTK does not expose the rc_style member of GtkStyle anyways.  

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

Reply via email to