OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 2009 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 #if OS(WIN) | 141 #if OS(WIN) |
142 // Try some more Windows-specific fallbacks. | 142 // Try some more Windows-specific fallbacks. |
143 if (!fontPlatformData) { | 143 if (!fontPlatformData) { |
144 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, msuigothicCreationPara
ms, (AtomicString("MS UI Gothic"))); | 144 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, msuigothicCreationPara
ms, (AtomicString("MS UI Gothic"))); |
145 fontPlatformData = getFontPlatformData(description, msuigothicCreationPa
rams); | 145 fontPlatformData = getFontPlatformData(description, msuigothicCreationPa
rams); |
146 } | 146 } |
147 if (!fontPlatformData) { | 147 if (!fontPlatformData) { |
148 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, mssansserifCreationPar
ams, (AtomicString("Microsoft Sans Serif"))); | 148 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, mssansserifCreationPar
ams, (AtomicString("Microsoft Sans Serif"))); |
149 fontPlatformData = getFontPlatformData(description, mssansserifCreationP
arams); | 149 fontPlatformData = getFontPlatformData(description, mssansserifCreationP
arams); |
150 } | 150 } |
| 151 if (!fontPlatformData) { |
| 152 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, segoeuiCreationParams,
(AtomicString("Segoe UI"))); |
| 153 fontPlatformData = getFontPlatformData(description, segoeuiCreationParam
s); |
| 154 } |
| 155 if (!fontPlatformData) { |
| 156 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, calibriCreationParams,
(AtomicString("Calibri"))); |
| 157 fontPlatformData = getFontPlatformData(description, calibriCreationParam
s); |
| 158 } |
| 159 if (!fontPlatformData) { |
| 160 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, timesnewromanCreationP
arams, (AtomicString("Times New Roman"))); |
| 161 fontPlatformData = getFontPlatformData(description, timesnewromanCreatio
nParams); |
| 162 } |
| 163 if (!fontPlatformData) { |
| 164 DEFINE_STATIC_LOCAL(const FontFaceCreationParams, couriernewCreationPara
ms, (AtomicString("Courier New"))); |
| 165 fontPlatformData = getFontPlatformData(description, couriernewCreationPa
rams); |
| 166 } |
151 #endif | 167 #endif |
152 | 168 |
153 ASSERT(fontPlatformData); | 169 ASSERT(fontPlatformData); |
154 return fontDataFromFontPlatformData(fontPlatformData, shouldRetain); | 170 return fontDataFromFontPlatformData(fontPlatformData, shouldRetain); |
155 } | 171 } |
156 | 172 |
157 PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
ription, const FontFaceCreationParams& creationParams, CString& name) | 173 PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
ription, const FontFaceCreationParams& creationParams, CString& name) |
158 { | 174 { |
159 #if !OS(WIN) && !OS(ANDROID) | 175 #if !OS(WIN) && !OS(ANDROID) |
160 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { | 176 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 return wrapUnique(new FontPlatformData(tf, | 227 return wrapUnique(new FontPlatformData(tf, |
212 name.data(), | 228 name.data(), |
213 fontSize, | 229 fontSize, |
214 (numericFontWeight(fontDescription.weight()) > 200 + tf->fontStyle().wei
ght()) || fontDescription.isSyntheticBold(), | 230 (numericFontWeight(fontDescription.weight()) > 200 + tf->fontStyle().wei
ght()) || fontDescription.isSyntheticBold(), |
215 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), | 231 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), |
216 fontDescription.orientation())); | 232 fontDescription.orientation())); |
217 } | 233 } |
218 #endif // !OS(WIN) | 234 #endif // !OS(WIN) |
219 | 235 |
220 } // namespace blink | 236 } // namespace blink |
OLD | NEW |