bug 588731 - ensure correct font is selected in the DC when getting glyph metrics. r=jdaggett a=blocking2.0

This commit is contained in:
Jonathan Kew 2010-08-23 11:32:45 +01:00
parent db6beae972
commit 308278b403

View File

@ -484,8 +484,11 @@ gfxGDIFont::GetHintedGlyphWidth(gfxContext *aCtx, PRUint16 aGID)
return width;
}
DCFromContext dc(aCtx);
AutoSelectFont fs(dc, GetHFONT());
int devWidth;
if (GetCharWidthI(DCFromContext(aCtx), aGID, 1, NULL, &devWidth)) {
if (GetCharWidthI(dc, aGID, 1, NULL, &devWidth)) {
// ensure width is positive, 16.16 fixed-point value
width = (devWidth & 0x7fff) << 16;
mGlyphWidths.Put(aGID, width);