diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-09-05 04:21:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-05 04:33:14 +0300 |
commit | 312af01fb4faa7d1ff0dea4d2ef936caa9af4c67 (patch) | |
tree | 260a1b6625b210d319b2baf7433287051cc5ff78 /source/blender/makesdna/DNA_curve_types.h | |
parent | 053669e4aec11e5dbad61dd7308fe68a23f67034 (diff) |
3D Text: improvements to vertical alignment
They way Blender handles vertical alignment is very buggy:
- Top-Base: It works perfectly.
- Bottom: It is actually bottom-baseline,
and it fails when line size is != 1.0 when working with text boxes.
- Top: Poorly implemented, it should use font's ascent
(recommended distance from baseline),
so it has room for accents,
but it's not one line distance far from the origin (as it is now).
- Center: Poorly implemented.
This is tricky since there is no silver bullet.
To clear this situation I created a new option (Bottom-Baseline),
and addressed the issues above.
I'm getting the ascent and descent from freetype2,
and use this for padding above/below the text.
Also for vertically centering the text.
Diffstat (limited to 'source/blender/makesdna/DNA_curve_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_curve_types.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 6e3573b9f80..7c7eaae4949 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -334,7 +334,8 @@ enum { CU_ALIGN_Y_TOP_BASELINE = 0, CU_ALIGN_Y_TOP = 1, CU_ALIGN_Y_CENTER = 2, - CU_ALIGN_Y_BOTTOM = 3, + CU_ALIGN_Y_BOTTOM_BASELINE = 3, + CU_ALIGN_Y_BOTTOM = 4, }; /* Nurb.flag */ |