private void CreateFont() { properties.FontFamily.GetEmHeight(properties.Style); Win32.Api.LOGFONT lf = new Win32.Api.LOGFONT(); lf.lfHeight = (int)(-properties.SizeInPoints * dpi / 75); lf.lfFaceName = properties.FontFamily.Name; switch (properties.Style) { case (FontStyle.Bold): lf.lfWeight = 600; break; case (FontStyle.Italic): lf.lfItalic = 1; break; case (FontStyle.Strikeout): lf.lfStrikeout = 1; break; case (FontStyle.Underline): lf.lfUnderline = 1; break; } // Don't know why but the next flag makes Windows text look ugly // lf.lfQuality = Win32.Api.FontQuality.CLEARTYPE_QUALITY; hFont = Win32.Api.CreateFontIndirectA(ref lf); }
private void CreateFont() { properties.FontFamily.GetEmHeight(properties.Style); Win32.Api.LOGFONT lf = new Win32.Api.LOGFONT(); lf.lfHeight=(int)(-properties.SizeInPoints*dpi/75); lf.lfFaceName=properties.FontFamily.Name; switch (properties.Style) { case(FontStyle.Bold): lf.lfWeight = 600; break; case(FontStyle.Italic): lf.lfItalic = 1; break; case(FontStyle.Strikeout): lf.lfStrikeout = 1; break; case(FontStyle.Underline): lf.lfUnderline = 1; break; } // Don't know why but the next flag makes Windows text look ugly // lf.lfQuality = Win32.Api.FontQuality.CLEARTYPE_QUALITY; hFont = Win32.Api.CreateFontIndirectA(ref lf); }