bug=100324 r=dcone sr=attinasi. Checkin for ftang. Measure the cyrillic characters.

git-svn-id: svn://10.0.0.236/trunk@115058 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dcone%netscape.com 2002-02-20 05:55:52 +00:00
parent a240366484
commit d781bc3674

View File

@ -787,15 +787,24 @@ float totallen=0.0f;
cptr = (PRUnichar*)aString;
for(i=0;i<aLength;i++,cptr++){
asciichar = (*cptr)&0x00ff;
idx = asciichar-32;
fwidth = (PRInt32)(mPSFontInfo->mAFMCharMetrics[idx].mW0x);
// if ( (*cptr == 0x0020) || (*cptr == 0x002c) )
// printf("fwidth = %d\n", fwidth);
fwidth = 0;
if (*cptr & 0xff00)
fwidth = 1056;
if ( (*cptr == 0x0020) || (*cptr == 0x002c) )
fwidth = 1056; // space and comma are half size of a CJK width
{
if (0x0400 == (*cptr & 0xff00)) { // Cyrillic
fwidth = 600;
} else {
fwidth = 1056;
}
} else {
// < 0x0100
asciichar = (*cptr)&0x00ff;
idx = asciichar-32;
if(idx >= 0 )
fwidth = (PRInt32)(mPSFontInfo->mAFMCharMetrics[idx].mW0x);
else if (*cptr == 0x0020)
fwidth = 1056;
}
totallen += fwidth;
}