Blender V4.3
blf_font.cc File Reference
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ft2build.h>
#include "MEM_guardedalloc.h"
#include "DNA_vec_types.h"
#include "BLI_listbase.h"
#include "BLI_math_bits.h"
#include "BLI_math_color_blend.h"
#include "BLI_math_matrix.h"
#include "BLI_path_utils.hh"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_string_cursor_utf8.h"
#include "BLI_string_utf8.h"
#include "BLI_threads.h"
#include "BLI_vector.hh"
#include "BLF_api.hh"
#include "GPU_batch.hh"
#include "GPU_matrix.hh"
#include "blf_internal.hh"
#include "blf_internal_types.hh"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Classes

struct  CursorPositionForeachGlyph_Data
 
struct  StrOffsetToGlyphBounds_Data
 
struct  FaceDetails
 

Functions

Font Query: Attributes
static ft_pix blf_font_height_max_ft_pix (FontBLF *font)
 
static ft_pix blf_font_width_max_ft_pix (FontBLF *font)
 
int blf_font_height_max (FontBLF *font)
 
int blf_font_width_max (FontBLF *font)
 
int blf_font_descender (FontBLF *font)
 
int blf_font_ascender (FontBLF *font)
 
char * blf_display_name (FontBLF *font)
 
FreeType Caching
static bool blf_setup_face (FontBLF *font)
 
static void blf_face_finalizer (void *object)
 
static FT_Error blf_cache_face_requester (FTC_FaceID faceID, FT_Library lib, FT_Pointer, FT_Face *face)
 
static void blf_size_finalizer (void *object)
 
FreeType Utilities (Internal)
uint blf_get_char_index (FontBLF *font, uint charcode)
 
static ft_pix blf_unscaled_F26Dot6_to_pixels (FontBLF *font, FT_Pos value)
 
Glyph Batching
static void blf_batch_draw_init ()
 
static void blf_batch_draw_exit ()
 
void blf_batch_draw_begin (FontBLF *font)
 
static GPUTexture * blf_batch_cache_texture_load ()
 
void blf_batch_draw ()
 
static void blf_batch_draw_end ()
 
Glyph Stepping Utilities (Internal)
BLI_INLINE ft_pix blf_kerning (FontBLF *font, const GlyphBLF *g_prev, const GlyphBLF *g)
 
BLI_INLINE GlyphBLFblf_glyph_from_utf8_and_step (FontBLF *font, GlyphCacheBLF *gc, const GlyphBLF *g_prev, const char *str, size_t str_len, size_t *i_p, int32_t *pen_x)
 
Text Drawing: GPU
static void blf_font_draw_ex (FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ResultBLF *r_info, const ft_pix pen_y)
 
