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 | |
134 #if ENABLE(SVG_FONTS) | 121 #if ENABLE(SVG_FONTS) |
135 bool CSSFontFace::hasSVGFontFaceSource() const | 122 bool CSSFontFace::hasSVGFontFaceSource() const |
136 { | 123 { |
137 for (unsigned i = 0; i < m_sources.size(); i++) { | 124 for (unsigned i = 0; i < m_sources.size(); i++) { |
138 if (m_sources[i]->isSVGFontFaceSource()) | 125 if (m_sources[i]->isSVGFontFaceSource()) |
139 return true; | 126 return true; |
140 } | 127 } |
141 return false; | 128 return false; |
142 } | 129 } |
143 #endif | 130 #endif |
144 | 131 |
145 } | 132 } |
146 | 133 |
OLD | NEW |