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/platform_font_win.h" | 5 #include "ui/gfx/platform_font_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <math.h> | 8 #include <math.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 if (length <= 0) | 186 if (length <= 0) |
187 return GetFontName(); | 187 return GetFontName(); |
188 return base::SysWideToUTF8(localized_font_name); | 188 return base::SysWideToUTF8(localized_font_name); |
189 } | 189 } |
190 | 190 |
191 int PlatformFontWin::GetFontSize() const { | 191 int PlatformFontWin::GetFontSize() const { |
192 return font_ref_->font_size(); | 192 return font_ref_->font_size(); |
193 } | 193 } |
194 | 194 |
195 const FontRenderParams& PlatformFontWin::GetFontRenderParams() const { | 195 const FontRenderParams& PlatformFontWin::GetFontRenderParams() const { |
196 return GetDefaultFontRenderParams(); | 196 return gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL); |
197 } | 197 } |
198 | 198 |
199 NativeFont PlatformFontWin::GetNativeFont() const { | 199 NativeFont PlatformFontWin::GetNativeFont() const { |
200 return font_ref_->hfont(); | 200 return font_ref_->hfont(); |
201 } | 201 } |
202 | 202 |
203 //////////////////////////////////////////////////////////////////////////////// | 203 //////////////////////////////////////////////////////////////////////////////// |
204 // Font, private: | 204 // Font, private: |
205 | 205 |
206 void PlatformFontWin::InitWithCopyOfHFONT(HFONT hfont) { | 206 void PlatformFontWin::InitWithCopyOfHFONT(HFONT hfont) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 return new PlatformFontWin(native_font); | 374 return new PlatformFontWin(native_font); |
375 } | 375 } |
376 | 376 |
377 // static | 377 // static |
378 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, | 378 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, |
379 int font_size) { | 379 int font_size) { |
380 return new PlatformFontWin(font_name, font_size); | 380 return new PlatformFontWin(font_name, font_size); |
381 } | 381 } |
382 | 382 |
383 } // namespace gfx | 383 } // namespace gfx |
OLD | NEW |