зеркало из https://github.com/mozilla/pjs.git
bug 63831, r=ftang@netscape.com, sr=sfraser
when measuring space glyph width use 8 bit space char with 8 bit font use 16 bit space char with 16 bit font
This commit is contained in:
Родитель
db9928f3b5
Коммит
f65acc722b
|
@ -1159,7 +1159,17 @@ void nsFontMetricsGTK::RealizeFont()
|
|||
// 56% of ascent, best guess for non-true type
|
||||
mXHeight = NSToCoordRound((float) fontInfo->ascent* f * 0.56f);
|
||||
|
||||
gint rawWidth = gdk_text_width(mWesternFont->GetGDKFont(), " ", 1);
|
||||
gint rawWidth;
|
||||
if ((fontInfo->min_byte1 == 0) && (fontInfo->max_byte1 == 0)) {
|
||||
rawWidth = gdk_text_width(mWesternFont->GetGDKFont(), " ", 1);
|
||||
}
|
||||
else {
|
||||
XChar2b _16bit_space;
|
||||
_16bit_space.byte1 = 0;
|
||||
_16bit_space.byte2 = ' ';
|
||||
rawWidth = gdk_text_width(mWesternFont->GetGDKFont(),
|
||||
(const char *)&_16bit_space, sizeof(_16bit_space));
|
||||
}
|
||||
mSpaceWidth = NSToCoordRound(rawWidth * f);
|
||||
|
||||
unsigned long pr = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче