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 <usp10.h> | 7 #include <usp10.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // The entry is comma separated, having the font filename as the first value | 199 // The entry is comma separated, having the font filename as the first value |
200 // followed optionally by the font family name and a pair of integer scaling | 200 // followed optionally by the font family name and a pair of integer scaling |
201 // factors. | 201 // factors. |
202 // TODO(asvitkine): Should we support these scaling factors? | 202 // TODO(asvitkine): Should we support these scaling factors? |
203 *font_names = base::SplitString( | 203 *font_names = base::SplitString( |
204 family, "&", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 204 family, "&", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
205 if (!font_names->empty()) { | 205 if (!font_names->empty()) { |
206 const size_t index = font_names->back().find('('); | 206 const size_t index = font_names->back().find('('); |
207 if (index != std::string::npos) { | 207 if (index != std::string::npos) { |
208 font_names->back().resize(index); | 208 font_names->back().resize(index); |
209 base::TrimWhitespace(font_names->back(), base::TRIM_TRAILING, | 209 base::TrimWhitespaceASCII(font_names->back(), base::TRIM_TRAILING, |
210 &font_names->back()); | 210 &font_names->back()); |
211 } | 211 } |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 LinkedFontsIterator::LinkedFontsIterator(Font font) | 215 LinkedFontsIterator::LinkedFontsIterator(Font font) |
216 : original_font_(font), | 216 : original_font_(font), |
217 next_font_set_(false), | 217 next_font_set_(false), |
218 linked_fonts_(NULL), | 218 linked_fonts_(NULL), |
219 linked_font_index_(0) { | 219 linked_font_index_(0) { |
220 SetNextFont(original_font_); | 220 SetNextFont(original_font_); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 font.GetFontSize()); | 323 font.GetFontSize()); |
324 found_fallback = true; | 324 found_fallback = true; |
325 } | 325 } |
326 } | 326 } |
327 DeleteEnhMetaFile(meta_file); | 327 DeleteEnhMetaFile(meta_file); |
328 | 328 |
329 return found_fallback; | 329 return found_fallback; |
330 } | 330 } |
331 | 331 |
332 } // namespace gfx | 332 } // namespace gfx |
OLD | NEW |