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

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

Issue 1206883002: Fix default text orientation that do not conform Unicode Technical Report #50 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/FontDescription.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/FontOrientation.h
diff --git a/Source/platform/fonts/FontOrientation.h b/Source/platform/fonts/FontOrientation.h
index 6ae111583fcdbd5169a2ada1792c1734094debfe..b7dde29e1eb07d3120a221b3f23c865201c803d7 100644
--- a/Source/platform/fonts/FontOrientation.h
+++ b/Source/platform/fonts/FontOrientation.h
@@ -26,6 +26,8 @@
#ifndef FontOrientation_h
#define FontOrientation_h
+#include "platform/fonts/Character.h"
+
namespace blink {
enum class FontOrientation {
@@ -46,6 +48,11 @@ enum class FontOrientation {
inline bool operator&(FontOrientation value, FontOrientation mask) { return static_cast<unsigned>(value) & static_cast<unsigned>(mask); }
inline bool isVerticalAnyUpright(FontOrientation orientation) { return orientation & FontOrientation::AnyUprightMask; }
inline bool isVerticalNonCJKUpright(FontOrientation orientation) { return orientation == FontOrientation::VerticalUpright; }
+inline bool isVerticalUpright(FontOrientation orientation, UChar32 character)
+{
+ return orientation == FontOrientation::VerticalUpright
+ || (orientation == FontOrientation::VerticalMixed && Character::isUprightInMixedVertical(character));
+}
inline bool isVerticalBaseline(FontOrientation orientation) { return orientation != FontOrientation::Horizontal; }
} // namespace blink
« no previous file with comments | « Source/platform/fonts/FontDescription.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698