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

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

Issue 844083002: Get all font unittests running with DirectWrite on Windows 7+ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 11 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/font_list_unittest.cc ('k') | ui/gfx/platform_font_win.cc » ('j') | 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 #ifndef UI_GFX_PLATFORM_FONT_WIN_H_ 5 #ifndef UI_GFX_PLATFORM_FONT_WIN_H_
6 #define UI_GFX_PLATFORM_FONT_WIN_H_ 6 #define UI_GFX_PLATFORM_FONT_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 static HFontRef* GetBaseFontRef(); 165 static HFontRef* GetBaseFontRef();
166 166
167 // Creates and returns a new HFontRef from the specified HFONT. 167 // Creates and returns a new HFontRef from the specified HFONT.
168 static HFontRef* CreateHFontRef(HFONT font); 168 static HFontRef* CreateHFontRef(HFONT font);
169 169
170 // Creates and returns a new HFontRef from the specified HFONT. Uses provided 170 // Creates and returns a new HFontRef from the specified HFONT. Uses provided
171 // |font_metrics| instead of calculating new one. 171 // |font_metrics| instead of calculating new one.
172 static HFontRef* CreateHFontRefFromGDI(HFONT font, 172 static HFontRef* CreateHFontRefFromGDI(HFONT font,
173 const TEXTMETRIC& font_metrics); 173 const TEXTMETRIC& font_metrics);
174 174
175 // Returns a largest derived Font whose height does not exceed the height of
176 // |base_font|.
177 static Font DeriveWithCorrectedSize(HFONT base_font);
178
179 // Creates and returns a new HFontRef from the specified HFONT using metrics 175 // Creates and returns a new HFontRef from the specified HFONT using metrics
180 // from skia. Currently this is only used if we use DirectWrite for font 176 // from skia. Currently this is only used if we use DirectWrite for font
181 // metrics. 177 // metrics.
182 // |gdi_font| : Handle to the GDI font created via CreateFontIndirect. 178 // |gdi_font| : Handle to the GDI font created via CreateFontIndirect.
183 // |font_metrics| : The GDI font metrics retrieved via the GetTextMetrics 179 // |font_metrics| : The GDI font metrics retrieved via the GetTextMetrics
184 // API. This is currently used to calculate the correct height of the font 180 // API. This is currently used to calculate the correct height of the font
185 // in case we get a font created with a positive height. 181 // in case we get a font created with a positive height.
186 // A positive height represents the cell height (ascent + descent). 182 // A positive height represents the cell height (ascent + descent).
187 // A negative height represents the character Em height which is cell 183 // A negative height represents the character Em height which is cell
188 // height minus the internal leading value. 184 // height minus the internal leading value.
(...skipping 13 matching lines...) Expand all
202 198
203 // Pointer to the global IDWriteFactory interface. 199 // Pointer to the global IDWriteFactory interface.
204 static IDWriteFactory* direct_write_factory_; 200 static IDWriteFactory* direct_write_factory_;
205 201
206 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin); 202 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin);
207 }; 203 };
208 204
209 } // namespace gfx 205 } // namespace gfx
210 206
211 #endif // UI_GFX_PLATFORM_FONT_WIN_H_ 207 #endif // UI_GFX_PLATFORM_FONT_WIN_H_
OLDNEW
« no previous file with comments | « ui/gfx/font_list_unittest.cc ('k') | ui/gfx/platform_font_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698