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/makesrna/intern/rna_curve.c | |
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/makesrna/intern/rna_curve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 6b294b9b3cd..a90a5cdff90 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -969,6 +969,8 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) {CU_ALIGN_Y_TOP, "TOP", 0, "Top", "Align text to the top"}, {CU_ALIGN_Y_CENTER, "CENTER", 0, "Center", "Align text to the middle"}, {CU_ALIGN_Y_BOTTOM, "BOTTOM", 0, "Bottom", "Align text to the bottom"}, + {CU_ALIGN_Y_BOTTOM_BASELINE, "BOTTOM_BASELINE", 0, "Bottom Base-Line", + "Align text to the bottom but use the base-line of the text"}, {0, NULL, 0, NULL, NULL} }; |