Blender Git Commit Log

Git Commits -> Revision 312af01

Revision 312af01 by Dalai Felinto (master)
September 5, 2018, 01:25 (GMT)
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.

Commit Details:

Full Hash: 312af01fb4faa7d1ff0dea4d2ef936caa9af4c67
Parent Commit: 053669e
Committed By: Campbell Barton
Lines Changed: +83, -30

6 Modified Paths:

/release/scripts/startup/bl_ui/properties_data_curve.py (+4, -3) (Diff)
/source/blender/blenkernel/intern/font.c (+55, -26) (Diff)
/source/blender/blenlib/BLI_vfontdata.h (+3, -0) (Diff)
/source/blender/blenlib/intern/freetypefont.c (+17, -0) (Diff)
/source/blender/makesdna/DNA_curve_types.h (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_curve.c (+2, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021