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

Unified Diff: ui/gfx/text_constants.h

Issue 924543004: adding baseline options for super/sub scripting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding SCOPED_TRACE Created 5 years, 10 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 | « ui/gfx/render_text_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/text_constants.h
diff --git a/ui/gfx/text_constants.h b/ui/gfx/text_constants.h
index 82f2a3b7061386b425c825480db256fe8c9ca446..c76adfa3a159c8a92b135c2ca45156736c547edd 100644
--- a/ui/gfx/text_constants.h
+++ b/ui/gfx/text_constants.h
@@ -42,6 +42,25 @@ enum TextStyle {
NUM_TEXT_STYLES,
};
+// Text baseline offset types.
+// Figure of font metrics:
+// +--------+--------+------------------------+-------------+
+// | | | internal leading | SUPERSCRIPT |
+// | | +------------+-----------| |
+// | | ascent | | SUPERIOR |-------------+
+// | height | | cap height |-----------|
+// | | | | INFERIOR |-------------+
+// | |--------+------------+-----------| |
+// | | descent | SUBSCRIPT |
+// +--------+---------------------------------+-------------+
+enum BaselineStyle {
+ NORMAL_BASELINE = 0,
+ SUPERSCRIPT, // e.g. a mathematical exponent would be superscript.
+ SUPERIOR, // e.g. 8th, the "th" would be superior script.
+ INFERIOR, // e.g. 1/2, the "2" would be inferior ("1" is superior).
+ SUBSCRIPT, // e.g. H2O, the "2" would be subscript.
+};
+
// Elision behaviors of text that exceeds constrained dimensions.
enum ElideBehavior {
NO_ELIDE = 0, // Do not modify the text, it may overflow its available bounds.
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698