| 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 20 matching lines...) Expand all Loading... |
| 31 #include "SkFontMgr.h" | 31 #include "SkFontMgr.h" |
| 32 #include "SkStream.h" | 32 #include "SkStream.h" |
| 33 #include "SkTypeface.h" | 33 #include "SkTypeface.h" |
| 34 #include "platform/Language.h" | 34 #include "platform/Language.h" |
| 35 #include "platform/fonts/AcceptLanguagesResolver.h" | 35 #include "platform/fonts/AcceptLanguagesResolver.h" |
| 36 #include "platform/fonts/AlternateFontFamily.h" | 36 #include "platform/fonts/AlternateFontFamily.h" |
| 37 #include "platform/fonts/FontCache.h" | 37 #include "platform/fonts/FontCache.h" |
| 38 #include "platform/fonts/FontDescription.h" | 38 #include "platform/fonts/FontDescription.h" |
| 39 #include "platform/fonts/FontFaceCreationParams.h" | 39 #include "platform/fonts/FontFaceCreationParams.h" |
| 40 #include "platform/fonts/SimpleFontData.h" | 40 #include "platform/fonts/SimpleFontData.h" |
| 41 #include "platform/graphics/skia/SkiaUtils.h" |
| 41 #include "public/platform/Platform.h" | 42 #include "public/platform/Platform.h" |
| 42 #include "public/platform/linux/WebSandboxSupport.h" | 43 #include "public/platform/linux/WebSandboxSupport.h" |
| 43 #include "wtf/Assertions.h" | 44 #include "wtf/Assertions.h" |
| 44 #include "wtf/text/AtomicString.h" | 45 #include "wtf/text/AtomicString.h" |
| 45 #include "wtf/text/CString.h" | 46 #include "wtf/text/CString.h" |
| 46 #include <unicode/locid.h> | 47 #include <unicode/locid.h> |
| 47 | 48 |
| 48 #if !OS(WIN) && !OS(ANDROID) | 49 #if !OS(WIN) && !OS(ANDROID) |
| 49 #include "SkFontConfigInterface.h" | 50 #include "SkFontConfigInterface.h" |
| 50 | 51 |
| 51 static PassRefPtr<SkTypeface> typefaceForFontconfigInterfaceIdAndTtcIndex(int fo
ntconfigInterfaceId, int ttcIndex) | 52 static PassRefPtr<SkTypeface> typefaceForFontconfigInterfaceIdAndTtcIndex(int fo
ntconfigInterfaceId, int ttcIndex) |
| 52 { | 53 { |
| 53 SkAutoTUnref<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal()); | 54 SkAutoTUnref<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal()); |
| 54 SkFontConfigInterface::FontIdentity fontIdentity; | 55 SkFontConfigInterface::FontIdentity fontIdentity; |
| 55 fontIdentity.fID = fontconfigInterfaceId; | 56 fontIdentity.fID = fontconfigInterfaceId; |
| 56 fontIdentity.fTTCIndex = ttcIndex; | 57 fontIdentity.fTTCIndex = ttcIndex; |
| 57 return adoptRef(fci->createTypeface(fontIdentity)); | 58 return blink::fromSkSp(fci->makeTypeface(fontIdentity)); |
| 58 } | 59 } |
| 59 #endif | 60 #endif |
| 60 | 61 |
| 61 namespace blink { | 62 namespace blink { |
| 62 | 63 |
| 63 #if OS(ANDROID) || OS(LINUX) | 64 #if OS(ANDROID) || OS(LINUX) |
| 64 // Android special locale for retrieving the color emoji font | 65 // Android special locale for retrieving the color emoji font |
| 65 // based on the proposed changes in UTR #51 for introducing | 66 // based on the proposed changes in UTR #51 for introducing |
| 66 // an Emoji script code: | 67 // an Emoji script code: |
| 67 // http://www.unicode.org/reports/tr51/proposed.html#Emoji_Script | 68 // http://www.unicode.org/reports/tr51/proposed.html#Emoji_Script |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 return adoptPtr(new FontPlatformData(tf, | 212 return adoptPtr(new FontPlatformData(tf, |
| 212 name.data(), | 213 name.data(), |
| 213 fontSize, | 214 fontSize, |
| 214 (fontDescription.weight() > 200 + tf->fontStyle().weight()) || fontDescr
iption.isSyntheticBold(), | 215 (fontDescription.weight() > 200 + tf->fontStyle().weight()) || fontDescr
iption.isSyntheticBold(), |
| 215 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), | 216 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), |
| 216 fontDescription.orientation())); | 217 fontDescription.orientation())); |
| 217 } | 218 } |
| 218 #endif // !OS(WIN) | 219 #endif // !OS(WIN) |
| 219 | 220 |
| 220 } // namespace blink | 221 } // namespace blink |
| OLD | NEW |