Lines Matching defs:lf
54 static void make_canonical(LOGFONT* lf) {
55 lf->lfHeight = -gCanonicalTextSize;
56 lf->lfQuality = CLEARTYPE_QUALITY;//PROOF_QUALITY;
57 lf->lfCharSet = DEFAULT_CHARSET;
60 static SkTypeface::Style getStyle(const LOGFONT& lf) {
62 if (lf.lfWeight >= FW_BOLD) {
65 if (lf.lfItalic) {
71 static void setStyle(LOGFONT* lf, SkTypeface::Style style) {
72 lf->lfWeight = (style & SkTypeface::kBold) != 0 ? FW_BOLD : FW_NORMAL ;
73 lf->lfItalic = ((style & SkTypeface::kItalic) != 0);
111 static SkTypeface::Style GetFontStyle(const LOGFONT& lf) {
113 if (lf.lfWeight == FW_SEMIBOLD || lf.lfWeight == FW_DEMIBOLD || lf.lfWeight == FW_BOLD)
115 if (lf.lfItalic)
123 LogFontTypeface(SkTypeface::Style style, SkFontID fontID, const LOGFONT& lf) :
124 SkTypeface(style, fontID, false), fLogFont(lf) {}
128 static LogFontTypeface* Create(const LOGFONT& lf) {
129 SkTypeface::Style style = GetFontStyle(lf);
131 return new LogFontTypeface(style, fontID, lf);
159 const LOGFONT* lf = reinterpret_cast<const LOGFONT*>(ctx);
162 !memcmp(&lface->fLogFont, lf, sizeof(LOGFONT));
170 LOGFONT lf = origLF;
171 make_canonical(&lf);
172 SkTypeface* face = SkTypefaceCache::FindByProc(FindByLogFont, &lf);
176 face = LogFontTypeface::Create(lf);
177 SkTypefaceCache::Add(face, getStyle(lf));
189 static void GetLogFontByID(SkFontID fontID, LOGFONT* lf) {
192 *lf = face->fLogFont;
194 sk_bzero(lf, sizeof(LOGFONT));
326 LOGFONT lf;
327 GetLogFontByID(fRec.fFontID, &lf);
328 lf.lfHeight = -gCanonicalTextSize;
329 fFont = CreateFontIndirect(&lf);
334 lf.lfHeight = -HIRES_TEXTSIZE;
335 fHiResFont = CreateFontIndirect(&lf);
654 sprintf(buf, "generatePath: id:%d, w=%d, h=%d, font:%s,fh:%d\n", glyph.fID, glyph.fWidth, glyph.fHeight, lf.lfFaceName, lf.lfHeight);
737 LOGFONT lf;
738 GetLogFontByID(fontID, &lf);
742 HFONT font = CreateFontIndirect(&lf);
750 !GetTextFace(hdc, LF_FACESIZE, lf.lfFaceName)) {
753 lf.lfHeight = -SkToS32(otm.otmEMSquare);
754 designFont = CreateFontIndirect(&lf);
768 size_t str_len = WideCharToMultiByte(CP_UTF8, 0, lf.lfFaceName, -1, NULL,
773 WideCharToMultiByte(CP_UTF8, 0, lf.lfFaceName, -1, familyName, str_len,
778 info->fFontName.set(lf.lfFaceName);
872 LOGFONT lf;
873 GetLogFontByID(uniqueID, &lf);
876 HFONT font = CreateFontIndirect(&lf);
919 LOGFONT lf;
921 lf = get_default_font();
924 lf = face->fLogFont;
926 memset(&lf, 0, sizeof(LOGFONT));
937 ::wcsncpy(lf.lfFaceName, wideFamilyName, LF_FACESIZE);
940 ::strncpy(lf.lfFaceName, familyName, LF_FACESIZE);
942 lf.lfFaceName[LF_FACESIZE-1] = '\0';
944 setStyle(&lf, style);
945 return SkCreateTypefaceFromLOGFONT(lf);