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
This commit is contained in:
bungeman@google.com 2012-04-20 15:26:28 +00:00
parent fab1ddd3a8
commit 90b7e386ca

View File

@ -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;