WindowsTypeface (const Font& font) : Typeface (font.getTypefaceFamily(), font.getTypefaceStyle()), fontH (0), previousFontH (0), dc (CreateCompatibleDC (0)), ascent (1.0f), defaultGlyph (-1) { loadFont(); if (GetTextMetrics (dc, &tm)) { ascent = tm.tmAscent / (float) tm.tmHeight; defaultGlyph = getGlyphForChar (dc, tm.tmDefaultChar); createKerningPairs (dc, (float) tm.tmHeight); } }
WindowsTypeface (const Font& font) : Typeface (font.getTypefaceName(), font.getTypefaceStyle()), fontH (0), previousFontH (0), dc (CreateCompatibleDC (0)), ascent (1.0f), heightToPointsFactor (1.0f), defaultGlyph (-1) { loadFont(); if (GetTextMetrics (dc, &tm)) { heightToPointsFactor = (72.0f / GetDeviceCaps (dc, LOGPIXELSY)) * heightInPoints / (float) tm.tmHeight; ascent = tm.tmAscent / (float) tm.tmHeight; defaultGlyph = getGlyphForChar (dc, tm.tmDefaultChar); createKerningPairs (dc, (float) tm.tmHeight); } }