Hi.
I am using Xemacs 21.0.67 under NT, and had a problem using my favourite fonts
(e.g. the 6x13 font that comes with Reflection X).
I traced this to 2 problems in objects-msw.c:
1. font_enum_callback_2() contains this code:
978 for (i=0; i<countof (charset_map); i++)
979 if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
980 {
981 strcat (fontname, charset_map[i].name);
982 break;
983 }
984 if (i==countof (charset_map))
985 strcpy (fontname, charset_map[0].name);
The intention of line 985 seems to be to select the default charset (the
first in charset_map) for the font. I think line 985 should be:
985 strcat (fontname, charset_map[0].name);
i.e. it should add the default charset to the end of the font name, as per
line 981.
2. The default charset - i.e. the first in charset_map - is "Western", which
maps to a logfont.lfCharSet of ANSI_CHARSET.
Thus, if I use a font like 6x13 that doesn't have a matching lfCharSet in
charset_map, it gets a default charset of "Western". Later, when
mswindows_initialize_font_instance() looks up the "Western" in charset_map,
it sets lfCharSet of ANSI_CHARSET. The result is that NT looks for the
6x13 font in the ANSI charset, and can't find it.
If, however, you use lfCharSet = DEFAULT_CHARSET, NT looks in all charsets,
and finds it.
To fix this, I changed charset_map from this:
754 static CONST fontmap_t charset_map[] =
755 {
756 {"Western" , ANSI_CHARSET},
757 {"Symbol" , SYMBOL_CHARSET},
etc
to this:
754 static CONST fontmap_t charset_map[] =
755 {
756 {"Default" , DEFAULT_CHARSET},
757 {"Western" , ANSI_CHARSET},
758 {"Symbol" , SYMBOL_CHARSET},
etc
Now, when a font has a charset that is not in the map, it gets lfCharSet =
DEFAULT_CHARSET, and the font works.
Note that you don't have to use "Default" as the string. An empty string
would be just as good. I chose "Default" as it maps to "DEFAULT_CHARSET".
This is consistent with most other entries.
Having made these 2 changes, my favourite fonts now work.
Also, fyi: I had a problem where the NT make would keep repeating forever.
When I first ran it, it created src/puresize-adjust.h by copying it from
nt/puresize-adjust.h. It then adjusted puresize-adjust.h and restarted the
make. But the next make ran the puresize-adjust.h rule again, thereby wiping
out the modified file, and thereby causing another make restart. This went on
forever.
I traced this to the fact than when I untar'd the source, the files had a
timestamp of 1/1/1970. The modified puresize-adjust.h had a time in 1999, but
there seems to be a bug in NT and/or nmake which made it think that 1999 was
before 1970. If I touched nt/puresize-adjust.h before doing the make, it all
worked fine. (Similarly, giving tar the 'm' flag when extracting the files
also solved the problem.)
Many thanks for your work with xemacs. I hope this report is useful.
Regards,
David Funk