From 6de0f299505a24969022cc2a63dd11db7b13b1be Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Mon, 27 Jun 2022 06:05:46 -0700 Subject: 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 --- source/blender/blenfont/intern/blf_internal_types.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/blenfont/intern/blf_internal_types.h') 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; -- cgit v1.2.3