Check that all the members of the XCharStruct are zero before rejecting a glyph. Bug 207438, r=Roland.Mainz@informatik.med.uni-giessen.de, sr=rbs

This commit is contained in:
smontagu%netscape.com 2003-06-11 22:32:54 +00:00
Родитель 7b4025bf73
Коммит 81825209da
2 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -2385,7 +2385,14 @@ GetMapFor10646Font(XFontStruct* aFont)
PRInt32 offset = (((row - minByte1) * charsPerRow) - minByte2); PRInt32 offset = (((row - minByte1) * charsPerRow) - minByte2);
for (PRInt32 cell = minByte2; cell <= maxByte2; cell++) { for (PRInt32 cell = minByte2; cell <= maxByte2; cell++) {
XCharStruct* bounds = &aFont->per_char[offset + cell]; XCharStruct* bounds = &aFont->per_char[offset + cell];
if (bounds->ascent || bounds->descent) { // From Section 8.5 Font Metrics in the Xlib programming manual:
// A nonexistent character is represented with all members of its XCharStruct set to zero.
if (bounds->ascent ||
bounds->descent ||
bounds->lbearing ||
bounds->rbearing ||
bounds->width ||
bounds->attributes) {
ccmapObj.SetChar((row << 8) | cell); ccmapObj.SetChar((row << 8) | cell);
} }
} }

Просмотреть файл

@ -2747,7 +2747,14 @@ GetMapFor10646Font(XFontStruct* aFont)
PRInt32 offset = (((row - minByte1) * charsPerRow) - minByte2); PRInt32 offset = (((row - minByte1) * charsPerRow) - minByte2);
for (PRInt32 cell = minByte2; cell <= maxByte2; cell++) { for (PRInt32 cell = minByte2; cell <= maxByte2; cell++) {
XCharStruct* bounds = &aFont->per_char[offset + cell]; XCharStruct* bounds = &aFont->per_char[offset + cell];
if (bounds->ascent || bounds->descent) { // From Section 8.5 Font Metrics in the Xlib programming manual:
// A nonexistent character is represented with all members of its XCharStruct set to zero.
if (bounds->ascent ||
bounds->descent ||
bounds->lbearing ||
bounds->rbearing ||
bounds->width ||
bounds->attributes) {
ccmapObj.SetChar((row << 8) | cell); ccmapObj.SetChar((row << 8) | cell);
} }
} }