[Apologies for crossposting to -beta and -nt, I'm not sure where this
will find the most receptive audience, but it's clearly a
Windows-specific issue...]
I've been having problems trying to get 21.2.44 on Windows 2000
(native build) to display my 'favourite' 6x13 font (which happens to
come with my Exceed installation). I've been though some of this
before with 20.x versions on Windows, but this time I seem to have hit
a brick wall (I think that in the past all I needed to do was tweak
the font description string correctly). Note that this font works
fine with (for example) Notepad and other 'native' apps. Also note
that I have the same problem with 21.1.13, although I haven't dug
around enough to find out if the stuff below would apply to 21.1.x as
well.
Here's what I've done:
1) Execute (list-fonts "") and note that the font I'm expecting to see
isn't there - I'm looking for an entry like "6x13::10::Western" or
similar.
2) Notice that there are a bunch of entries which are just "Western"
which seems like the wrong thing. Poke around in object-msw.c and
notice this at line 1061:
for (i=0; i<countof (charset_map); i++)
if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
{
strcat (fontname, charset_map[i].name);
break;
}
if (i==countof (charset_map))
strcpy (fontname, charset_map[0].name);
Surely this last line should be:
strcat (fontname, charset_map[0].name);
3) Make this change and rebuild. Now I _do_ get "6x13::10::Western"
in the results of (list-fonts ""). Try to ignore naggy worry about
the fact that the charset for this font wasn't found in charset_map...
4) Try (set-face-font 'default "6x13::10::Western"). I just get
Courier New instead. Boo, hiss.
5) Now go digging in font.el and msw-faces.el etc. Notice that
mswindows-font-regexp and font-mswindows-font-regexp (why do we need
both?) disallow the 'name' part of a font from containing numbers.
Think that I must have it cracked now, fix msw-faces.el and font.el -
and notice that now if I do (mswindows-font-create-object
"6x13::10::Western") I get 'correct' results like:
[:family ("6x13") :weight : :style 0 :size "10pt" :registry nil
:encoding "Western"]
6) Try set-face-font again, and I still get stuck with Courier. Start
to lose hope....
6a) Dig around some more in the debugger, note that functions like
initialise_font_instance() in objects-msw.c _seem_ to be succeeding
for my font spec "6x13::10::Western".
6b) Wonder some more about the character set issue. Decide to 'ask the
audience' (or is this more a case of 'phoning a friend'?)
So, does anyone out there have an idea of what could be going wrong
here. I think that regardless of my specific font issue, there's a
patch here fixing the strcpy/strcat issue and the problems with the
-font-regexp's, but I would like to get to the bottom of what is going
wrong here first.
Cheers,
Matt.
--
/\/\att Stupple - TFTI Engineering, London - +44 (0) 20 7542 9554
matts(a)tibcofinance.com - ukweb.ldn/~matts -
www.tibcofinance.com