Home | History | Annotate | Download | only in ports

Lines Matching refs:lf

32 static bool compute_bounds_outset(const LOGFONT& lf, SkIRect* outset) {
57 uint16_t c = lf.lfFaceName[i];
150 static void make_canonical(LOGFONT* lf) {
151 lf->lfHeight = -gCanonicalTextSize;
152 lf->lfQuality = CLEARTYPE_QUALITY;//PROOF_QUALITY;
153 lf->lfCharSet = DEFAULT_CHARSET;
154 // lf->lfClipPrecision = 64;
157 static SkTypeface::Style get_style(const LOGFONT& lf) {
159 if (lf.lfWeight >= FW_BOLD) {
162 if (lf.lfItalic) {
168 static void setStyle(LOGFONT* lf, SkTypeface::Style style) {
169 lf->lfWeight = (style & SkTypeface::kBold) != 0 ? FW_BOLD : FW_NORMAL ;
170 lf->lfItalic = ((style & SkTypeface::kItalic) != 0);
213 LogFontTypeface(SkTypeface::Style style, SkFontID fontID, const LOGFONT& lf, bool serializeAsStream = false) :
214 SkTypeface(style, fontID, false), fLogFont(lf), fSerializeAsStream(serializeAsStream) {
217 HFONT font = CreateFontIndirect(&lf);
247 static LogFontTypeface* Create(const LOGFONT& lf) {
248 SkTypeface::Style style = get_style(lf);
250 return new LogFontTypeface(style, fontID, lf);
259 FontMemResourceTypeface(SkTypeface::Style style, SkFontID fontID, const LOGFONT& lf, HANDLE fontMemResource) :
260 LogFontTypeface(style, fontID, lf, true), fFontMemResource(fontMemResource) {
268 static FontMemResourceTypeface* Create(const LOGFONT& lf, HANDLE fontMemResource) {
269 SkTypeface::Style style = get_style(lf);
271 return new FontMemResourceTypeface(style, fontID, lf, fontMemResource);
292 const LOGFONT* lf = reinterpret_cast<const LOGFONT*>(ctx);
296 !memcmp(&lface->fLogFont, lf, sizeof(LOGFONT));
304 LOGFONT lf = origLF;
305 make_canonical(&lf);
306 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByLogFont, &lf);
308 face = LogFontTypeface::Create(lf);
309 SkTypefaceCache::Add(face, get_style(lf));
318 LOGFONT lf = origLF;
319 make_canonical(&lf);
320 FontMemResourceTypeface* face = FontMemResourceTypeface::Create(lf, fontMemResource);
321 SkTypefaceCache::Add(face, get_style(lf), false);
328 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) {
330 *lf = get_default_font();
332 *lf = static_cast<const LogFontTypeface*>(face)->fLogFont;
350 static void GetLogFontByID(SkFontID fontID, LOGFONT* lf) {
353 *lf = face->fLogFont;
355 sk_bzero(lf, sizeof(LOGFONT));
631 LOGFONT lf;
632 GetLogFontByID(fRec.fFontID, &lf);
633 lf.lfHeight = -gCanonicalTextSize;
634 lf.lfQuality = compute_quality(fRec);
635 fFont = CreateFontIndirect(&lf);
637 if (!compute_bounds_outset(lf, &fOutset)) {
644 lf.lfHeight = -HIRES_TEXTSIZE;
645 fHiResFont = CreateFontIndirect(&lf);
712 lf.lfHeight = -SkScalarCeilToInt(fRec.fTextSize);
713 HFONT bitmapFont = CreateFontIndirect(&lf);
1240 sprintf(buf, "generatePath: id:%d, w=%d, h=%d, font:%s,fh:%d\n", glyph.fID, glyph.fWidth, glyph.fHeight, lf.lfFaceName, lf.lfHeight);
1300 static void logfont_for_name(const char* familyName, LOGFONT& lf) {
1301 memset(&lf, 0, sizeof(LOGFONT));
1312 ::wcsncpy(lf.lfFaceName, wideFamilyName, LF_FACESIZE - 1);
1314 lf.lfFaceName[LF_FACESIZE-1] = L'\0';
1316 ::strncpy(lf.lfFaceName, familyName, LF_FACESIZE - 1);
1317 lf.lfFaceName[LF_FACESIZE - 1] = '\0';
1419 LOGFONT lf;
1420 GetLogFontByID(fontID, &lf);
1424 HFONT font = CreateFontIndirect(&lf);
1440 if (!otmRet || !GetTextFace(hdc, LF_FACESIZE, lf.lfFaceName)) {
1443 lf.lfHeight = -SkToS32(otm.otmEMSquare);
1444 designFont = CreateFontIndirect(&lf);
1456 tchar_to_skstring(lf.lfFaceName, &info->fFontName);
1640 LOGFONT lf;
1641 logfont_for_name(familyName, lf);
1643 return SkCreateFontMemResourceTypefaceFromLOGFONT(lf, fontReference);
1649 LOGFONT lf;
1650 GetLogFontByID(uniqueID, &lf);
1653 HFONT font = CreateFontIndirect(&lf);
1699 LOGFONT lf;
1701 lf = get_default_font();
1704 lf = face->fLogFont;
1706 logfont_for_name(familyName, lf);
1708 setStyle(&lf, style);
1709 return SkCreateTypefaceFromLOGFONT(lf);