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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 | 47 |
48 #if !OS(WIN) && !OS(ANDROID) | 48 #if !OS(WIN) && !OS(ANDROID) |
49 #include "SkFontConfigInterface.h" | 49 #include "SkFontConfigInterface.h" |
50 | 50 |
51 static PassRefPtr<SkTypeface> typefaceForFontconfigInterfaceIdAndTtcIndex(int fo ntconfigInterfaceId, int ttcIndex) | 51 static PassRefPtr<SkTypeface> typefaceForFontconfigInterfaceIdAndTtcIndex(int fo ntconfigInterfaceId, int ttcIndex) |
52 { | 52 { |
53 SkAutoTUnref<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal()); | 53 SkAutoTUnref<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal()); |
54 SkFontConfigInterface::FontIdentity fontIdentity; | 54 SkFontConfigInterface::FontIdentity fontIdentity; |
55 fontIdentity.fID = fontconfigInterfaceId; | 55 fontIdentity.fID = fontconfigInterfaceId; |
56 fontIdentity.fTTCIndex = ttcIndex; | 56 fontIdentity.fTTCIndex = ttcIndex; |
57 return adoptRef(fci->createTypeface(fontIdentity)); | 57 return adoptRef(fci->makeTypeface(fontIdentity).release()); |
f(malita)
2016/06/03 17:11:59
Nit: return fromSkSp(fci->makeTypeface(fontIdentit
bungeman-chromium
2016/06/03 18:28:18
Thanks, I thought something like this existed, but
| |
58 } | 58 } |
59 #endif | 59 #endif |
60 | 60 |
61 namespace blink { | 61 namespace blink { |
62 | 62 |
63 #if OS(ANDROID) || OS(LINUX) | 63 #if OS(ANDROID) || OS(LINUX) |
64 // Android special locale for retrieving the color emoji font | 64 // Android special locale for retrieving the color emoji font |
65 // based on the proposed changes in UTR #51 for introducing | 65 // based on the proposed changes in UTR #51 for introducing |
66 // an Emoji script code: | 66 // an Emoji script code: |
67 // http://www.unicode.org/reports/tr51/proposed.html#Emoji_Script | 67 // 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, | 211 return adoptPtr(new FontPlatformData(tf, |
212 name.data(), | 212 name.data(), |
213 fontSize, | 213 fontSize, |
214 (fontDescription.weight() > 200 + tf->fontStyle().weight()) || fontDescr iption.isSyntheticBold(), | 214 (fontDescription.weight() > 200 + tf->fontStyle().weight()) || fontDescr iption.isSyntheticBold(), |
215 ((fontDescription.style() == FontStyleItalic || fontDescription.style() == FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), | 215 ((fontDescription.style() == FontStyleItalic || fontDescription.style() == FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), |
216 fontDescription.orientation())); | 216 fontDescription.orientation())); |
217 } | 217 } |
218 #endif // !OS(WIN) | 218 #endif // !OS(WIN) |
219 | 219 |
220 } // namespace blink | 220 } // namespace blink |
OLD | NEW |