OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData( | 261 std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData( |
262 const FontDescription& fontDescription, | 262 const FontDescription& fontDescription, |
263 const FontFaceCreationParams& creationParams, | 263 const FontFaceCreationParams& creationParams, |
264 float fontSize, | 264 float fontSize, |
265 AlternateFontName) { | 265 AlternateFontName) { |
266 CString name; | 266 CString name; |
267 sk_sp<SkTypeface> tf = createTypeface(fontDescription, creationParams, name); | 267 sk_sp<SkTypeface> tf = createTypeface(fontDescription, creationParams, name); |
268 if (!tf) | 268 if (!tf) |
269 return nullptr; | 269 return nullptr; |
270 | 270 |
271 return WTF::wrapUnique(new FontPlatformData( | 271 return WTF::wrapUnique( |
272 tf, name.data(), fontSize, (numericFontWeight(fontDescription.weight()) > | 272 new FontPlatformData(tf, name.data(), fontSize, |
273 200 + tf->fontStyle().weight()) || | 273 (numericFontWeight(fontDescription.weight()) > |
274 fontDescription.isSyntheticBold(), | 274 200 + tf->fontStyle().weight()) || |
275 ((fontDescription.style() == FontStyleItalic || | 275 fontDescription.isSyntheticBold(), |
276 fontDescription.style() == FontStyleOblique) && | 276 ((fontDescription.style() == FontStyleItalic || |
277 !tf->isItalic()) || | 277 fontDescription.style() == FontStyleOblique) && |
278 fontDescription.isSyntheticItalic(), | 278 !tf->isItalic()) || |
279 fontDescription.orientation())); | 279 fontDescription.isSyntheticItalic(), |
| 280 fontDescription.orientation())); |
280 } | 281 } |
281 #endif // !OS(WIN) | 282 #endif // !OS(WIN) |
282 | 283 |
283 } // namespace blink | 284 } // namespace blink |
OLD | NEW |