Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: ui/gfx/platform_font_win.cc

Issue 789583002: Updates subpixel positioning and hinting when DSF is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/platform_font_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/platform_font_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698