| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <dwrite.h> | 8 #include <dwrite.h> |
| 9 #include <math.h> | 9 #include <math.h> |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 &localized_font_name[0]); | 304 &localized_font_name[0]); |
| 305 if (length <= 0) | 305 if (length <= 0) |
| 306 return GetFontName(); | 306 return GetFontName(); |
| 307 return base::SysWideToUTF8(localized_font_name); | 307 return base::SysWideToUTF8(localized_font_name); |
| 308 } | 308 } |
| 309 | 309 |
| 310 int PlatformFontWin::GetFontSize() const { | 310 int PlatformFontWin::GetFontSize() const { |
| 311 return font_ref_->font_size(); | 311 return font_ref_->font_size(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 const FontRenderParams& PlatformFontWin::GetFontRenderParams() const { | 314 const FontRenderParams& PlatformFontWin::GetFontRenderParams() { |
| 315 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, | 315 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, |
| 316 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL))); | 316 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), NULL))); |
| 317 return params; | 317 return params; |
| 318 } | 318 } |
| 319 | 319 |
| 320 NativeFont PlatformFontWin::GetNativeFont() const { | 320 NativeFont PlatformFontWin::GetNativeFont() const { |
| 321 return font_ref_->hfont(); | 321 return font_ref_->hfont(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void PlatformFontWin::SetDirectWriteFactory(IDWriteFactory* factory) { | 324 void PlatformFontWin::SetDirectWriteFactory(IDWriteFactory* factory) { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 return new PlatformFontWin(native_font); | 596 return new PlatformFontWin(native_font); |
| 597 } | 597 } |
| 598 | 598 |
| 599 // static | 599 // static |
| 600 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, | 600 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, |
| 601 int font_size) { | 601 int font_size) { |
| 602 return new PlatformFontWin(font_name, font_size); | 602 return new PlatformFontWin(font_name, font_size); |
| 603 } | 603 } |
| 604 | 604 |
| 605 } // namespace gfx | 605 } // namespace gfx |
| OLD | NEW |