&& '=' == familyName[22] && '=' == familyName[23];
}
-int FontPlatformData::paintTextFlags() const
+static int computePaintTextFlags(String fontFamilyName)
{
int textFlags = getSystemTextFlags();
// Many web-fonts are so poorly hinted that they are terrible to read when drawn in BW.
// In these cases, we have decided to FORCE these fonts to be drawn with at least grayscale AA,
// even when the System (getSystemTextFlags) tells us to draw only in BW.
- if (isWebFont(fontFamilyName()) && !isRunningLayoutTest())
+ if (isWebFont(fontFamilyName) && !isRunningLayoutTest())
textFlags |= SkPaint::kAntiAlias_Flag;
return textFlags;
}
, m_syntheticItalic(false)
, m_orientation(Horizontal)
, m_typeface(adoptRef(SkTypeface::RefDefault()))
+ , m_paintTextFlags(0)
, m_isHashTableDeletedValue(true)
, m_useSubpixelPositioning(false)
{
, m_syntheticItalic(false)
, m_orientation(Horizontal)
, m_typeface(adoptRef(SkTypeface::RefDefault()))
+ , m_paintTextFlags(0)
, m_isHashTableDeletedValue(false)
, m_useSubpixelPositioning(false)
{
, m_isHashTableDeletedValue(false)
, m_useSubpixelPositioning(false)
{
+ m_paintTextFlags = computePaintTextFlags(fontFamilyName());
}
#endif
, m_syntheticItalic(false)
, m_orientation(Horizontal)
, m_typeface(adoptRef(SkTypeface::RefDefault()))
+ , m_paintTextFlags(0)
, m_isHashTableDeletedValue(false)
, m_useSubpixelPositioning(false)
{
, m_syntheticItalic(data.m_syntheticItalic)
, m_orientation(data.m_orientation)
, m_typeface(data.m_typeface)
+ , m_paintTextFlags(data.m_paintTextFlags)
, m_isHashTableDeletedValue(false)
, m_useSubpixelPositioning(data.m_useSubpixelPositioning)
{
, m_syntheticItalic(data.m_syntheticItalic)
, m_orientation(data.m_orientation)
, m_typeface(data.m_typeface)
+ , m_paintTextFlags(data.m_paintTextFlags)
, m_isHashTableDeletedValue(false)
, m_useSubpixelPositioning(data.m_useSubpixelPositioning)
{
, m_isHashTableDeletedValue(false)
, m_useSubpixelPositioning(useSubpixelPositioning)
{
+ m_paintTextFlags = computePaintTextFlags(fontFamilyName());
+#if !USE(HARFBUZZ)
// FIXME: This can be removed together with m_font once the last few
// uses of hfont() has been eliminated.
LOGFONT logFont;
SkLOGFONTFromTypeface(m_typeface.get(), &logFont);
logFont.lfHeight = -textSize;
-
-#if !USE(HARFBUZZ)
HFONT hFont = CreateFontIndirect(&logFont);
m_font = hFont ? RefCountedHFONT::create(hFont) : 0;
m_scriptCache = 0;
m_syntheticItalic = data.m_syntheticItalic;
m_orientation = data.m_orientation;
m_typeface = data.m_typeface;
+ m_paintTextFlags = data.m_paintTextFlags;
#if !USE(HARFBUZZ)
m_font = data.m_font;