Blender V5.3
BLF_api.hh File Reference
#include "BLF_enums.hh"
#include "BLI_array.hh"
#include "BLI_bounds_types.hh"
#include "BLI_compiler_attrs.hh"
#include "BLI_function_ref.hh"
#include "BLI_string_ref.hh"
#include "BLI_sys_types.hh"
#include "BLI_vector.hh"
#include "DNA_listBase.h"

Go to the source code of this file.

Classes

struct  blender::ResultBLF

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ocio

Macros

#define BLF_DATAFILES_FONTS_DIR   "fonts"
#define BLF_DEFAULT_PROPORTIONAL_FONT   "Inter.woff2"
#define BLF_DEFAULT_MONOSPACED_FONT   "DejaVuSansMono.woff2"
#define BLF_VFONT_METRICS_SCALE_DEFAULT   float(1.0 / 1000.0)
#define BLF_VFONT_METRICS_EM_RATIO_DEFAULT   1.0f
#define BLF_VFONT_METRICS_ASCEND_RATIO_DEFAULT   0.8f
#define BLF_DRAW_STR_DUMMY_MAX   1024

Typedefs

using blender::ColorSpace = ocio::ColorSpace
using blender::BLF_GlyphBoundsFn

Functions

int blender::BLF_init ()
void blender::BLF_exit ()
void blender::BLF_reset_fonts ()
void blender::BLF_cache_clear ()
int blender::BLF_load (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int blender::BLF_load_mem (const char *name, const unsigned char *mem, int mem_size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int bool blender::BLF_is_loaded (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool blender::BLF_is_loaded_mem (const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool blender::BLF_is_loaded_id (int fontid) ATTR_WARN_UNUSED_RESULT
int blender::BLF_load_unique (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int blender::BLF_load_mem_unique (const char *name, const unsigned char *mem, int mem_size) ATTR_NONNULL(1
int void blender::BLF_unload (const char *filepath) ATTR_NONNULL(1)
bool blender::BLF_unload_id (int fontid)
void blender::BLF_unload_all ()
void blender::BLF_addref_id (int fontid)
char * blender::BLF_display_name_from_file (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * blender::BLF_display_name_from_id (int fontid)
bool blender::BLF_get_vfont_metrics (int fontid, float *ascend_ratio, float *em_ratio, float *scale)
bool blender::BLF_character_to_curves (int fontid, unsigned int unicode, ListBaseT< Nurb > *nurbsbase, const float scale, bool use_fallback, float *r_advance, rctf *r_bounds)
bool blender::BLF_has_glyph (int fontid, unsigned int unicode) ATTR_WARN_UNUSED_RESULT
void blender::BLF_metrics_attach (int fontid, const unsigned char *mem, int mem_size) ATTR_NONNULL(2)
void blender::BLF_aspect (int fontid, float x, float y, float z)
void blender::BLF_position (int fontid, float x, float y, float z)
void blender::BLF_size (int fontid, float size)
void blender::BLF_character_weight (int fontid, int weight)
int blender::BLF_default_weight (int fontid) ATTR_WARN_UNUSED_RESULT
bool blender::BLF_has_variable_weight (int fontid) ATTR_WARN_UNUSED_RESULT
void blender::BLF_color4ubv (int fontid, const unsigned char rgba[4])
void blender::BLF_color3ubv (int fontid, const unsigned char rgb[3])
void blender::BLF_color3ubv_alpha (int fontid, const unsigned char rgb[3], unsigned char alpha)
void blender::BLF_color4ub (int fontid, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha)
void blender::BLF_color3ub (int fontid, unsigned char r, unsigned char g, unsigned char b)
void blender::BLF_color4f (int fontid, float r, float g, float b, float a)
void blender::BLF_color4fv (int fontid, const float rgba[4])
void blender::BLF_color3f (int fontid, float r, float g, float b)
void blender::BLF_color3fv_alpha (int fontid, const float rgb[3], float alpha)
void blender::BLF_batch_draw_begin ()
void blender::BLF_batch_draw_flush ()
void blender::BLF_batch_draw_end ()
void blender::BLF_draw (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
int blender::BLF_draw_mono (int fontid, const char *str, size_t str_len, int char_width, int tab_columns) ATTR_NONNULL(2)
void blender::BLF_draw_svg_icon (uint icon_id, float x, float y, float size, const float color[4]=nullptr, float outline_alpha=1.0f, bool multicolor=false, FunctionRef< void(std::string &)> edit_source_cb=nullptr)
Array< uchar > blender::BLF_svg_icon_bitmap (uint icon_id, float size, int *r_width, int *r_height, bool multicolor=false, FunctionRef< void(std::string &)> edit_source_cb=nullptr)
void blender::BLF_boundbox_foreach_glyph (int fontid, const char *str, size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data) ATTR_NONNULL(2)
void blender::BLF_info_foreach_glyph (int fontid, const char *str, size_t str_len, FunctionRef< void(int index, size_t byte_offset, int byte_len, int advance_x)> callback)
size_t blender::BLF_str_offset_from_cursor_position (int fontid, const char *str, size_t str_len, int location_x) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
bool blender::BLF_str_offset_to_glyph_bounds (int fontid, const char *str, size_t str_offset, rcti *r_glyph_bounds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2
bool int blender::BLF_str_offset_to_cursor (int fontid, const char *str, size_t str_len, size_t str_offset, int cursor_width)
Vector< Bounds< int > > blender::BLF_str_selection_boxes (int fontid, const char *str, size_t str_len, size_t sel_start, size_t sel_length)
size_t blender::BLF_width_to_strlen (int fontid, const char *str, size_t str_len, float width, float *r_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
size_t blender::BLF_width_to_rstrlen (int fontid, const char *str, size_t str_len, float width, float *r_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void blender::BLF_boundbox (int fontid, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
float blender::BLF_width (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
float blender::BLF_height (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
int blender::BLF_height_max (int fontid) ATTR_WARN_UNUSED_RESULT
int blender::BLF_width_max (int fontid) ATTR_WARN_UNUSED_RESULT
int blender::BLF_descender (int fontid) ATTR_WARN_UNUSED_RESULT
int blender::BLF_ascender (int fontid) ATTR_WARN_UNUSED_RESULT
bool blender::BLF_bounds_max (int fontid, rctf *r_bounds) ATTR_NONNULL(2)
void blender::BLF_width_and_height (int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
float blender::BLF_fixed_width (int fontid) ATTR_WARN_UNUSED_RESULT
int blender::BLF_glyph_advance (int fontid, const char *str)
void blender::BLF_rotation (int fontid, float angle)
void blender::BLF_clipping (int fontid, int xmin, int ymin, int xmax, int ymax)
void blender::BLF_wordwrap (int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
Vector< StringRef > blender::BLF_string_wrap (int fontid, StringRef str, const int max_pixel_width, BLFWrapMode mode=BLFWrapMode::Minimal)
void blender::BLF_enable (int fontid, FontFlags flag)
void blender::BLF_disable (int fontid, FontFlags flag)
bool blender::BLF_is_builtin (int fontid)
void blender::BLF_shadow (int fontid, FontShadowType type, const float rgba[4]=nullptr)
void blender::BLF_shadow_offset (int fontid, int x, int y)
void blender::BLF_buffer (int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int channel_count, const ColorSpace *colorspace)
BLFBufferState * blender::BLF_buffer_state_push (int fontid)
void blender::BLF_buffer_state_pop (BLFBufferState *buffer_state)
void blender::BLF_buffer_state_free (BLFBufferState *buffer_state)
void blender::BLF_buffer_col (int fontid, const float srgb_color[4]) ATTR_NONNULL(2)
void blender::BLF_draw_buffer (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
bool blender::BLF_thumb_preview (const char *filepath, unsigned char *buf, int w, int h, int channels) ATTR_NONNULL()
void blender::BLF_default_size (float size)
void blender::BLF_default_set (int fontid)
int blender::BLF_default ()
void blender::BLF_draw_default (float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
int blender::BLF_set_default ()
int blender::BLF_load_default (bool unique)
int blender::BLF_load_mono_default (bool unique)
void blender::BLF_load_font_stack ()
void blender::BLF_state_print (int fontid)
Font Subsystem Init/Exit
void blender::BLF_cache_flush_set_fn (void(*cache_flush_fn)())
Glyph Batching
void blender::BLF_batch_discard ()

Variables

int blender::blf_mono_font = -1
int blender::blf_mono_font_render = -1

Macro Definition Documentation

◆ BLF_DATAFILES_FONTS_DIR

#define BLF_DATAFILES_FONTS_DIR   "fonts"

Name of sub-directory inside #BLENDER_DATAFILES that contains font files.

Definition at line 26 of file BLF_api.hh.

Referenced by blender::blf_load_datafiles_dir(), and blender::blf_load_font_default().

◆ BLF_DEFAULT_MONOSPACED_FONT

#define BLF_DEFAULT_MONOSPACED_FONT   "DejaVuSansMono.woff2"

File name of the default fixed-pitch font.

Definition at line 32 of file BLF_api.hh.

Referenced by blender::BLF_load_mono_default().

◆ BLF_DEFAULT_PROPORTIONAL_FONT

#define BLF_DEFAULT_PROPORTIONAL_FONT   "Inter.woff2"

File name of the default variable-width font.

Definition at line 29 of file BLF_api.hh.

Referenced by blender::BLF_load_default().

◆ BLF_DRAW_STR_DUMMY_MAX

◆ BLF_VFONT_METRICS_ASCEND_RATIO_DEFAULT

#define BLF_VFONT_METRICS_ASCEND_RATIO_DEFAULT   0.8f

◆ BLF_VFONT_METRICS_EM_RATIO_DEFAULT

#define BLF_VFONT_METRICS_EM_RATIO_DEFAULT   1.0f

◆ BLF_VFONT_METRICS_SCALE_DEFAULT

#define BLF_VFONT_METRICS_SCALE_DEFAULT   float(1.0 / 1000.0)