Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: Source/core/css/CSSFontFace.cpp

Issue 26702008: Allow small-caps synthesis for @font-face with multiple sources including SVG format (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSSegmentedFontFace.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 document->fonts()->fontLoaded(m_fontFace.get()); 170 document->fonts()->fontLoaded(m_fontFace.get());
171 break; 171 break;
172 case FontFace::Error: 172 case FontFace::Error:
173 document->fonts()->loadError(m_fontFace.get()); 173 document->fonts()->loadError(m_fontFace.get());
174 break; 174 break;
175 default: 175 default:
176 break; 176 break;
177 } 177 }
178 } 178 }
179 179
180 #if ENABLE(SVG_FONTS)
181 bool CSSFontFace::hasSVGFontFaceSource() const
182 {
183 size_t size = m_sources.size();
184 for (size_t i = 0; i < size; i++) {
185 if (m_sources[i]->isSVGFontFaceSource())
186 return true;
187 }
188 return false;
189 }
190 #endif
191
192 bool CSSFontFace::UnicodeRangeSet::intersectsWith(const String& text) const 180 bool CSSFontFace::UnicodeRangeSet::intersectsWith(const String& text) const
193 { 181 {
194 if (text.isEmpty()) 182 if (text.isEmpty())
195 return false; 183 return false;
196 if (m_ranges.isEmpty()) 184 if (m_ranges.isEmpty())
197 return true; // Empty UnicodeRangeSet represents the whole code space. 185 return true; // Empty UnicodeRangeSet represents the whole code space.
198 186
199 // FIXME: This takes O(text.length() * m_ranges.size()) time. It would be 187 // FIXME: This takes O(text.length() * m_ranges.size()) time. It would be
200 // better to make m_ranges sorted and use binary search. 188 // better to make m_ranges sorted and use binary search.
201 unsigned index = 0; 189 unsigned index = 0;
202 while (index < text.length()) { 190 while (index < text.length()) {
203 UChar32 c = text.characterStartingAt(index); 191 UChar32 c = text.characterStartingAt(index);
204 index += U16_LENGTH(c); 192 index += U16_LENGTH(c);
205 for (unsigned i = 0; i < m_ranges.size(); i++) { 193 for (unsigned i = 0; i < m_ranges.size(); i++) {
206 if (m_ranges[i].contains(c)) 194 if (m_ranges[i].contains(c))
207 return true; 195 return true;
208 } 196 }
209 } 197 }
210 return false; 198 return false;
211 } 199 }
212 200
213 } 201 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSSegmentedFontFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698