diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-06-27 16:05:46 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-06-27 16:07:55 +0300 |
commit | 6de0f299505a24969022cc2a63dd11db7b13b1be (patch) | |
tree | fb50036eb7b9bc3db510100d79ce2771ab49fcd2 /source/blender/blenfont/intern/blf_internal_types.h | |
parent | 151fc2fcd8461a9a28a2e912148718d51e8efd37 (diff) |
BLF: Add Support for Variable Fonts
Add support for Variable/Multiple Master font features. These are fonts
that contain a range of design variations along multiple axes. This
contains no client-facing options.
See D12977 for details and examples
Differential Revision: https://developer.blender.org/D12977
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/blenfont/intern/blf_internal_types.h')
-rw-r--r-- | source/blender/blenfont/intern/blf_internal_types.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 998093dae70..238301b9c4d 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -10,6 +10,10 @@ #include "GPU_texture.h" #include "GPU_vertex_buffer.h" +#include FT_MULTIPLE_MASTERS_H /* Variable font support. */ + +#define BLF_VARIATIONS_MAX 16 /* Maximum variation axes per font. */ + /* -------------------------------------------------------------------- */ /** \name Sub-Pixel Offset & Utilities * @@ -125,6 +129,10 @@ typedef struct GlyphCacheBLF { /* and DPI. */ unsigned int dpi; + float char_weight; + float char_slant; + float char_width; + float char_spacing; bool bold; bool italic; @@ -275,6 +283,15 @@ typedef struct FontBLF { /* font size. */ float size; + /* Axes data for Adobe MM, TrueType GX, or OpenType variation fonts. */ + FT_MM_Var *variations; + + /* Character variation; 0=default, -1=min, +1=max. */ + float char_weight; + float char_slant; + float char_width; + float char_spacing; + /* max texture size. */ int tex_size_max; |