From 8a44197cee226d29df0cb5d3eea907e92eeccc35 Mon Sep 17 00:00:00 2001 From: "asvitkine@chromium.org" Date: Wed, 30 May 2012 20:59:26 +0000 Subject: 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 --- ui/gfx/render_text_win.cc | 6 ++++-- 1 file 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()); + } } } -- cgit v1.1