[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] Ambiguously Undefined Glyphs [was: Mozilla needs some inf
From: |
Brian Stell |
Subject: |
Re: [Freetype] Ambiguously Undefined Glyphs [was: Mozilla needs some info on Xft] |
Date: |
Fri, 10 Aug 2001 00:35:56 -0700 |
Juliusz Chroboczek wrote:
> ...
> To quote myself, what you're doing is ``clearly bogus.'' See also
> Antoine Leca's note on the FreeType list.
Could you describe what specifically is ``cleary bogus''.
> Anyway, back to your problem. If these fonts work with Windows, there
> must be something we don't understand (I'm sure Windows doesn't do
> something that stupid), so there must be some way of disambiguating
> these Ambiguously Undefined Glyphs (AUGs) from blank glyphs.
>
> It is difficult to say without seeing a dump of the relevant parts of
> the fonts, but I'll take a guess. Assuming that the AUGs' cmap
> entries point at valid loca entries, and that the loca entries point
> at valid glyph data (you have checked that, haven't you?), I'd be
> tempted to believe that they're trying to optimise the size of a type
> 4 cmap by having non-zero cmap entries that are aliased to the
> undefined glyph through the loca table.
I did chat with him specifically about this problem and I belive
I understood what he did to test for the "broken" glyphs.
Take a look at Erik's test:
http://lxr.mozilla.org/seamonkey/source/gfx/src/windows/nsFontMetricsWin.cpp#637
which was checked in with this comment:
3.37 <address@hidden> 16 Apr 1999 13:01
Fixed bugs 2522 and 4875. Switched from FONTSIGNATURE to cmap to
figure
out which glyphs are available. Removed FONT_SWITCHING ifdef.
As I read line 661 it is checking the LOCA table to see
if the character's glyph has data 0 length.
651 DWORD newLen = GetFontData(aDC, LOCA, 0, buf, len);
652 if (newLen != len) {
653 PR_Free(buf);
654 return nsnull;
655 }
656 if (isLong) {
657 DWORD longLen = ((len / 4) - 1);
658 *aMaxGlyph = longLen;
659 PRUint32* longBuf = (PRUint32*) buf;
660 for (PRUint32 i = 0; i < longLen; i++) {
661 if (longBuf[i] == longBuf[i+1]) {
662 buf[i] = 1;
663 }
664 else {
665 buf[i] = 0;
666 }
667 }
668 }
These blank chars are later used to test if we shoule mark the
font as having a particular char.
(longBuf becomes isSpace)
1407 if (glyph < maxGlyph) {
1408 if (isSpace[glyph]) {
1409 if (SHOULD_BE_SPACE(c)) {
1410 ADD_GLYPH(map, c);
1411 }
1412 }
1413 else {
1414 ADD_GLYPH(map, c);
1415 }
1416 }
FreeType2 does not provide access to the LOCA table so I could not
do the test in Erik's code or the test you suggested. Instead
I load the glyph and look at the count of contours.
> P.S. I want Erik back!
He just got married and he's taking time off (and having alot of
fun!).
--
Brian Stell
mailto:address@hidden