diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-20 15:26:28 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-20 15:26:28 +0000 |
commit | 90b7e386cab251db78152f18adfd54e019b8dc10 (patch) | |
tree | ea71058243cc91cfddc4f03ebef0d9131f3ab452 | |
parent | fab1ddd3a8893db58b2ce0afd28ecc73412ee871 (diff) |
Fix gdi assert that the font is not a vector FON font.
See http://code.google.com/p/chromium/issues/detail?id=124313
git-svn-id: http://skia.googlecode.com/svn/trunk@3740 2bbb7eff-a529-9590-31e7-b0007b416f81
-rwxr-xr-x | src/ports/SkFontHost_win.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index 68fe1480cc..21a2d3cc79 100755 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -523,8 +523,16 @@ SkScalerContext_Windows::SkScalerContext_Windows(const SkDescriptor* desc) } } // Used a logfont on a memory context, should never get a device font. - SkASSERT(!(fTM.tmPitchAndFamily & (TMPF_DEVICE))); - if (fTM.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) { + // Therefore all TMPF_DEVICE will be PostScript fonts. + + // If TMPF_VECTOR is set, one of TMPF_TRUETYPE or TMPF_DEVICE must be set, + // otherwise we have a vector FON, which we don't support. + // This was determined by testing with Type1 PFM/PFB and OpenTypeCFF OTF, + // as well as looking at Wine bugs and sources. + SkASSERT(!(fTM.tmPitchAndFamily & TMPF_VECTOR) || + (fTM.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_DEVICE))); + + if (fTM.tmPitchAndFamily & TMPF_VECTOR) { // Truetype or PostScript. // Stroked FON also gets here (TMPF_VECTOR), but we don't handle it. fType = SkScalerContext_Windows::kTrueType_Type; |