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

Unified Diff: Source/platform/fonts/FontDescription.h

Issue 342883004: Using Enum in place of bool for better code readability (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment fixes Created 6 years, 6 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
« no previous file with comments | « Source/platform/fonts/FixedPitchFontType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontDescription.h
diff --git a/Source/platform/fonts/FontDescription.h b/Source/platform/fonts/FontDescription.h
index 9cefae0436a002fe2cde08e1388cad87c6c91946..6c1e239292e4e811e86a2c3897890ab6c39faabc 100644
--- a/Source/platform/fonts/FontDescription.h
+++ b/Source/platform/fonts/FontDescription.h
@@ -26,6 +26,7 @@
#define FontDescription_h
#include "platform/FontFamilyNames.h"
+#include "platform/fonts/FixedPitchFontType.h"
#include "platform/fonts/FontCacheKey.h"
#include "platform/fonts/FontFamily.h"
#include "platform/fonts/FontFeatureSettings.h"
@@ -102,7 +103,12 @@ public:
GenericFamilyType genericFamily() const { return static_cast<GenericFamilyType>(m_genericFamily); }
// only use fixed default size when there is only one font family, and that family is "monospace"
- bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily && !family().next() && family().family() == FontFamilyNames::webkit_monospace; }
+ FixedPitchFontType fixedPitchFontType() const
+ {
+ if (genericFamily() == MonospaceFamily && !family().next() && family().family() == FontFamilyNames::webkit_monospace)
+ return FixedPitchFont;
+ return NonFixedPitchFont;
+ }
Kerning kerning() const { return static_cast<Kerning>(m_kerning); }
LigaturesState commonLigaturesState() const { return static_cast<LigaturesState>(m_commonLigaturesState); }
LigaturesState discretionaryLigaturesState() const { return static_cast<LigaturesState>(m_discretionaryLigaturesState); }
« no previous file with comments | « Source/platform/fonts/FixedPitchFontType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698