OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 const SimpleFontData* FontFallbackList::determinePrimarySimpleFontData(const Fon
tDescription& fontDescription) const | 104 const SimpleFontData* FontFallbackList::determinePrimarySimpleFontData(const Fon
tDescription& fontDescription) const |
105 { | 105 { |
106 bool shouldLoadCustomFont = true; | 106 bool shouldLoadCustomFont = true; |
107 | 107 |
108 for (unsigned fontIndex = 0; ; ++fontIndex) { | 108 for (unsigned fontIndex = 0; ; ++fontIndex) { |
109 const FontData* fontData = fontDataAt(fontDescription, fontIndex); | 109 const FontData* fontData = fontDataAt(fontDescription, fontIndex); |
110 if (!fontData) { | 110 if (!fontData) { |
111 // All fonts are custom fonts and are loading. Return the first Font
Data. | 111 // All fonts are custom fonts and are loading. Return the first Font
Data. |
112 fontData = fontDataAt(fontDescription, 0); | 112 fontData = fontDataAt(fontDescription, 0); |
113 if (fontData) | 113 if (fontData) |
114 return fontData->fontDataForCharacter(space); | 114 return fontData->fontDataForCharacter(spaceCharacter); |
115 | 115 |
116 SimpleFontData* lastResortFallback = FontCache::fontCache()->getLast
ResortFallbackFont(fontDescription).get(); | 116 SimpleFontData* lastResortFallback = FontCache::fontCache()->getLast
ResortFallbackFont(fontDescription).get(); |
117 ASSERT(lastResortFallback); | 117 ASSERT(lastResortFallback); |
118 return lastResortFallback; | 118 return lastResortFallback; |
119 } | 119 } |
120 | 120 |
121 if (fontData->isSegmented() && !toSegmentedFontData(fontData)->containsC
haracter(space)) | 121 if (fontData->isSegmented() && !toSegmentedFontData(fontData)->containsC
haracter(spaceCharacter)) |
122 continue; | 122 continue; |
123 | 123 |
124 const SimpleFontData* fontDataForSpace = fontData->fontDataForCharacter(
space); | 124 const SimpleFontData* fontDataForSpace = fontData->fontDataForCharacter(
spaceCharacter); |
125 ASSERT(fontDataForSpace); | 125 ASSERT(fontDataForSpace); |
126 | 126 |
127 // When a custom font is loading, we should use the correct fallback fon
t to layout the text. | 127 // When a custom font is loading, we should use the correct fallback fon
t to layout the text. |
128 // Here skip the temporary font for the loading custom font which may no
t act as the correct fallback font. | 128 // Here skip the temporary font for the loading custom font which may no
t act as the correct fallback font. |
129 if (!fontDataForSpace->isLoadingFallback()) | 129 if (!fontDataForSpace->isLoadingFallback()) |
130 return fontDataForSpace; | 130 return fontDataForSpace; |
131 | 131 |
132 if (fontData->isSegmented()) { | 132 if (fontData->isSegmented()) { |
133 const SegmentedFontData* segmented = toSegmentedFontData(fontData); | 133 const SegmentedFontData* segmented = toSegmentedFontData(fontData); |
134 for (unsigned i = 0; i < segmented->numRanges(); i++) { | 134 for (unsigned i = 0; i < segmented->numRanges(); i++) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 bool FontFallbackList::isValid() const | 217 bool FontFallbackList::isValid() const |
218 { | 218 { |
219 if (!m_fontSelector) | 219 if (!m_fontSelector) |
220 return m_fontSelectorVersion == 0; | 220 return m_fontSelectorVersion == 0; |
221 | 221 |
222 return m_fontSelector->version() == m_fontSelectorVersion; | 222 return m_fontSelector->version() == m_fontSelectorVersion; |
223 } | 223 } |
224 | 224 |
225 } // namespace blink | 225 } // namespace blink |
OLD | NEW |