Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | ResultBLF |
Macros | |
#define | BLF_DATAFILES_FONTS_DIR "fonts" |
#define | BLF_DEFAULT_PROPORTIONAL_FONT "droidsans.ttf" |
#define | BLF_DEFAULT_MONOSPACED_FONT "bmonofont-i18n.ttf" |
#define | BLF_BLUR_ENABLE 0 |
#define | BLF_DRAW_STR_DUMMY_MAX 1024 |
Typedefs | |
typedef bool(* | BLF_GlyphBoundsFn) (const char *str, size_t str_step_ofs, const struct rcti *glyph_step_bounds, int glyph_advance_x, const struct rcti *glyph_bounds, const int glyph_bearing[2], void *user_data) |
Enumerations | |
enum | { BLF_ROTATION = 1 << 0 , BLF_CLIPPING = 1 << 1 , BLF_SHADOW = 1 << 2 , BLF_MATRIX = 1 << 4 , BLF_ASPECT = 1 << 5 , BLF_WORD_WRAP = 1 << 6 , BLF_MONOCHROME = 1 << 7 , BLF_HINTING_NONE = 1 << 8 , BLF_HINTING_SLIGHT = 1 << 9 , BLF_HINTING_FULL = 1 << 10 , BLF_BOLD = 1 << 11 , BLF_ITALIC = 1 << 12 , BLF_MONOSPACED = 1 << 13 , BLF_DEFAULT = 1 << 14 , BLF_LAST_RESORT = 1 << 15 } |
Functions | |
int | BLF_init (void) |
void | BLF_exit (void) |
void | BLF_cache_clear (void) |
void | BLF_cache_flush_set_fn (void(*cache_flush_fn)(void)) |
int | BLF_load (const char *name) ATTR_NONNULL() |
int | BLF_load_mem (const char *name, const unsigned char *mem, int mem_size) ATTR_NONNULL() |
bool | BLF_is_loaded (const char *name) ATTR_NONNULL() |
int | BLF_load_unique (const char *name) ATTR_NONNULL() |
int | BLF_load_mem_unique (const char *name, const unsigned char *mem, int mem_size) ATTR_NONNULL() |
void | BLF_unload (const char *name) ATTR_NONNULL() |
void | BLF_unload_id (int fontid) |
void | BLF_unload_all (void) |
char * | BLF_display_name_from_file (const char *filepath) |
bool | BLF_has_glyph (int fontid, unsigned int unicode) |
void | BLF_metrics_attach (int fontid, unsigned char *mem, int mem_size) |
void | BLF_aspect (int fontid, float x, float y, float z) |
void | BLF_position (int fontid, float x, float y, float z) |
void | BLF_size (int fontid, float size, int dpi) |
void | BLF_color4ubv (int fontid, const unsigned char rgba[4]) |
void | BLF_color3ubv (int fontid, const unsigned char rgb[3]) |
void | BLF_color3ubv_alpha (int fontid, const unsigned char rgb[3], unsigned char alpha) |
void | BLF_color4ub (int fontid, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha) |
void | BLF_color3ub (int fontid, unsigned char r, unsigned char g, unsigned char b) |
void | BLF_color4f (int fontid, float r, float g, float b, float a) |
void | BLF_color4fv (int fontid, const float rgba[4]) |
void | BLF_color3f (int fontid, float r, float g, float b) |
void | BLF_color3fv_alpha (int fontid, const float rgb[3], float alpha) |
void | BLF_matrix (int fontid, const float m[16]) |
void | BLF_batch_draw_begin (void) |
void | BLF_batch_draw_flush (void) |
void | BLF_batch_draw_end (void) |
void | BLF_draw_ex (int fontid, const char *str, size_t str_len, struct ResultBLF *r_info) ATTR_NONNULL(2) |
void | BLF_draw (int fontid, const char *str, size_t str_len) ATTR_NONNULL(2) |
int | BLF_draw_mono (int fontid, const char *str, size_t str_len, int cwidth) ATTR_NONNULL(2) |
void | BLF_boundbox_foreach_glyph_ex (int fontid, const char *str, size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data, struct ResultBLF *r_info) ATTR_NONNULL(2) |
void | BLF_boundbox_foreach_glyph (int fontid, const char *str, size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data) ATTR_NONNULL(2) |
size_t | BLF_width_to_strlen (int fontid, const char *str, size_t str_len, float width, float *r_width) ATTR_NONNULL(2) |
size_t | BLF_width_to_rstrlen (int fontid, const char *str, size_t str_len, float width, float *r_width) ATTR_NONNULL(2) |
void | BLF_boundbox_ex (int fontid, const char *str, size_t str_len, struct rcti *box, struct ResultBLF *r_info) ATTR_NONNULL(2) |
void | BLF_boundbox (int fontid, const char *str, size_t str_len, struct rcti *box) ATTR_NONNULL() |
float | BLF_width_ex (int fontid, const char *str, size_t str_len, struct ResultBLF *r_info) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) |
float | BLF_width (int fontid, const char *str, size_t str_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
float | BLF_height_ex (int fontid, const char *str, size_t str_len, struct ResultBLF *r_info) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) |
float | BLF_height (int fontid, const char *str, size_t str_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
int | BLF_height_max (int fontid) ATTR_WARN_UNUSED_RESULT |
int | BLF_width_max (int fontid) ATTR_WARN_UNUSED_RESULT |
int | BLF_descender (int fontid) ATTR_WARN_UNUSED_RESULT |
int | BLF_ascender (int fontid) ATTR_WARN_UNUSED_RESULT |
void | BLF_width_and_height (int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL() |
float | BLF_fixed_width (int fontid) ATTR_WARN_UNUSED_RESULT |
void | BLF_rotation (int fontid, float angle) |
void | BLF_clipping (int fontid, int xmin, int ymin, int xmax, int ymax) |
void | BLF_wordwrap (int fontid, int wrap_width) |
void | BLF_enable (int fontid, int option) |
void | BLF_disable (int fontid, int option) |
void | BLF_shadow (int fontid, int level, const float rgba[4]) ATTR_NONNULL(3) |
void | BLF_shadow_offset (int fontid, int x, int y) |
void | BLF_buffer (int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display) |
void | BLF_buffer_col (int fontid, const float rgba[4]) ATTR_NONNULL(2) |
void | BLF_draw_buffer_ex (int fontid, const char *str, size_t str_len, struct ResultBLF *r_info) ATTR_NONNULL(2) |
void | BLF_draw_buffer (int fontid, const char *str, size_t str_len) ATTR_NONNULL(2) |
void | BLF_dir_add (const char *path) ATTR_NONNULL() |
void | BLF_dir_rem (const char *path) ATTR_NONNULL() |
char ** | BLF_dir_get (int *ndir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() |
void | BLF_dir_free (char **dirs, int count) ATTR_NONNULL() |
void | BLF_thumb_preview (const char *filepath, const char **draw_str, const char **i18n_draw_str, unsigned char draw_str_lines, const float font_color[4], int font_size, unsigned char *buf, int w, int h, int channels) ATTR_NONNULL() |
void | BLF_default_dpi (int dpi) |
void | BLF_default_size (float size) |
void | BLF_default_set (int fontid) |
int | BLF_default (void) |
void | BLF_draw_default (float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL() |
int | BLF_set_default (void) |
int | BLF_load_default (bool unique) |
int | BLF_load_mono_default (bool unique) |
void | BLF_load_font_stack (void) |
Variables | |
int | blf_mono_font |
int | blf_mono_font_render |
anonymous enum |
int BLF_ascender | ( | int | fontid | ) |
Definition at line 755 of file blf.c.
References blf_font_ascender(), and blf_get().
Referenced by blender::ed::space_node::frame_node_draw_label(), UI_fontstyle_draw_ex(), and UI_fontstyle_draw_rotated().
Definition at line 288 of file blf.c.
References FontBLF::aspect, blf_get(), x, y, and z.
Referenced by blender::ed::space_node::frame_node_draw_label(), playanim_toscreen(), and py_blf_aspect().
Batch draw-calls together as long as the model-view matrix and the font remain unchanged.
Definition at line 466 of file blf.c.
References BLI_assert, BatchBLF::enabled, and g_batch.
Referenced by draw_horizontal_scale_indicators(), draw_vertical_scale_indicators(), DRW_stats_draw(), file_draw_list(), UI_block_draw(), and view3d_draw_region_info().
Definition at line 479 of file blf.c.
References blf_batch_draw(), BLI_assert, BatchBLF::enabled, and g_batch.
Referenced by draw_horizontal_scale_indicators(), draw_vertical_scale_indicators(), DRW_stats_draw(), file_draw_list(), UI_block_draw(), and view3d_draw_region_info().
Definition at line 472 of file blf.c.
References blf_batch_draw(), BatchBLF::enabled, and g_batch.
Referenced by icon_draw_rect_input_symbol(), and icon_draw_rect_input_text().
Definition at line 657 of file blf.c.
References BLF_boundbox_ex(), NULL, and str.
Referenced by file_draw_string_multiline().
void BLF_boundbox_ex | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
struct rcti * | box, | ||
struct ResultBLF * | r_info | ||
) |
This function return the bounding box of the string and are not multiplied by the aspect.
Definition at line 640 of file blf.c.
References blf_font_boundbox(), blf_font_boundbox__wrap(), blf_get(), BLF_RESULT_CHECK_INIT, BLF_WORD_WRAP, FontBLF::flags, and str.
Referenced by BLF_boundbox(), do_text_effect(), and metadata_box_height_get().
void BLF_boundbox_foreach_glyph | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
BLF_GlyphBoundsFn | user_fn, | ||
void * | user_data | ||
) |
Definition at line 590 of file blf.c.
References BLF_boundbox_foreach_glyph_ex(), NULL, str, and user_data.
Referenced by ui_textedit_set_cursor_pos(), and widget_draw_text().
void BLF_boundbox_foreach_glyph_ex | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
BLF_GlyphBoundsFn | user_fn, | ||
void * | user_data, | ||
struct ResultBLF * | r_info | ||
) |
Run user_fn for each character, with the bound-box that would be used for drawing.
user_fn | Callback that runs on each glyph, returning false early exits. |
user_data | User argument passed to user_fn. |
Definition at line 568 of file blf.c.
References blf_font_boundbox_foreach_glyph(), blf_get(), BLF_RESULT_CHECK_INIT, BLF_WORD_WRAP, BLI_assert, FontBLF::flags, str, and user_data.
Referenced by BLF_boundbox_foreach_glyph().
void BLF_buffer | ( | int | fontid, |
float * | fbuf, | ||
unsigned char * | cbuf, | ||
int | w, | ||
int | h, | ||
int | nch, | ||
struct ColorManagedDisplay * | display | ||
) |
Set the buffer, size and number of channels to draw, one thing to take care is call this function with NULL pointer when we finish, for example:
Definition at line 816 of file blf.c.
References blf_get(), FontBLF::buf_info, FontBufInfoBLF::cbuf, FontBufInfoBLF::ch, FontBufInfoBLF::dims, FontBufInfoBLF::display, FontBufInfoBLF::fbuf, and w().
Referenced by BKE_image_stamp_buf(), checker_board_text(), and do_text_effect().
Set the color to be used for text.
Definition at line 836 of file blf.c.
References blf_get(), FontBLF::buf_info, FontBufInfoBLF::col_init, copy_v4_v4(), and usdtokens::rgba().
Referenced by BKE_image_stamp_buf(), checker_board_text(), and do_text_effect().
Definition at line 83 of file blf.c.
References blf_glyph_cache_clear(), BLF_MAX_FONT, and global_font.
Referenced by ghost_event_proc(), reloadtranslation_exec(), and UI_view2d_zoom_cache_reset().
Optional cache flushing function, called before blf_batch_draw.
Definition at line 1188 of file blf_font.c.
References blf_draw_cache_flush.
Referenced by uiStyleInit().
void BLF_clipping | ( | int | fontid, |
int | xmin, | ||
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) |
Definition at line 775 of file blf.c.
References blf_get(), FontBLF::clip_rec, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), blender::ed::space_node::frame_node_draw_label(), py_blf_clipping(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), and UI_view2d_text_cache_draw().
Definition at line 460 of file blf.c.
References usdtokens::b(), BLF_color4fv(), usdtokens::g(), r, and usdtokens::rgba().
Referenced by voxel_size_edit_draw().
Definition at line 452 of file blf.c.
References BLF_color4fv(), copy_v3_v3(), usdtokens::rgb(), and usdtokens::rgba().
void BLF_color3ub | ( | int | fontid, |
unsigned char | r, | ||
unsigned char | g, | ||
unsigned char | b | ||
) |
Definition at line 425 of file blf.c.
References usdtokens::b(), blf_get(), FontBLF::color, usdtokens::g(), and r.
Referenced by ED_image_draw_info().
void BLF_color3ubv | ( | int | fontid, |
const unsigned char | rgb[3] | ||
) |
Definition at line 407 of file blf.c.
References BLF_color3ubv_alpha(), and usdtokens::rgb().
Referenced by drawAutoKeyWarning(), ED_image_draw_info(), blender::ed::space_node::frame_node_draw_label(), gizmo_ruler_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), slider_draw(), UI_panel_category_draw_all(), and UI_view2d_text_cache_draw().
void BLF_color3ubv_alpha | ( | int | fontid, |
const unsigned char | rgb[3], | ||
unsigned char | alpha | ||
) |
Definition at line 395 of file blf.c.
References blf_get(), FontBLF::color, and usdtokens::rgb().
Referenced by BLF_color3ubv().
Definition at line 446 of file blf.c.
References Freestyle::a, usdtokens::b(), BLF_color4fv(), usdtokens::g(), r, and usdtokens::rgba().
Referenced by playanim_toscreen().
Definition at line 437 of file blf.c.
References blf_get(), FontBLF::color, usdtokens::rgba(), and rgba_float_to_uchar().
Referenced by BLF_color3f(), BLF_color3fv_alpha(), BLF_color4f(), gizmo_axis_draw(), icon_draw_rect_input_symbol(), icon_draw_rect_input_text(), py_blf_color(), radial_control_paint_cursor(), and UI_fontstyle_draw_simple_backdrop().
void BLF_color4ub | ( | int | fontid, |
unsigned char | r, | ||
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | alpha | ||
) |
Definition at line 412 of file blf.c.
References usdtokens::b(), blf_get(), FontBLF::color, usdtokens::g(), and r.
void BLF_color4ubv | ( | int | fontid, |
const unsigned char | rgba[4] | ||
) |
Definition at line 383 of file blf.c.
References blf_get(), FontBLF::color, and usdtokens::rgba().
Referenced by draw_marker_texts(), draw_view_axis(), drw_text_cache_draw_ex(), textview_draw_string(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_FontThemeColor(), and widget_draw_text().
int BLF_default | ( | void | ) |
Get default font ID so we can pass it to other functions.
Definition at line 44 of file blf_default.c.
References ASSERT_DEFAULT_SET, and global_font_default.
Referenced by draw_grid_unit_name(), draw_horizontal_scale_indicators(), draw_selected_name(), draw_seq_handle(), draw_vertical_scale_indicators(), draw_view_axis(), draw_viewport_name(), drawAutoKeyWarning(), drawviewborder(), DRW_draw_region_engine_info(), DRW_stats_draw(), drw_text_cache_draw_ex(), ED_scene_draw_fps(), gizmo_axis_draw(), icon_draw_rect_input_text(), UI_view2d_text_cache_draw(), and WM_key_event_string().
void BLF_default_dpi | ( | int | dpi | ) |
Definition at line 27 of file blf_default.c.
References global_font_dpi.
Referenced by BLF_init(), and WM_window_set_dpi().
void BLF_default_set | ( | int | fontid | ) |
Definition at line 37 of file blf_default.c.
References blf_font_id_is_valid(), and global_font_default.
Referenced by BKE_blender_userdef_data_free(), BLF_unload_all(), and uiStyleInit().
Definition at line 32 of file blf_default.c.
References global_font_size, and size().
Referenced by uiStyleInit().
int BLF_descender | ( | int | fontid | ) |
Definition at line 744 of file blf.c.
References blf_font_descender(), and blf_get().
Referenced by BKE_image_stamp_buf(), do_text_effect(), metadata_draw_imbuf(), textview_draw(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), and UI_fontstyle_draw_simple_backdrop().
void BLF_dir_add | ( | const char * | path | ) |
Add a path to the font dir paths.
Definition at line 50 of file blf_dir.c.
References blf_dir_find(), BLI_addhead(), BLI_strdup(), global_font_dir, MEM_callocN, and DirBLF::path.
void BLF_dir_free | ( | char ** | dirs, |
int | count | ||
) |
Free the data return by BLF_dir_get.
char** BLF_dir_get | ( | int * | ndir | ) |
Return an array with all the font dir (this can be used for file-selector).
Definition at line 76 of file blf_dir.c.
References BLI_listbase_count(), BLI_strdup(), count, ListBase::first, global_font_dir, MEM_callocN, DirBLF::next, NULL, and DirBLF::path.
void BLF_dir_rem | ( | const char * | path | ) |
Remove a path from the font dir paths.
Definition at line 64 of file blf_dir.c.
References blf_dir_find(), BLI_remlink(), global_font_dir, MEM_freeN, and DirBLF::path.
void BLF_disable | ( | int | fontid, |
int | option | ||
) |
Definition at line 279 of file blf.c.
References blf_get(), and FontBLF::flags.
Referenced by BKE_image_stamp_buf(), do_text_effect(), draw_grid_unit_name(), draw_selected_name(), draw_vertical_scale_indicators(), draw_viewport_name(), DRW_draw_region_engine_info(), DRW_stats_draw(), ED_info_draw_stats(), ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), ED_scene_draw_fps(), file_draw_string_multiline(), blender::ed::space_node::frame_node_draw_label(), gizmo_axis_draw(), gizmo_ruler_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), metadata_box_height_get(), metadata_draw_imbuf(), py_blf_disable(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), UI_panel_category_draw_all(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), UI_view2d_text_cache_draw(), uiStyleInit(), and widget_draw_text_icon().
char* BLF_display_name_from_file | ( | const char * | filepath | ) |
Definition at line 886 of file blf.c.
References blf_display_name(), blf_font_free(), blf_font_new(), and NULL.
Referenced by fileentry_uiname().
void BLF_draw | ( | int | fontid, |
const char * | str, | ||
size_t | str_len | ||
) |
Definition at line 538 of file blf.c.
References BLF_draw_ex(), GPU_bgl_end(), NULL, and str.
Referenced by BLF_draw_default(), clip_draw_dopesheet_channels(), draw_marker_texts(), drw_text_cache_draw_ex(), ED_image_draw_info(), ED_region_cache_draw_curfra_label(), ED_region_info_draw_multiline(), blender::ed::space_node::frame_node_draw_label(), gizmo_axis_draw(), gizmo_ruler_draw(), icon_draw_rect_input_symbol(), icon_draw_rect_input_text(), knifetool_draw_angle(), knifetool_draw_visible_distances(), loggerwindow_do_draw(), metadata_custom_draw_fields(), metadata_draw_imbuf(), playanim_toscreen(), py_blf_draw(), radial_control_paint_cursor(), region_draw_status_text(), slider_draw(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_fontstyle_draw_simple_backdrop(), UI_panel_category_draw_all(), voxel_size_edit_draw(), and widget_draw_text().
void BLF_draw_buffer | ( | int | fontid, |
const char * | str, | ||
size_t | str_len | ||
) |
Definition at line 881 of file blf.c.
References BLF_draw_buffer_ex(), NULL, and str.
Referenced by BKE_image_stamp_buf(), checker_board_text(), and do_text_effect().
Draw the string into the buffer, this function draw in both buffer, float and unsigned char BUT it's not necessary set both buffer, NULL is valid here.
Definition at line 863 of file blf.c.
References blf_draw_buffer__end(), blf_draw_buffer__start(), blf_font_draw_buffer(), blf_font_draw_buffer__wrap(), blf_get(), BLF_WORD_WRAP, FontBLF::buf_info, FontBufInfoBLF::cbuf, FontBufInfoBLF::fbuf, FontBLF::flags, and str.
Referenced by BLF_draw_buffer().
Draw the string using the default font, size and DPI.
Definition at line 59 of file blf_default.c.
References ASSERT_DEFAULT_SET, BLF_draw(), BLF_position(), BLF_size(), global_font_default, global_font_dpi, global_font_size, str, x, y, and z.
Referenced by draw_grid_unit_name(), draw_horizontal_scale_indicators(), draw_selected_name(), draw_stat(), draw_stat_5row(), draw_vertical_scale_indicators(), draw_view_axis(), draw_viewport_name(), drawAutoKeyWarning(), drawviewborder(), DRW_draw_region_engine_info(), ED_scene_draw_fps(), stats_row(), and UI_view2d_text_cache_draw().
Draw the string using the current font.
Definition at line 521 of file blf.c.
References blf_draw_gl__end(), blf_draw_gl__start(), blf_font_draw(), blf_font_draw__wrap(), blf_get(), BLF_RESULT_CHECK_INIT, BLF_WORD_WRAP, FontBLF::flags, and str.
Referenced by BLF_draw(), blender::ed::space_node::frame_node_draw_label(), metadata_draw_imbuf(), and UI_fontstyle_draw_ex().
int BLF_draw_mono | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
int | cwidth | ||
) |
Definition at line 550 of file blf.c.
References blf_draw_gl__end(), blf_draw_gl__start(), blf_font_draw_mono(), blf_get(), and str.
Referenced by text_font_draw(), text_font_draw_character(), text_font_draw_character_utf8(), and textview_draw_string().
void BLF_enable | ( | int | fontid, |
int | option | ||
) |
Definition at line 270 of file blf.c.
References blf_get(), and FontBLF::flags.
Referenced by BKE_image_stamp_buf(), BLF_load_default(), BLF_load_font_stack(), BLF_load_mono_default(), do_text_effect(), draw_grid_unit_name(), draw_selected_name(), draw_vertical_scale_indicators(), draw_viewport_name(), DRW_draw_region_engine_info(), DRW_stats_draw(), ED_info_draw_stats(), ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), ED_scene_draw_fps(), file_draw_string_multiline(), blender::ed::space_node::frame_node_draw_label(), gizmo_axis_draw(), gizmo_ruler_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), metadata_box_height_get(), metadata_draw_imbuf(), playanim_toscreen(), py_blf_enable(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), UI_panel_category_draw_all(), ui_tooltip_create_with_data(), UI_view2d_text_cache_draw(), and uiStyleInit().
Definition at line 70 of file blf.c.
References blf_font_exit(), blf_font_free(), BLF_MAX_FONT, global_font, and NULL.
Referenced by multitestapp_free(), WM_exit_ex(), and wm_main_playanim_intern().
float BLF_fixed_width | ( | int | fontid | ) |
For fixed width fonts only, returns the width of a character.
Definition at line 693 of file blf.c.
References blf_font_fixed_width(), and blf_get().
Referenced by textview_draw().
bool BLF_has_glyph | ( | int | fontid, |
unsigned int | unicode | ||
) |
Check if font supports a particular glyph.
Definition at line 121 of file blf.c.
References blf_get(), and FontBLF::face.
Referenced by key_event_glyph_or_text().
float BLF_height | ( | int | fontid, |
const char * | str, | ||
size_t | str_len | ||
) |
Definition at line 717 of file blf.c.
References BLF_height_ex(), NULL, and str.
Referenced by clip_draw_dopesheet_channels(), draw_vertical_scale_indicators(), file_font_pointsize(), loggerwindow_new(), and UI_view2d_text_cache_draw().
Definition at line 704 of file blf.c.
References blf_font_height(), blf_get(), BLF_RESULT_CHECK_INIT, and str.
Referenced by BLF_height().
int BLF_height_max | ( | int | fontid | ) |
Return dimensions of the font without any sample text.
Definition at line 722 of file blf.c.
References blf_font_height_max(), and blf_get().
Referenced by BKE_image_stamp_buf(), do_text_effect(), draw_marker_texts(), blender::ed::space_node::frame_node_draw_label(), metadata_box_height_get(), metadata_draw_imbuf(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_simple_backdrop(), UI_fontstyle_height_max(), and ui_tooltip_create_with_data().
int BLF_init | ( | void | ) |
Definition at line 59 of file blf.c.
References BLF_default_dpi(), blf_font_init(), BLF_MAX_FONT, global_font, and NULL.
Referenced by main(), WM_init(), and wm_main_playanim_intern().
bool BLF_is_loaded | ( | const char * | name | ) |
int BLF_load | ( | const char * | name | ) |
Loads a font, or returns an already loaded font and increments its reference count.
Definition at line 135 of file blf.c.
References BLF_load_unique(), blf_search(), global_font, and FontBLF::reference_count.
Referenced by blf_load_font_default(), BLF_load_font_stack(), py_blf_load(), SEQ_effect_text_font_load(), and uiStyleInit().
int BLF_load_default | ( | bool | unique | ) |
Definition at line 36 of file blf_font_default.c.
References BLF_DEFAULT, BLF_DEFAULT_PROPORTIONAL_FONT, BLF_enable(), and blf_load_font_default().
Referenced by BLF_load_font_stack(), loggerwindow_new(), and uiStyleInit().
Definition at line 50 of file blf_font_default.c.
References BKE_appdir_folder_id(), BLENDER_DATAFILES, BLF_DATAFILES_FONTS_DIR, BLF_DEFAULT, BLF_enable(), BLF_is_loaded(), BLF_load(), BLF_load_default(), BLF_load_mono_default(), BLI_exists(), BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_is_dir(), FILENAME_IS_CURRPAR, direntry::path, direntry::relname, SEP_STR, and UNLIKELY.
Referenced by uiStyleInit(), and wm_main_playanim_intern().
int BLF_load_mem | ( | const char * | name, |
const unsigned char * | mem, | ||
int | mem_size | ||
) |
Definition at line 187 of file blf.c.
References BLF_load_mem_unique(), and blf_search().
Referenced by SEQ_effect_text_font_load().
int BLF_load_mem_unique | ( | const char * | name, |
const unsigned char * | mem, | ||
int | mem_size | ||
) |
Definition at line 197 of file blf.c.
References blf_font_new_from_mem(), blf_search_available(), global_font, and FontBLF::reference_count.
Referenced by BLF_load_mem().
int BLF_load_mono_default | ( | bool | unique | ) |
Definition at line 43 of file blf_font_default.c.
References BLF_DEFAULT, BLF_DEFAULT_MONOSPACED_FONT, BLF_enable(), blf_load_font_default(), and BLF_MONOSPACED.
Referenced by BLF_load_font_stack(), uiStyleInit(), and wm_main_playanim_intern().
int BLF_load_unique | ( | const char * | name | ) |
Definition at line 148 of file blf.c.
References blf_dir_search(), blf_font_new(), blf_search_available(), global_font, MEM_freeN, and FontBLF::reference_count.
Referenced by BLF_load(), blf_load_font_default(), and uiStyleInit().
Set a 4x4 matrix to be multiplied before draw the text. Remember that you need call BLF_enable(BLF_MATRIX) to enable this.
The order of the matrix is like GL:
Definition at line 299 of file blf.c.
References blf_get(), and FontBLF::m.
void BLF_metrics_attach | ( | int | fontid, |
unsigned char * | mem, | ||
int | mem_size | ||
) |
Attach a file with metrics information from memory.
Definition at line 178 of file blf.c.
References blf_font_attach_from_mem(), and blf_get().
Definition at line 308 of file blf.c.
References FontBLF::aspect, BLF_ASPECT, blf_get(), FontBLF::flags, floorf, FontBLF::pos, round_fl_to_int(), x, y, and z.
Referenced by BKE_image_stamp_buf(), BLF_draw_default(), checker_board_text(), clip_draw_dopesheet_channels(), do_text_effect(), draw_marker_texts(), drw_text_cache_draw_ex(), ED_image_draw_info(), ED_region_cache_draw_curfra_label(), ED_region_info_draw_multiline(), blender::ed::space_node::frame_node_draw_label(), gizmo_axis_draw(), gizmo_ruler_draw(), icon_draw_rect_input_symbol(), icon_draw_rect_input_text(), knifetool_draw_angle(), knifetool_draw_visible_distances(), loggerwindow_do_draw(), metadata_custom_draw_fields(), metadata_draw_imbuf(), playanim_toscreen(), py_blf_position(), radial_control_paint_cursor(), region_draw_status_text(), slider_draw(), text_font_draw(), text_font_draw_character(), text_font_draw_character_utf8(), textview_draw_string(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_fontstyle_draw_simple_backdrop(), UI_panel_category_draw_all(), voxel_size_edit_draw(), and widget_draw_text().
By default, rotation and clipping are disable and have to be enable/disable using BLF_enable/disable.
Definition at line 766 of file blf.c.
References angle(), FontBLF::angle, and blf_get().
Referenced by gizmo_ruler_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), py_blf_rotation(), slider_draw(), UI_fontstyle_draw_rotated(), and UI_panel_category_draw_all().
int BLF_set_default | ( | void | ) |
Set size and DPI, and return default font ID.
Definition at line 50 of file blf_default.c.
References ASSERT_DEFAULT_SET, BLF_size(), global_font_default, global_font_dpi, and global_font_size.
Referenced by draw_seq_handle(), ED_info_draw_stats(), region_draw_status_text(), and UI_view2d_text_cache_draw().
Shadow options, level is the blur level, can be 3, 5 or 0 and the other argument are the RGBA color. Take care that shadow need to be enable using BLF_enable!
Definition at line 796 of file blf.c.
References blf_get(), usdtokens::rgba(), rgba_float_to_uchar(), FontBLF::shadow, and FontBLF::shadow_color.
Referenced by draw_grid_unit_name(), draw_selected_name(), draw_vertical_scale_indicators(), draw_viewport_name(), DRW_draw_region_engine_info(), DRW_stats_draw(), ED_info_draw_stats(), ED_scene_draw_fps(), py_blf_shadow(), UI_fontstyle_draw_ex(), and UI_fontstyle_draw_rotated().
void BLF_shadow_offset | ( | int | fontid, |
int | x, | ||
int | y | ||
) |
Set the offset for shadow text, this is the current cursor position plus this offset, don't need call BLF_position before this function, the current position is calculate only on BLF_draw, so it's safe call this whenever you like.
Definition at line 806 of file blf.c.
References blf_get(), FontBLF::shadow_x, FontBLF::shadow_y, x, and y.
Referenced by draw_grid_unit_name(), draw_selected_name(), draw_vertical_scale_indicators(), draw_viewport_name(), DRW_draw_region_engine_info(), DRW_stats_draw(), ED_info_draw_stats(), ED_scene_draw_fps(), py_blf_shadow_offset(), UI_fontstyle_draw_ex(), and UI_fontstyle_draw_rotated().
Definition at line 363 of file blf.c.
References blf_font_size(), blf_get(), and size().
Referenced by BKE_image_stamp_buf(), BLF_draw_default(), BLF_set_default(), checker_board_text(), clip_draw_dopesheet_channels(), do_text_effect(), draw_marker_texts(), drw_text_cache_draw_ex(), ED_image_draw_info(), ED_region_cache_draw_curfra_label(), ED_region_image_metadata_draw(), blender::ed::space_node::frame_node_draw_label(), get_column_width(), get_index_column_width(), gizmo_axis_draw(), gizmo_ruler_draw(), icon_draw_rect_input_symbol(), icon_draw_rect_input_text(), knifetool_draw_angle(), knifetool_draw_visible_distances(), loggerwindow_new(), py_blf_size(), radial_control_paint_cursor(), text_font_begin(), textview_font_begin(), UI_fontstyle_set(), UI_panel_category_draw_all(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), voxel_size_edit_draw(), and wm_main_playanim_intern().
void BLF_thumb_preview | ( | const char * | filepath, |
const char ** | draw_str, | ||
const char ** | i18n_draw_str, | ||
unsigned char | draw_str_lines, | ||
const float | font_color[4], | ||
int | font_size, | ||
unsigned char * | buf, | ||
int | w, | ||
int | h, | ||
int | channels | ||
) |
This function is used for generating thumbnail previews.
Definition at line 32 of file blf_thumbs.c.
References blf_draw_buffer__end(), blf_draw_buffer__start(), blf_font_ascender(), blf_font_count_missing_chars(), blf_font_draw_buffer(), blf_font_free(), blf_font_new(), blf_font_size(), FontBLF::buf_info, FontBufInfoBLF::cbuf, FontBufInfoBLF::ch, channels(), CLAMP_MIN, FontBufInfoBLF::col_init, FontBufInfoBLF::dims, NULL, FontBLF::pos, and w().
Referenced by IMB_thumb_load_font().
void BLF_unload | ( | const char * | name | ) |
Definition at line 225 of file blf.c.
References blf_font_free(), BLF_MAX_FONT, BLI_assert, global_font, FontBLF::name, NULL, FontBLF::reference_count, and STREQ.
Referenced by py_blf_unload().
Definition at line 256 of file blf.c.
References BLF_default_set(), blf_font_free(), BLF_MAX_FONT, blf_mono_font, blf_mono_font_render, global_font, and NULL.
Referenced by uiStyleInit().
void BLF_unload_id | ( | int | fontid | ) |
Definition at line 242 of file blf.c.
References blf_font_free(), blf_get(), BLI_assert, global_font, NULL, and FontBLF::reference_count.
Referenced by BKE_blender_userdef_data_free(), and SEQ_effect_text_font_unload().
float BLF_width | ( | int | fontid, |
const char * | str, | ||
size_t | str_len | ||
) |
Definition at line 688 of file blf.c.
References BLF_width_ex(), NULL, and str.
Referenced by draw_horizontal_scale_indicators(), draw_seq_handle(), ED_image_draw_info(), ED_info_draw_stats(), ED_region_info_draw_multiline(), file_string_width(), blender::ed::space_node::frame_node_draw_label(), get_column_width(), get_index_column_width(), metadata_draw_imbuf(), region_draw_status_text(), ui_block_bounds_calc_text(), ui_draw_menu_item(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple_backdrop(), UI_fontstyle_string_width(), UI_panel_category_draw_all(), ui_text_clip_cursor(), UI_text_clip_middle_ex(), ui_text_clip_right_label(), ui_textedit_set_cursor_pos(), ui_tooltip_create_with_data(), uiTemplateReportsBanner(), uiTemplateStatusInfo(), and widget_draw_text().
void BLF_width_and_height | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
float * | r_width, | ||
float * | r_height | ||
) |
The following function return the width and height of the string, but just in one call, so avoid extra freetype2 stuff.
Definition at line 662 of file blf.c.
References blf_font_width_and_height(), blf_get(), NULL, and str.
Referenced by draw_backdrop(), drawAutoKeyWarning(), ED_region_cache_draw_curfra_label(), gizmo_axis_draw(), gizmo_ruler_draw(), icon_draw_rect_input_text(), knifetool_draw_angle(), knifetool_draw_visible_distances(), py_blf_dimensions(), radial_control_paint_cursor(), slider_draw(), ui_draw_preview_item_stateless(), and voxel_size_edit_draw().
The next both function return the width and height of the string, using the current font and both value are multiplied by the aspect of the font.
Definition at line 675 of file blf.c.
References blf_font_width(), blf_get(), BLF_RESULT_CHECK_INIT, and str.
Referenced by BLF_width(), and ui_tooltip_create_with_data().
int BLF_width_max | ( | int | fontid | ) |
Definition at line 733 of file blf.c.
References blf_font_width_max(), and blf_get().
Referenced by BKE_image_stamp_buf(), and do_text_effect().
size_t BLF_width_to_rstrlen | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
float | width, | ||
float * | r_width | ||
) |
Same as BLF_width_to_strlen but search from the string end.
Definition at line 618 of file blf.c.
References FontBLF::aspect, BLF_ASPECT, blf_font_width_to_rstrlen(), blf_get(), FontBLF::flags, float(), ret, str, and width.
Referenced by UI_text_clip_middle_ex().
size_t BLF_width_to_strlen | ( | int | fontid, |
const char * | str, | ||
size_t | str_len, | ||
float | width, | ||
float * | r_width | ||
) |
Get the string byte offset that fits within a given width.
Definition at line 596 of file blf.c.
References FontBLF::aspect, BLF_ASPECT, blf_font_width_to_strlen(), blf_get(), FontBLF::flags, float(), ret, str, and width.
Referenced by UI_panel_category_draw_all(), UI_text_clip_middle_ex(), ui_text_clip_right_ex(), and ui_text_clip_right_label().
void BLF_wordwrap | ( | int | fontid, |
int | wrap_width | ||
) |
Definition at line 787 of file blf.c.
References blf_get(), FontBLF::wrap_width, and wrap_width().
Referenced by BKE_image_stamp_buf(), do_text_effect(), file_draw_string_multiline(), blender::ed::space_node::frame_node_draw_label(), metadata_box_height_get(), metadata_draw_imbuf(), py_blf_word_wrap(), ui_tooltip_create_with_data(), and ui_tooltip_region_draw_cb().
|
extern |
Definition at line 48 of file blf.c.
Referenced by BLF_unload_all(), ED_image_draw_info(), ED_region_image_metadata_draw(), gizmo_ruler_draw(), icon_draw_rect_input_symbol(), knifetool_draw_angle(), knifetool_draw_visible_distances(), text_draw_context_init(), textview_draw(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), and uiStyleInit().
|
extern |
Definition at line 49 of file blf.c.
Referenced by BKE_image_stamp_buf(), BLF_unload_all(), checker_board_text(), do_text_effect(), and uiStyleInit().