| 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 "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 Loading... |
| 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 |
| OLD | NEW |