Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-09-05 04:21:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-05 04:33:14 +0300
commit312af01fb4faa7d1ff0dea4d2ef936caa9af4c67 (patch)
tree260a1b6625b210d319b2baf7433287051cc5ff78 /source/blender/blenlib/BLI_vfontdata.h
parent053669e4aec11e5dbad61dd7308fe68a23f67034 (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/blenlib/BLI_vfontdata.h')
-rw-r--r--source/blender/blenlib/BLI_vfontdata.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h
index 1cc1ef17486..892d084f5ee 100644
--- a/source/blender/blenlib/BLI_vfontdata.h
+++ b/source/blender/blenlib/BLI_vfontdata.h
@@ -43,6 +43,9 @@ typedef struct VFontData {
struct GHash *characters;
char name[128];
float scale;
+ /* Calculated from the font. */
+ float em_height;
+ float ascender;
} VFontData;
typedef struct VChar {