OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 else | 89 else |
90 paint->setSubpixelText(m_style.useSubpixelPositioning); | 90 paint->setSubpixelText(m_style.useSubpixelPositioning); |
91 | 91 |
92 const float ts = m_textSize >= 0 ? m_textSize : 12; | 92 const float ts = m_textSize >= 0 ? m_textSize : 12; |
93 paint->setTextSize(SkFloatToScalar(ts)); | 93 paint->setTextSize(SkFloatToScalar(ts)); |
94 paint->setTypeface(m_typeface.get()); | 94 paint->setTypeface(m_typeface.get()); |
95 paint->setFakeBoldText(m_syntheticBold); | 95 paint->setFakeBoldText(m_syntheticBold); |
96 paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); | 96 paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); |
97 } | 97 } |
98 | 98 |
99 void FontPlatformData::querySystemForRenderStyle(bool useSkiaSubpixelPositioning
) | 99 void FontPlatformData::querySystemForRenderStyle() |
100 { | 100 { |
101 WebFontRenderStyle style; | 101 WebFontRenderStyle style; |
102 #if OS(ANDROID) | 102 #if OS(ANDROID) |
103 style.setDefaults(); | 103 style.setDefaults(); |
104 #else | 104 #else |
105 // If the font name is missing (i.e. probably a web font) or the sandbox is
disabled, use the system defaults. | 105 // If the font name is missing (i.e. probably a web font) or the sandbox is
disabled, use the system defaults. |
106 if (!m_family.length() || !Platform::current()->sandboxSupport()) { | 106 if (!m_family.length() || !Platform::current()->sandboxSupport()) { |
107 style.setDefaults(); | 107 style.setDefaults(); |
108 } else { | 108 } else { |
109 const int sizeAndStyle = (((int)m_textSize) << 2) | (m_typeface->style()
& 3); | 109 const int sizeAndStyle = (((int)m_textSize) << 2) | (m_typeface->style()
& 3); |
(...skipping 16 matching lines...) Expand all Loading... |
126 if (m_style.useAutoHint == FontRenderStyle::NoPreference) | 126 if (m_style.useAutoHint == FontRenderStyle::NoPreference) |
127 m_style.useAutoHint = useSkiaAutoHint; | 127 m_style.useAutoHint = useSkiaAutoHint; |
128 if (m_style.useAntiAlias == FontRenderStyle::NoPreference) | 128 if (m_style.useAntiAlias == FontRenderStyle::NoPreference) |
129 m_style.useAntiAlias = useSkiaAntiAlias; | 129 m_style.useAntiAlias = useSkiaAntiAlias; |
130 if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) | 130 if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) |
131 m_style.useSubpixelRendering = useSkiaSubpixelRendering; | 131 m_style.useSubpixelRendering = useSkiaSubpixelRendering; |
132 | 132 |
133 // TestRunner specifically toggles the subpixel positioning flag. | 133 // TestRunner specifically toggles the subpixel positioning flag. |
134 if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference | 134 if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference |
135 || LayoutTestSupport::isRunningLayoutTest()) | 135 || LayoutTestSupport::isRunningLayoutTest()) |
136 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; | 136 m_style.useSubpixelPositioning = FontDescription::subpixelPositioning(); |
137 } | |
138 | |
139 bool FontPlatformData::defaultUseSubpixelPositioning() | |
140 { | |
141 return FontDescription::subpixelPositioning(); | |
142 } | 137 } |
143 | 138 |
144 } // namespace blink | 139 } // namespace blink |
OLD | NEW |