OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 return face->getFontData(fontDescription); | 197 return face->getFontData(fontDescription); |
198 | 198 |
199 // Try to return the correct font based off our settings, in case we were ha
nded the generic font family name. | 199 // Try to return the correct font based off our settings, in case we were ha
nded the generic font family name. |
200 AtomicString settingsFamilyName = familyNameFromSettings(m_genericFontFamily
Settings, fontDescription, familyName); | 200 AtomicString settingsFamilyName = familyNameFromSettings(m_genericFontFamily
Settings, fontDescription, familyName); |
201 if (settingsFamilyName.isEmpty()) | 201 if (settingsFamilyName.isEmpty()) |
202 return 0; | 202 return 0; |
203 | 203 |
204 return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyNa
me); | 204 return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyNa
me); |
205 } | 205 } |
206 | 206 |
207 CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDe
scription, const AtomicString& familyName) | |
208 { | |
209 return m_cssSegmentedFontFaceCache.get(fontDescription, familyName); | |
210 } | |
211 | |
212 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, co
nst AtomicString& family) | 207 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, co
nst AtomicString& family) |
213 { | 208 { |
214 CSSSegmentedFontFace* face = getFontFace(fontDescription, family); | 209 CSSSegmentedFontFace* face = m_cssSegmentedFontFaceCache.get(fontDescription
, family); |
215 if (face) | 210 if (face) |
216 face->willUseFontData(fontDescription); | 211 face->willUseFontData(fontDescription); |
217 } | 212 } |
218 | 213 |
219 void CSSFontSelector::clearDocument() | 214 void CSSFontSelector::clearDocument() |
220 { | 215 { |
221 m_fontLoader.clearResourceFetcher(); | 216 m_fontLoader.clearResourceFetcher(); |
222 m_document = 0; | 217 m_document = 0; |
223 } | 218 } |
224 | 219 |
225 void CSSFontSelector::beginLoadingFontSoon(FontResource* font) | 220 void CSSFontSelector::beginLoadingFontSoon(FontResource* font) |
226 { | 221 { |
227 m_fontLoader.addFontToBeginLoading(font); | 222 m_fontLoader.addFontToBeginLoading(font); |
228 } | 223 } |
229 | 224 |
230 void CSSFontSelector::loadPendingFonts() | 225 void CSSFontSelector::loadPendingFonts() |
231 { | 226 { |
232 m_fontLoader.loadPendingFonts(); | 227 m_fontLoader.loadPendingFonts(); |
233 } | 228 } |
234 | 229 |
235 } | 230 } |
OLD | NEW |