void blf_font_draw (FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
 
int blf_font_draw_mono (FontBLF *font, const char *str, const size_t str_len, int cwidth, int tab_columns)
 
void blf_draw_svg_icon (FontBLF *font, uint icon_id, float x, float y, float size, const float color[4], float outline_alpha, bool multicolor, blender::FunctionRef< void(std::string &)> edit_source_cb)
 
blender::Array< ucharblf_svg_icon_bitmap (FontBLF *font, uint icon_id, float size, int *r_width, int *r_height, bool multicolor, blender::FunctionRef< void(std::string &)> edit_source_cb)
 
Text Drawing: Buffer
static void blf_glyph_draw_buffer (FontBufInfoBLF *buf_info, GlyphBLF *g, const ft_pix pen_x, const ft_pix pen_y_basis)
 
static void blf_font_draw_buffer_ex (FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ResultBLF *r_info, ft_pix pen_y)
 
void blf_font_draw_buffer (FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
 
Text Evaluation: Width to String Length

Use to implement exported functions:

static bool blf_font_width_to_strlen_glyph_process (FontBLF *font, GlyphCacheBLF *gc, const GlyphBLF *g_prev, GlyphBLF *g, ft_pix *pen_x, const int width_i)
 
size_t blf_font_width_to_strlen (FontBLF *font, const char *str, const size_t str_len, int width, int *r_width)
 
size_t blf_font_width_to_rstrlen (FontBLF *font, const char *str, const size_t str_len, int width, int *r_width)
 
Text Evaluation: Glyph Bound Box with Callback
static void blf_font_boundbox_ex (FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, rcti *r_box, ResultBLF *r_info, ft_pix pen_y)
 
void blf_font_boundbox (FontBLF *font, const char *str, const size_t str_len, rcti *r_box, ResultBLF *r_info)
 
void blf_font_width_and_height (FontBLF *font, const char *str, const size_t str_len, float *r_width, float *r_height, ResultBLF *r_info)
 
float blf_font_width (FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
 
float blf_font_height (FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
 
float blf_font_fixed_width (FontBLF *font)
 
void blf_font_boundbox_foreach_glyph (FontBLF *font, const char *str, const size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data)
 
static bool blf_cursor_position_foreach_glyph (const char *, const size_t str_step_ofs, const rcti *bounds, void *user_data)
 
size_t blf_str_offset_from_cursor_position (FontBLF *font, const char *str, size_t str_len, int location_x)
 
static bool blf_str_offset_foreach_glyph (const char *, const size_t str_step_ofs, const rcti *bounds, void *user_data)
 
void blf_str_offset_to_glyph_bounds (FontBLF *font, const char *str, size_t str_offset, rcti *r_glyph_bounds)
 
int blf_str_offset_to_cursor (FontBLF *font, const char *str, const size_t str_len, const size_t str_offset, const int cursor_width)
 
blender::Vector< blender::Bounds< int > > blf_str_selection_boxes (FontBLF *font, const char *str, size_t str_len, size_t sel_start, size_t sel_length)
 
Text Evaluation: Word-Wrap with Callback
static void blf_font_wrap_apply (FontBLF *font, const char *str, const size_t str_len, const int max_pixel_width, ResultBLF *r_info, void(*callback)(FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ft_pix pen_y, void *userdata), void *userdata)
 
static void blf_font_draw__wrap_cb (FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ft_pix pen_y, void *)
 
void blf_font_draw__wrap (FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
 
static void blf_font_boundbox_wrap_cb (FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ft_pix pen_y, void *userdata)
 
void blf_font_boundbox__wrap (FontBLF *font, const char *str, const size_t str_len, rcti *r_box, ResultBLF *r_info)
 
static void blf_font_draw_buffer__wrap_cb (FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ft_pix pen_y, void *)
 
void blf_font_draw_buffer__wrap (FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
 
static void blf_font_string_wrap_cb (FontBLF *, GlyphCacheBLF *, const char *str, const size_t str_len, ft_pix, void *str_list_ptr)
 
blender::Vector< blender::StringRefblf_font_string_wrap (FontBLF *font, blender::StringRef str, int max_pixel_width)
 
Font Subsystem Init/Exit
int blf_font_init ()
 
void blf_font_exit ()
 
void BLF_cache_flush_set_fn (void(*cache_flush_fn)())
 
Font Configure
void blf_ensure_size (FontBLF *font)
 
bool blf_font_size (FontBLF *font, float size)
 

Variables

BatchBLF g_batch
 
static FT_Library ft_lib = nullptr
 
static FTC_Manager ftc_manager = nullptr
 
static FTC_CMapCache ftc_charmap_cache = nullptr
 
static ThreadMutex ft_lib_mutex
 
static void(* blf_draw_cache_flush )() = nullptr
 

Font New/Free

static const FaceDetails static_face_details []
 
static void blf_font_fill (FontBLF *font)
 
static void blf_font_metrics (FT_Face face, FontMetrics *metrics)
 
bool blf_ensure_face (FontBLF *font)
 
static FontBLFblf_font_new_impl (const char *filepath, const char *mem_name, const uchar *mem, const size_t mem_size, void *ft_library)
 
FontBLFblf_font_new_from_filepath (const char *filepath)
 
FontBLFblf_font_new_from_mem (const char *mem_name, const uchar *mem, const size_t mem_size)
 
void blf_font_attach_from_mem (FontBLF *font, const uchar *mem, const size_t mem_size)
 
void blf_font_free (FontBLF *font)
 

Detailed Description

Deals with drawing text to OpenGL or bitmap buffers.

Also low level functions for managing FontBLF.

Definition in file blf_font.cc.

Function Documentation

◆ blf_batch_cache_texture_load()

◆ blf_batch_draw()

◆ blf_batch_draw_begin()

◆ blf_batch_draw_end()

static void blf_batch_draw_end ( )
static

Definition at line 365 of file blf_font.cc.

References BatchBLF::active, blf_batch_draw(), and g_batch.

Referenced by blf_draw_svg_icon(), blf_font_draw_ex(), and blf_font_draw_mono().

◆ blf_batch_draw_exit()

static void blf_batch_draw_exit ( )
static

Definition at line 220 of file blf_font.cc.

References BatchBLF::batch, g_batch, and GPU_BATCH_DISCARD_SAFE.

Referenced by blf_font_exit().

◆ blf_batch_draw_init()

◆ blf_cache_face_requester()

static FT_Error blf_cache_face_requester ( FTC_FaceID faceID,
FT_Library lib,
FT_Pointer ,
FT_Face * face )
static

Called in response to #FTC_Manager_LookupFace. Now add a face to our font.

Note
Unused arguments are kept to match #FTC_Face_Requester function signature.

Definition at line 97 of file blf_font.cc.

References blf_face_finalizer(), blf_setup_face(), BLI_mutex_lock(), BLI_mutex_unlock(), ft_lib_mutex, and lib.

Referenced by blf_font_init().

◆ BLF_cache_flush_set_fn()

void BLF_cache_flush_set_fn ( void(* cache_flush_fn )())

Optional cache flushing function, called before blf_batch_draw.

Definition at line 1523 of file blf_font.cc.

References blf_draw_cache_flush.

Referenced by uiStyleInit().

◆ blf_cursor_position_foreach_glyph()

static bool blf_cursor_position_foreach_glyph ( const char * ,
const size_t str_step_ofs,
const rcti * bounds,
void * user_data )
static

◆ blf_display_name()

char * blf_display_name ( FontBLF * font)

Definition at line 1475 of file blf_font.cc.

References blf_ensure_face(), and BLI_sprintfN().

Referenced by BLF_display_name_from_id().

◆ blf_draw_svg_icon()

void blf_draw_svg_icon ( FontBLF * font,
uint icon_id,
float x,
float y,
float size,
const float color[4],
float outline_alpha,
bool multicolor,
blender::FunctionRef< void(std::string &)> edit_source_cb )

◆ blf_ensure_face()

◆ blf_ensure_size()

◆ blf_face_finalizer()

static void blf_face_finalizer ( void * object)
static

Called when a face is removed by the cache. FreeType will call #FT_Done_Face.

Definition at line 85 of file blf_font.cc.

Referenced by blf_cache_face_requester().

◆ blf_font_ascender()

int blf_font_ascender ( FontBLF * font)

Definition at line 1469 of file blf_font.cc.

References blf_ensure_size(), and ft_pix_to_int().

Referenced by BLF_ascender().

◆ blf_font_attach_from_mem()

void blf_font_attach_from_mem ( FontBLF * font,
const uchar * mem,
const size_t mem_size )

Definition at line 1995 of file blf_font.cc.

References blf_ensure_face().

Referenced by BLF_metrics_attach().

◆ blf_font_boundbox()

void blf_font_boundbox ( FontBLF * font,
const char * str,
const size_t str_len,
rcti * r_box,
ResultBLF * r_info )

◆ blf_font_boundbox__wrap()

void blf_font_boundbox__wrap ( FontBLF * font,
const char * str,
const size_t str_len,
rcti * r_box,
ResultBLF * r_info )

◆ blf_font_boundbox_ex()

◆ blf_font_boundbox_foreach_glyph()

◆ blf_font_boundbox_wrap_cb()

static void blf_font_boundbox_wrap_cb ( FontBLF * font,
GlyphCacheBLF * gc,
const char * str,
const size_t str_len,
ft_pix pen_y,
void * userdata )
static

Utility for blf_font_boundbox__wrap.

Definition at line 1360 of file blf_font.cc.

References blf_font_boundbox_ex(), BLI_rcti_union(), and str.

Referenced by blf_font_boundbox__wrap().

◆ blf_font_descender()

int blf_font_descender ( FontBLF * font)

Definition at line 1463 of file blf_font.cc.

References blf_ensure_size(), and ft_pix_to_int().

Referenced by BLF_descender().

◆ blf_font_draw()

void blf_font_draw ( FontBLF * font,
const char * str,
const size_t str_len,
ResultBLF * r_info )

Definition at line 485 of file blf_font.cc.

References blf_font_draw_ex(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), and str.

Referenced by BLF_draw().

◆ blf_font_draw__wrap()

void blf_font_draw__wrap ( FontBLF * font,
const char * str,
const size_t str_len,
ResultBLF * r_info )

Definition at line 1353 of file blf_font.cc.

References blf_font_draw__wrap_cb(), blf_font_wrap_apply(), and str.

Referenced by BLF_draw().

◆ blf_font_draw__wrap_cb()

static void blf_font_draw__wrap_cb ( FontBLF * font,
GlyphCacheBLF * gc,
const char * str,
const size_t str_len,
ft_pix pen_y,
void *  )
static

Utility for blf_font_draw__wrap.

Definition at line 1344 of file blf_font.cc.

References blf_font_draw_ex(), and str.

Referenced by blf_font_draw__wrap().

◆ blf_font_draw_buffer()

void blf_font_draw_buffer ( FontBLF * font,
const char * str,
const size_t str_len,
ResultBLF * r_info )

◆ blf_font_draw_buffer__wrap()

void blf_font_draw_buffer__wrap ( FontBLF * font,
const char * str,
const size_t str_len,
ResultBLF * r_info )

Definition at line 1395 of file blf_font.cc.

References blf_font_draw_buffer__wrap_cb(), blf_font_wrap_apply(), and str.

Referenced by BLF_draw_buffer().

◆ blf_font_draw_buffer__wrap_cb()

static void blf_font_draw_buffer__wrap_cb ( FontBLF * font,
GlyphCacheBLF * gc,
const char * str,
const size_t str_len,
ft_pix pen_y,
void *  )
static

Utility for blf_font_draw_buffer__wrap.

Definition at line 1386 of file blf_font.cc.

References blf_font_draw_buffer_ex(), and str.

Referenced by blf_font_draw_buffer__wrap().

◆ blf_font_draw_buffer_ex()

static void blf_font_draw_buffer_ex ( FontBLF * font,
GlyphCacheBLF * gc,
const char * str,
const size_t str_len,
ResultBLF * r_info,
ft_pix pen_y )
static

◆ blf_font_draw_ex()

static void blf_font_draw_ex ( FontBLF * font,
GlyphCacheBLF * gc,
const char * str,
const size_t str_len,
ResultBLF * r_info,
const ft_pix pen_y )
static

◆ blf_font_draw_mono()

int blf_font_draw_mono ( FontBLF * font,
const char * str,
size_t str_len,
int cwidth,
int tab_columns )

◆ blf_font_exit()

void blf_font_exit ( )

Definition at line 1511 of file blf_font.cc.

References blf_batch_draw_exit(), BLI_mutex_end(), ft_lib, ft_lib_mutex, and ftc_manager.

Referenced by BLF_exit().

◆ blf_font_fill()

static void blf_font_fill ( FontBLF * font)
static

Definition at line 1534 of file blf_font.cc.

Referenced by blf_font_new_impl().

◆ blf_font_fixed_width()

float blf_font_fixed_width ( FontBLF * font)

◆ blf_font_free()

◆ blf_font_height()

float blf_font_height ( FontBLF * font,
const char * str,
const size_t str_len,
ResultBLF * r_info )

◆ blf_font_height_max()

int blf_font_height_max ( FontBLF * font)

Definition at line 1446 of file blf_font.cc.

References blf_font_height_max_ft_pix(), and ft_pix_to_int().

Referenced by BLF_height_max().

◆ blf_font_height_max_ft_pix()

static ft_pix blf_font_height_max_ft_pix ( FontBLF * font)
static

Definition at line 1439 of file blf_font.cc.

References blf_ensure_size(), and ft_pix_from_int().

Referenced by blf_font_height_max(), and blf_font_wrap_apply().

◆ blf_font_init()

◆ blf_font_metrics()

◆ blf_font_new_from_filepath()

FontBLF * blf_font_new_from_filepath ( const char * filepath)

Definition at line 1985 of file blf_font.cc.

References blf_font_new_impl().

Referenced by BLF_load_unique().

◆ blf_font_new_from_mem()

FontBLF * blf_font_new_from_mem ( const char * mem_name,
const uchar * mem,
const size_t mem_size )

Definition at line 1990 of file blf_font.cc.

References blf_font_new_impl().

Referenced by BLF_load_mem_unique().

◆ blf_font_new_impl()

static FontBLF * blf_font_new_impl ( const char * filepath,
const char * mem_name,
const uchar * mem,
const size_t mem_size,
void * ft_library )
static

Create a new font from filename OR memory pointer. For normal operation pass nullptr as FT_Library object. Pass a custom FT_Library if you want to use the font without its lifetime being managed by the FreeType cache subsystem.

Definition at line 1916 of file blf_font.cc.

References ARRAY_SIZE, BLF_CACHED, blf_ensure_face(), blf_font_fill(), blf_font_free(), BLF_LAST_RESORT, BLI_path_basename(), BLI_path_cmp, BLI_strdup(), FaceDetails::coverage1, FaceDetails::coverage2, FaceDetails::coverage3, FaceDetails::coverage4, ft_lib, int, and static_face_details.

Referenced by blf_font_new_from_filepath(), and blf_font_new_from_mem().

◆ blf_font_size()

bool blf_font_size ( FontBLF * font,
float size )

Change font's output size. Returns true if successful in changing the size.

Definition at line 2068 of file blf_font.cc.

References BLF_CACHED, BLF_DPI, blf_ensure_face(), blf_size_finalizer(), float, ftc_manager, round_fl_to_uint(), and size().

Referenced by blf_draw_svg_icon(), blf_glyph_render(), BLF_size(), and blf_svg_icon_bitmap().

◆ blf_font_string_wrap()

blender::Vector< blender::StringRef > blf_font_string_wrap ( FontBLF * font,
blender::StringRef str,
int max_pixel_width )

Definition at line 1418 of file blf_font.cc.

References blf_font_string_wrap_cb(), blf_font_wrap_apply(), and str.

Referenced by BLF_string_wrap().

◆ blf_font_string_wrap_cb()

static void blf_font_string_wrap_cb ( FontBLF * ,
GlyphCacheBLF * ,
const char * str,
const size_t str_len,
ft_pix ,
void * str_list_ptr )
static

Wrap a blender::StringRef.

Definition at line 1405 of file blf_font.cc.

References str.

Referenced by blf_font_string_wrap().

◆ blf_font_width()

float blf_font_width ( FontBLF * font,
const char * str,
const size_t str_len,
ResultBLF * r_info )

◆ blf_font_width_and_height()

void blf_font_width_and_height ( FontBLF * font,
const char * str,
const size_t str_len,
float * r_width,
float * r_height,
ResultBLF * r_info )

◆ blf_font_width_max()

int blf_font_width_max ( FontBLF * font)

Definition at line 1458 of file blf_font.cc.

References blf_font_width_max_ft_pix(), and ft_pix_to_int().

Referenced by BLF_width_max().

◆ blf_font_width_max_ft_pix()

static ft_pix blf_font_width_max_ft_pix ( FontBLF * font)
static

Definition at line 1451 of file blf_font.cc.

References blf_ensure_size(), and ft_pix_from_int().

Referenced by blf_font_width_max().

◆ blf_font_width_to_rstrlen()

size_t blf_font_width_to_rstrlen ( FontBLF * font,
const char * str,
const size_t str_len,
int width,
int * r_width )

◆ blf_font_width_to_strlen()

size_t blf_font_width_to_strlen ( FontBLF * font,
const char * str,
const size_t str_len,
int width,
int * r_width )

◆ blf_font_width_to_strlen_glyph_process()

static bool blf_font_width_to_strlen_glyph_process ( FontBLF * font,
GlyphCacheBLF * gc,
const GlyphBLF * g_prev,
GlyphBLF * g,
ft_pix * pen_x,
const int width_i )
static

◆ blf_font_wrap_apply()

static void blf_font_wrap_apply ( FontBLF * font,
const char * str,
const size_t str_len,
const int max_pixel_width,
ResultBLF * r_info,
void(* callback )(FontBLF *font, GlyphCacheBLF *gc, const char *str, const size_t str_len, ft_pix pen_y, void *userdata),
void * userdata )
static

Generic function to add word-wrap support for other existing functions.

Wraps on spaces and respects newlines. Intentionally ignores non-unix newlines, tabs and more advanced text formatting.

Note
If we want rich text - we better have a higher level API to handle that (color, bold, switching fonts... etc).

Implementation Detail (utf8).

Take care with single byte offsets here, since this is utf8 we can't be sure a single byte is a single character.

This is only done when we know for sure the character is ascii (newline or a space).

Definition at line 1238 of file blf_font.cc.

References GlyphBLF::advance_x, blf_font_height_max_ft_pix(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_from_utf8_and_step(), GlyphBLF::c, callback, ft_pix_from_int(), ft_pix_to_int(), ResultBLF::lines, printf, str, UNLIKELY, ResultBLF::width, and wrap().

Referenced by blf_font_boundbox__wrap(), blf_font_draw__wrap(), blf_font_draw_buffer__wrap(), and blf_font_string_wrap().

◆ blf_get_char_index()

uint blf_get_char_index ( FontBLF * font,
uint charcode )

Return glyph id from char-code.

Definition at line 149 of file blf_font.cc.

References BLF_CACHED, blf_ensure_face(), and ftc_charmap_cache.

Referenced by blf_glyph_cache_new(), blf_glyph_index_from_charcode(), and BLF_has_glyph().

◆ blf_glyph_draw_buffer()

◆ blf_glyph_from_utf8_and_step()

◆ blf_kerning()

◆ blf_setup_face()

static bool blf_setup_face ( FontBLF * font)
static

Extra FontBLF setup needed after it gets a Face. Called from both blf_ensure_face and from the blf_cache_face_requester callback.

Definition at line 1747 of file blf_font.cc.

References KerningCacheBLF::ascii_table, blf_font_metrics(), BLF_MONOSPACED, KERNING_CACHE_TABLE_SIZE, KERNING_ENTRY_UNSET, and MEM_mallocN.

Referenced by blf_cache_face_requester(), and blf_ensure_face().

◆ blf_size_finalizer()

static void blf_size_finalizer ( void * object)
static

Called when the FreeType cache is removing a font size.

Definition at line 136 of file blf_font.cc.

Referenced by blf_ensure_size(), and blf_font_size().

◆ blf_str_offset_foreach_glyph()

static bool blf_str_offset_foreach_glyph ( const char * ,
const size_t str_step_ofs,
const rcti * bounds,
void * user_data )
static

Definition at line 1142 of file blf_font.cc.

References bounds(), and StrOffsetToGlyphBounds_Data::bounds.

Referenced by blf_str_offset_to_glyph_bounds().

◆ blf_str_offset_from_cursor_position()

size_t blf_str_offset_from_cursor_position ( FontBLF * font,
const char * str,
size_t str_len,
int location_x )

◆ blf_str_offset_to_cursor()

int blf_str_offset_to_cursor ( FontBLF * font,
const char * str,
const size_t str_len,
const size_t str_offset,
const int cursor_width )

◆ blf_str_offset_to_glyph_bounds()

void blf_str_offset_to_glyph_bounds ( FontBLF * font,
const char * str,
size_t str_offset,
rcti * r_glyph_bounds )

◆ blf_str_selection_boxes()

blender::Vector< blender::Bounds< int > > blf_str_selection_boxes ( FontBLF * font,
const char * str,
size_t str_len,
size_t sel_start,
size_t sel_length )

◆ blf_svg_icon_bitmap()

◆ blf_unscaled_F26Dot6_to_pixels()

static ft_pix blf_unscaled_F26Dot6_to_pixels ( FontBLF * font,
FT_Pos value )
static

Definition at line 160 of file blf_font.cc.

References blf_ensure_size(), and scaled().

Referenced by blf_kerning().

Variable Documentation

◆ blf_draw_cache_flush

void(* blf_draw_cache_flush) () ( ) = nullptr
static

Definition at line 70 of file blf_font.cc.

Referenced by blf_batch_draw(), and BLF_cache_flush_set_fn().

◆ ft_lib

FT_Library ft_lib = nullptr
static

Definition at line 62 of file blf_font.cc.

Referenced by blf_font_exit(), blf_font_init(), blf_font_new_impl(), and BLF_thumb_preview().

◆ ft_lib_mutex

ThreadMutex ft_lib_mutex
static

◆ ftc_charmap_cache

FTC_CMapCache ftc_charmap_cache = nullptr
static

Definition at line 64 of file blf_font.cc.

Referenced by blf_font_init(), and blf_get_char_index().

◆ ftc_manager

FTC_Manager ftc_manager = nullptr
static

◆ g_batch

◆ static_face_details

const FaceDetails static_face_details[]
static

Definition at line 1875 of file blf_font.cc.

Referenced by blf_font_new_impl().