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

Side by Side 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: manual merge to help try bots 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 unified diff | Download patch
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_TEXT_CONSTANTS_H_ 5 #ifndef UI_GFX_TEXT_CONSTANTS_H_
6 #define UI_GFX_TEXT_CONSTANTS_H_ 6 #define UI_GFX_TEXT_CONSTANTS_H_
7 7
8 namespace gfx { 8 namespace gfx {
9 9
10 // TODO(msw): Distinguish between logical character stops and glyph stops? 10 // TODO(msw): Distinguish between logical character stops and glyph stops?
(...skipping 24 matching lines...) Expand all
35 // TODO(msw): Merge with gfx::Font::FontStyle. 35 // TODO(msw): Merge with gfx::Font::FontStyle.
36 enum TextStyle { 36 enum TextStyle {
37 BOLD = 0, 37 BOLD = 0,
38 ITALIC, 38 ITALIC,
39 STRIKE, 39 STRIKE,
40 DIAGONAL_STRIKE, 40 DIAGONAL_STRIKE,
41 UNDERLINE, 41 UNDERLINE,
42 NUM_TEXT_STYLES, 42 NUM_TEXT_STYLES,
43 }; 43 };
44 44
45 // Text baseline offset types.
46 // Figure of font metrics:
47 // +--------+--------+------------------------+-------------+
48 // | | | internal leading | SUPERSCRIPT |
49 // | | +------------+-----------| |
50 // | | ascent | | SUPERIOR |-------------+
51 // | height | | cap height |-----------|
52 // | | | | INFERIOR |-------------+
53 // | |--------+------------+-----------| |
54 // | | descent | SUBSCRIPT |
55 // +--------+---------------------------------+-------------+
56 enum BaselineStyle {
57 NORMAL_BASELINE = 0,
58 SUPERSCRIPT, // e.g. a mathematical exponent would be superscript.
59 SUPERIOR, // e.g. 8th, the "th" would be superior script.
60 INFERIOR, // e.g. 1/2, the "2" would be inferior ("1" is superior).
61 SUBSCRIPT, // e.g. H2O, the "2" would be subscript.
62 NUM_BASELINE_STYLES,
msw 2015/02/18 23:32:08 nit: this isn't actually needed, you can safely re
dschuyler 2015/02/19 00:29:15 Done.
63 };
64
45 // Elision behaviors of text that exceeds constrained dimensions. 65 // Elision behaviors of text that exceeds constrained dimensions.
46 enum ElideBehavior { 66 enum ElideBehavior {
47 NO_ELIDE = 0, // Do not modify the text, it may overflow its available bounds. 67 NO_ELIDE = 0, // Do not modify the text, it may overflow its available bounds.
48 TRUNCATE, // Do not elide or fade, just truncate at the end of the string. 68 TRUNCATE, // Do not elide or fade, just truncate at the end of the string.
49 ELIDE_HEAD, // Add an ellipsis at the start of the string. 69 ELIDE_HEAD, // Add an ellipsis at the start of the string.
50 ELIDE_MIDDLE, // Add an ellipsis in the middle of the string. 70 ELIDE_MIDDLE, // Add an ellipsis in the middle of the string.
51 ELIDE_TAIL, // Add an ellipsis at the end of the string. 71 ELIDE_TAIL, // Add an ellipsis at the end of the string.
52 ELIDE_EMAIL, // Add ellipses to username and domain substrings. 72 ELIDE_EMAIL, // Add ellipses to username and domain substrings.
53 FADE_TAIL, // Fade the string's end opposite of its horizontal alignment. 73 FADE_TAIL, // Fade the string's end opposite of its horizontal alignment.
54 }; 74 };
55 75
56 } // namespace gfx 76 } // namespace gfx
57 77
58 #endif // UI_GFX_TEXT_CONSTANTS_H_ 78 #endif // UI_GFX_TEXT_CONSTANTS_H_
OLDNEW
« ui/gfx/render_text_harfbuzz.cc ('K') | « ui/gfx/render_text_harfbuzz.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698