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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (fallbackFont.isItalic && description.style() == FontStyleNormal) | 127 if (fallbackFont.isItalic && description.style() == FontStyleNormal) |
128 description.setStyle(FontStyleItalic); | 128 description.setStyle(FontStyleItalic); |
129 if (!fallbackFont.isItalic && (description.style() == FontStyleItalic || des
cription.style() == FontStyleOblique)) { | 129 if (!fallbackFont.isItalic && (description.style() == FontStyleItalic || des
cription.style() == FontStyleOblique)) { |
130 shouldSetSyntheticItalic = true; | 130 shouldSetSyntheticItalic = true; |
131 description.setStyle(FontStyleNormal); | 131 description.setStyle(FontStyleNormal); |
132 } | 132 } |
133 | 133 |
134 FontPlatformData* substitutePlatformData = getFontPlatformData(description,
creationParams); | 134 FontPlatformData* substitutePlatformData = getFontPlatformData(description,
creationParams); |
135 if (!substitutePlatformData) | 135 if (!substitutePlatformData) |
136 return nullptr; | 136 return nullptr; |
137 FontPlatformData platformData = FontPlatformData(*substitutePlatformData); | 137 |
138 platformData.setSyntheticBold(shouldSetSyntheticBold); | 138 std::unique_ptr<FontPlatformData> platformData(new FontPlatformData(*substit
utePlatformData)); |
139 platformData.setSyntheticItalic(shouldSetSyntheticItalic); | 139 platformData->setSyntheticBold(shouldSetSyntheticBold); |
140 return fontDataFromFontPlatformData(&platformData, DoNotRetain); | 140 platformData->setSyntheticItalic(shouldSetSyntheticItalic); |
| 141 return fontDataFromFontPlatformData(platformData.get(), DoNotRetain); |
141 } | 142 } |
142 | 143 |
143 #endif // !OS(ANDROID) | 144 #endif // !OS(ANDROID) |
144 | 145 |
145 } // namespace blink | 146 } // namespace blink |
OLD | NEW |