OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/font_fallback_win.h" | 5 #include "ui/gfx/font_fallback_win.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 std::vector<std::string>* font_names) { | 173 std::vector<std::string>* font_names) { |
174 // The entry is comma separated, having the font filename as the first value | 174 // The entry is comma separated, having the font filename as the first value |
175 // followed optionally by the font family name and a pair of integer scaling | 175 // followed optionally by the font family name and a pair of integer scaling |
176 // factors. | 176 // factors. |
177 // TODO(asvitkine): Should we support these scaling factors? | 177 // TODO(asvitkine): Should we support these scaling factors? |
178 base::SplitString(family, '&', font_names); | 178 base::SplitString(family, '&', font_names); |
179 if (!font_names->empty()) { | 179 if (!font_names->empty()) { |
180 const size_t index = font_names->back().find('('); | 180 const size_t index = font_names->back().find('('); |
181 if (index != std::string::npos) { | 181 if (index != std::string::npos) { |
182 font_names->back().resize(index); | 182 font_names->back().resize(index); |
183 TrimWhitespace(font_names->back(), TRIM_TRAILING, &font_names->back()); | 183 base::TrimWhitespace(font_names->back(), base::TRIM_TRAILING, |
| 184 &font_names->back()); |
184 } | 185 } |
185 } | 186 } |
186 } | 187 } |
187 | 188 |
188 } // namespace internal | 189 } // namespace internal |
189 | 190 |
190 LinkedFontsIterator::LinkedFontsIterator(Font font) | 191 LinkedFontsIterator::LinkedFontsIterator(Font font) |
191 : original_font_(font), | 192 : original_font_(font), |
192 next_font_set_(false), | 193 next_font_set_(false), |
193 linked_fonts_(NULL), | 194 linked_fonts_(NULL), |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Note: One possibility would be to always merge both lists of fonts, | 237 // Note: One possibility would be to always merge both lists of fonts, |
237 // but it is not clear whether there are any real world scenarios | 238 // but it is not clear whether there are any real world scenarios |
238 // where this would actually help. | 239 // where this would actually help. |
239 if (fonts->empty()) | 240 if (fonts->empty()) |
240 fonts = font_link->GetLinkedFonts(current_font_); | 241 fonts = font_link->GetLinkedFonts(current_font_); |
241 | 242 |
242 return fonts; | 243 return fonts; |
243 } | 244 } |
244 | 245 |
245 } // namespace gfx | 246 } // namespace gfx |
OLD | NEW |