OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 ShouldRetain should_retain) { | 234 ShouldRetain should_retain) { |
235 DEFINE_STATIC_LOCAL(AtomicString, times_str, ("Times")); | 235 DEFINE_STATIC_LOCAL(AtomicString, times_str, ("Times")); |
236 | 236 |
237 // FIXME: Would be even better to somehow get the user's default font here. | 237 // FIXME: Would be even better to somehow get the user's default font here. |
238 // For now we'll pick the default that the user would get without changing | 238 // For now we'll pick the default that the user would get without changing |
239 // any prefs. | 239 // any prefs. |
240 RefPtr<SimpleFontData> simple_font_data = | 240 RefPtr<SimpleFontData> simple_font_data = |
241 GetFontData(font_description, times_str, | 241 GetFontData(font_description, times_str, |
242 AlternateFontName::kAllowAlternate, should_retain); | 242 AlternateFontName::kAllowAlternate, should_retain); |
243 if (simple_font_data) | 243 if (simple_font_data) |
244 return simple_font_data.Release(); | 244 return simple_font_data; |
245 | 245 |
246 // The Times fallback will almost always work, but in the highly unusual case | 246 // The Times fallback will almost always work, but in the highly unusual case |
247 // where the user doesn't have it, we fall back on Lucida Grande because | 247 // where the user doesn't have it, we fall back on Lucida Grande because |
248 // that's guaranteed to be there, according to Nathan Taylor. This is good | 248 // that's guaranteed to be there, according to Nathan Taylor. This is good |
249 // enough to avoid a crash at least. | 249 // enough to avoid a crash at least. |
250 DEFINE_STATIC_LOCAL(AtomicString, lucida_grande_str, ("Lucida Grande")); | 250 DEFINE_STATIC_LOCAL(AtomicString, lucida_grande_str, ("Lucida Grande")); |
251 return GetFontData(font_description, lucida_grande_str, | 251 return GetFontData(font_description, lucida_grande_str, |
252 AlternateFontName::kAllowAlternate, should_retain); | 252 AlternateFontName::kAllowAlternate, should_retain); |
253 } | 253 } |
254 | 254 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 WTF::MakeUnique<FontPlatformData>( | 296 WTF::MakeUnique<FontPlatformData>( |
297 platform_font, size, synthetic_bold, synthetic_italic, | 297 platform_font, size, synthetic_bold, synthetic_italic, |
298 font_description.Orientation(), font_description.VariationSettings()); | 298 font_description.Orientation(), font_description.VariationSettings()); |
299 if (!platform_data->Typeface()) { | 299 if (!platform_data->Typeface()) { |
300 return nullptr; | 300 return nullptr; |
301 } | 301 } |
302 return platform_data; | 302 return platform_data; |
303 } | 303 } |
304 | 304 |
305 } // namespace blink | 305 } // namespace blink |
OLD | NEW |