summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text_win.cc
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 20:59:26 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 20:59:26 +0000
commit8a44197cee226d29df0cb5d3eea907e92eeccc35 (patch)
tree1fd93cd36bc4cf73251998f715ef995573812f39 /ui/gfx/render_text_win.cc
parent1851bc517fbcc70a75f1689c567c2cb0f98f5c4b (diff)
downloadchromium_src-8a44197cee226d29df0cb5d3eea907e92eeccc35.zip
chromium_src-8a44197cee226d29df0cb5d3eea907e92eeccc35.tar.gz
chromium_src-8a44197cee226d29df0cb5d3eea907e92eeccc35.tar.bz2
RenderTextWin: Trim whitespace when stripping parentheses from the font name.
BUG=129713, 105550 TEST=Go to ko.wikipedia.org and verify that Malgun Gothic gets used for the tab title text via logging. Review URL: https://chromiumcodereview.appspot.com/10458035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text_win.cc')
-rw-r--r--ui/gfx/render_text_win.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index f57a56a..0c1de02 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -115,13 +115,15 @@ void GetFontNamesFromFilename(const std::string& filename,
if (it == font_map->end())
return;
- // The family string is in the format "FamilyFoo & FamilyBar (True Type)".
+ // The family string is in the format "FamilyFoo & FamilyBar (TrueType)".
// Split by '&' and strip off the trailing parenthesized experession.
base::SplitString(it->second, '&', font_names);
if (!font_names->empty()) {
const size_t index = font_names->back().find('(');
- if (index != std::string::npos)
+ if (index != std::string::npos) {
font_names->back().resize(index);
+ TrimWhitespace(font_names->back(), TRIM_TRAILING, &font_names->back());
+ }
}
}