|
Blender V5.0
|
#include "BLF_enums.hh"#include "BLI_array.hh"#include "BLI_bounds_types.hh"#include "BLI_compiler_attrs.h"#include "BLI_function_ref.hh"#include "BLI_string_ref.hh"#include "BLI_sys_types.h"#include "BLI_vector.hh"Go to the source code of this file.
Classes | |
| struct | ResultBLF |
Namespaces | |
| namespace | blender |
| 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 | ColorSpace = blender::ocio::ColorSpace |
| using | BLF_GlyphBoundsFn |
Functions | |
| int | BLF_init () |
| void | BLF_exit () |
| void | BLF_reset_fonts () |
| void | BLF_cache_clear () |
| void | BLF_cache_flush_set_fn (void(*cache_flush_fn)()) |
| int | BLF_load (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) |
| int | BLF_load_mem (const char *name, const unsigned char *mem, int mem_size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1 |
| int bool | BLF_is_loaded (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) |
| bool | BLF_is_loaded_mem (const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) |
| bool | BLF_is_loaded_id (int fontid) ATTR_WARN_UNUSED_RESULT |
| int | BLF_load_unique (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) |
| int | BLF_load_mem_unique (const char *name, const unsigned char *mem, int mem_size) ATTR_NONNULL(1 |
| int void | BLF_unload (const char *filepath) ATTR_NONNULL(1) |
| bool | BLF_unload_id (int fontid) |
| void | BLF_unload_all () |
| void | BLF_addref_id (int fontid) |
| char * | BLF_display_name_from_file (const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) |
| char * | BLF_display_name_from_id (int fontid) |
| bool | BLF_get_vfont_metrics (int fontid, float *ascend_ratio, float *em_ratio, float *scale) |
| bool | BLF_character_to_curves (int fontid, unsigned int unicode, ListBase *nurbsbase, const float scale, bool use_fallback, float *r_advance) |
| bool | BLF_has_glyph (int fontid, unsigned int unicode) ATTR_WARN_UNUSED_RESULT |
| void | BLF_metrics_attach (int fontid, const unsigned char *mem, int mem_size) ATTR_NONNULL(2) |
| 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) |
| void | BLF_character_weight (int fontid, int weight) |
| int | BLF_default_weight (int fontid) ATTR_WARN_UNUSED_RESULT |
| bool | BLF_has_variable_weight (int fontid) ATTR_WARN_UNUSED_RESULT |
| 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_batch_draw_begin () |
| void | BLF_batch_draw_flush () |
| void | BLF_batch_draw_end () |
| void | BLF_batch_discard () |
| void | BLF_draw (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2) |
| int | BLF_draw_mono (int fontid, const char *str, size_t str_len, int cwidth, int tab_columns) ATTR_NONNULL(2) |
| void | 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, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr) |
| blender::Array< uchar > | BLF_svg_icon_bitmap (uint icon_id, float size, int *r_width, int *r_height, bool multicolor=false, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr) |
| 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_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 | 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 | BLF_str_offset_to_cursor (int fontid, const char *str, size_t str_len, size_t str_offset, int cursor_width) |
| blender::Vector< blender::Bounds< int > > | BLF_str_selection_boxes (int fontid, const char *str, size_t str_len, size_t sel_start, size_t sel_length) |
| size_t | 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 | 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 | BLF_boundbox (int fontid, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info=nullptr) ATTR_NONNULL(2) |
| float | BLF_width (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) |
| float | BLF_height (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) |
| 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 |
| bool | BLF_bounds_max (int fontid, rctf *r_bounds) ATTR_NONNULL(2) |
| 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 |
| int | BLF_glyph_advance (int fontid, const char *str) |
| 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, BLFWrapMode mode=BLFWrapMode::Minimal) |
| blender::Vector< blender::StringRef > | BLF_string_wrap (int fontid, blender::StringRef str, const int max_pixel_width, BLFWrapMode mode=BLFWrapMode::Minimal) |
| void | BLF_enable (int fontid, FontFlags flag) |
| void | BLF_disable (int fontid, FontFlags flag) |
| bool | BLF_is_builtin (int fontid) |
| void | BLF_shadow (int fontid, FontShadowType type, const float rgba[4]=nullptr) |
| void | BLF_shadow_offset (int fontid, int x, int y) |
| void | BLF_buffer (int fontid, float *fbuf, unsigned char *cbuf, int w, int h, const ColorSpace *colorspace) |
| BLFBufferState * | BLF_buffer_state_push (int fontid) |
| void | BLF_buffer_state_pop (BLFBufferState *buffer_state) |
| void | BLF_buffer_state_free (BLFBufferState *buffer_state) |
| void | BLF_buffer_col (int fontid, const float srgb_color[4]) ATTR_NONNULL(2) |
| void | BLF_draw_buffer (int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2) |
| bool | BLF_thumb_preview (const char *filepath, unsigned char *buf, int w, int h, int channels) ATTR_NONNULL() |
| void | BLF_default_size (float size) |
| void | BLF_default_set (int fontid) |
| int | BLF_default () |
| void | BLF_draw_default (float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL() |
| int | BLF_set_default () |
| int | BLF_load_default (bool unique) |
| int | BLF_load_mono_default (bool unique) |
| void | BLF_load_font_stack () |
| void | BLF_state_print (int fontid) |
Variables | |
| int | blf_mono_font |
| int | blf_mono_font_render |
| #define BLF_DATAFILES_FONTS_DIR "fonts" |
Name of sub-directory inside BLENDER_DATAFILES that contains font files.
Definition at line 22 of file BLF_api.hh.
Referenced by blf_load_datafiles_dir(), and blf_load_font_default().
| #define BLF_DEFAULT_MONOSPACED_FONT "DejaVuSansMono.woff2" |
File name of the default fixed-pitch font.
Definition at line 28 of file BLF_api.hh.
Referenced by BLF_load_mono_default().
| #define BLF_DEFAULT_PROPORTIONAL_FONT "Inter.woff2" |
File name of the default variable-width font.
Definition at line 25 of file BLF_api.hh.
Referenced by BLF_load_default().
| #define BLF_DRAW_STR_DUMMY_MAX 1024 |
Definition at line 440 of file BLF_api.hh.
Referenced by block_create_autorun_warning(), blender::ed::transform::drawAutoKeyWarning(), ED_region_info_draw_multiline(), file_string_width(), icon_draw_rect_input_text(), region_draw_status_text(), screen_draw_area_drag_tip(), text_font_draw(), ui_def_but_rna__menu(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_fontstyle_string_width(), UI_panel_category_draw_all(), ui_tooltip_create_with_data(), UI_view2d_text_cache_draw(), blender::ed::outliner::unused_message_popup_width_compute(), and wm_block_dialog_create().
| #define BLF_VFONT_METRICS_ASCEND_RATIO_DEFAULT 0.8f |
Definition at line 114 of file BLF_api.hh.
Referenced by BKE_vfontdata_metrics_get_defaults(), and BLF_get_vfont_metrics().
| #define BLF_VFONT_METRICS_EM_RATIO_DEFAULT 1.0f |
Definition at line 113 of file BLF_api.hh.
Referenced by BKE_vfontdata_metrics_get_defaults(), and BLF_get_vfont_metrics().
| #define BLF_VFONT_METRICS_SCALE_DEFAULT float(1.0 / 1000.0) |
Definition at line 112 of file BLF_api.hh.
Referenced by BKE_vfontdata_metrics_get_defaults(), and BLF_get_vfont_metrics().
| using BLF_GlyphBoundsFn |
Definition at line 207 of file BLF_api.hh.
| using ColorSpace = blender::ocio::ColorSpace |
Definition at line 38 of file BLF_api.hh.
| void BLF_addref_id | ( | int | fontid | ) |
Increases font reference count.
Definition at line 311 of file blf.cc.
References blf_get(), g_blf_load_mutex, lock, and FontBLF::reference_count.
Referenced by blender::seq::strip_load_font_file(), and blender::seq::strip_load_font_mem().
| int BLF_ascender | ( | int | fontid | ) |
Definition at line 883 of file blf.cc.
References blf_font_ascender(), and blf_get().
Referenced by BLF_str_offset_to_glyph_bounds(), blender::tests::TEST(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), and UI_fontstyle_draw_rotated().
Definition at line 377 of file blf.cc.
References FontBLF::aspect, blf_get(), x, y, and z().
Referenced by blender::ed::space_node::frame_node_draw_label(), playanim_toscreen_ex(), and py_blf_aspect().
| void BLF_batch_discard | ( | ) |
Definition at line 346 of file blf_font.cc.
References g_batch, GPU_storagebuf_create_ex(), GPU_storagebuf_free(), and GPU_USAGE_STREAM.
Referenced by ED_region_header_draw().
| void BLF_batch_draw_begin | ( | ) |
Batch draw-calls together as long as the model-view matrix and the font remain unchanged.
Definition at line 534 of file blf.cc.
References BLI_assert, and g_batch.
Referenced by draw_horizontal_scale_indicators(), draw_vertical_scale_indicators(), file_draw_list(), UI_block_draw(), and view3d_draw_region_info().
| void BLF_batch_draw_end | ( | ) |
Definition at line 547 of file blf.cc.
References blf_batch_draw(), BLI_assert, and g_batch.
Referenced by draw_horizontal_scale_indicators(), draw_vertical_scale_indicators(), file_draw_list(), UI_block_draw(), and view3d_draw_region_info().
| void BLF_batch_draw_flush | ( | ) |
Definition at line 540 of file blf.cc.
References blf_batch_draw(), and g_batch.
Referenced by ui_draw_but_WAVEFORM().
| void BLF_boundbox | ( | int | fontid, |
| const char * | str, | ||
| size_t | str_len, | ||
| rcti * | r_box, | ||
| ResultBLF * | r_info = nullptr ) |
This function return the bounding box of the string and are not multiplied by the aspect.
Definition at line 772 of file blf.cc.
References blf_font_boundbox(), blf_font_boundbox__wrap(), blf_get(), BLF_RESULT_CHECK_INIT, BLF_WORD_WRAP, FontBLF::flags, and str.
Referenced by BLF_str_offset_to_glyph_bounds(), file_draw_string_multiline(), icon_draw_rect_input_text(), 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 ) |
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 664 of file blf.cc.
References blf_font_boundbox_foreach_glyph(), blf_get(), BLF_WORD_WRAP, BLI_assert, FontBLF::flags, and str.
| bool BLF_bounds_max | ( | int | fontid, |
| rctf * | r_bounds ) |
Returns the minimum bounding box that can enclose all glyphs in the font at the current size. Expect negative values as Y=0 is the baseline, X=0 is normal advance position (glyphs can have negative bearing and positioning). There should be little use for this as it is best to measure the bounds of the actual text to be drawn. These values (unscaled) are set in the font file, not calculated from the actual glyphs at load time. This should be considered correct but it is possible, although very unlikely, for a defective font to contain incorrect values.
Definition at line 894 of file blf.cc.
References blf_font_bounds_max(), and blf_get().
Referenced by BLF_str_offset_to_glyph_bounds(), and blender::seq::calc_boundbox().
| void BLF_buffer | ( | int | fontid, |
| float * | fbuf, | ||
| unsigned char * | cbuf, | ||
| int | w, | ||
| int | h, | ||
| const ColorSpace * | colorspace ) |
Make font be rasterized into a given memory image/buffer. The image is assumed to have 4 color channels (RGBA) per pixel. When done, call this function with null buffer pointers.
Definition at line 956 of file blf.cc.
References blf_get(), FontBLF::buf_info, FontBufInfoBLF::cbuf, FontBufInfoBLF::colorspace, FontBufInfoBLF::dims, FontBufInfoBLF::fbuf, and w().
Referenced by BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), checker_board_text(), cursor_bitmap_from_text(), blender::seq::do_text_effect(), blender::seq::draw_text_outline(), IMB_font_preview(), and py_blf_bind_imbuf_enter().
| void BLF_buffer_col | ( | int | fontid, |
| const float | srgb_color[4] ) |
Set the color to be used for text.
Definition at line 1015 of file blf.cc.
References blf_get(), FontBLF::buf_info, FontBufInfoBLF::col_init, and copy_v4_v4().
Referenced by BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), checker_board_text(), cursor_bitmap_from_text(), IMB_font_preview(), py_blf_color(), and blender::seq::text_draw().
| void BLF_buffer_state_free | ( | BLFBufferState * | buffer_state | ) |
Free the state, only use in the rare case pop is not called (if the font itself is unloaded after pushing for example).
Definition at line 1010 of file blf.cc.
Referenced by BLF_buffer_state_pop(), BLF_str_offset_to_glyph_bounds(), and py_blf_bind_imbuf_dealloc().
| void BLF_buffer_state_pop | ( | BLFBufferState * | buffer_state | ) |
Pop the state (restoring the state when BLF_buffer_state_push was called).
Definition at line 993 of file blf.cc.
References BLF_buffer_state_free(), blf_get(), BLFBufferState::buf_info, FontBLF::buf_info, FontBufInfoBLF::col_init, copy_v4_v4(), BLFBufferState::font, and BLFBufferState::fontid.
Referenced by BLF_str_offset_to_glyph_bounds(), and py_blf_bind_imbuf_exit().
| BLFBufferState * BLF_buffer_state_push | ( | int | fontid | ) |
Store the current buffer state. This state must be popped with BLF_buffer_state_pop.
Definition at line 980 of file blf.cc.
References blf_get(), BLFBufferState::buf_info, FontBLF::buf_info, BLFBufferState::font, and BLFBufferState::fontid.
Referenced by BLF_str_offset_to_glyph_bounds(), and py_blf_bind_imbuf_enter().
| void BLF_cache_clear | ( | ) |
Definition at line 98 of file blf.cc.
References blf_glyph_cache_clear(), BLF_MAX_FONT, global_font, and i.
Referenced by ghost_event_proc(), reloadtranslation_exec(), and UI_view2d_zoom_cache_reset().
| void BLF_cache_flush_set_fn | ( | void(* | cache_flush_fn )() | ) |
Optional cache flushing function, called before blf_batch_draw.
Definition at line 1633 of file blf_font.cc.
References blf_draw_cache_flush.
Referenced by uiStyleInit().
| bool BLF_character_to_curves | ( | int | fontid, |
| unsigned int | unicode, | ||
| ListBase * | nurbsbase, | ||
| const float | scale, | ||
| bool | use_fallback, | ||
| float * | r_advance ) |
Convert a character's outlines into curves.
Definition at line 1146 of file blf.cc.
References blf_character_to_curves(), and blf_get().
Referenced by BKE_vfontdata_char_from_freetypefont().
| void BLF_character_weight | ( | int | fontid, |
| int | weight ) |
Weight class: 100 (Thin) - 400 (Normal) - 900 (Heavy).
Definition at line 347 of file blf.cc.
References blf_get(), and FontBLF::char_weight.
Referenced by fontstyle_set_ex(), and blender::tests::TEST().
| void BLF_clipping | ( | int | fontid, |
| int | xmin, | ||
| int | ymin, | ||
| int | xmax, | ||
| int | ymax ) |
Definition at line 912 of file blf.cc.
References blf_get(), FontBLF::clip_rec, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by BLF_str_offset_to_glyph_bounds(), 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_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), and UI_view2d_text_cache_draw().
Definition at line 528 of file blf.cc.
References b, and BLF_color4fv().
Referenced by blender::ed::object::voxel_size_edit_draw().
Definition at line 520 of file blf.cc.
References BLF_color4fv(), and copy_v3_v3().
Definition at line 493 of file blf.cc.
References b, blf_get(), and FontBLF::color.
Referenced by ED_image_draw_info().
| void BLF_color3ubv | ( | int | fontid, |
| const unsigned char | rgb[3] ) |
Definition at line 476 of file blf.cc.
References BLF_color3ubv_alpha().
Referenced by ED_image_draw_info(), blender::ed::space_node::frame_node_draw_label(), gizmo_ruler_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), slider_draw(), and UI_panel_category_draw_all().
Definition at line 464 of file blf.cc.
References blf_get(), and FontBLF::color.
Referenced by BLF_color3ubv().
Definition at line 514 of file blf.cc.
References b, and BLF_color4fv().
Referenced by playanim_toscreen_ex(), ui_draw_but_WAVEFORM(), and vectorscope_draw_target().
| void BLF_color4fv | ( | int | fontid, |
| const float | rgba[4] ) |
Definition at line 505 of file blf.cc.
References blf_get(), FontBLF::color, and rgba_float_to_uchar().
Referenced by BLF_color3f(), BLF_color3fv_alpha(), BLF_color4f(), draw_view_axis(), blender::ed::transform::drawAutoKeyWarning(), ED_scene_draw_fps(), gizmo_axis_draw(), icon_draw_rect_input_text(), py_blf_color(), radial_control_paint_cursor(), screen_draw_area_drag_tip(), blender::ed::vse::sequencer_preview_draw_overlays(), text_info_row(), UI_fontstyle_draw_simple_backdrop(), and view3d_draw_region_info().
| void BLF_color4ub | ( | int | fontid, |
| unsigned char | r, | ||
| unsigned char | g, | ||
| unsigned char | b, | ||
| unsigned char | alpha ) |
Definition at line 481 of file blf.cc.
References b, blf_get(), and FontBLF::color.
| void BLF_color4ubv | ( | int | fontid, |
| const unsigned char | rgba[4] ) |
Definition at line 452 of file blf.cc.
References blf_get(), and FontBLF::color.
Referenced by draw_marker_texts(), drw_text_cache_draw_ex(), textview_draw_string(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_FontThemeColor(), UI_view2d_text_cache_draw(), vicon_rgb_text_draw(), and widget_draw_text().
| int BLF_default | ( | ) |
Get default font ID so we can pass it to other functions.
Definition at line 37 of file blf_default.cc.
References ASSERT_DEFAULT_SET, and global_font_default.
Referenced by blender::ed::vse::add_vertical_line(), BLF_reset_fonts(), BLF_str_offset_to_glyph_bounds(), blender::ed::vse::draw_handle_transform_text(), draw_selected_name(), blender::ed::vse::draw_vectorscope_graticule(), draw_view_axis(), blender::ed::transform::drawAutoKeyWarning(), drawviewborder(), drw_text_cache_draw_ex(), ED_info_draw_stats(), ED_region_image_overlay_info_text_draw(), ED_scene_draw_fps(), blender::ed::spreadsheet::ColumnValues::fit_column_values_width_px(), blender::ed::spreadsheet::ColumnValues::fit_column_width_px(), blender::ed::spreadsheet::get_index_column_width(), gizmo_axis_draw(), icon_draw_rect_input_text(), blender::ed::vse::label_rect_get(), blender::ed::vse::sequencer_preview_draw_overlays(), text_info_row(), ui_def_but_rna__menu(), ui_draw_but_WAVEFORM(), UI_view2d_text_cache_draw(), vectorscope_draw_target(), vicon_rgb_text_draw(), view3d_draw_region_info(), and WM_key_event_string().
| void BLF_default_set | ( | int | fontid | ) |
Definition at line 30 of file blf_default.cc.
References BLF_is_loaded_id(), and global_font_default.
Referenced by BKE_blender_userdef_data_free(), BLF_str_offset_to_glyph_bounds(), BLF_unload_all(), and uiStyleInit().
| void BLF_default_size | ( | float | size | ) |
Definition at line 25 of file blf_default.cc.
References global_font_size, and size().
Referenced by BLF_str_offset_to_glyph_bounds(), drw_text_cache_draw_ex(), uiStyleInit(), and view3d_draw_region_info().
| int BLF_default_weight | ( | int | fontid | ) |
Definition at line 355 of file blf.cc.
References blf_get(), FontBLF::metrics, and FontMetrics::weight.
Referenced by blender::tests::TEST(), and UI_update_text_styles().
| int BLF_descender | ( | int | fontid | ) |
Definition at line 872 of file blf.cc.
References blf_font_descender(), and blf_get().
Referenced by blender::seq::apply_text_alignment(), BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), cursor_bitmap_from_text(), metadata_draw_imbuf(), screen_draw_area_drag_tip(), blender::tests::TEST(), blender::seq::text_effect_calc_runtime(), textview_draw(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple_backdrop(), and ui_tooltip_region_draw_cb().
| void BLF_disable | ( | int | fontid, |
| FontFlags | flag ) |
Definition at line 329 of file blf.cc.
References blf_get(), flag, and FontBLF::flags.
Referenced by BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), blender::seq::build_character_info(), blender::seq::do_text_effect(), draw_vertical_scale_indicators(), drw_text_cache_draw_ex(), ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), 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(), blender::ed::vse::sequencer_preview_draw_overlays(), blender::seq::text_draw(), text_info_row(), blender::seq::transform_image_raw_size_get(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_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(), view3d_draw_region_info(), and widget_draw_text_icon().
| char * BLF_display_name_from_file | ( | const char * | filepath | ) |
Definition at line 1073 of file blf.cc.
References BLI_sprintfN(), and name.
Referenced by fileentry_uiname(), and blender::tests::TEST().
| char * BLF_display_name_from_id | ( | int | fontid | ) |
Definition at line 1093 of file blf.cc.
References blf_display_name(), and blf_get().
Referenced by BKE_vfontdata_from_freetypefont(), and blender::tests::TEST().
Draw the string using the current font.
Definition at line 585 of file blf.cc.
References blf_draw_gpu__end(), blf_draw_gpu__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_default(), clip_draw_dopesheet_channels(), draw_marker_texts(), 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_text(), knifetool_draw_angle(), knifetool_draw_visible_distances(), loggerwindow_do_draw(), metadata_custom_draw_fields(), metadata_draw_imbuf(), playanim_toscreen_ex(), py_blf_draw(), radial_control_paint_cursor(), region_draw_status_text(), screen_draw_area_drag_tip(), slider_draw(), text_info_row(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_fontstyle_draw_simple_backdrop(), UI_panel_category_draw_all(), vicon_rgb_text_draw(), blender::ed::object::voxel_size_edit_draw(), and widget_draw_text().
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 1045 of file blf.cc.
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 BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), checker_board_text(), cursor_bitmap_from_text(), IMB_font_preview(), py_blf_draw_buffer(), and blender::seq::text_draw().
Draw the string using the default font, size and DPI.
Definition at line 52 of file blf_default.cc.
References ASSERT_DEFAULT_SET, BLF_draw(), BLF_position(), BLF_size(), global_font_default, global_font_size, str, UI_SCALE_FAC, x, y, and z().
Referenced by BLF_str_offset_to_glyph_bounds(), draw_grid_unit_name(), draw_horizontal_scale_indicators(), draw_selected_name(), draw_vertical_scale_indicators(), draw_view_axis(), draw_viewport_name(), blender::ed::transform::drawAutoKeyWarning(), drawviewborder(), DRW_draw_region_engine_info(), drw_text_cache_draw_ex(), ED_scene_draw_fps(), stats_row(), ui_draw_but_WAVEFORM(), UI_view2d_text_cache_draw(), and vectorscope_draw_target().
| int BLF_draw_mono | ( | int | fontid, |
| const char * | str, | ||
| size_t | str_len, | ||
| int | cwidth, | ||
| int | tab_columns ) |
Definition at line 607 of file blf.cc.
References blf_draw_gpu__end(), blf_draw_gpu__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_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, | ||
| blender::FunctionRef< void(std::string &)> | edit_source_cb = nullptr ) |
Definition at line 625 of file blf.cc.
References blf_draw_gpu__end(), blf_draw_gpu__start(), blf_draw_svg_icon(), global_font, size(), UNUSED_VARS, x, and y.
Referenced by icon_draw_icon(), and icon_draw_size().
| void BLF_enable | ( | int | fontid, |
| FontFlags | flag ) |
Definition at line 320 of file blf.cc.
References blf_get(), flag, and FontBLF::flags.
Referenced by BKE_image_stamp_buf(), blf_load_datafiles_dir(), BLF_load_default(), BLF_load_mono_default(), BLF_str_offset_to_glyph_bounds(), blender::seq::build_character_info(), draw_vertical_scale_indicators(), drw_text_cache_draw_ex(), ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), 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_ex(), py_blf_enable(), blender::ed::vse::sequencer_preview_draw_overlays(), blender::seq::text_draw(), blender::seq::text_effect_font_init(), text_info_row(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_panel_category_draw_all(), ui_tooltip_create_with_data(), UI_view2d_text_cache_draw(), uiStyleInit(), and view3d_draw_region_info().
| void BLF_exit | ( | ) |
Definition at line 70 of file blf.cc.
References blf_font_exit(), blf_font_free(), BLF_MAX_FONT, global_font, and i.
Referenced by blender::tests::close_font(), multitestapp_free(), BlendfileLoadingBaseTest::TearDownTestCase(), 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 815 of file blf.cc.
References blf_font_fixed_width(), and blf_get().
Referenced by BLF_str_offset_to_glyph_bounds(), cursor_bitmap_from_text(), draw_text_main(), space_text_update_character_width(), blender::tests::TEST(), and textview_draw().
Get the metrics needed for the initial sizing of text objects.
Definition at line 1103 of file blf.cc.
References blf_ensure_face(), blf_get(), BLF_VFONT_METRICS_ASCEND_RATIO_DEFAULT, BLF_VFONT_METRICS_EM_RATIO_DEFAULT, BLF_VFONT_METRICS_SCALE_DEFAULT, FontBLF::face, and float.
Referenced by BKE_vfontdata_from_freetypefont(), and blender::tests::TEST().
| int BLF_glyph_advance | ( | int | fontid, |
| const char * | str ) |
Returns offset for drawing next character in the string.
Definition at line 826 of file blf.cc.
References blf_font_glyph_advance(), blf_get(), and str.
Referenced by BLF_str_offset_to_glyph_bounds(), blender::seq::build_character_info(), and blender::tests::TEST().
| bool BLF_has_glyph | ( | int | fontid, |
| unsigned int | unicode ) |
Check if font supports a particular glyph.
Definition at line 151 of file blf.cc.
References blf_get(), and blf_get_char_index().
Referenced by key_event_glyph_or_text(), and blender::tests::TEST().
| bool BLF_has_variable_weight | ( | int | fontid | ) |
Definition at line 364 of file blf.cc.
References blf_get(), BLF_VARIATION_AXIS_WEIGHT, i, and FontBLF::variations.
Referenced by blender::tests::TEST(), and UI_update_text_styles().
Definition at line 837 of file blf.cc.
References blf_font_height(), blf_get(), BLF_RESULT_CHECK_INIT, and str.
Referenced by BLF_str_offset_to_glyph_bounds(), clip_draw_dopesheet_channels(), draw_vertical_scale_indicators(), blender::ed::vse::label_rect_get(), loggerwindow_new(), blender::tests::TEST(), and UI_view2d_text_cache_draw().
| int BLF_height_max | ( | int | fontid | ) |
Return dimensions of the font without any sample text.
Definition at line 850 of file blf.cc.
References blf_font_height_max(), and blf_get().
Referenced by BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), cursor_bitmap_from_text(), draw_marker_texts(), blender::ed::space_node::frame_node_draw_label(), metadata_box_height_get(), metadata_draw_imbuf(), screen_draw_area_drag_tip(), blender::tests::TEST(), blender::seq::text_effect_calc_runtime(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_simple_backdrop(), UI_fontstyle_height_max(), and ui_tooltip_create_with_data().
| int BLF_init | ( | ) |
Definition at line 61 of file blf.cc.
References blf_font_init(), BLF_MAX_FONT, global_font, and i.
Referenced by main(), blender::tests::open_font(), BlendfileLoadingBaseTest::SetUpTestCase(), blender::tests::TEST(), WM_init(), and wm_main_playanim_intern().
| bool BLF_is_builtin | ( | int | fontid | ) |
Is this font part of the default fonts in the fallback stack?
Definition at line 338 of file blf.cc.
References BLF_DEFAULT, blf_get(), and FontBLF::flags.
Referenced by BLF_str_offset_to_glyph_bounds(), blender::seq::build_character_info(), and blender::seq::text_draw().
| int bool BLF_is_loaded | ( | const char * | filepath | ) |
Definition at line 160 of file blf.cc.
References blf_search_by_filepath().
Referenced by blf_load_datafiles_dir(), and blender::tests::TEST().
| bool BLF_is_loaded_id | ( | int | fontid | ) |
Definition at line 170 of file blf.cc.
References blf_get().
Referenced by BLF_default_set(), blender::seq::strip_load_font_file(), blender::seq::strip_load_font_mem(), blender::tests::TEST(), and blender::seq::text_effect_font_init().
| bool BLF_is_loaded_mem | ( | const char * | name | ) |
Definition at line 165 of file blf.cc.
References blf_search_by_mem_name(), and name.
| int BLF_load | ( | const char * | filepath | ) |
Loads a font, or returns an already loaded font and increments its reference count.
Note that while loading fonts is thread-safe, most of font usage via BLF state modification functions is not. If you need to use fonts from multiple threads, use unique font instances for threaded parts, see BLF_load_unique.
Definition at line 175 of file blf.cc.
References BLF_load_unique(), blf_search_by_filepath(), global_font, i, and FontBLF::reference_count.
Referenced by blf_load_datafiles_dir(), blf_load_font_default(), IMB_font_preview(), blender::tests::open_font(), py_blf_load(), blender::tests::TEST(), and uiStyleInit().
| int BLF_load_default | ( | bool | unique | ) |
Definition at line 42 of file blf_font_default.cc.
References BLF_DEFAULT, BLF_DEFAULT_PROPORTIONAL_FONT, BLF_enable(), and blf_load_font_default().
Referenced by BLF_load_font_stack(), BLF_str_offset_to_glyph_bounds(), loggerwindow_new(), and uiStyleInit().
| void BLF_load_font_stack | ( | ) |
Definition at line 93 of file blf_font_default.cc.
References blf_load_datafiles_dir(), BLF_load_default(), and BLF_load_mono_default().
Referenced by BLF_str_offset_to_glyph_bounds(), and uiStyleInit().
| int BLF_load_mem | ( | const char * | name, |
| const unsigned char * | mem, | ||
| int | mem_size ) |
References ATTR_WARN_UNUSED_RESULT, and name.
Referenced by BKE_vfontdata_char_from_freetypefont(), and BKE_vfontdata_from_freetypefont().
| int BLF_load_mem_unique | ( | const char * | name, |
| const unsigned char * | mem, | ||
| int | mem_size ) |
References ATTR_WARN_UNUSED_RESULT, and name.
Referenced by blender::seq::strip_load_font_mem().
| int BLF_load_mono_default | ( | bool | unique | ) |
Definition at line 49 of file blf_font_default.cc.
References BLF_DEFAULT, BLF_DEFAULT_MONOSPACED_FONT, BLF_enable(), blf_load_font_default(), and BLF_MONOSPACED.
Referenced by BLF_load_font_stack(), BLF_str_offset_to_glyph_bounds(), uiStyleInit(), and wm_main_playanim_intern().
| int BLF_load_unique | ( | const char * | filepath | ) |
Loads a font into a new font object.
Unlike BLF_load, it does not look whether a font with the same path or name is already loaded. Primary use case is when using BLF functions from a non-main thread.
Definition at line 188 of file blf.cc.
References blf_font_new_from_filepath(), blf_search_available(), BLI_exists(), g_blf_load_mutex, global_font, i, lock, printf, and FontBLF::reference_count.
Referenced by BLF_load(), blf_load_font_default(), blender::seq::strip_load_font_file(), and uiStyleInit().
| void BLF_metrics_attach | ( | int | fontid, |
| const unsigned char * | mem, | ||
| int | mem_size ) |
Attach a file with metrics information from memory.
Definition at line 216 of file blf.cc.
References blf_font_attach_from_mem(), and blf_get().
Definition at line 388 of file blf.cc.
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(), cursor_bitmap_from_text(), draw_marker_texts(), 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_text(), IMB_font_preview(), knifetool_draw_angle(), knifetool_draw_visible_distances(), loggerwindow_do_draw(), metadata_custom_draw_fields(), metadata_draw_imbuf(), playanim_toscreen_ex(), py_blf_position(), radial_control_paint_cursor(), region_draw_status_text(), screen_draw_area_drag_tip(), slider_draw(), blender::seq::text_draw(), text_font_draw(), text_font_draw_character(), text_font_draw_character_utf8(), text_info_row(), textview_draw_string(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_fontstyle_draw_simple_backdrop(), UI_panel_category_draw_all(), vicon_rgb_text_draw(), blender::ed::object::voxel_size_edit_draw(), and widget_draw_text().
| void BLF_reset_fonts | ( | ) |
Close any user-loaded fonts that are not used by the Interface. Call when loading new blend files so that the old fonts are not still taking resources.
Definition at line 83 of file blf.cc.
References BLF_DEFAULT, BLF_default(), blf_font_free(), BLF_MAX_FONT, blf_mono_font, blf_mono_font_render, ELEM, FontBLF::flags, global_font, and i.
Referenced by WM_file_read(), and wm_homefile_read_exec().
| void BLF_rotation | ( | int | fontid, |
| float | angle ) |
By default, rotation and clipping are disable and have to be enable/disable using BLF_enable/disable.
Definition at line 903 of file blf.cc.
References angle(), FontBLF::angle, and blf_get().
Referenced by BLF_str_offset_to_glyph_bounds(), 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 | ( | ) |
Set size and DPI, and return default font ID.
Definition at line 43 of file blf_default.cc.
References ASSERT_DEFAULT_SET, BLF_size(), global_font_default, global_font_size, and UI_SCALE_FAC.
Referenced by BLF_str_offset_to_glyph_bounds(), blender::ed::vse::draw_handle_transform_text(), draw_horizontal_scale_indicators(), draw_vertical_scale_indicators(), blender::ed::transform::drawAutoKeyWarning(), drw_text_cache_draw_ex(), ED_region_image_overlay_info_text_draw(), region_draw_status_text(), UI_view2d_text_cache_draw(), and view3d_draw_region_info().
| void BLF_shadow | ( | int | fontid, |
| FontShadowType | type, | ||
| const float | rgba[4] = nullptr ) |
Note that shadow needs to be enabled with BLF_enable.
Definition at line 934 of file blf.cc.
References blf_get(), rgba_float_to_uchar(), FontBLF::shadow, and FontBLF::shadow_color.
Referenced by BLF_str_offset_to_glyph_bounds(), draw_vertical_scale_indicators(), blender::ed::transform::drawAutoKeyWarning(), drw_text_cache_draw_ex(), py_blf_shadow(), blender::ed::vse::sequencer_preview_draw_overlays(), text_info_row(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_panel_category_draw_all(), and view3d_draw_region_info().
| 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 946 of file blf.cc.
References blf_get(), FontBLF::shadow_x, FontBLF::shadow_y, x, and y.
Referenced by BLF_str_offset_to_glyph_bounds(), draw_vertical_scale_indicators(), drw_text_cache_draw_ex(), py_blf_shadow_offset(), blender::ed::vse::sequencer_preview_draw_overlays(), text_info_row(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_panel_category_draw_all(), and view3d_draw_region_info().
| void BLF_size | ( | int | fontid, |
| float | size ) |
Definition at line 443 of file blf.cc.
References blf_font_size(), blf_get(), and size().
Referenced by BKE_image_stamp_buf(), BKE_vfontdata_char_from_freetypefont(), BLF_draw_default(), BLF_set_default(), checker_board_text(), clip_draw_dopesheet_channels(), cursor_bitmap_from_text(), draw_marker_texts(), ED_image_draw_info(), ED_region_cache_draw_curfra_label(), ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), blender::ed::spreadsheet::ColumnValues::fit_column_values_width_px(), blender::ed::spreadsheet::ColumnValues::fit_column_width_px(), fontstyle_set_ex(), blender::ed::space_node::frame_node_draw_label(), blender::ed::spreadsheet::get_index_column_width(), gizmo_axis_draw(), gizmo_ruler_draw(), icon_draw_rect_input_text(), IMB_font_preview(), knifetool_draw_angle(), knifetool_draw_visible_distances(), loggerwindow_new(), blender::nodes::node_fn_input_string_cc::node_gather_link_searches(), playanim_window_font_scale_from_dpi(), py_blf_size(), radial_control_paint_cursor(), screen_draw_area_drag_tip(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::seq::text_effect_font_init(), text_font_begin(), textview_font_begin(), ui_def_but_rna__menu(), UI_panel_category_draw_all(), UI_tooltip_color_field_add(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), vicon_rgb_text_draw(), and blender::ed::object::voxel_size_edit_draw().
| void BLF_state_print | ( | int | fontid | ) |
Definition at line 1161 of file blf.cc.
References BLF_ASPECT, blf_get(), BLF_ROTATION, printf, and UNPACK3.
| size_t BLF_str_offset_from_cursor_position | ( | int | fontid, |
| const char * | str, | ||
| size_t | str_len, | ||
| int | location_x ) |
Get the byte offset within a string, selected by mouse at a horizontal location.
Definition at line 680 of file blf.cc.
References blf_get(), blf_str_offset_from_cursor_position(), and str.
Referenced by ui_textedit_set_cursor_pos().
| bool int BLF_str_offset_to_cursor | ( | int | fontid, |
| const char * | str, | ||
| size_t | str_len, | ||
| size_t | str_offset, | ||
| int | cursor_width ) |
Return left edge of text cursor (caret), given a character offset and cursor width.
Definition at line 705 of file blf.cc.
References blf_get(), blf_str_offset_to_cursor(), and str.
Referenced by BLF_str_offset_to_glyph_bounds(), and widget_draw_text().
| bool BLF_str_offset_to_glyph_bounds | ( | int | fontid, |
| const char * | str, | ||
| size_t | str_offset, | ||
| rcti * | r_glyph_bounds ) |
Return bounds of the glyph rect at the string offset.
References angle(), ATTR_NONNULL, ATTR_WARN_UNUSED_RESULT, BLF_ascender(), BLF_boundbox(), BLF_bounds_max(), BLF_buffer(), BLF_buffer_col(), BLF_buffer_state_free(), BLF_buffer_state_pop(), BLF_buffer_state_push(), BLF_clipping(), BLF_default(), BLF_default_set(), BLF_default_size(), BLF_descender(), BLF_disable(), BLF_draw_buffer(), BLF_draw_default(), BLF_enable(), BLF_fixed_width(), BLF_glyph_advance(), BLF_height(), BLF_height_max(), BLF_is_builtin(), BLF_load_default(), BLF_load_font_stack(), BLF_load_mono_default(), BLF_rotation(), BLF_set_default(), BLF_shadow(), BLF_shadow_offset(), BLF_str_offset_to_cursor(), BLF_str_offset_to_glyph_bounds(), BLF_str_selection_boxes(), BLF_string_wrap(), BLF_thumb_preview(), BLF_width(), BLF_width_and_height(), BLF_width_max(), BLF_width_to_rstrlen(), BLF_width_to_strlen(), BLF_wordwrap(), flag, size(), str, w(), x, y, and z().
Referenced by BLF_str_offset_to_glyph_bounds(), and widget_draw_text().
| blender::Vector< blender::Bounds< int > > BLF_str_selection_boxes | ( | int | fontid, |
| const char * | str, | ||
| size_t | str_len, | ||
| size_t | sel_start, | ||
| size_t | sel_length ) |
Return bounds of selection boxes. There is just one normally but there could be more for multi-line and when containing text of differing directions.
Definition at line 718 of file blf.cc.
References blf_get(), blf_str_selection_boxes(), and str.
Referenced by BLF_str_offset_to_glyph_bounds(), and widget_draw_text().
| blender::Vector< blender::StringRef > BLF_string_wrap | ( | int | fontid, |
| blender::StringRef | str, | ||
| const int | max_pixel_width, | ||
| BLFWrapMode | mode = BLFWrapMode::Minimal ) |
Definition at line 1061 of file blf.cc.
References blf_font_string_wrap(), blf_get(), and str.
Referenced by BLF_str_offset_to_glyph_bounds(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), ui_alert_create(), and UI_text_clip_multiline_middle().
| blender::Array< uchar > BLF_svg_icon_bitmap | ( | uint | icon_id, |
| float | size, | ||
| int * | r_width, | ||
| int * | r_height, | ||
| bool | multicolor = false, | ||
| blender::FunctionRef< void(std::string &)> | edit_source_cb = nullptr ) |
Definition at line 646 of file blf.cc.
References blf_svg_icon_bitmap(), global_font, size(), and UNUSED_VARS.
Referenced by UI_svg_icon_bitmap().
| bool BLF_thumb_preview | ( | const char * | filepath, |
| unsigned char * | buf, | ||
| int | w, | ||
| int | h, | ||
| int | channels ) |
This function is used for generating thumbnail previews.
Definition at line 302 of file blf_thumbs.cc.
References blf_get_sample_text(), BLF_SAMPLE_LEN, float, ft_lib, ft_pix_to_int(), i, left, top, w(), x, and y.
Referenced by BLF_str_offset_to_glyph_bounds(), and IMB_thumb_load_font().
| int void BLF_unload | ( | const char * | filepath | ) |
Decreases font reference count, if it reaches zero the font is unloaded.
Definition at line 259 of file blf.cc.
References blf_font_free(), BLF_MAX_FONT, BLI_assert, BLI_path_cmp, FontBLF::filepath, g_blf_load_mutex, global_font, i, lock, and FontBLF::reference_count.
Referenced by py_blf_unload().
| void BLF_unload_all | ( | ) |
Definition at line 297 of file blf.cc.
References BLF_default_set(), blf_font_free(), BLF_MAX_FONT, blf_mono_font, blf_mono_font_render, global_font, and i.
Referenced by uiStyleInit().
| bool BLF_unload_id | ( | int | fontid | ) |
Decreases font reference count, if it reaches zero the font is unloaded. Returns true if font got unloaded.
Definition at line 280 of file blf.cc.
References blf_font_free(), blf_get(), BLI_assert, g_blf_load_mutex, global_font, lock, and FontBLF::reference_count.
Referenced by BKE_blender_userdef_data_free(), BKE_vfontdata_char_from_freetypefont(), BKE_vfontdata_from_freetypefont(), blender::tests::close_font(), blender::seq::fontmap_clear(), IMB_font_preview(), and blender::seq::strip_unload_font().
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 802 of file blf.cc.
References blf_font_width(), blf_get(), BLF_RESULT_CHECK_INIT, and str.
Referenced by blender::seq::apply_word_wrapping(), BLF_str_offset_to_glyph_bounds(), block_create_autorun_warning(), blender::ed::vse::draw_handle_transform_text(), draw_horizontal_scale_indicators(), ED_image_draw_info(), ED_info_draw_stats(), ED_region_image_overlay_info_text_draw(), ED_region_info_draw_multiline(), blender::ed::spreadsheet::estimate_max_column_width(), file_string_width(), blender::ed::spreadsheet::ColumnValues::fit_column_width_px(), blender::ed::space_node::frame_node_draw_label(), blender::ed::spreadsheet::get_index_column_width(), blender::ed::vse::label_rect_get(), metadata_draw_imbuf(), blender::nodes::node_fn_input_string_cc::node_gather_link_searches(), region_draw_status_text(), screen_draw_area_drag_tip(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), ui_alert_create(), ui_block_bounds_calc_text(), ui_def_but_rna__menu(), ui_draw_menu_item(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_multiline_clipped_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple_backdrop(), UI_fontstyle_string_width(), UI_fontstyle_string_width_with_block_aspect(), 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_color_field_add(), ui_tooltip_create_with_data(), uiTemplateReportsBanner(), uiTemplateStatusInfo(), blender::ed::outliner::unused_message_popup_width_compute(), widget_draw_text(), and wm_block_dialog_create().
| 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 789 of file blf.cc.
References blf_font_width_and_height(), blf_get(), and str.
Referenced by blender::ed::vse::add_vertical_line(), BLF_str_offset_to_glyph_bounds(), draw_backdrop(), blender::ed::vse::draw_vectorscope_graticule(), blender::ed::transform::drawAutoKeyWarning(), drw_text_cache_draw_ex(), ED_region_cache_draw_curfra_label(), gizmo_axis_draw(), gizmo_ruler_draw(), IMB_font_preview(), knifetool_draw_angle(), knifetool_draw_visible_distances(), py_blf_dimensions(), radial_control_paint_cursor(), slider_draw(), vicon_rgb_text_draw(), and blender::ed::object::voxel_size_edit_draw().
| int BLF_width_max | ( | int | fontid | ) |
Definition at line 861 of file blf.cc.
References blf_font_width_max(), and blf_get().
Referenced by BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), and blender::tests::TEST().
| 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 750 of file blf.cc.
References FontBLF::aspect, BLF_ASPECT, blf_font_width_to_rstrlen(), blf_get(), FontBLF::flags, float, ret, and str.
Referenced by BLF_str_offset_to_glyph_bounds(), UI_text_clip_middle_ex(), and UI_text_clip_multiline_middle().
| 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 728 of file blf.cc.
References FontBLF::aspect, BLF_ASPECT, blf_font_width_to_strlen(), blf_get(), FontBLF::flags, float, ret, and str.
Referenced by BLF_str_offset_to_glyph_bounds(), UI_text_clip_middle_ex(), ui_text_clip_right_ex(), and ui_text_clip_right_label().
| void BLF_wordwrap | ( | int | fontid, |
| int | wrap_width, | ||
| BLFWrapMode | mode = BLFWrapMode::Minimal ) |
Definition at line 924 of file blf.cc.
References blf_get(), FontBLF::wrap_mode, and FontBLF::wrap_width.
Referenced by BKE_image_stamp_buf(), BLF_str_offset_to_glyph_bounds(), 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.cc.
Referenced by BLF_reset_fonts(), BLF_unload_all(), ED_image_draw_info(), ED_region_image_metadata_draw(), gizmo_ruler_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), space_text_draw_context_init(), textview_draw(), UI_tooltip_color_field_add(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), uiStyleInit(), and wm_cursor_number_impl().
|
extern |
Definition at line 49 of file blf.cc.
Referenced by BKE_image_stamp_buf(), BLF_reset_fonts(), BLF_unload_all(), checker_board_text(), blender::seq::text_effect_font_init(), and uiStyleInit().