OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2007 Apple Computer, Inc. |
3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 fontData->setupPaint(&paint); | 78 fontData->setupPaint(&paint); |
79 paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); | 79 paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); |
80 | 80 |
81 uint16_t glyph; | 81 uint16_t glyph; |
82 paint.textToGlyphs(&character, sizeof(character), &glyph); | 82 paint.textToGlyphs(&character, sizeof(character), &glyph); |
83 return glyph; | 83 return glyph; |
84 } | 84 } |
85 | 85 |
86 // Given the desired base font, this will create a SimpleFontData for a specific | 86 // Given the desired base font, this will create a SimpleFontData for a specific |
87 // font that can be used to render the given range of characters. | 87 // font that can be used to render the given range of characters. |
88 PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDes
cription& fontDescription, UChar32 character, const SimpleFontData*) | 88 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
tion& fontDescription, UChar32 character, const SimpleFontData*) |
89 { | 89 { |
90 // FIXME: Consider passing fontDescription.dominantScript() | 90 // FIXME: Consider passing fontDescription.dominantScript() |
91 // to GetFallbackFamily here. | 91 // to GetFallbackFamily here. |
92 UScriptCode script; | 92 UScriptCode script; |
93 const wchar_t* family = getFallbackFamily(character, | 93 const wchar_t* family = getFallbackFamily(character, |
94 fontDescription.genericFamily(), | 94 fontDescription.genericFamily(), |
95 &script, | 95 &script, |
96 m_fontManager.get()); | 96 m_fontManager.get()); |
97 FontPlatformData* data = 0; | 97 FontPlatformData* data = 0; |
98 if (family) | 98 if (family) |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 fontSize, | 222 fontSize, |
223 fontDescription.weight() >= FontWeightBold && !tf->isBold() || fontDescr
iption.isSyntheticBold(), | 223 fontDescription.weight() >= FontWeightBold && !tf->isBold() || fontDescr
iption.isSyntheticBold(), |
224 fontDescription.style() == FontStyleItalic && !tf->isItalic() || fontDes
cription.isSyntheticItalic(), | 224 fontDescription.style() == FontStyleItalic && !tf->isItalic() || fontDes
cription.isSyntheticItalic(), |
225 fontDescription.orientation(), | 225 fontDescription.orientation(), |
226 s_useSubpixelPositioning); | 226 s_useSubpixelPositioning); |
227 | 227 |
228 return result; | 228 return result; |
229 } | 229 } |
230 | 230 |
231 } | 231 } |
OLD | NEW |