Font Questions - Xwindows

This is a discussion on Font Questions - Xwindows ; A few font-related questions: 1) If I specify an XLFD that is not fully qualified how I can determine which specific font the server will pick to satisfy the font request? 2) Using xfontsel I've specified a fully qualified XLFD. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Font Questions

  1. Font Questions


    A few font-related questions:

    1) If I specify an XLFD that is not fully qualified how I can determine which
    specific font the server will pick to satisfy the font request?

    2) Using xfontsel I've specified a fully qualified XLFD. xfontsel shows that
    4 fonts matched. How can that be? For a given fully qualified XLFD
    shouldn't there be only a single match?

    3) In a running application, how can I query a window to see the font that is
    being used for the window itself or for specific widgets on the window?
    Can editres show me the value for a resource?

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  2. Re: Font Questions

    Jake Colman wrote:
    >
    >A few font-related questions:
    >
    >1) If I specify an XLFD that is not fully qualified how I can determine which
    > specific font the server will pick to satisfy the font request?
    >
    >2) Using xfontsel I've specified a fully qualified XLFD. xfontsel shows that
    > 4 fonts matched. How can that be? For a given fully qualified XLFD
    > shouldn't there be only a single match?


    The font path gives a number of directories which each contain a fonts.dir
    file. They contain a font-file-name opposite an XLFD. A search for a
    font essentially matches the request to the XLFD, similar to the ls(1)
    command. The match is first-found; xfontsel shows the number of matches.

    In practical terms, this means the order of font directories determines
    which font will be used. Duplicate XLFD's in a font.dir file are not
    useful.

    >3) In a running application, how can I query a window to see the font that is
    > being used for the window itself or for specific widgets on the window?
    > Can editres show me the value for a resource?


    An application knows a number of windows and a number of fontID's --
    it can write any font to any window, so the question of `what font is
    being used in a window' is without basis. The font selected in a
    particular GC is not readily queried.

    Editres can show you resources in an Xt application that understands the
    editres protocol. With the increasing use of non-Xt toolkits, this is
    becoming less useful. Those of us who still use nothing but Xt are, of
    course, excepted.

    If you want to determine the fonts used by an application, you could try
    a trace such as in xmon/xscope/strace.


+ Reply to Thread