On Wed, 30 Jul 2008, Chip Griffin wrote:

Is it possible to have the installer check which fonts are available and then modify the new config file? Alternatively is it possible for Xastir to check to see if the font is valid and if not then either select one that is valid? Seems like there ought to be a way to make this smoother when installing the first time. I must admit that it worked flawlessly for me.

"fixed" is supposed to be a font that can be relied upon.  It turns
out these days it can't.  I found two fonts aliases to "fixed", one
courier, one cyrillic, on my system.  Of course the system picked
the wrong one.

The next idea would be to use "-*-*-*-*-*-*-*-*-*-*-*-*-*-*"
for the font.  This means the system chooses the font at startup.
That would probably result in more erratic behavior.

Yet another idea would be to use
"-*-fixed-medium-r-*-*-10-*-*-*-*-*-*-*" as the default font.  Here
we specify only the parameters that are important and leave the rest
to the system.  In fact near the top of main.c:main() you'll see
"*.fontList: -misc-fixed-*-r-*-*-10-*-*-*-*-*-*-*".  This font gets
used if we don't set the font.  But we do set the font.

In main.c:create_appshell() we have this code:

--------------------------------------
// Set up default font
    font1 = XLoadQueryFont(display, rotated_label_fontname[FONT_SYSTEM]);

    if (font1 == NULL) {    // Couldn't get the font!!!
        fprintf(stderr,"create_appshell: Couldn't load system font %s.  ",
            rotated_label_fontname[FONT_SYSTEM]);
        fprintf(stderr,"Loading default system font instead.\n");
        font1 = XLoadQueryFont(display, "-misc-fixed-*-r-*-*-10-*-*-*-*-*-*-*");
        if (font1 == NULL) {    // Couldn't get the font!!!
            fprintf(stderr,"create_appshell: Couldn't load default system font, 
exiting.\n");
            exit(1);
        }
        else {
            // _Now_ we can do a popup message about the first error
            // as we have a font to work with!
--------------------------------------

So... We do give it a pretty good effort to come up with a font that
works.  The above is for the system font (menus and the like).  For
the station font we do this:

    Try to load font.
    If no-go, load this font instead:
    "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*"

If people have severe difficulty with the station font but not the
system font, I can make the fallback for the station font be
"-misc-fixed-*-r-*-*-10-*-*-*-*-*-*-*" as well.

--
Curt, WE7U.                             archer at eskimo dot com
http://www.eskimo.com/~archer
  Lotto:  A tax on people who are bad at math. - unknown
Windows:  Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me:  I picked the coordinate system!"
_______________________________________________
Xastir mailing list
[email protected]
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir

Reply via email to