34#define BLF_MAX_FONT 64
39#define BLF_SUBPIXEL_POSITION
44#define BLF_SUBPIXEL_AA
47#define BLF_CACHE_MAX_FACES 8
49#define BLF_CACHE_MAX_SIZES 16
51#define BLF_CACHE_BYTES 0x100000
57#define BLF_ICON_OFFSET 0x100000L
105void blf_font_draw(FontBLF *font,
const char *
str,
size_t str_len, ResultBLF *r_info);
114 const float color[4] =
nullptr,
115 float outline_alpha = 1.0f,
116 bool multicolor =
false,
117 FunctionRef<
void(std::string &)> edit_source_cb =
nullptr);
124 bool multicolor =
false,
125 FunctionRef<
void(std::string &)> edit_source_cb =
nullptr);
136 FontBLF *font,
const char *
str,
size_t str_len,
int char_width,
int tab_columns);
140 FontBLF *font,
const char *
str,
size_t str_len,
int width,
int *r_width);
142 FontBLF *font,
const char *
str,
size_t str_len,
int width,
int *r_width);
144 FontBLF *font,
const char *
str,
size_t str_len, rcti *r_box, ResultBLF *r_info);
146 FontBLF *font,
const char *
str,
size_t str_len, rcti *r_box, ResultBLF *r_info);
153float blf_font_width(FontBLF *font,
const char *
str,
size_t str_len, ResultBLF *r_info);
154float blf_font_height(FontBLF *font,
const char *
str,
size_t str_len, ResultBLF *r_info);
169 bool (*user_fn)(
const char *
str,
size_t str_step_ofs,
const rcti *
bounds,
void *user_data),
176 FunctionRef<
void(
int index,
size_t byte_offset,
int byte_len,
int advance_x)> callback);
186 rcti *r_glyph_bounds);
189 FontBLF *font,
const char *
str,
size_t str_len,
size_t sel_start,
size_t sel_length);
192 FontBLF *font,
const char *
str,
size_t str_len,
size_t str_offset,
int cursor_width);
205#ifdef BLF_SUBPIXEL_AA
212 FunctionRef<
void(std::string &)> edit_source_cb =
nullptr);
233 unsigned int unicode,
234 ListBaseT<Nurb> *nurbsbase,
246extern FT_Error FT_New_Face__win32_compat(FT_Library library,
247 const char *pathname,
These structs are the foundation for all linked lists in the library system.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
float3x3 scale(float3x3 mat, float2 scale)
int blf_font_height_max(FontBLF *font)
bool blf_character_to_curves(FontBLF *font, uint unicode, ListBaseT< Nurb > *nurbsbase, const float scale, bool use_fallback, float *r_advance, rctf *r_bounds)
void blf_font_width_and_height(FontBLF *font, const char *str, const size_t str_len, float *r_width, float *r_height, ResultBLF *r_info)
bool blf_ensure_face(FontBLF *font)
FT_GlyphSlot blf_glyph_render_outline(FontBLF *settings_font, FontBLF *glyph_font, FT_UInt glyph_index, uint charcode, int fixed_width)
void blf_glyph_cache_release(FontBLF *font)
void blf_font_draw_buffer__wrap(FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
char * blf_dir_metrics_search(const char *filepath)
uint blf_get_char_index(FontBLF *font, const uint charcode)
int blf_font_draw_mono(FontBLF *font, const char *str, const size_t str_len, const int char_width, const int tab_columns)
float blf_font_fixed_width(FontBLF *font)
void blf_ensure_size(FontBLF *font)
Vector< Bounds< int > > blf_str_selection_boxes(FontBLF *font, const char *str, size_t str_len, size_t sel_start, size_t sel_length)
void blf_font_free(FontBLF *font)
void blf_glyph_draw(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, const int x, const int y)
void blf_font_boundbox(FontBLF *font, const char *str, const size_t str_len, rcti *r_box, ResultBLF *r_info)
void blf_font_boundbox__wrap(FontBLF *font, const char *str, const size_t str_len, rcti *r_box, ResultBLF *r_info)
float blf_font_height(FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
void blf_font_info_foreach_glyph(FontBLF *font, const char *str, size_t str_len, FunctionRef< void(int index, size_t byte_offset, int byte_len, int advance_x)> callback)
void blf_str_offset_to_glyph_bounds(FontBLF *font, const char *str, size_t str_offset, rcti *r_glyph_bounds)
Vector< StringRef > blf_font_string_wrap(FontBLF *font, StringRef str, int max_pixel_width, BLFWrapMode mode)
size_t blf_font_width_to_strlen(FontBLF *font, const char *str, const size_t str_len, int width, int *r_width)
void blf_draw_buffer__end()
void blf_font_draw_buffer(FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
FontBLF * blf_font_new_from_mem(const char *mem_name, const uchar *mem, const size_t mem_size)
GlyphCacheBLF * blf_glyph_cache_acquire(FontBLF *font)
int blf_font_descender(FontBLF *font)
bool blf_font_bounds_max(FontBLF *font, rctf *r_bounds)
int blf_font_glyph_advance(FontBLF *font, const char *str)
int blf_str_offset_to_cursor(FontBLF *font, const char *str, const size_t str_len, const size_t str_offset, const int cursor_width)
FT_UInt blf_glyph_index_from_charcode(FontBLF **font, const uint charcode)
FontBLF * blf_font_new_from_filepath(const char *filepath)
void blf_font_draw__wrap(FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
GlyphBLF * blf_glyph_ensure(FontBLF *font, GlyphCacheBLF *gc, const uint charcode, uint8_t subpixel)
GlyphBLF * blf_glyph_ensure_icon(GlyphCacheBLF *gc, const uint icon_id, bool color, FunctionRef< void(std::string &)> edit_source_cb)
void blf_font_draw(FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
void blf_font_boundbox_foreach_glyph(FontBLF *font, const char *str, const size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data)
size_t blf_str_offset_from_cursor_position(FontBLF *font, const char *str, size_t str_len, int location_x)
FontBLF * global_font[BLF_MAX_FONT]
int blf_font_width_max(FontBLF *font)
void blf_draw_svg_icon(FontBLF *font, const uint icon_id, const float size, const float color[4], const float outline_alpha, const bool multicolor, FunctionRef< void(std::string &)> edit_source_cb)
Array< uchar > blf_svg_icon_bitmap(FontBLF *font, const uint icon_id, const float size, int *r_width, int *r_height, const bool multicolor, FunctionRef< void(std::string &)> edit_source_cb)
size_t blf_font_width_to_rstrlen(FontBLF *font, const char *str, const size_t str_len, int width, int *r_width)
void blf_batch_draw_begin(FontBLF *font)
bool blf_font_size(FontBLF *font, float size)
void blf_glyph_cache_clear(FontBLF *font)
float blf_font_width(FontBLF *font, const char *str, const size_t str_len, ResultBLF *r_info)
void blf_draw_buffer__start(FontBLF *font)
void blf_font_attach_from_mem(FontBLF *font, const uchar *mem, const size_t mem_size)
GlyphBLF * blf_glyph_ensure_subpixel(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, int32_t pen_x)
int blf_font_ascender(FontBLF *font)
char * blf_display_name(FontBLF *font)