|
Blender V5.0
|
#include <cstdio>#include <cstdlib>#include <cstring>#include <cwctype>#include <optional>#include "CLG_log.h"#include "MEM_guardedalloc.h"#include "BLI_ghash.h"#include "BLI_listbase.h"#include "BLI_path_utils.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "DNA_curve_types.h"#include "DNA_object_types.h"#include "DNA_packedFile_types.h"#include "DNA_vfont_types.h"#include "BKE_bpath.hh"#include "BKE_curve.hh"#include "BKE_global.hh"#include "BKE_idtype.hh"#include "BKE_lib_id.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_packedFile.hh"#include "BKE_vfont.hh"#include "BKE_vfontdata.hh"#include "BLO_read_write.hh"Go to the source code of this file.
Functions | |
Prototypes | |
| static PackedFile * | packedfile_new_from_builtin () |
VFont | |
| void | BKE_vfont_data_ensure (VFont *vfont) |
| void | BKE_vfont_data_free (VFont *vfont) |
| bool | BKE_vfont_is_builtin (const VFont *vfont) |
| void | BKE_vfont_builtin_register (const void *mem, int size) |
| VFont * | BKE_vfont_load (Main *bmain, const char *filepath) |
| VFont * | BKE_vfont_load_exists_ex (Main *bmain, const char *filepath, bool *r_exists) |
| VFont * | BKE_vfont_load_exists (Main *bmain, const char *filepath) |
| VFont * | BKE_vfont_builtin_ensure () |
VFont Selection | |
| int | BKE_vfont_select_get (const Curve *cu, int *r_start, int *r_end) |
| void | BKE_vfont_select_clamp (Curve *cu) |
Variables | |
| static CLG_LogRef | LOG = {"geom.vfont"} |
VFont Data-block | |
| const void * | builtin_font_data = nullptr |
| int | builtin_font_size = 0 |
| IDTypeInfo | IDType_ID_VF |
| static void | vfont_init_data (ID *id) |
| static void | vfont_copy_data (Main *, std::optional< Library * >, ID *id_dst, const ID *, const int flag) |
| static void | vfont_free_data (ID *id) |
| static void | vfont_foreach_path (ID *id, BPathForeachPathData *bpath_data) |
| static void | vfont_blend_write (BlendWriter *writer, ID *id, const void *id_address) |
| static void | vfont_blend_read_data (BlendDataReader *reader, ID *id) |
VFont Clipboard | |
| struct { | |
| char32_t * text_buffer | |
| CharInfo * info_buffer | |
| size_t len_utf32 | |
| size_t len_utf8 | |
| } | g_vfont_clipboard = {nullptr} |
| void | BKE_vfont_clipboard_free () |
| void | BKE_vfont_clipboard_set (const char32_t *text_buf, const CharInfo *info_buf, const size_t len) |
| void | BKE_vfont_clipboard_get (char32_t **r_text_buf, CharInfo **r_info_buf, size_t *r_len_utf8, size_t *r_len_utf32) |
| VFont * BKE_vfont_builtin_ensure | ( | ) |
Return the built-in VFont, without adding a user (the user-count may be zero). The caller is responsible for adding a user.
Definition at line 386 of file vfont.cc.
References BKE_vfont_is_builtin(), BKE_vfont_load(), BLI_assert, FO_BUILTIN_NAME, G_MAIN, VFont::id, id_us_min(), LISTBASE_FOREACH, and ID::us.
Referenced by BKE_curve_init(), font_unlink_exec(), blender::nodes::node_geo_string_to_curves_cc::node_init(), and txt_add_object().
| void BKE_vfont_builtin_register | ( | const void * | mem, |
| int | size ) |
Definition at line 282 of file vfont.cc.
References builtin_font_data, builtin_font_size, and size().
Referenced by main(), and BlendfileLoadingBaseTest::SetUpTestCase().
| void BKE_vfont_clipboard_free | ( | ) |
Definition at line 471 of file vfont.cc.
References g_vfont_clipboard, and MEM_SAFE_FREE.
Referenced by BKE_vfont_clipboard_set(), paste_text_exec(), and WM_exit_ex().
| void BKE_vfont_clipboard_get | ( | char32_t ** | r_text_buf, |
| CharInfo ** | r_info_buf, | ||
| size_t * | r_len_utf8, | ||
| size_t * | r_len_utf32 ) |
Definition at line 509 of file vfont.cc.
References g_vfont_clipboard.
Referenced by copy_selection(), paste_selection(), and paste_text_exec().
| void BKE_vfont_clipboard_set | ( | const char32_t * | text_buf, |
| const CharInfo * | info_buf, | ||
| const size_t | len ) |
Definition at line 479 of file vfont.cc.
References BKE_vfont_clipboard_free(), BLI_str_utf32_as_utf8_len(), g_vfont_clipboard, len, MEM_freeN(), and MEM_malloc_arrayN().
Referenced by copy_selection().
| void BKE_vfont_data_ensure | ( | VFont * | vfont | ) |
Definition at line 202 of file vfont.cc.
References BKE_packedfile_duplicate(), BKE_packedfile_free(), BKE_packedfile_new(), BKE_vfont_is_builtin(), BKE_vfontdata_from_freetypefont(), CLOG_WARN, VFont::data, VFont::filepath, VFont::id, ID_BLEND_PATH_FROM_GLOBAL, LOG, VFont::packedfile, packedfile_new_from_builtin(), pf, and VFont::temp_pf.
Referenced by vfont_data_ensure_with_lock().
| void BKE_vfont_data_free | ( | VFont * | vfont | ) |
Definition at line 242 of file vfont.cc.
References Nurb::bezt, BKE_packedfile_free(), BLI_freelinkN(), BLI_ghash_free(), BLI_ghashIterator_getValue(), VFontData::characters, VFont::data, ListBase::first, GHASH_ITER, MEM_freeN(), VChar::nurbsbase, and VFont::temp_pf.
Referenced by vfont_free_data().
| bool BKE_vfont_is_builtin | ( | const VFont * | vfont | ) |
Definition at line 277 of file vfont.cc.
References VFont::filepath, FO_BUILTIN_NAME, and STREQ.
Referenced by BKE_packedfile_pack_all(), BKE_vfont_builtin_ensure(), BKE_vfont_data_ensure(), BKE_vfontdata_char_from_freetypefont(), open_invoke(), ui_tooltip_from_vfont(), and vfont_foreach_path().
Definition at line 303 of file vfont.cc.
References BKE_libblock_alloc(), BKE_main_blendfile_path(), BKE_packedfile_free(), BKE_packedfile_new(), BKE_vfontdata_from_freetypefont(), BLI_path_split_file_part(), VFont::data, FILE_MAXFILE, VFont::filepath, FO_BUILTIN_NAME, G, G_FILE_AUTOPACK, ID_VF, VFontData::name, VFont::packedfile, packedfile_new_from_builtin(), pf, STREQ, STRNCPY(), and VFont::temp_pf.
Referenced by BKE_vfont_builtin_ensure(), BKE_vfont_load_exists_ex(), and font_open_exec().
Definition at line 381 of file vfont.cc.
References BKE_vfont_load_exists_ex().
Definition at line 354 of file vfont.cc.
References BKE_main_blendfile_path(), BKE_vfont_load(), BLI_path_abs(), BLI_path_cmp, FILE_MAX, Main::fonts, ID_BLEND_PATH, id_us_plus(), LISTBASE_FOREACH, and STRNCPY().
Referenced by BKE_vfont_load_exists().
| void BKE_vfont_select_clamp | ( | Curve * | cu | ) |
Definition at line 447 of file vfont.cc.
References BLI_assert, CLAMP_MAX, Curve::editfont, EditFont::len, OB_FONT, Curve::ob_type, EditFont::pos, EditFont::selend, and EditFont::selstart.
Referenced by delete_exec(), and ED_curve_editfont_make().
| int BKE_vfont_select_get | ( | const Curve * | cu, |
| int * | r_start, | ||
| int * | r_end ) |
Definition at line 408 of file vfont.cc.
References BLI_assert, Curve::editfont, EditFont::len, OB_FONT, Curve::ob_type, EditFont::pos, EditFont::selend, and EditFont::selstart.
Referenced by change_spacing_exec(), copy_selection(), cut_text_exec(), delete_exec(), font_paste_wchar(), font_select_to_buffer(), kill_selection(), material_slot_assign_exec(), move_cursor_drop_select(), set_case(), set_style(), toggle_style_exec(), and vfont_to_curve().
|
static |
Definition at line 288 of file vfont.cc.
References BKE_packedfile_new_from_memory(), builtin_font_data, builtin_font_size, CLOG_ERROR, LOG, and MEM_mallocN().
Referenced by BKE_vfont_data_ensure(), BKE_vfont_load(), and vfont_init_data().
|
static |
Definition at line 157 of file vfont.cc.
References BKE_packedfile_blend_read(), VFont::data, VFont::filepath, VFont::packedfile, and VFont::temp_pf.
|
static |
Definition at line 135 of file vfont.cc.
References BKE_id_blend_write(), BKE_packedfile_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), VFont::data, VFont::id, ID_IS_OVERRIDE_LIBRARY, VFont::packedfile, and VFont::temp_pf.
|
static |
Definition at line 83 of file vfont.cc.
References BKE_packedfile_duplicate(), BKE_vfontdata_copy(), VFont::data, flag, LIB_ID_CREATE_NO_USER_REFCOUNT, VFont::packedfile, and VFont::temp_pf.
|
static |
Definition at line 118 of file vfont.cc.
References BKE_bpath_foreach_path_fixed_process(), BKE_BPATH_FOREACH_PATH_SKIP_PACKED, BKE_vfont_is_builtin(), VFont::filepath, BPathForeachPathData::flag, and VFont::packedfile.
|
static |
Free (or release) any data used by this font (does not free the font itself).
Definition at line 107 of file vfont.cc.
References BKE_packedfile_free(), BKE_vfont_data_free(), and VFont::packedfile.
|
static |
Definition at line 63 of file vfont.cc.
References BKE_packedfile_free(), BKE_vfontdata_from_freetypefont(), VFont::data, VFont::filepath, FO_BUILTIN_NAME, packedfile_new_from_builtin(), pf, and STRNCPY().
| const void* builtin_font_data = nullptr |
Definition at line 60 of file vfont.cc.
Referenced by BKE_vfont_builtin_register(), BKE_vfontdata_char_from_freetypefont(), and packedfile_new_from_builtin().
| int builtin_font_size = 0 |
Definition at line 61 of file vfont.cc.
Referenced by BKE_vfont_builtin_register(), BKE_vfontdata_char_from_freetypefont(), and packedfile_new_from_builtin().
| struct { ... } g_vfont_clipboard |
Referenced by BKE_vfont_clipboard_free(), BKE_vfont_clipboard_get(), and BKE_vfont_clipboard_set().
| IDTypeInfo IDType_ID_VF |
| size_t len_utf8 |
Definition at line 468 of file vfont.cc.
Referenced by copy_selection(), font_select_to_buffer(), and paste_text_exec().
|
static |