OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 for (int i = 0; i < srcLength; i++) { | 241 for (int i = 0; i < srcLength; i++) { |
242 // An item in the list either specifies a string (local font name) or a
URL (remote font to download). | 242 // An item in the list either specifies a string (local font name) or a
URL (remote font to download). |
243 CSSFontFaceSrcValue* item = static_cast<CSSFontFaceSrcValue*>(srcList->i
temWithoutBoundsCheck(i)); | 243 CSSFontFaceSrcValue* item = static_cast<CSSFontFaceSrcValue*>(srcList->i
temWithoutBoundsCheck(i)); |
244 CSSFontFaceSource* source = 0; | 244 CSSFontFaceSource* source = 0; |
245 | 245 |
246 #if ENABLE(SVG_FONTS) | 246 #if ENABLE(SVG_FONTS) |
247 foundSVGFont = item->isSVGFontFaceSrc() || item->svgFontFaceElement(); | 247 foundSVGFont = item->isSVGFontFaceSrc() || item->svgFontFaceElement(); |
248 #endif | 248 #endif |
249 | 249 |
250 if (!item->isLocal()) { | 250 if (!item->isLocal()) { |
| 251 #if ENABLE(SVG_FONTS) |
| 252 if (item->isSupportedFormat() && (foundSVGFont || (m_document && m_d
ocument->settings()->remoteFontEnabled()))) { |
| 253 #else |
251 if (item->isSupportedFormat() && m_document && m_document->settings(
)->remoteFontEnabled()) { | 254 if (item->isSupportedFormat() && m_document && m_document->settings(
)->remoteFontEnabled()) { |
| 255 #endif |
252 CachedFont* cachedFont = m_document->docLoader()->requestFont(it
em->resource()); | 256 CachedFont* cachedFont = m_document->docLoader()->requestFont(it
em->resource()); |
253 if (cachedFont) { | 257 if (cachedFont) { |
254 #if ENABLE(SVG_FONTS) | 258 #if ENABLE(SVG_FONTS) |
255 if (foundSVGFont) | 259 if (foundSVGFont) |
256 cachedFont->setSVGFont(true); | 260 cachedFont->setSVGFont(true); |
257 #endif | 261 #endif |
258 source = new CSSFontFaceSource(item->resource(), cachedFont)
; | 262 source = new CSSFontFaceSource(item->resource(), cachedFont)
; |
259 } | 263 } |
260 } | 264 } |
261 } else { | 265 } else { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 unsigned numCandidates = candidateFontFaces.size(); | 536 unsigned numCandidates = candidateFontFaces.size(); |
533 for (unsigned i = 0; i < numCandidates; ++i) | 537 for (unsigned i = 0; i < numCandidates; ++i) |
534 face->appendFontFace(candidateFontFaces[i]); | 538 face->appendFontFace(candidateFontFaces[i]); |
535 } | 539 } |
536 | 540 |
537 // We have a face. Ask it for a font data. If it cannot produce one, it wi
ll fail, and the OS will take over. | 541 // We have a face. Ask it for a font data. If it cannot produce one, it wi
ll fail, and the OS will take over. |
538 return face->getFontData(fontDescription); | 542 return face->getFontData(fontDescription); |
539 } | 543 } |
540 | 544 |
541 } | 545 } |
OLD | NEW |