|
Blender V4.3
|
#include "BLI_array.hh"#include "BLI_bounds_types.hh"#include "BLI_function_ref.hh"#include "BLI_string_ref.hh"#include "BLI_vector.hh"Go to the source code of this file.
Macros | |
| #define | BLF_MAX_FONT 64 |
| #define | BLF_SUBPIXEL_POSITION |
| #define | BLF_SUBPIXEL_AA |
| #define | BLF_CACHE_MAX_FACES 4 |
| #define | BLF_CACHE_MAX_SIZES 8 |
| #define | BLF_CACHE_BYTES 400000 |
| #define | BLF_ICON_OFFSET 0x100000L |
| #define | BLF_DPI 72 |
Functions | |
| void | blf_batch_draw_begin (FontBLF *font) |
| void | blf_batch_draw () |
| char * | blf_dir_metrics_search (const char *filepath) |
| int | blf_font_init () |
| void | blf_font_exit () |
| bool | blf_font_id_is_valid (int fontid) |
| uint | blf_get_char_index (FontBLF *font, uint charcode) |
| bool | blf_ensure_face (FontBLF *font) |
| void | blf_ensure_size (FontBLF *font) |
| void | blf_draw_buffer__start (FontBLF *font) |
| void | blf_draw_buffer__end () |
| FontBLF * | blf_font_new_from_filepath (const char *filepath) |
| FontBLF * | blf_font_new_from_mem (const char *mem_name, const unsigned char *mem, size_t mem_size) |
| void | blf_font_attach_from_mem (FontBLF *font, const unsigned char *mem, size_t mem_size) |
| bool | blf_font_size (FontBLF *font, float size) |
| void | blf_font_draw (FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info) |
| void | blf_font_draw__wrap (FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info) |
| void | blf_draw_svg_icon (FontBLF *font, 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 (FontBLF *font, uint icon_id, float size, int *r_width, int *r_height, bool multicolor=false, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr) |
| blender::Vector< blender::StringRef > | blf_font_string_wrap (FontBLF *font, blender::StringRef str, int max_pixel_width) |
| int | blf_font_draw_mono (FontBLF *font, const char *str, size_t str_len, int cwidth, int tab_columns) |
| void | blf_font_draw_buffer (FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info) |
| void | blf_font_draw_buffer__wrap (FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info) |
| size_t | blf_font_width_to_strlen (FontBLF *font, const char *str, size_t str_len, int width, int *r_width) |
| size_t | blf_font_width_to_rstrlen (FontBLF *font, const char *str, size_t str_len, int width, int *r_width) |
| void | blf_font_boundbox (FontBLF *font, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info) |
| void | blf_font_boundbox__wrap (FontBLF *font, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info) |
| void | blf_font_width_and_height (FontBLF *font, const char *str, size_t str_len, float *r_width, float *r_height, ResultBLF *r_info) |
| float | blf_font_width (FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info) |
| float | blf_font_height (FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info) |
| float | blf_font_fixed_width (FontBLF *font) |
| int | blf_font_height_max (FontBLF *font) |
| int | blf_font_width_max (FontBLF *font) |
| int | blf_font_descender (FontBLF *font) |
| int | blf_font_ascender (FontBLF *font) |
| char * | blf_display_name (FontBLF *font) |
| void | blf_font_boundbox_foreach_glyph (FontBLF *font, const char *str, size_t str_len, bool(*user_fn)(const char *str, size_t str_step_ofs, const rcti *bounds, void *user_data), void *user_data) |
| size_t | blf_str_offset_from_cursor_position (FontBLF *font, const char *str, size_t str_len, int location_x) |
| void | blf_str_offset_to_glyph_bounds (FontBLF *font, const char *str, size_t str_offset, rcti *r_glyph_bounds) |
| blender::Vector< blender::Bounds< int > > | blf_str_selection_boxes (FontBLF *font, const char *str, size_t str_len, size_t sel_start, size_t sel_length) |
| int | blf_str_offset_to_cursor (FontBLF *font, const char *str, size_t str_len, size_t str_offset, int cursor_width) |
| void | blf_font_free (FontBLF *font) |
| GlyphCacheBLF * | blf_glyph_cache_acquire (FontBLF *font) |
| void | blf_glyph_cache_release (FontBLF *font) |
| void | blf_glyph_cache_clear (FontBLF *font) |
| GlyphBLF * | blf_glyph_ensure (FontBLF *font, GlyphCacheBLF *gc, uint charcode, uint8_t subpixel=0) |
| GlyphBLF * | blf_glyph_ensure_subpixel (FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, int32_t pen_x) |
| GlyphBLF * | blf_glyph_ensure_icon (GlyphCacheBLF *gc, uint icon_id, bool color=false, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr) |
| float | blf_character_to_curves (FontBLF *font, unsigned int unicode, ListBase *nurbsbase, const float scale) |
| void | blf_glyph_draw (FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, int x, int y) |
Variables | |
| FontBLF * | global_font [BLF_MAX_FONT] |
| #define BLF_CACHE_BYTES 400000 |
Maximum number of bytes to use for cached data nodes. 0 is default of 200,000.
Definition at line 45 of file blf_internal.hh.
Referenced by blf_font_init().
| #define BLF_CACHE_MAX_FACES 4 |
Maximum number of opened FT_Face objects managed by cache. 0 is default of 2.
Definition at line 41 of file blf_internal.hh.
Referenced by blf_font_init().
| #define BLF_CACHE_MAX_SIZES 8 |
Maximum number of opened FT_Size objects managed by cache. 0 is default of 4
Definition at line 43 of file blf_internal.hh.
Referenced by blf_font_init().
| #define BLF_DPI 72 |
We assume square pixels at a fixed DPI of 72, scaling only the size. Therefore font size = points = pixels, i.e. a size of 20 will result in a 20-pixel EM square. Although we could use the actual monitor DPI instead, we would then have to scale the size to cancel that out. Other libraries like Skia use this same fixed value.
Definition at line 59 of file blf_internal.hh.
Referenced by blf_ensure_size(), and blf_font_size().
| #define BLF_ICON_OFFSET 0x100000L |
Offset from icon id to Unicode Supplementary Private Use Area-B, added with Unicode 2.0. 65,536 code-points at U+100000..U+10FFFF.
Definition at line 51 of file blf_internal.hh.
Referenced by blf_glyph_cache_add_svg(), and blf_glyph_ensure_icon().
| #define BLF_MAX_FONT 64 |
Max number of FontBLFs in memory. Take care that every font has a glyph cache per size/dpi, so we don't need load the same font with different size, just load one and call BLF_size.
Definition at line 28 of file blf_internal.hh.
Referenced by BLF_cache_clear(), BLF_exit(), blf_get(), blf_glyph_index_from_charcode(), BLF_init(), BLF_reset_fonts(), blf_search_available(), blf_search_by_filepath(), blf_search_by_mem_name(), BLF_unload(), and BLF_unload_all().
| #define BLF_SUBPIXEL_AA |
If enabled, glyphs are rendered at multiple horizontal subpixel positions.
Definition at line 38 of file blf_internal.hh.
| #define BLF_SUBPIXEL_POSITION |
If enabled, glyphs positions are on 64ths of a pixel. Disabled, they are on whole pixels.
Definition at line 33 of file blf_internal.hh.
| void blf_batch_draw | ( | ) |
Definition at line 325 of file blf_font.cc.
References BatchBLF::batch, bitscan_reverse_i(), blf_batch_cache_texture_load(), blf_draw_cache_flush, BLI_assert_msg, BatchBLF::col_loc, BatchBLF::col_step, g_batch, BatchBLF::glyph_flags_loc, BatchBLF::glyph_flags_step, BatchBLF::glyph_len, BatchBLF::glyph_size_loc, BatchBLF::glyph_size_step, GPU_batch_draw(), GPU_batch_program_set_builtin(), GPU_batch_texture_bind, GPU_batch_uniform_1i, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_SHADER_TEXT, GPU_texture_unbind(), GPU_texture_width(), GPU_vertbuf_attr_get_raw_data(), GPU_vertbuf_data_len_set(), GPU_vertbuf_use(), is_power_of_2_i(), BatchBLF::offset_loc, BatchBLF::offset_step, BatchBLF::pos_loc, BatchBLF::pos_step, and BatchBLF::verts.
Referenced by blf_batch_draw_begin(), BLF_batch_draw_end(), blf_batch_draw_end(), BLF_batch_draw_flush(), blf_glyph_draw(), and blf_texture_draw().
| void blf_batch_draw_begin | ( | FontBLF * | font | ) |
Definition at line 225 of file blf_font.cc.
References BatchBLF::active, BatchBLF::batch, BLF_ASPECT, blf_batch_draw(), blf_batch_draw_init(), BLF_ROTATION, BatchBLF::enabled, equals_m4m4(), BatchBLF::font, g_batch, GPU_matrix_model_view_get, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_set, BatchBLF::mat, BatchBLF::ofs, BatchBLF::simple_shader, and zero_v2_int().
Referenced by blf_draw_svg_icon(), blf_font_draw_ex(), and blf_font_draw_mono().
| float blf_character_to_curves | ( | FontBLF * | font, |
| unsigned int | unicode, | ||
| ListBase * | nurbsbase, | ||
| const float | scale ) |
Convert a character's outlines into curves.
Definition at line 1883 of file blf_glyph.cc.
References blf_glyph_to_curves(), blf_glyphslot_ensure_outline(), and float.
Referenced by BLF_character_to_curves().
| char * blf_dir_metrics_search | ( | const char * | filepath | ) |
Some font have additional file with metrics information, in general, the extension of the file is: .afm or .pfm
Definition at line 30 of file blf_dir.cc.
References BLI_exists(), BLI_strdup(), BLI_strnlen(), and MEM_freeN().
Referenced by blf_ensure_face().
| char * blf_display_name | ( | FontBLF * | font | ) |
Definition at line 1475 of file blf_font.cc.
References blf_ensure_face(), and BLI_sprintfN().
Referenced by BLF_display_name_from_id().
| void blf_draw_buffer__end | ( | ) |
Definition at line 960 of file blf.cc.
Referenced by BLF_draw_buffer().
| void blf_draw_buffer__start | ( | FontBLF * | font | ) |
Definition at line 946 of file blf.cc.
References FontBufInfoBLF::col_char, FontBufInfoBLF::col_float, FontBufInfoBLF::col_init, copy_v4_v4(), FontBufInfoBLF::display, IMB_colormanagement_display_to_scene_linear_v3(), rgba_float_to_uchar(), and srgb_to_linearrgb_v4().
Referenced by BLF_draw_buffer().
| void blf_draw_svg_icon | ( | FontBLF * | font, |
| 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 528 of file blf_font.cc.
References blf_batch_draw_begin(), blf_batch_draw_end(), blf_font_size(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_draw(), blf_glyph_ensure_icon(), BLF_SHADOW, int, Outline, and rgba_float_to_uchar().
Referenced by BLF_draw_svg_icon().
| bool blf_ensure_face | ( | FontBLF * | font | ) |
Create an FT_Face for this font if not already existing.
Definition at line 1781 of file blf_font.cc.
References BLF_BAD_FONT, BLF_CACHED, blf_dir_metrics_search(), blf_setup_face(), BLI_mutex_lock(), BLI_mutex_unlock(), ELEM, ft_lib_mutex, ftc_manager, MEM_freeN(), and printf.
Referenced by blf_display_name(), blf_font_attach_from_mem(), blf_font_new_impl(), blf_font_size(), blf_get_char_index(), BLF_get_vfont_metrics(), blf_glyph_ensure(), and blf_glyphslot_ensure_outline().
| void blf_ensure_size | ( | FontBLF * | font | ) |
Definition at line 2046 of file blf_font.cc.
References BLF_CACHED, BLF_DPI, blf_size_finalizer(), BLI_assert_unreachable, ftc_manager, and round_fl_to_uint().
Referenced by blf_font_ascender(), blf_font_descender(), blf_font_height_max_ft_pix(), blf_font_width_max_ft_pix(), blf_glyph_cache_new(), blf_glyph_render(), and blf_unscaled_F26Dot6_to_pixels().
Definition at line 1469 of file blf_font.cc.
References blf_ensure_size(), and ft_pix_to_int().
Referenced by BLF_ascender().
| void blf_font_attach_from_mem | ( | FontBLF * | font, |
| const unsigned char * | mem, | ||
| size_t | mem_size ) |
Definition at line 1995 of file blf_font.cc.
References blf_ensure_face().
Referenced by BLF_metrics_attach().
| void blf_font_boundbox | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| rcti * | r_box, | ||
| ResultBLF * | r_info ) |
Definition at line 957 of file blf_font.cc.
References blf_font_boundbox_ex(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), and str.
Referenced by BLF_boundbox(), blf_font_height(), blf_font_width(), and blf_font_width_and_height().
| void blf_font_boundbox__wrap | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| rcti * | r_box, | ||
| ResultBLF * | r_info ) |
Definition at line 1373 of file blf_font.cc.
References blf_font_boundbox_wrap_cb(), blf_font_wrap_apply(), str, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by BLF_boundbox(), blf_font_height(), blf_font_width(), and blf_font_width_and_height().
| void blf_font_boundbox_foreach_glyph | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| bool(* | user_fn )(const char *str, size_t str_step_ofs, const rcti *bounds, void *user_data), | ||
| void * | user_data ) |
Definition at line 1463 of file blf_font.cc.
References blf_ensure_size(), and ft_pix_to_int().
Referenced by BLF_descender().
Definition at line 485 of file blf_font.cc.
References blf_font_draw_ex(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), and str.
Referenced by BLF_draw().
Definition at line 1353 of file blf_font.cc.
References blf_font_draw__wrap_cb(), blf_font_wrap_apply(), and str.
Referenced by BLF_draw().
Definition at line 766 of file blf_font.cc.
References blf_font_draw_buffer_ex(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), and str.
Referenced by BLF_draw_buffer().
| void blf_font_draw_buffer__wrap | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| ResultBLF * | r_info ) |
Definition at line 1395 of file blf_font.cc.
References blf_font_draw_buffer__wrap_cb(), blf_font_wrap_apply(), and str.
Referenced by BLF_draw_buffer().
| int blf_font_draw_mono | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| int | cwidth, | ||
| int | tab_columns ) |
Use fixed column width, but an utf8 character may occupy multiple columns.
Definition at line 492 of file blf_font.cc.
References blf_batch_draw_begin(), blf_batch_draw_end(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_draw(), blf_glyph_from_utf8_and_step(), BLI_wcwidth_safe(), GlyphBLF::c, col, ft_pix_from_int(), ft_pix_to_int_floor(), str, and UNLIKELY.
Referenced by BLF_draw_mono().
| void blf_font_exit | ( | ) |
Definition at line 1511 of file blf_font.cc.
References blf_batch_draw_exit(), BLI_mutex_end(), ft_lib, ft_lib_mutex, and ftc_manager.
Referenced by BLF_exit().
Definition at line 1036 of file blf_font.cc.
References blf_glyph_cache_acquire(), blf_glyph_cache_release(), and GlyphCacheBLF::fixed_width.
Referenced by BLF_fixed_width().
| void blf_font_free | ( | FontBLF * | font | ) |
Definition at line 2007 of file blf_font.cc.
References BLF_CACHED, blf_glyph_cache_clear(), BLI_mutex_lock(), BLI_mutex_unlock(), ft_lib_mutex, ftc_manager, and MEM_freeN().
Referenced by BLF_exit(), blf_font_new_impl(), BLF_reset_fonts(), BLF_unload(), BLF_unload_all(), and BLF_unload_id().
Definition at line 1015 of file blf_font.cc.
References BLF_ASPECT, blf_font_boundbox(), blf_font_boundbox__wrap(), BLF_WORD_WRAP, BLI_rcti_size_y(), float, and str.
Referenced by BLF_height().
Definition at line 1446 of file blf_font.cc.
References blf_font_height_max_ft_pix(), and ft_pix_to_int().
Referenced by BLF_height_max().
| bool blf_font_id_is_valid | ( | int | fontid | ) |
| int blf_font_init | ( | ) |
Definition at line 1489 of file blf_font.cc.
References BLF_CACHE_BYTES, blf_cache_face_requester(), BLF_CACHE_MAX_FACES, BLF_CACHE_MAX_SIZES, BLI_mutex_init(), ft_lib, ft_lib_mutex, ftc_charmap_cache, ftc_manager, and g_batch.
Referenced by BLF_init().
| FontBLF * blf_font_new_from_filepath | ( | const char * | filepath | ) |
Definition at line 1985 of file blf_font.cc.
References blf_font_new_impl().
Referenced by BLF_load_unique().
| FontBLF * blf_font_new_from_mem | ( | const char * | mem_name, |
| const unsigned char * | mem, | ||
| size_t | mem_size ) |
Definition at line 1990 of file blf_font.cc.
References blf_font_new_impl().
Referenced by BLF_load_mem_unique().
Change font's output size. Returns true if successful in changing the size.
Definition at line 2068 of file blf_font.cc.
References BLF_CACHED, BLF_DPI, blf_ensure_face(), blf_size_finalizer(), float, ftc_manager, round_fl_to_uint(), and size().
Referenced by blf_draw_svg_icon(), blf_glyph_render(), BLF_size(), and blf_svg_icon_bitmap().
| blender::Vector< blender::StringRef > blf_font_string_wrap | ( | FontBLF * | font, |
| blender::StringRef | str, | ||
| int | max_pixel_width ) |
Definition at line 1418 of file blf_font.cc.
References blf_font_string_wrap_cb(), blf_font_wrap_apply(), and str.
Referenced by BLF_string_wrap().
Definition at line 994 of file blf_font.cc.
References BLF_ASPECT, blf_font_boundbox(), blf_font_boundbox__wrap(), BLF_WORD_WRAP, BLI_rcti_size_x(), float, and str.
Referenced by blf_str_offset_to_cursor(), and BLF_width().
| void blf_font_width_and_height | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| float * | r_width, | ||
| float * | r_height, | ||
| ResultBLF * | r_info ) |
Definition at line 965 of file blf_font.cc.
References BLF_ASPECT, blf_font_boundbox(), blf_font_boundbox__wrap(), BLF_WORD_WRAP, BLI_rcti_size_x(), BLI_rcti_size_y(), float, and str.
Referenced by BLF_width_and_height().
Definition at line 1458 of file blf_font.cc.
References blf_font_width_max_ft_pix(), and ft_pix_to_int().
Referenced by BLF_width_max().
| size_t blf_font_width_to_rstrlen | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| int | width, | ||
| int * | r_width ) |
Definition at line 846 of file blf_font.cc.
References blf_font_width_to_strlen_glyph_process(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_from_utf8_and_step(), BLI_assert, BLI_str_find_prev_char_utf8(), BLI_strnlen(), ft_pix_to_int(), and str.
Referenced by BLF_width_to_rstrlen().
| size_t blf_font_width_to_strlen | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| int | width, | ||
| int * | r_width ) |
Definition at line 817 of file blf_font.cc.
References blf_font_width_to_strlen_glyph_process(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_from_utf8_and_step(), ft_pix_to_int(), int, and str.
Referenced by BLF_width_to_strlen().
Return glyph id from char-code.
Definition at line 149 of file blf_font.cc.
References BLF_CACHED, blf_ensure_face(), and ftc_charmap_cache.
Referenced by blf_glyph_cache_new(), blf_glyph_index_from_charcode(), and BLF_has_glyph().
| GlyphCacheBLF * blf_glyph_cache_acquire | ( | FontBLF * | font | ) |
Definition at line 135 of file blf_glyph.cc.
References blf_glyph_cache_find(), and blf_glyph_cache_new().
Referenced by blf_draw_svg_icon(), blf_font_boundbox(), blf_font_boundbox_foreach_glyph(), blf_font_draw(), blf_font_draw_buffer(), blf_font_draw_mono(), blf_font_fixed_width(), blf_font_width_to_rstrlen(), blf_font_width_to_strlen(), blf_font_wrap_apply(), and blf_svg_icon_bitmap().
| void blf_glyph_cache_clear | ( | FontBLF * | font | ) |
Definition at line 164 of file blf_glyph.cc.
References lock.
Referenced by BLF_cache_clear(), and blf_font_free().
| void blf_glyph_cache_release | ( | FontBLF * | font | ) |
Definition at line 148 of file blf_glyph.cc.
Referenced by blf_draw_svg_icon(), blf_font_boundbox(), blf_font_boundbox_foreach_glyph(), blf_font_draw(), blf_font_draw_buffer(), blf_font_draw_mono(), blf_font_fixed_width(), blf_font_width_to_rstrlen(), blf_font_width_to_strlen(), blf_font_wrap_apply(), and blf_svg_icon_bitmap().
| void blf_glyph_draw | ( | FontBLF * | font, |
| GlyphCacheBLF * | gc, | ||
| GlyphBLF * | g, | ||
| int | x, | ||
| int | y ) |
Definition at line 1507 of file blf_glyph.cc.
References GlyphBLF::bitmap, GlyphCacheBLF::bitmap_len, GlyphCacheBLF::bitmap_len_alloc, GlyphCacheBLF::bitmap_len_landed, GlyphCacheBLF::bitmap_result, BLF_ASPECT, blf_batch_draw(), BLF_CLIPPING, blf_glyph_calc_rect(), blf_glyph_calc_rect_shadow(), blf_glyph_calc_rect_test(), BLF_SHADOW, blf_texture_draw(), BLI_rcti_inside_rcti(), BLI_rcti_translate(), GlyphBLF::dims, g_batch, BatchBLF::glyph_cache, GlyphBLF::glyph_cache, GPU_max_texture_size(), GPU_R8, GPU_texture_create_2d(), GPU_texture_free(), GPU_TEXTURE_USAGE_SHADER_READ, MEM_reallocN, None, GlyphBLF::num_channels, GlyphBLF::offset, GlyphCacheBLF::texture, w(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by blf_draw_svg_icon(), blf_font_draw_ex(), and blf_font_draw_mono().
| GlyphBLF * blf_glyph_ensure | ( | FontBLF * | font, |
| GlyphCacheBLF * | gc, | ||
| uint | charcode, | ||
| uint8_t | subpixel = 0 ) |
Create (or load from cache) a fully-rendered bitmap glyph.
Definition at line 1372 of file blf_glyph.cc.
References blf_ensure_face(), blf_glyph_cache_add_glyph(), blf_glyph_cache_find_glyph(), blf_glyph_index_from_charcode(), blf_glyph_render(), and GlyphCacheBLF::fixed_width.
Referenced by blf_glyph_ensure_subpixel(), and blf_glyph_from_utf8_and_step().
| GlyphBLF * blf_glyph_ensure_icon | ( | GlyphCacheBLF * | gc, |
| uint | icon_id, | ||
| bool | color = false, | ||
| blender::FunctionRef< void(std::string &)> | edit_source_cb = nullptr ) |
Definition at line 1399 of file blf_glyph.cc.
References blf_glyph_cache_add_svg(), blf_glyph_cache_find_glyph(), and BLF_ICON_OFFSET.
Referenced by blf_draw_svg_icon(), and blf_svg_icon_bitmap().
| GlyphBLF * blf_glyph_ensure_subpixel | ( | FontBLF * | font, |
| GlyphCacheBLF * | gc, | ||
| GlyphBLF * | g, | ||
| int32_t | pen_x ) |
Definition at line 1413 of file blf_glyph.cc.
References GlyphBLF::advance_x, blf_glyph_ensure(), BLF_RENDER_SUBPIXELAA, GlyphBLF::c, GlyphBLF::dims, and GlyphBLF::subpixel.
Referenced by blf_font_width_to_strlen_glyph_process(), and blf_glyph_from_utf8_and_step().
| size_t blf_str_offset_from_cursor_position | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| int | location_x ) |
Definition at line 1105 of file blf_font.cc.
References blf_cursor_position_foreach_glyph(), blf_font_boundbox_foreach_glyph(), BLI_str_cursor_step_prev_utf8(), BLI_str_utf8_char_width_or_error(), BLI_strnlen(), int, CursorPositionForeachGlyph_Data::location_x, and str.
Referenced by BLF_str_offset_from_cursor_position().
| int blf_str_offset_to_cursor | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| size_t | str_offset, | ||
| int | cursor_width ) |
Definition at line 1168 of file blf_font.cc.
References blf_font_width(), blf_str_offset_to_glyph_bounds(), int, next, and str.
Referenced by BLF_str_offset_to_cursor(), and blf_str_selection_boxes().
| void blf_str_offset_to_glyph_bounds | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_offset, | ||
| rcti * | r_glyph_bounds ) |
Definition at line 1155 of file blf_font.cc.
References blf_font_boundbox_foreach_glyph(), blf_str_offset_foreach_glyph(), str, and StrOffsetToGlyphBounds_Data::str_offset.
Referenced by blf_str_offset_to_cursor(), and BLF_str_offset_to_glyph_bounds().
| blender::Vector< blender::Bounds< int > > blf_str_selection_boxes | ( | FontBLF * | font, |
| const char * | str, | ||
| size_t | str_len, | ||
| size_t | sel_start, | ||
| size_t | sel_length ) |
Definition at line 1213 of file blf_font.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blf_str_offset_to_cursor(), and str.
Referenced by BLF_str_selection_boxes().
| blender::Array< uchar > blf_svg_icon_bitmap | ( | FontBLF * | font, |
| 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 574 of file blf_font.cc.
References GlyphBLF::bitmap, blf_font_size(), blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_ensure_icon(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), GlyphBLF::dims, GlyphBLF::num_channels, GlyphBLF::pitch, and blender::Array< T, InlineBufferCapacity, Allocator >::size().
Referenced by BLF_svg_icon_bitmap().
|
extern |
Font array.
Definition at line 47 of file blf.cc.
Referenced by BLF_cache_clear(), BLF_draw_svg_icon(), BLF_exit(), blf_get(), blf_glyph_index_from_charcode(), BLF_init(), BLF_load(), BLF_load_mem_unique(), BLF_load_unique(), BLF_reset_fonts(), blf_search_available(), blf_search_by_filepath(), blf_search_by_mem_name(), BLF_svg_icon_bitmap(), BLF_unload(), BLF_unload_all(), and BLF_unload_id().