summaryrefslogtreecommitdiffstats
path: root/ui/gfx/platform_font_win.cc
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 23:55:37 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 23:55:37 +0000
commit610ae5f3c2e8ee2bd7ecf4cbef5aaeb2ac0b1a68 (patch)
treee275e905152f02a814386ba779eb1c15e9e8dd99 /ui/gfx/platform_font_win.cc
parentc1e45f4712de9f686e39f947c8e49eb28f352bf7 (diff)
downloadchromium_src-610ae5f3c2e8ee2bd7ecf4cbef5aaeb2ac0b1a68.zip
chromium_src-610ae5f3c2e8ee2bd7ecf4cbef5aaeb2ac0b1a68.tar.gz
chromium_src-610ae5f3c2e8ee2bd7ecf4cbef5aaeb2ac0b1a68.tar.bz2
Change string16 to std::string in the gfx::Font() interface.
Most consumers on all platforms (including windows!) were converting the font family/GetFontName() result to UTF8. (Windows was still having to convert for the SkTypeface calls.) On Linux, we're performing a UTF16ToUTF8 on each string print (and this is showing up in pprof output.) BUG=100803 TEST=none Review URL: http://codereview.chromium.org/8392017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/platform_font_win.cc')
-rw-r--r--ui/gfx/platform_font_win.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc
index e8fb93d..04375aa 100644
--- a/ui/gfx/platform_font_win.cc
+++ b/ui/gfx/platform_font_win.cc
@@ -69,7 +69,7 @@ PlatformFontWin::PlatformFontWin(NativeFont native_font) {
InitWithCopyOfHFONT(native_font);
}
-PlatformFontWin::PlatformFontWin(const string16& font_name,
+PlatformFontWin::PlatformFontWin(const std::string& font_name,
int font_size) {
InitWithFontNameAndSize(font_name, font_size);
}
@@ -117,7 +117,7 @@ int PlatformFontWin::GetStyle() const {
return font_ref_->style();
}
-string16 PlatformFontWin::GetFontName() const {
+std::string PlatformFontWin::GetFontName() const {
return font_ref_->font_name();
}
@@ -142,10 +142,10 @@ void PlatformFontWin::InitWithCopyOfHFONT(HFONT hfont) {
font_ref_ = CreateHFontRef(CreateFontIndirect(&font_info));
}
-void PlatformFontWin::InitWithFontNameAndSize(const string16& font_name,
+void PlatformFontWin::InitWithFontNameAndSize(const std::string& font_name,
int font_size) {
HFONT hf = ::CreateFont(-font_size, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- font_name.c_str());
+ UTF8ToUTF16(font_name).c_str());
font_ref_ = CreateHFontRef(hf);
}
@@ -224,7 +224,7 @@ PlatformFontWin::HFontRef::HFontRef(HFONT hfont,
LOGFONT font_info;
GetObject(hfont_, sizeof(LOGFONT), &font_info);
- font_name_ = string16(font_info.lfFaceName);
+ font_name_ = UTF16ToUTF8(string16(font_info.lfFaceName));
}
PlatformFontWin::HFontRef::~HFontRef() {
@@ -250,7 +250,7 @@ PlatformFont* PlatformFont::CreateFromNativeFont(NativeFont native_font) {
}
// static
-PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name,
+PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
int font_size) {
return new PlatformFontWin(font_name, font_size);
}