Blender V4.3
blf_internal_types.hh File Reference
#include <mutex>
#include "BLF_api.hh"
#include "BLI_map.hh"
#include "BLI_vector.hh"
#include "GPU_texture.hh"
#include "GPU_vertex_buffer.hh"

Go to the source code of this file.

Classes

struct  BatchBLF
struct  KerningCacheBLF
struct  GlyphCacheKey
struct  GlyphCacheBLF
struct  GlyphBLF
struct  FontBufInfoBLF
struct  FontMetrics
struct  FontBLF

Namespaces

namespace  blender
namespace  blender::gpu

Macros

#define BLF_VARIATIONS_MAX   16
#define MAKE_DVAR_TAG(a, b, c, d)
#define BLF_VARIATION_AXIS_WEIGHT   MAKE_DVAR_TAG('w', 'g', 'h', 't') /* 'wght' weight axis. */
#define BLF_VARIATION_AXIS_SLANT   MAKE_DVAR_TAG('s', 'l', 'n', 't') /* 'slnt' slant axis. */
#define BLF_VARIATION_AXIS_WIDTH   MAKE_DVAR_TAG('w', 'd', 't', 'h') /* 'wdth' width axis. */
#define BLF_VARIATION_AXIS_SPACING   MAKE_DVAR_TAG('s', 'p', 'a', 'c') /* 'spac' spacing axis. */
#define BLF_VARIATION_AXIS_OPTSIZE   MAKE_DVAR_TAG('o', 'p', 's', 'z') /* 'opsz' optical size. */
#define BLF_BATCH_DRAW_LEN_MAX   2048 /* in glyph */
#define KERNING_CACHE_TABLE_SIZE   128
#define KERNING_ENTRY_UNSET   INT_MAX

Variables

BatchBLF g_batch

Sub-Pixel Offset & Utilities

Free-type uses fixed point precision for sub-pixel offsets. Utility functions here avoid exposing the details in the BLF API.

#define FT_PIX_FLOOR(x)
#define FT_PIX_ROUND(x)
#define FT_PIX_CEIL(x)
typedef int32_t ft_pix
int ft_pix_to_int (ft_pix v)
int ft_pix_to_int_floor (ft_pix v)
int ft_pix_to_int_ceil (ft_pix v)
ft_pix ft_pix_from_int (int v)
ft_pix ft_pix_from_float (float v)

Macro Definition Documentation

◆ BLF_BATCH_DRAW_LEN_MAX

#define BLF_BATCH_DRAW_LEN_MAX   2048 /* in glyph */

Definition at line 89 of file blf_internal_types.hh.

Referenced by blf_batch_draw_init(), and blf_texture_draw().

◆ BLF_VARIATION_AXIS_OPTSIZE

#define BLF_VARIATION_AXIS_OPTSIZE   MAKE_DVAR_TAG('o', 'p', 's', 'z') /* 'opsz' optical size. */

Definition at line 41 of file blf_internal_types.hh.

Referenced by blf_glyph_set_variation_optical_size().

◆ BLF_VARIATION_AXIS_SLANT

#define BLF_VARIATION_AXIS_SLANT   MAKE_DVAR_TAG('s', 'l', 'n', 't') /* 'slnt' slant axis. */

Definition at line 38 of file blf_internal_types.hh.

Referenced by blf_glyph_set_variation_slant().

◆ BLF_VARIATION_AXIS_SPACING

#define BLF_VARIATION_AXIS_SPACING   MAKE_DVAR_TAG('s', 'p', 'a', 'c') /* 'spac' spacing axis. */

Definition at line 40 of file blf_internal_types.hh.

Referenced by blf_glyph_set_variation_spacing().

◆ BLF_VARIATION_AXIS_WEIGHT

#define BLF_VARIATION_AXIS_WEIGHT   MAKE_DVAR_TAG('w', 'g', 'h', 't') /* 'wght' weight axis. */

◆ BLF_VARIATION_AXIS_WIDTH

#define BLF_VARIATION_AXIS_WIDTH   MAKE_DVAR_TAG('w', 'd', 't', 'h') /* 'wdth' width axis. */

Definition at line 39 of file blf_internal_types.hh.

Referenced by blf_glyph_set_variation_width().

◆ BLF_VARIATIONS_MAX

#define BLF_VARIATIONS_MAX   16

Maximum variation axes per font.

Definition at line 32 of file blf_internal_types.hh.

Referenced by blf_glyph_render(), blf_glyph_set_variation_float(), and blf_glyph_set_variation_normalized().

◆ FT_PIX_CEIL

#define FT_PIX_CEIL ( x)
Value:
((x) + 63)

Definition at line 60 of file blf_internal_types.hh.

Referenced by ft_pix_to_int_ceil().

◆ FT_PIX_FLOOR

#define FT_PIX_FLOOR ( x)
Value:
((x) & ~63)

Definition at line 58 of file blf_internal_types.hh.

◆ FT_PIX_ROUND

#define FT_PIX_ROUND ( x)
Value:
FT_PIX_FLOOR((x) + 32)
#define FT_PIX_FLOOR(x)

Definition at line 59 of file blf_internal_types.hh.

Referenced by blf_font_width_to_strlen_glyph_process(), and blf_glyph_from_utf8_and_step().

◆ KERNING_CACHE_TABLE_SIZE

#define KERNING_CACHE_TABLE_SIZE   128

Number of characters in #KerningCacheBLF.table.

Definition at line 92 of file blf_internal_types.hh.

Referenced by blf_kerning(), and blf_setup_face().

◆ KERNING_ENTRY_UNSET

#define KERNING_ENTRY_UNSET   INT_MAX

A value in the kerning cache that indicates it is not yet set.

Definition at line 95 of file blf_internal_types.hh.

Referenced by blf_kerning(), and blf_setup_face().

◆ MAKE_DVAR_TAG

#define MAKE_DVAR_TAG ( a,
b,
c,
d )
Value:
((uint32_t(a) << 24u) | (uint32_t(b) << 16u) | (uint32_t(c) << 8u) | (uint32_t(d)))
local_group_size(16, 16) .push_constant(Type b
unsigned int uint32_t
Definition stdint.h:80

Definition at line 34 of file blf_internal_types.hh.

Typedef Documentation

◆ ft_pix

typedef int32_t ft_pix

This is an internal type that represents sub-pixel positioning, users of this type are to use ft_pix_* functions to keep scaling/rounding in one place.

Definition at line 54 of file blf_internal_types.hh.

Function Documentation

◆ ft_pix_from_float()

ft_pix ft_pix_from_float ( float v)
inline

Definition at line 82 of file blf_internal_types.hh.

References v.

◆ ft_pix_from_int()

◆ ft_pix_to_int()

◆ ft_pix_to_int_ceil()

int ft_pix_to_int_ceil ( ft_pix v)
inline

Definition at line 72 of file blf_internal_types.hh.

References FT_PIX_CEIL, int, and v.

Referenced by blf_font_boundbox_ex(), and blf_font_boundbox_foreach_glyph().

◆ ft_pix_to_int_floor()

int ft_pix_to_int_floor ( ft_pix v)
inline

Variable Documentation

◆ g_batch