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

Unified Diff: ui/gfx/platform_font_win.h

Issue 853553002: Relanding this with font test fixes for gdi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DeriveFontWithHeight starts with a font matching the minimum size 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/platform_font_win.h
diff --git a/ui/gfx/platform_font_win.h b/ui/gfx/platform_font_win.h
index 11f94d4d2ee86576f879c7a8b7435c7279bfca6f..f0a2af9518b6ef4f464c2007ee4b5c61a8540ea9 100644
--- a/ui/gfx/platform_font_win.h
+++ b/ui/gfx/platform_font_win.h
@@ -49,11 +49,10 @@ class GFX_EXPORT PlatformFontWin : public PlatformFont {
// name could not be retrieved, returns GetFontName().
std::string GetLocalizedFontName() const;
- // Returns a derived Font with the specified |style| and with height at most
- // |height|. If the height and style of the receiver already match, it is
- // returned. Otherwise, the returned Font will have the largest size such that
- // its height is less than or equal to |height| (since there may not exist a
- // size that matches the exact |height| specified).
+ // Returns a derived Font with the specified |style| and maximum |height|.
+ // The returned Font will be the largest font size with a height <= |height|,
+ // since a size with the exact specified |height| may not necessarily exist.
+ // GetMinimumFontSize() may impose a font size that is taller than |height|
msw 2015/01/13 23:54:59 nit: trailing period.
ananta 2015/01/14 00:17:23 Done.
Font DeriveFontWithHeight(int height, int style);
// Overridden from PlatformFont:
@@ -172,10 +171,6 @@ class GFX_EXPORT PlatformFontWin : public PlatformFont {
static HFontRef* CreateHFontRefFromGDI(HFONT font,
const TEXTMETRIC& font_metrics);
- // Returns a largest derived Font whose height does not exceed the height of
- // |base_font|.
- static Font DeriveWithCorrectedSize(HFONT base_font);
-
// Creates and returns a new HFontRef from the specified HFONT using metrics
// from skia. Currently this is only used if we use DirectWrite for font
// metrics.
@@ -194,6 +189,13 @@ class GFX_EXPORT PlatformFontWin : public PlatformFont {
// constructing a Font from a HFONT we don't want to copy.
explicit PlatformFontWin(HFontRef* hfont_ref);
+ // Returns a HFONT with the specified |style| and maximum |height|.
+ // The returned HFONT will be the largest font size with a
msw 2015/01/13 23:54:59 nit: s/HFONT/font/ to fix line wrapping.
ananta 2015/01/14 00:17:23 Removed this function.
+ // height <= |height|, since a size with the exact specified |height| may
+ // not necessarily exist.
+ // GetMinimumFontSize() may impose a font size that is taller than |height|
msw 2015/01/13 23:54:59 nit: trailing period.
ananta 2015/01/14 00:17:23 Removed this function
+ HFONT CreateFontWithHeight(int height, int style);
+
// Reference to the base font all fonts are derived from.
static HFontRef* base_font_ref_;

Powered by Google App Engine
This is Rietveld 408576698