OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2007 Apple Computer, Inc. |
3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // Web-fonts have artifical names constructed to always be: | 105 // Web-fonts have artifical names constructed to always be: |
106 // 1. 24 characters, followed by a '\0' | 106 // 1. 24 characters, followed by a '\0' |
107 // 2. the last two characters are '==' | 107 // 2. the last two characters are '==' |
108 return familyName.length() == 24 | 108 return familyName.length() == 24 |
109 && '=' == familyName[22] && '=' == familyName[23]; | 109 && '=' == familyName[22] && '=' == familyName[23]; |
110 } | 110 } |
111 | 111 |
112 static int computePaintTextFlags(String fontFamilyName) | 112 static int computePaintTextFlags(String fontFamilyName) |
113 { | 113 { |
114 if (isRunningLayoutTest()) | 114 if (isRunningLayoutTest()) |
115 return isFontSmoothingEnabledForTest() ? SkPaint::kAntiAlias_Flag : 0; | 115 return isFontAntialiasingEnabledForTest() ? SkPaint::kAntiAlias_Flag : 0
; |
116 | 116 |
117 int textFlags = getSystemTextFlags(); | 117 int textFlags = getSystemTextFlags(); |
118 | 118 |
119 // Many web-fonts are so poorly hinted that they are terrible to read when d
rawn in BW. | 119 // Many web-fonts are so poorly hinted that they are terrible to read when d
rawn in BW. |
120 // In these cases, we have decided to FORCE these fonts to be drawn with at
least grayscale AA, | 120 // In these cases, we have decided to FORCE these fonts to be drawn with at
least grayscale AA, |
121 // even when the System (getSystemTextFlags) tells us to draw only in BW. | 121 // even when the System (getSystemTextFlags) tells us to draw only in BW. |
122 if (isWebFont(fontFamilyName)) | 122 if (isWebFont(fontFamilyName)) |
123 textFlags |= SkPaint::kAntiAlias_Flag; | 123 textFlags |= SkPaint::kAntiAlias_Flag; |
124 | 124 |
125 return textFlags; | 125 return textFlags; |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 void FontPlatformData::querySystemForRenderStyle(bool) | 129 void FontPlatformData::querySystemForRenderStyle(bool) |
130 { | 130 { |
131 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); | 131 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); |
132 } | 132 } |
133 | 133 |
134 bool FontPlatformData::defaultUseSubpixelPositioning() | 134 bool FontPlatformData::defaultUseSubpixelPositioning() |
135 { | 135 { |
136 return FontCache::fontCache()->useSubpixelPositioning(); | 136 return FontCache::fontCache()->useSubpixelPositioning(); |
137 } | 137 } |
138 | 138 |
139 } // namespace WebCore | 139 } // namespace WebCore |
OLD | NEW |