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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 const void* keys[] = { kCTFontFeatureSettingsAttribute }; | 228 const void* keys[] = { kCTFontFeatureSettingsAttribute }; |
229 const void* values[] = { featureSettings.get() }; | 229 const void* values[] = { featureSettings.get() }; |
230 RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocat
orDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks)); | 230 RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocat
orDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks)); |
231 | 231 |
232 descriptor = CTFontDescriptorCreateCopyWithAttributes(cascadeToLastResortFon
tDescriptor(), attributes.get()); | 232 descriptor = CTFontDescriptorCreateCopyWithAttributes(cascadeToLastResortFon
tDescriptor(), attributes.get()); |
233 | 233 |
234 return descriptor; | 234 return descriptor; |
235 } | 235 } |
236 | 236 |
| 237 String FontPlatformData::fontFamilyName() const |
| 238 { |
| 239 return String(CTFontCopyDisplayName(ctFont())); |
| 240 } |
| 241 |
237 CTFontRef FontPlatformData::ctFont() const | 242 CTFontRef FontPlatformData::ctFont() const |
238 { | 243 { |
239 if (m_CTFont) | 244 if (m_CTFont) |
240 return m_CTFont.get(); | 245 return m_CTFont.get(); |
241 | 246 |
242 if (m_inMemoryFont) { | 247 if (m_inMemoryFont) { |
243 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(),
m_size, 0, cascadeToLastResortFontDescriptor())); | 248 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(),
m_size, 0, cascadeToLastResortFontDescriptor())); |
244 return m_CTFont.get(); | 249 return m_CTFont.get(); |
245 } | 250 } |
246 | 251 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 #ifndef NDEBUG | 312 #ifndef NDEBUG |
308 String FontPlatformData::description() const | 313 String FontPlatformData::description() const |
309 { | 314 { |
310 RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()
)); | 315 RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()
)); |
311 return String(cgFontDescription.get()) + " " + String::number(m_size) | 316 return String(cgFontDescription.get()) + " " + String::number(m_size) |
312 + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ?
" synthetic oblique" : "") + (m_orientation ? " vertical orientation" : ""); | 317 + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ?
" synthetic oblique" : "") + (m_orientation ? " vertical orientation" : ""); |
313 } | 318 } |
314 #endif | 319 #endif |
315 | 320 |
316 } // namespace WebCore | 321 } // namespace WebCore |
OLD | NEW |