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 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 for (size_t i = 0; i < size; ++i) { | 111 for (size_t i = 0; i < size; ++i) { |
112 if (SimpleFontData* result = m_sources[i]->getFontData(fontDescription,
syntheticBold, syntheticItalic, fontSelector)) { | 112 if (SimpleFontData* result = m_sources[i]->getFontData(fontDescription,
syntheticBold, syntheticItalic, fontSelector)) { |
113 m_activeSource = m_sources[i]; | 113 m_activeSource = m_sources[i]; |
114 return result; | 114 return result; |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 return 0; | 118 return 0; |
119 } | 119 } |
120 | 120 |
| 121 void CSSFontFace::retireCustomFont(SimpleFontData* fontData) |
| 122 { |
| 123 if (m_segmentedFontFaces.isEmpty()) { |
| 124 GlyphPageTreeNode::pruneTreeCustomFontData(fontData); |
| 125 delete fontData; |
| 126 return; |
| 127 } |
| 128 |
| 129 // Use one of the CSSSegmentedFontFaces' font selector. They all have |
| 130 // the same font selector. |
| 131 (*m_segmentedFontFaces.begin())->fontSelector()->retireCustomFont(fontData); |
| 132 } |
| 133 |
121 #if ENABLE(SVG_FONTS) | 134 #if ENABLE(SVG_FONTS) |
122 bool CSSFontFace::hasSVGFontFaceSource() const | 135 bool CSSFontFace::hasSVGFontFaceSource() const |
123 { | 136 { |
124 for (unsigned i = 0; i < m_sources.size(); i++) { | 137 for (unsigned i = 0; i < m_sources.size(); i++) { |
125 if (m_sources[i]->isSVGFontFaceSource()) | 138 if (m_sources[i]->isSVGFontFaceSource()) |
126 return true; | 139 return true; |
127 } | 140 } |
128 return false; | 141 return false; |
129 } | 142 } |
130 #endif | 143 #endif |
131 | 144 |
132 } | 145 } |
133 | 146 |
OLD | NEW |