OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (fallbackPriority != FontFallbackPriority::EmojiEmoji | 98 if (fallbackPriority != FontFallbackPriority::EmojiEmoji |
99 && (fontDescription.style() == FontStyleItalic | 99 && (fontDescription.style() == FontStyleItalic |
100 || fontDescription.weight() >= FontWeight600)) { | 100 || fontDescription.weight() >= FontWeight600)) { |
101 RefPtr<SimpleFontData> fontData = fallbackOnStandardFontStyle( | 101 RefPtr<SimpleFontData> fontData = fallbackOnStandardFontStyle( |
102 fontDescription, c); | 102 fontDescription, c); |
103 if (fontData) | 103 if (fontData) |
104 return fontData; | 104 return fontData; |
105 } | 105 } |
106 | 106 |
107 FontCache::PlatformFallbackFont fallbackFont; | 107 FontCache::PlatformFallbackFont fallbackFont; |
108 FontCache::getFontForCharacter(c, fontDescription.locale().ascii().data(), &
fallbackFont); | 108 FontCache::getFontForCharacter(c, fontDescription.localeOrDefault().ascii().
data(), &fallbackFont); |
109 if (fallbackFont.name.isEmpty()) | 109 if (fallbackFont.name.isEmpty()) |
110 return nullptr; | 110 return nullptr; |
111 | 111 |
112 FontFaceCreationParams creationParams; | 112 FontFaceCreationParams creationParams; |
113 creationParams = FontFaceCreationParams(fallbackFont.filename, fallbackFont.
fontconfigInterfaceId, fallbackFont.ttcIndex); | 113 creationParams = FontFaceCreationParams(fallbackFont.filename, fallbackFont.
fontconfigInterfaceId, fallbackFont.ttcIndex); |
114 | 114 |
115 // Changes weight and/or italic of given FontDescription depends on | 115 // Changes weight and/or italic of given FontDescription depends on |
116 // the result of fontconfig so that keeping the correct font mapping | 116 // the result of fontconfig so that keeping the correct font mapping |
117 // of the given character. See http://crbug.com/32109 for details. | 117 // of the given character. See http://crbug.com/32109 for details. |
118 bool shouldSetSyntheticBold = false; | 118 bool shouldSetSyntheticBold = false; |
(...skipping 18 matching lines...) Expand all Loading... |
137 | 137 |
138 std::unique_ptr<FontPlatformData> platformData(new FontPlatformData(*substit
utePlatformData)); | 138 std::unique_ptr<FontPlatformData> platformData(new FontPlatformData(*substit
utePlatformData)); |
139 platformData->setSyntheticBold(shouldSetSyntheticBold); | 139 platformData->setSyntheticBold(shouldSetSyntheticBold); |
140 platformData->setSyntheticItalic(shouldSetSyntheticItalic); | 140 platformData->setSyntheticItalic(shouldSetSyntheticItalic); |
141 return fontDataFromFontPlatformData(platformData.get(), DoNotRetain); | 141 return fontDataFromFontPlatformData(platformData.get(), DoNotRetain); |
142 } | 142 } |
143 | 143 |
144 #endif // !OS(ANDROID) | 144 #endif // !OS(ANDROID) |
145 | 145 |
146 } // namespace blink | 146 } // namespace blink |
OLD | NEW |