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

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

Issue 875303003: For DirectWrite font metrics use the average character width from the TEXTMETRIC structure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comment Created 5 years, 10 months 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.cc ('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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 scoped_refptr<PlatformFontWin::HFontRef> h_font_gdi( 144 scoped_refptr<PlatformFontWin::HFontRef> h_font_gdi(
145 PlatformFontWin::CreateHFontRefFromGDI(font, font_metrics)); 145 PlatformFontWin::CreateHFontRefFromGDI(font, font_metrics));
146 146
147 scoped_refptr<PlatformFontWin::HFontRef> h_font_skia( 147 scoped_refptr<PlatformFontWin::HFontRef> h_font_skia(
148 PlatformFontWin::CreateHFontRefFromSkia(font, font_metrics)); 148 PlatformFontWin::CreateHFontRefFromSkia(font, font_metrics));
149 149
150 EXPECT_EQ(h_font_gdi->font_size(), h_font_skia->font_size()); 150 EXPECT_EQ(h_font_gdi->font_size(), h_font_skia->font_size());
151 EXPECT_EQ(h_font_gdi->style(), h_font_skia->style()); 151 EXPECT_EQ(h_font_gdi->style(), h_font_skia->style());
152 EXPECT_EQ(h_font_gdi->font_name(), h_font_skia->font_name()); 152 EXPECT_EQ(h_font_gdi->font_name(), h_font_skia->font_name());
153 EXPECT_EQ(h_font_gdi->ave_char_width(), h_font_skia->ave_char_width());
153 154
154 EXPECT_LE(abs(h_font_gdi->cap_height() - h_font_skia->cap_height()), 1); 155 EXPECT_LE(abs(h_font_gdi->cap_height() - h_font_skia->cap_height()), 1);
155 EXPECT_LE(abs(h_font_gdi->baseline() - h_font_skia->baseline()), 1); 156 EXPECT_LE(abs(h_font_gdi->baseline() - h_font_skia->baseline()), 1);
156 EXPECT_LE(abs(h_font_gdi->height() - h_font_skia->height()), 1); 157 EXPECT_LE(abs(h_font_gdi->height() - h_font_skia->height()), 1);
157 } 158 }
158 } 159 }
159 160
160 } // namespace gfx 161 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/platform_font_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698