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

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: rebase Created 6 years, 7 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/CSSSegmentedFontFace.h ('k') | Source/core/rendering/RenderText.cpp » ('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) 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 bool CSSSegmentedFontFace::isLoaded() const 178 bool CSSSegmentedFontFace::isLoaded() const
179 { 179 {
180 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 180 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
181 if ((*it)->loadStatus() != FontFace::Loaded) 181 if ((*it)->loadStatus() != FontFace::Loaded)
182 return false; 182 return false;
183 } 183 }
184 return true; 184 return true;
185 } 185 }
186 186
187 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio n) 187 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio n, UChar32 character)
188 { 188 {
189 for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end( ); ++it) 189 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF aces.rend(); ++it) {
190 (*it)->cssFontFace()->willUseFontData(fontDescription); 190 if ((*it)->loadStatus() != FontFace::Unloaded)
191 break;
192 if ((*it)->cssFontFace()->maybeScheduleFontLoad(fontDescription, charact er))
193 break;
194 }
191 } 195 }
192 196
193 bool CSSSegmentedFontFace::checkFont(const String& text) const 197 bool CSSSegmentedFontFace::checkFont(const String& text) const
194 { 198 {
195 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 199 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
196 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran ges().intersectsWith(text)) 200 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran ges().intersectsWith(text))
197 return false; 201 return false;
198 } 202 }
199 return true; 203 return true;
200 } 204 }
201 205
202 void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWill BeMember<FontFace> >& faces) const 206 void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWill BeMember<FontFace> >& faces) const
203 { 207 {
204 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 208 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
205 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) 209 if ((*it)->cssFontFace()->ranges().intersectsWith(text))
206 faces.append(*it); 210 faces.append(*it);
207 } 211 }
208 } 212 }
209 213
210 void CSSSegmentedFontFace::trace(Visitor* visitor) 214 void CSSSegmentedFontFace::trace(Visitor* visitor)
211 { 215 {
212 visitor->trace(m_fontSelector); 216 visitor->trace(m_fontSelector);
213 visitor->trace(m_fontFaces); 217 visitor->trace(m_fontFaces);
214 } 218 }
215 219
216 } 220 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.h ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698