OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the internal font implementation. | 2 * This file is part of the internal font implementation. |
3 * | 3 * |
4 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
5 * Copyright (c) 2010 Google Inc. All rights reserved. | 5 * Copyright (c) 2010 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 #else | 240 #else |
241 return false; | 241 return false; |
242 #endif | 242 #endif |
243 } | 243 } |
244 | 244 |
245 CTFontRef FontPlatformData::ctFont() const | 245 CTFontRef FontPlatformData::ctFont() const |
246 { | 246 { |
247 if (m_CTFont) | 247 if (m_CTFont) |
248 return m_CTFont.get(); | 248 return m_CTFont.get(); |
249 | 249 |
| 250 #if PLATFORM(CHROMIUM) |
| 251 if (m_inMemoryFont) { |
| 252 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(),
m_size, 0, canSetCascadeListForCustomFont() ? cascadeToLastResortFontDescriptor(
) : 0)); |
| 253 return m_CTFont.get(); |
| 254 } |
| 255 #endif |
| 256 |
250 m_CTFont = toCTFontRef(m_font); | 257 m_CTFont = toCTFontRef(m_font); |
251 if (m_CTFont) { | 258 if (m_CTFont) { |
252 CTFontDescriptorRef fontDescriptor; | 259 CTFontDescriptorRef fontDescriptor; |
253 RetainPtr<CFStringRef> postScriptName(AdoptCF, CTFontCopyPostScriptName(
m_CTFont.get())); | 260 RetainPtr<CFStringRef> postScriptName(AdoptCF, CTFontCopyPostScriptName(
m_CTFont.get())); |
254 // Hoefler Text Italic has line-initial and -final swashes enabled by de
fault, so disable them. | 261 // Hoefler Text Italic has line-initial and -final swashes enabled by de
fault, so disable them. |
255 if (CFEqual(postScriptName.get(), CFSTR("HoeflerText-Italic")) || CFEqua
l(postScriptName.get(), CFSTR("HoeflerText-BlackItalic"))) | 262 if (CFEqual(postScriptName.get(), CFSTR("HoeflerText-Italic")) || CFEqua
l(postScriptName.get(), CFSTR("HoeflerText-BlackItalic"))) |
256 fontDescriptor = cascadeToLastResortAndDisableSwashesFontDescriptor(
); | 263 fontDescriptor = cascadeToLastResortAndDisableSwashesFontDescriptor(
); |
257 else | 264 else |
258 fontDescriptor = cascadeToLastResortFontDescriptor(); | 265 fontDescriptor = cascadeToLastResortFontDescriptor(); |
259 m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size,
0, fontDescriptor)); | 266 m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size,
0, fontDescriptor)); |
(...skipping 19 matching lines...) Expand all Loading... |
279 #ifndef NDEBUG | 286 #ifndef NDEBUG |
280 String FontPlatformData::description() const | 287 String FontPlatformData::description() const |
281 { | 288 { |
282 RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()
)); | 289 RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()
)); |
283 return String(cgFontDescription.get()) + " " + String::number(m_size) | 290 return String(cgFontDescription.get()) + " " + String::number(m_size) |
284 + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ?
" synthetic oblique" : "") + (m_orientation ? " vertical orientation" : ""); | 291 + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ?
" synthetic oblique" : "") + (m_orientation ? " vertical orientation" : ""); |
285 } | 292 } |
286 #endif | 293 #endif |
287 | 294 |
288 } // namespace WebCore | 295 } // namespace WebCore |
OLD | NEW |