Lines Matching refs:lf
44 static void call_ensure_accessible(const LOGFONT& lf) { in call_ensure_accessible() argument
46 gEnsureLOGFONTAccessibleProc(lf); in call_ensure_accessible()
101 static void dcfontname_to_skstring(HDC deviceContext, const LOGFONT& lf, SkString* familyName) { in dcfontname_to_skstring() argument
104 call_ensure_accessible(lf); in dcfontname_to_skstring()
112 call_ensure_accessible(lf); in dcfontname_to_skstring()
121 static void make_canonical(LOGFONT* lf) { in make_canonical() argument
122 lf->lfHeight = -64; in make_canonical()
123 lf->lfQuality = CLEARTYPE_QUALITY;//PROOF_QUALITY; in make_canonical()
124 lf->lfCharSet = DEFAULT_CHARSET; in make_canonical()
128 static SkFontStyle get_style(const LOGFONT& lf) { in get_style() argument
129 return SkFontStyle(lf.lfWeight, in get_style()
130 lf.lfWidth, in get_style()
131 lf.lfItalic ? SkFontStyle::kItalic_Slant : SkFontStyle::kUpright_Slant); in get_style()
149 static unsigned calculateGlyphCount(HDC hdc, const LOGFONT& lf) { in calculateGlyphCount() argument
153 call_ensure_accessible(lf); in calculateGlyphCount()
185 static unsigned calculateUPEM(HDC hdc, const LOGFONT& lf) { in calculateUPEM() argument
189 call_ensure_accessible(lf); in calculateUPEM()
200 call_ensure_accessible(lf); in calculateUPEM()
209 LogFontTypeface(const SkFontStyle& style, const LOGFONT& lf, bool serializeAsStream) in LogFontTypeface() argument
211 , fLogFont(lf) in LogFontTypeface()
216 HFONT font = CreateFontIndirect(&lf); in LogFontTypeface()
223 call_ensure_accessible(lf); in LogFontTypeface()
249 static LogFontTypeface* Create(const LOGFONT& lf) { in Create() argument
250 return new LogFontTypeface(get_style(lf), lf, false); in Create()
280 static FontMemResourceTypeface* Create(const LOGFONT& lf, HANDLE fontMemResource) { in Create() argument
281 return new FontMemResourceTypeface(get_style(lf), lf, fontMemResource); in Create()
295 FontMemResourceTypeface(const SkFontStyle& style, const LOGFONT& lf, HANDLE fontMemResource) in FontMemResourceTypeface() argument
296 : LogFontTypeface(style, lf, true), fFontMemResource(fontMemResource) in FontMemResourceTypeface()
311 const LOGFONT* lf = reinterpret_cast<const LOGFONT*>(ctx); in FindByLogFont() local
315 !memcmp(&lface->fLogFont, lf, sizeof(LOGFONT)); in FindByLogFont()
323 LOGFONT lf = origLF; in SkCreateTypefaceFromLOGFONT() local
324 make_canonical(&lf); in SkCreateTypefaceFromLOGFONT()
325 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByLogFont, &lf); in SkCreateTypefaceFromLOGFONT()
327 face = LogFontTypeface::Create(lf); in SkCreateTypefaceFromLOGFONT()
328 SkTypefaceCache::Add(face, get_style(lf)); in SkCreateTypefaceFromLOGFONT()
337 LOGFONT lf = origLF; in SkCreateFontMemResourceTypefaceFromLOGFONT() local
338 make_canonical(&lf); in SkCreateFontMemResourceTypefaceFromLOGFONT()
340 return FontMemResourceTypeface::Create(lf, fontMemResource); in SkCreateFontMemResourceTypefaceFromLOGFONT()
346 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) { in SkLOGFONTFromTypeface() argument
348 *lf = get_default_font(); in SkLOGFONTFromTypeface()
350 *lf = static_cast<const LogFontTypeface*>(face)->fLogFont; in SkLOGFONTFromTypeface()
653 LOGFONT lf = typeface->fLogFont; in SkScalerContext_GDI() local
654 lf.lfHeight = -SkScalarTruncToInt(gdiTextSize); in SkScalerContext_GDI()
655 lf.lfQuality = compute_quality(fRec); in SkScalerContext_GDI()
656 fFont = CreateFontIndirect(&lf); in SkScalerContext_GDI()
664 call_ensure_accessible(lf); in SkScalerContext_GDI()
712 call_ensure_accessible(lf); in SkScalerContext_GDI()
1669 static void logfont_for_name(const char* familyName, LOGFONT* lf) { in logfont_for_name() argument
1670 sk_bzero(lf, sizeof(LOGFONT)); in logfont_for_name()
1681 ::wcsncpy(lf->lfFaceName, wideFamilyName, LF_FACESIZE - 1); in logfont_for_name()
1683 lf->lfFaceName[LF_FACESIZE-1] = L'\0'; in logfont_for_name()
1685 ::strncpy(lf->lfFaceName, familyName, LF_FACESIZE - 1); in logfont_for_name()
1686 lf->lfFaceName[LF_FACESIZE - 1] = '\0'; in logfont_for_name()
1734 LOGFONT lf = fLogFont; in onGetAdvancedTypefaceMetrics() local
1738 HFONT font = CreateFontIndirect(&lf); in onGetAdvancedTypefaceMetrics()
1751 call_ensure_accessible(lf); in onGetAdvancedTypefaceMetrics()
1754 if (!otmRet || !GetTextFace(hdc, LF_FACESIZE, lf.lfFaceName)) { in onGetAdvancedTypefaceMetrics()
1757 lf.lfHeight = -SkToS32(otm.otmEMSquare); in onGetAdvancedTypefaceMetrics()
1758 designFont = CreateFontIndirect(&lf); in onGetAdvancedTypefaceMetrics()
1768 tchar_to_skstring(lf.lfFaceName, &info->fFontName); in onGetAdvancedTypefaceMetrics()
1947 LOGFONT lf; in create_from_stream() local
1948 logfont_for_name(familyName, &lf); in create_from_stream()
1950 return SkCreateFontMemResourceTypefaceFromLOGFONT(lf, fontReference); in create_from_stream()
1958 LOGFONT lf = fLogFont; in onOpenStream() local
1961 HFONT font = CreateFontIndirect(&lf); in onOpenStream()
1969 call_ensure_accessible(lf); in onOpenStream()
2047 SkAutoHDC(const LOGFONT& lf) in SkAutoHDC() argument
2049 , fFont(::CreateFontIndirect(&lf)) in SkAutoHDC()
2259 LOGFONT lf = fLogFont; in onGetTableData() local
2262 HFONT font = CreateFontIndirect(&lf); in onGetTableData()
2271 call_ensure_accessible(lf); in onGetTableData()
2351 static bool valid_logfont_for_enum(const LOGFONT& lf) { in valid_logfont_for_enum() argument
2355 lf.lfFaceName[0] && lf.lfFaceName[0] != '@' in valid_logfont_for_enum()
2359 && ANSI_CHARSET == lf.lfCharSet in valid_logfont_for_enum()
2367 static int CALLBACK enum_family_proc(const LOGFONT* lf, const TEXTMETRIC*, in enum_family_proc() argument
2369 if (valid_logfont_for_enum(*lf)) { in enum_family_proc()
2371 *array->append() = *(ENUMLOGFONTEX*)lf; in enum_family_proc()
2379 LOGFONT lf; in SkFontStyleSetGDI() local
2380 sk_bzero(&lf, sizeof(lf)); in SkFontStyleSetGDI()
2381 lf.lfCharSet = DEFAULT_CHARSET; in SkFontStyleSetGDI()
2382 _tcscpy_s(lf.lfFaceName, familyName); in SkFontStyleSetGDI()
2385 ::EnumFontFamiliesEx(hdc, &lf, enum_family_proc, (LPARAM)&fArray, 0); in SkFontStyleSetGDI()
2425 LOGFONT lf; in SkFontMgrGDI() local
2426 sk_bzero(&lf, sizeof(lf)); in SkFontMgrGDI()
2427 lf.lfCharSet = DEFAULT_CHARSET; in SkFontMgrGDI()
2430 ::EnumFontFamiliesEx(hdc, &lf, enum_family_proc, (LPARAM)&fLogFontArray, 0); in SkFontMgrGDI()
2453 LOGFONT lf; in onMatchFamily() local
2454 logfont_for_name(familyName, &lf); in onMatchFamily()
2455 return new SkFontStyleSetGDI(lf.lfFaceName); in onMatchFamily()
2496 LOGFONT lf; in onLegacyCreateTypeface() local
2498 lf = get_default_font(); in onLegacyCreateTypeface()
2500 logfont_for_name(familyName, &lf); in onLegacyCreateTypeface()
2504 lf.lfWeight = (style & SkTypeface::kBold) != 0 ? FW_BOLD : FW_NORMAL; in onLegacyCreateTypeface()
2505 lf.lfItalic = ((style & SkTypeface::kItalic) != 0); in onLegacyCreateTypeface()
2506 return SkCreateTypefaceFromLOGFONT(lf); in onLegacyCreateTypeface()