Blender V2.61 - r43446
|
Go to the source code of this file.
Functions | |
unsigned int | blf_next_p2 (unsigned int x) |
unsigned int | blf_hash (unsigned int val) |
char * | blf_dir_search (const char *file) |
char * | blf_dir_metrics_search (const char *filename) |
int | blf_font_init (void) |
void | blf_font_exit (void) |
struct FontBLF * | blf_font_new (const char *name, const char *filename) |
struct FontBLF * | blf_font_new_from_mem (const char *name, unsigned char *mem, int mem_size) |
void | blf_font_attach_from_mem (struct FontBLF *font, const unsigned char *mem, int mem_size) |
void | blf_font_size (struct FontBLF *font, int size, int dpi) |
void | blf_font_draw (struct FontBLF *font, const char *str, unsigned int len) |
void | blf_font_draw_ascii (struct FontBLF *font, const char *str, unsigned int len) |
void | blf_font_buffer (struct FontBLF *font, const char *str) |
void | blf_font_boundbox (struct FontBLF *font, const char *str, struct rctf *box) |
void | blf_font_width_and_height (struct FontBLF *font, const char *str, float *width, float *height) |
float | blf_font_width (struct FontBLF *font, const char *str) |
float | blf_font_height (struct FontBLF *font, const char *str) |
float | blf_font_fixed_width (struct FontBLF *font) |
void | blf_font_free (struct FontBLF *font) |
struct GlyphCacheBLF * | blf_glyph_cache_find (struct FontBLF *font, int size, int dpi) |
struct GlyphCacheBLF * | blf_glyph_cache_new (struct FontBLF *font) |
void | blf_glyph_cache_clear (struct FontBLF *font) |
void | blf_glyph_cache_free (struct GlyphCacheBLF *gc) |
struct GlyphBLF * | blf_glyph_search (struct GlyphCacheBLF *gc, unsigned int c) |
struct GlyphBLF * | blf_glyph_add (struct FontBLF *font, unsigned int index, unsigned int c) |
void | blf_glyph_free (struct GlyphBLF *g) |
int | blf_glyph_render (struct FontBLF *font, struct GlyphBLF *g, float x, float y) |
Definition in file blf_internal.h.
char* blf_dir_metrics_search | ( | const char * | filename | ) |
Definition at line 181 of file blf_dir.c.
References BLI_exists(), BLI_strdup(), BLI_strnlen(), MEM_freeN(), and NULL.
Referenced by blf_font_new().
char* blf_dir_search | ( | const char * | file | ) |
Definition at line 129 of file blf_dir.c.
References BLI_exists(), BLI_join_dirfile(), BLI_strdup(), FILE_MAX, ListBase::first, DirBLF::next, NULL, and DirBLF::path.
Referenced by BLF_load(), and BLF_load_unique().
void blf_font_attach_from_mem | ( | struct FontBLF * | font, |
const unsigned char * | mem, | ||
int | mem_size | ||
) |
Definition at line 548 of file blf_font.c.
References FontBLF::face.
Referenced by BLF_metrics_attach().
Definition at line 341 of file blf_font.c.
References GlyphBLF::advance, blf_font_ensure_ascii_table(), BLF_KERNING_STEP, BLF_KERNING_VARS, BLF_UTF8_NEXT_FAST, BLI_UTF8_ERR, GlyphBLF::box, g, GlyphCacheBLF::glyph_ascii_table, FontBLF::glyph_cache, NULL, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BLF_boundbox(), blf_font_height(), blf_font_width(), and blf_font_width_and_height().
void blf_font_buffer | ( | struct FontBLF * | font, |
const char * | str | ||
) |
Definition at line 215 of file blf_font.c.
References FontBLF::b_col, g, GlyphCacheBLF::glyph_ascii_table, FontBLF::glyph_cache, i, NULL, and FontBLF::pos.
Referenced by BLF_draw_buffer().
void blf_font_draw | ( | struct FontBLF * | font, |
const char * | str, | ||
unsigned int | len | ||
) |
Definition at line 160 of file blf_font.c.
References GlyphBLF::advance, blf_font_ensure_ascii_table(), blf_glyph_render(), BLF_KERNING_STEP, BLF_KERNING_VARS, BLF_UTF8_NEXT_FAST, BLI_UTF8_ERR, g, GlyphCacheBLF::glyph_ascii_table, FontBLF::glyph_cache, i, and NULL.
Referenced by BLF_draw().
void blf_font_draw_ascii | ( | struct FontBLF * | font, |
const char * | str, | ||
unsigned int | len | ||
) |
Definition at line 190 of file blf_font.c.
References GlyphBLF::advance, blf_font_ensure_ascii_table(), blf_glyph_render(), BLF_KERNING_STEP, BLF_KERNING_VARS, g, GlyphCacheBLF::glyph_ascii_table, FontBLF::glyph_cache, and NULL.
Referenced by BLF_draw_ascii().
void blf_font_exit | ( | void | ) |
float blf_font_fixed_width | ( | struct FontBLF * | font | ) |
Definition at line 439 of file blf_font.c.
References GlyphBLF::advance, blf_glyph_add(), blf_glyph_search(), FontBLF::face, g, and FontBLF::glyph_cache.
Referenced by BLF_fixed_width().
void blf_font_free | ( | struct FontBLF * | font | ) |
Definition at line 455 of file blf_font.c.
References blf_glyph_cache_free(), BLI_remlink(), FontBLF::cache, FontBLF::face, FontBLF::filename, ListBase::first, FontBLF::glyph_cache, MEM_freeN(), FontBLF::name, and NULL.
Referenced by BLF_exit(), and BLF_unload().
float blf_font_height | ( | struct FontBLF * | font, |
const char * | str | ||
) |
Definition at line 425 of file blf_font.c.
References FontBLF::aspect, BLF_ASPECT, blf_font_boundbox(), FontBLF::flags, rctf::ymax, and rctf::ymin.
Referenced by BLF_height().
int blf_font_init | ( | void | ) |
struct FontBLF* blf_font_new | ( | const char * | name, |
const char * | filename | ||
) | [read] |
Definition at line 512 of file blf_font.c.
References blf_dir_metrics_search(), blf_font_fill(), BLI_strdup(), err, FontBLF::face, FontBLF::filename, ft_lib, MEM_callocN(), MEM_freeN(), FontBLF::name, and NULL.
Referenced by BLF_load(), and BLF_load_unique().
struct FontBLF* blf_font_new_from_mem | ( | const char * | name, |
unsigned char * | mem, | ||
int | mem_size | ||
) | [read] |
Definition at line 558 of file blf_font.c.
References blf_font_fill(), BLI_strdup(), err, FontBLF::face, FontBLF::filename, ft_lib, MEM_callocN(), MEM_freeN(), FontBLF::name, and NULL.
Referenced by BLF_load_mem(), and BLF_load_mem_unique().
void blf_font_size | ( | struct FontBLF * | font, |
int | size, | ||
int | dpi | ||
) |
Definition at line 71 of file blf_font.c.
References blf_glyph_cache_find(), blf_glyph_cache_new(), FontBLF::dpi, err, FontBLF::face, FontBLF::glyph_cache, NULL, FontBLF::size, and size().
Referenced by BLF_size().
float blf_font_width | ( | struct FontBLF * | font, |
const char * | str | ||
) |
Definition at line 411 of file blf_font.c.
References FontBLF::aspect, BLF_ASPECT, blf_font_boundbox(), FontBLF::flags, rctf::xmax, and rctf::xmin.
Referenced by BLF_width().
void blf_font_width_and_height | ( | struct FontBLF * | font, |
const char * | str, | ||
float * | width, | ||
float * | height | ||
) |
Definition at line 392 of file blf_font.c.
References FontBLF::aspect, BLF_ASPECT, blf_font_boundbox(), FontBLF::flags, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BLF_width_and_height().
Definition at line 209 of file blf_glyph.c.
References GlyphBLF::advance, GlyphBLF::bitmap, blf_glyph_search(), blf_hash(), BLI_addhead(), GlyphBLF::box, GlyphCacheBLF::bucket, GlyphBLF::c, err, FontBLF::face, FontBLF::ft_lib, g, FontBLF::glyph_cache, GlyphBLF::height, i, GlyphBLF::idx, MEM_callocN(), MEM_mallocN(), NULL, GlyphBLF::pitch, GlyphBLF::pos_x, GlyphBLF::pos_y, UserDef::text_render, U, USER_TEXT_DISABLE_AA, GlyphBLF::width, rctf::xmax, rctf::xmin, GlyphBLF::xoff, rctf::ymax, rctf::ymin, and GlyphBLF::yoff.
Referenced by blf_font_ensure_ascii_table(), and blf_font_fixed_width().
void blf_glyph_cache_clear | ( | struct FontBLF * | font | ) |
Definition at line 118 of file blf_glyph.c.
References blf_glyph_free(), BLI_remlink(), GlyphCacheBLF::bucket, FontBLF::cache, ListBase::first, g, GlyphCacheBLF::glyph_ascii_table, i, and GlyphCacheBLF::next.
Referenced by BLF_cache_clear().
struct GlyphCacheBLF* blf_glyph_cache_find | ( | struct FontBLF * | font, |
int | size, | ||
int | dpi | ||
) | [read] |
Definition at line 58 of file blf_glyph.c.
References FontBLF::cache, GlyphCacheBLF::dpi, ListBase::first, GlyphCacheBLF::next, NULL, p, and GlyphCacheBLF::size.
Referenced by blf_font_size().
void blf_glyph_cache_free | ( | struct GlyphCacheBLF * | gc | ) |
Definition at line 137 of file blf_glyph.c.
References blf_glyph_free(), BLI_remlink(), GlyphCacheBLF::bucket, GlyphCacheBLF::cur_tex, ListBase::first, addon::engine::free(), g, i, MEM_freeN(), and GlyphCacheBLF::textures.
Referenced by blf_font_free().
struct GlyphCacheBLF* blf_glyph_cache_new | ( | struct FontBLF * | font | ) | [read] |
Definition at line 72 of file blf_glyph.c.
References GlyphCacheBLF::ascender, BLI_addhead(), GlyphCacheBLF::bucket, FontBLF::cache, GlyphCacheBLF::cur_tex, GlyphCacheBLF::descender, FontBLF::dpi, GlyphCacheBLF::dpi, FontBLF::face, GlyphCacheBLF::glyph_ascii_table, GlyphCacheBLF::max_glyph_height, GlyphCacheBLF::max_glyph_width, MEM_callocN(), GlyphCacheBLF::next, GlyphCacheBLF::ntex, NULL, GlyphCacheBLF::num_glyphs, GlyphCacheBLF::p2_height, GlyphCacheBLF::p2_width, GlyphCacheBLF::pad, GlyphCacheBLF::prev, GlyphCacheBLF::rem_glyphs, GlyphCacheBLF::size, FontBLF::size, GlyphCacheBLF::textures, GlyphCacheBLF::x_offs, and GlyphCacheBLF::y_offs.
Referenced by blf_font_size().
void blf_glyph_free | ( | struct GlyphBLF * | g | ) |
Definition at line 287 of file blf_glyph.c.
References GlyphBLF::bitmap, and MEM_freeN().
Referenced by blf_glyph_cache_clear(), and blf_glyph_cache_free().
Definition at line 366 of file blf_glyph.c.
References GlyphBLF::bitmap, BLF_CLIPPING, blf_glyph_cache_texture(), BLF_SHADOW, blf_texture3_draw(), blf_texture5_draw(), blf_texture_draw(), BLI_in_rctf(), FontBLF::blur, GlyphBLF::box, GlyphBLF::build_tex, FontBLF::clip_rec, GlyphCacheBLF::cur_tex, FontBLF::flags, FontBLF::glyph_cache, GlyphBLF::height, GlyphCacheBLF::max_glyph_height, GlyphCacheBLF::max_glyph_width, FontBLF::max_tex_size, FontBLF::orig_col, GlyphCacheBLF::p2_height, GlyphCacheBLF::p2_width, GlyphCacheBLF::pad, FontBLF::pos, GlyphBLF::pos_x, GlyphBLF::pos_y, GlyphCacheBLF::rem_glyphs, FontBLF::shadow, FontBLF::shadow_col, FontBLF::shadow_x, FontBLF::shadow_y, GlyphBLF::tex, FontBLF::tex_bind_state, GlyphCacheBLF::textures, GlyphBLF::uv, GlyphBLF::width, GlyphCacheBLF::x_offs, rctf::xmax, rctf::xmin, GlyphBLF::xoff, GlyphCacheBLF::y_offs, and GlyphBLF::yoff.
Referenced by blf_font_draw(), and blf_font_draw_ascii().
struct GlyphBLF* blf_glyph_search | ( | struct GlyphCacheBLF * | gc, |
unsigned int | c | ||
) | [read] |
Definition at line 194 of file blf_glyph.c.
References blf_hash(), GlyphCacheBLF::bucket, GlyphBLF::c, ListBase::first, GlyphBLF::next, NULL, and p.
Referenced by blf_font_ensure_ascii_table(), blf_font_fixed_width(), and blf_glyph_add().
unsigned int blf_hash | ( | unsigned int | val | ) |
Definition at line 52 of file blf_util.c.
References simple_enum_gen::val.
Referenced by blf_glyph_add(), and blf_glyph_search().
unsigned int blf_next_p2 | ( | unsigned int | x | ) |
Definition at line 40 of file blf_util.c.
Referenced by blf_glyph_cache_texture().