diff --git a/mozilla/gfx/src/ps/nsAFMObject.cpp b/mozilla/gfx/src/ps/nsAFMObject.cpp index 08e83fd6da2..62d87bbc6eb 100644 --- a/mozilla/gfx/src/ps/nsAFMObject.cpp +++ b/mozilla/gfx/src/ps/nsAFMObject.cpp @@ -787,15 +787,24 @@ float totallen=0.0f; cptr = (PRUnichar*)aString; for(i=0;imAFMCharMetrics[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; }