[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] Misfeature in .fon font handling?
From: |
Tor Lillqvist |
Subject: |
[Devel] Misfeature in .fon font handling? |
Date: |
Tue, 30 Mar 2004 23:45:30 +0000 |
There seems to be a problem in the way winfnt.c handles the font (or
face?) name(s). For some fonts, the name doesn't get properly NUL
terminated. See http://bugzilla.gnome.org/show_bug.cgi?id=132366
. There are some false starts earlier in that bug's history (ignore
the HOME and Registry stuff), but see especially Pedro Gimeno's fresh
comment #55, which I quote here:
Further investigation has led me to the following conclusion: the
problem is in Freetype. Specifically, the font name happens to be
the last resource in a frame and the frame size does not include the
trailing \0.
In the sample ProFont.fon, at offset 0510h starts the .FON font
structure about which you can learn e.g. here:
http://www.csn.ul.ie/~caolan/publink/winresdump/winresdump/doc/resfmt.txt
Note that the dfSize member in this case equals 0E92h, and exactly
at offset (0510h+0E92h) = 13A2h there's the trailing \0 which should
end the string. However looking at
freetype-2.1.7/src/winfonts/winfnt.c lines 184 and 502 it seems that
this trailing \0 is never loaded but the string is used as is. The
fact that it works properly under Unix somewhat puzzles me.
I have not investigated the streaming functions of Freetype so I
can't tell what's a good fix for this problem.
Of course checking the validity of the font name string can't hurt
and is even a healthy practice.
--tml
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Devel] Misfeature in .fon font handling?,
Tor Lillqvist <=