From cb5a77253a719c08986aa69a3d3f7fc8725648c7 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 20 Jun 2016 23:21:24 -0300 Subject: Text Object: Vertical Alignment A new option for Font/Text objects vertical alignment: * Top Base-Line (current mode) * Top * Center * Bottom The Top is the equivalent as the Top-Baseline with an empty line at the begin of the text. It's nice to have this option too though, since if we are driving the alignment via Python we don't want to add extra lines to the text only to accomodate to the desired vertical alignment. The Center and Bottom are as intuitive as their name suggest. When working with text boxes, the vertical alignment only work for paragraphs that are not vertically full. Many thanks to Campbell Barton (ideasman42 / @campbellbarton) for the code review, code comments, and overall suggestions and changes :) Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D2061 --- source/blender/makesdna/DNA_curve_types.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_curve_types.h') diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 8f711c1b23b..6d139955ae1 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -230,7 +230,7 @@ typedef struct Curve { /* font part */ short lines; - char spacemode, pad1; + char spacemode, align_y; float spacing, linedist, shear, fsize, wordspace, ulpos, ulheight; float xof, yof; float linewidth; @@ -329,6 +329,14 @@ enum { CU_FLUSH = 4, }; +/* Curve.align_y */ +enum { + CU_ALIGN_Y_TOP_BASELINE = 0, + CU_ALIGN_Y_TOP = 1, + CU_ALIGN_Y_CENTER = 2, + CU_ALIGN_Y_BOTTOM = 3, +}; + /* Nurb.flag */ enum { CU_SMOOTH = 1 << 0, -- cgit v1.2.3