| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 // FIXME: Use m_fontManager, matchFamilyStyle instead of | 195 // FIXME: Use m_fontManager, matchFamilyStyle instead of |
| 196 // legacyCreateTypeface on all platforms. | 196 // legacyCreateTypeface on all platforms. |
| 197 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); | 197 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); |
| 198 return adoptRef(fm->legacyCreateTypeface(name.data(), | 198 return adoptRef(fm->legacyCreateTypeface(name.data(), |
| 199 fontDescription.skiaFontStyle())); | 199 fontDescription.skiaFontStyle())); |
| 200 } | 200 } |
| 201 | 201 |
| 202 #if !OS(WIN) | 202 #if !OS(WIN) |
| 203 PassOwnPtr<FontPlatformData> FontCache::createFontPlatformData(const FontDescrip
tion& fontDescription, | 203 PassOwnPtr<FontPlatformData> FontCache::createFontPlatformData(const FontDescrip
tion& fontDescription, |
| 204 const FontFaceCreationParams& creationParams, float fontSize) | 204 const FontFaceCreationParams& creationParams) |
| 205 { | 205 { |
| 206 CString name; | 206 CString name; |
| 207 RefPtr<SkTypeface> tf(createTypeface(fontDescription, creationParams, name))
; | 207 RefPtr<SkTypeface> tf(createTypeface(fontDescription, creationParams, name))
; |
| 208 if (!tf) | 208 if (!tf) |
| 209 return nullptr; | 209 return nullptr; |
| 210 | 210 |
| 211 return adoptPtr(new FontPlatformData(tf, | 211 return adoptPtr(new FontPlatformData(tf, |
| 212 name.data(), | 212 name.data(), |
| 213 fontSize, | |
| 214 (fontDescription.weight() > 200 + tf->fontStyle().weight()) || fontDescr
iption.isSyntheticBold(), | 213 (fontDescription.weight() > 200 + tf->fontStyle().weight()) || fontDescr
iption.isSyntheticBold(), |
| 215 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), | 214 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), |
| 216 fontDescription.orientation())); | 215 fontDescription.orientation())); |
| 217 } | 216 } |
| 218 #endif // !OS(WIN) | 217 #endif // !OS(WIN) |
| 219 | 218 |
| 220 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |