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

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

Issue 248473005: Make CSSFontFace::willUseFontData() load fonts with unicode-range (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 bool CSSSegmentedFontFace::isLoaded() const 176 bool CSSSegmentedFontFace::isLoaded() const
177 { 177 {
178 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 178 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
179 if ((*it)->loadStatus() != FontFace::Loaded) 179 if ((*it)->loadStatus() != FontFace::Loaded)
180 return false; 180 return false;
181 } 181 }
182 return true; 182 return true;
183 } 183 }
184 184
185 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio n) 185 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio n, const String& text)
186 { 186 {
187 for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end( ); ++it) 187 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF aces.rend(); ++it) {
188 (*it)->cssFontFace()->willUseFontData(fontDescription); 188 if ((*it)->loadStatus() != FontFace::Unloaded)
189 break;
190 if ((*it)->cssFontFace()->willUseFontData(fontDescription, text))
191 break;
192 }
189 } 193 }
190 194
191 bool CSSSegmentedFontFace::checkFont(const String& text) const 195 bool CSSSegmentedFontFace::checkFont(const String& text) const
192 { 196 {
193 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 197 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
194 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran ges().intersectsWith(text)) 198 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran ges().intersectsWith(text))
195 return false; 199 return false;
196 } 200 }
197 return true; 201 return true;
198 } 202 }
199 203
200 void CSSSegmentedFontFace::match(const String& text, Vector<RefPtr<FontFace> >& faces) const 204 void CSSSegmentedFontFace::match(const String& text, Vector<RefPtr<FontFace> >& faces) const
201 { 205 {
202 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 206 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
203 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) 207 if ((*it)->cssFontFace()->ranges().intersectsWith(text))
204 faces.append(*it); 208 faces.append(*it);
205 } 209 }
206 } 210 }
207 211
208 } 212 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698