|
Blender V5.0
|
#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 8 |
| #define | BLF_CACHE_MAX_SIZES 16 |
| #define | BLF_CACHE_BYTES 0x100000 |
| #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 () |
| 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, BLFWrapMode mode) |
| 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_glyph_advance (FontBLF *font, const char *str) |
| 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) |
| bool | blf_font_bounds_max (FontBLF *font, rctf *r_bounds) |
| 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) |
| bool | blf_character_to_curves (FontBLF *font, unsigned int unicode, ListBase *nurbsbase, const float scale, bool use_fallback, float *r_advance) |
| 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 0x100000 |
Maximum number of bytes to use for cached data nodes. 0 is default of 200,000.
Definition at line 47 of file blf_internal.hh.
Referenced by blf_font_init().
| #define BLF_CACHE_MAX_FACES 8 |
Maximum number of opened FT_Face objects managed by cache. 0 is default of 2.
Definition at line 43 of file blf_internal.hh.
Referenced by blf_font_init().
| #define BLF_CACHE_MAX_SIZES 16 |
Maximum number of opened FT_Size objects managed by cache. 0 is default of 4
Definition at line 45 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 61 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 53 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 30 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 40 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 35 of file blf_internal.hh.
| void blf_batch_draw | ( | ) |
Definition at line 305 of file blf_font.cc.
References bitscan_reverse_i(), blf_batch_cache_texture_load(), blf_draw_cache_flush, BLI_assert_msg, g_batch, GPU_batch_draw_advanced(), 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_storagebuf_bind(), GPU_storagebuf_update(), GPU_storagebuf_usage_size_set(), GPU_texture_unbind(), GPU_texture_width(), is_power_of_2_i(), and texture().
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 205 of file blf_font.cc.
References BLF_ASPECT, blf_batch_draw(), blf_batch_draw_init(), BLF_ROTATION, equals_m4m4(), FontBLF::flags, g_batch, GPU_matrix_model_view_get, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_set, FontBLF::pos, and zero_v2_int().
Referenced by blf_draw_svg_icon(), blf_font_draw_ex(), and blf_font_draw_mono().
| bool blf_character_to_curves | ( | FontBLF * | font, |
| unsigned int | unicode, | ||
| ListBase * | nurbsbase, | ||
| const float | scale, | ||
| bool | use_fallback, | ||
| float * | r_advance ) |
Convert a character's outlines into curves.
Definition at line 1887 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 26 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 1587 of file blf_font.cc.
References blf_ensure_face(), BLI_sprintfN(), and FontBLF::face.
Referenced by BLF_display_name_from_id().
| void blf_draw_buffer__end | ( | ) |
Definition at line 1043 of file blf.cc.
Referenced by BLF_draw_buffer().
| void blf_draw_buffer__start | ( | FontBLF * | font | ) |
Definition at line 1024 of file blf.cc.
References FontBLF::buf_info, FontBufInfoBLF::col_char, FontBufInfoBLF::col_float, FontBufInfoBLF::col_init, FontBufInfoBLF::colorspace, copy_v4_v4(), IMB_colormanagement_scene_linear_to_colorspace_v3(), IMB_colormanagement_srgb_to_scene_linear_v3(), and rgba_float_to_uchar().
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 ) |
| outline_alpha | Alpha value between 0 and 1. |
Definition at line 530 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, BLI_assert, FontBLF::color, FontBLF::flags, Outline, FontBLF::pos, rgba_float_to_uchar(), FontBLF::shadow, FontBLF::shadow_color, FontBLF::shadow_x, FontBLF::shadow_y, size(), x, and y.
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 1890 of file blf_font.cc.
References BLF_BAD_FONT, BLF_CACHED, blf_dir_metrics_search(), blf_setup_face(), ELEM, FontBLF::face, FontBLF::filepath, FontBLF::flags, FontBLF::ft_lib, ft_lib_mutex, FontBLF::ft_size, ftc_manager, lock, FontBLF::mem, MEM_freeN(), FontBLF::mem_size, and printf.
Referenced by blf_display_name(), blf_font_attach_from_mem(), blf_font_bounds_max(), 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 2152 of file blf_font.cc.
References BLF_CACHED, BLF_DPI, blf_size_finalizer(), BLI_assert_unreachable, FontBLF::flags, FontBLF::ft_size, ftc_manager, round_fl_to_uint(), and FontBLF::size.
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().
| int blf_font_ascender | ( | FontBLF * | font | ) |
Definition at line 1568 of file blf_font.cc.
References blf_ensure_size(), ft_pix_to_int(), and FontBLF::ft_size.
Referenced by BLF_ascender().
Definition at line 2102 of file blf_font.cc.
References blf_ensure_face(), and FontBLF::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 961 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 1458 of file blf_font.cc.
References blf_font_boundbox_wrap_cb(), blf_font_wrap_apply(), str, FontBLF::wrap_mode, FontBLF::wrap_width, 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().
Definition at line 1574 of file blf_font.cc.
References blf_ensure_face(), FontBLF::face, float, FontBLF::size, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BLF_bounds_max().
| int blf_font_descender | ( | FontBLF * | font | ) |
Definition at line 1562 of file blf_font.cc.
References blf_ensure_size(), ft_pix_to_int(), and FontBLF::ft_size.
Referenced by BLF_descender().
Definition at line 487 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 1432 of file blf_font.cc.
References blf_font_draw__wrap_cb(), blf_font_wrap_apply(), str, FontBLF::wrap_mode, and FontBLF::wrap_width.
Referenced by BLF_draw().
Definition at line 769 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 1486 of file blf_font.cc.
References blf_font_draw_buffer__wrap_cb(), blf_font_wrap_apply(), str, FontBLF::wrap_mode, and FontBLF::wrap_width.
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 494 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(), i, str, and UNLIKELY.
Referenced by BLF_draw_mono().
| void blf_font_exit | ( | ) |
Definition at line 1622 of file blf_font.cc.
References blf_batch_draw_exit(), ft_lib, and ftc_manager.
Referenced by BLF_exit().
Definition at line 1040 of file blf_font.cc.
References blf_glyph_cache_acquire(), blf_glyph_cache_release(), GlyphCacheBLF::fixed_width, and FontBLF::size.
Referenced by BLF_fixed_width().
| void blf_font_free | ( | FontBLF * | font | ) |
Definition at line 2114 of file blf_font.cc.
References BLF_CACHED, blf_glyph_cache_clear(), FontBLF::face, FontBLF::filepath, FontBLF::flags, FontBLF::ft_lib, ft_lib_mutex, ftc_manager, FontBLF::kerning_cache, lock, MEM_freeN(), FontBLF::mem_name, and FontBLF::variations.
Referenced by BLF_exit(), blf_font_new_impl(), BLF_reset_fonts(), BLF_unload(), BLF_unload_all(), and BLF_unload_id().
| int blf_font_glyph_advance | ( | FontBLF * | font, |
| const char * | str ) |
Definition at line 1048 of file blf_font.cc.
References GlyphBLF::advance_x, blf_glyph_cache_acquire(), blf_glyph_cache_release(), blf_glyph_ensure(), BLI_str_utf8_as_unicode_safe(), ft_pix_to_int(), str, and UNLIKELY.
Referenced by BLF_glyph_advance().
Definition at line 1019 of file blf_font.cc.
References FontBLF::aspect, BLF_ASPECT, blf_font_boundbox(), blf_font_boundbox__wrap(), BLF_WORD_WRAP, BLI_rcti_size_y(), FontBLF::flags, float, and str.
Referenced by BLF_height().
| int blf_font_height_max | ( | FontBLF * | font | ) |
Definition at line 1545 of file blf_font.cc.
References blf_font_height_max_ft_pix(), and ft_pix_to_int().
Referenced by BLF_height_max().
| int blf_font_init | ( | ) |
Definition at line 1601 of file blf_font.cc.
References BLF_CACHE_BYTES, blf_cache_face_requester(), BLF_CACHE_MAX_FACES, BLF_CACHE_MAX_SIZES, ft_lib, ftc_charmap_cache, ftc_manager, and g_batch.
Referenced by BLF_init().
| FontBLF * blf_font_new_from_filepath | ( | const char * | filepath | ) |
Definition at line 2092 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 2097 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 2174 of file blf_font.cc.
References BLF_CACHED, BLF_DPI, blf_ensure_face(), blf_size_finalizer(), FontBLF::face, FontBLF::flags, float, FontBLF::ft_size, ftc_manager, round_fl_to_uint(), FontBLF::size, 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, | ||
| BLFWrapMode | mode ) |
Definition at line 1515 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 998 of file blf_font.cc.
References FontBLF::aspect, BLF_ASPECT, blf_font_boundbox(), blf_font_boundbox__wrap(), BLF_WORD_WRAP, BLI_rcti_size_x(), FontBLF::flags, 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 969 of file blf_font.cc.
References FontBLF::aspect, BLF_ASPECT, blf_font_boundbox(), blf_font_boundbox__wrap(), BLF_WORD_WRAP, BLI_rcti_size_x(), BLI_rcti_size_y(), FontBLF::flags, float, and str.
Referenced by BLF_width_and_height().
| int blf_font_width_max | ( | FontBLF * | font | ) |
Definition at line 1557 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 849 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(), blf_str_is_utf8_valid_lazy_init(), BLI_assert, BLI_str_find_prev_char_utf8(), BLI_strnlen(), ft_pix_to_int(), i, 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 820 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(), i, and str.
Referenced by BLF_width_to_strlen().
Return glyph id from char-code.
Definition at line 148 of file blf_font.cc.
References BLF_CACHED, blf_ensure_face(), FontBLF::face, FontBLF::flags, and ftc_charmap_cache.
Referenced by blf_glyph_cache_new(), blf_glyph_index_from_charcode(), blf_glyphslot_ensure_outline(), and BLF_has_glyph().
| GlyphCacheBLF * blf_glyph_cache_acquire | ( | FontBLF * | font | ) |
Definition at line 133 of file blf_glyph.cc.
References blf_glyph_cache_find(), blf_glyph_cache_new(), and FontBLF::glyph_cache_mutex.
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_glyph_advance(), 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 162 of file blf_glyph.cc.
References FontBLF::cache, Vector< T, InlineBufferCapacity, Allocator >::clear_and_shrink(), FontBLF::glyph_cache_mutex, and lock.
Referenced by BLF_cache_clear(), and blf_font_free().
| void blf_glyph_cache_release | ( | FontBLF * | font | ) |
Definition at line 146 of file blf_glyph.cc.
References FontBLF::glyph_cache_mutex.
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_glyph_advance(), 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 1493 of file blf_glyph.cc.
References FontBLF::aspect, 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(), FontBLF::clip_rec, FontBLF::color, GlyphBLF::dims, FontBLF::flags, g_batch, GlyphBLF::glyph_cache, GPU_max_texture_size(), GPU_texture_create_2d(), GPU_texture_free(), GPU_TEXTURE_USAGE_SHADER_READ, MEM_reallocN, None, GlyphBLF::num_channels, GlyphBLF::offset, FontBLF::pos, FontBLF::shadow, FontBLF::shadow_color, FontBLF::tex_size_max, GlyphCacheBLF::texture, w(), x, rcti::xmax, rcti::xmin, y, 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 1345 of file blf_glyph.cc.
References blf_ensure_face(), blf_glyph_cache_add_glyph(), blf_glyph_cache_find_glyph(), blf_glyph_ensure_icon(), blf_glyph_index_from_charcode(), blf_glyph_render(), ELEM, and GlyphCacheBLF::fixed_width.
Referenced by blf_font_glyph_advance(), 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 1387 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(), blf_glyph_ensure(), and blf_svg_icon_bitmap().
| GlyphBLF * blf_glyph_ensure_subpixel | ( | FontBLF * | font, |
| GlyphCacheBLF * | gc, | ||
| GlyphBLF * | g, | ||
| int32_t | pen_x ) |
Definition at line 1401 of file blf_glyph.cc.
References GlyphBLF::advance_x, blf_glyph_ensure(), BLF_RENDER_SUBPIXELAA, GlyphBLF::c, GlyphBLF::dims, FontBLF::flags, FontBLF::size, 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 1126 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(), data, 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 1189 of file blf_font.cc.
References blf_font_width(), blf_str_offset_to_glyph_bounds(), 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 1176 of file blf_font.cc.
References blf_font_boundbox_foreach_glyph(), blf_str_offset_foreach_glyph(), data, and str.
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 1234 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 577 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, blender::Array< T, InlineBufferCapacity, Allocator >::size(), size(), x, and y.
Referenced by BLF_svg_icon_bitmap().
|
extern |
Font array.
Definition at line 44 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().