Blender V2.61 - r43446
Defines | Functions | Variables

blf.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ft2build.h>
#include "MEM_guardedalloc.h"
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
#include "BIF_gl.h"
#include "BLF_api.h"
#include "blf_internal_types.h"
#include "blf_internal.h"

Go to the source code of this file.

Defines

#define BLF_MAX_FONT   16

Functions

static FontBLFBLF_get (int fontid)
int BLF_init (int points, int dpi)
void BLF_exit (void)
void BLF_cache_clear (void)
static int blf_search (const char *name)
static int blf_search_available (void)
int BLF_load (const char *name)
int BLF_load_unique (const char *name)
void BLF_metrics_attach (int fontid, unsigned char *mem, int mem_size)
int BLF_load_mem (const char *name, unsigned char *mem, int mem_size)
int BLF_load_mem_unique (const char *name, unsigned char *mem, int mem_size)
void BLF_unload (const char *name)
void BLF_enable (int fontid, int option)
void BLF_disable (int fontid, int option)
void BLF_enable_default (int option)
void BLF_disable_default (int option)
void BLF_aspect (int fontid, float x, float y, float z)
void BLF_matrix (int fontid, const double m[16])
void BLF_position (int fontid, float x, float y, float z)
void BLF_size (int fontid, int size, int dpi)
void BLF_blur (int fontid, int size)
void BLF_draw_default (float x, float y, float z, const char *str, size_t len)
void BLF_draw_default_ascii (float x, float y, float z, const char *str, size_t len)
void BLF_rotation_default (float angle)
static void blf_draw__start (FontBLF *font, GLint *mode, GLint *param)
static void blf_draw__end (GLint mode, GLint param)
void BLF_draw (int fontid, const char *str, size_t len)
void BLF_draw_ascii (int fontid, const char *str, size_t len)
void BLF_boundbox (int fontid, const char *str, rctf *box)
void BLF_width_and_height (int fontid, const char *str, float *width, float *height)
float BLF_width (int fontid, const char *str)
float BLF_fixed_width (int fontid)
float BLF_width_default (const char *str)
float BLF_height (int fontid, const char *str)
float BLF_height_max (int fontid)
float BLF_width_max (int fontid)
float BLF_descender (int fontid)
float BLF_ascender (int fontid)
float BLF_height_default (const char *str)
void BLF_rotation (int fontid, float angle)
void BLF_clipping (int fontid, float xmin, float ymin, float xmax, float ymax)
void BLF_clipping_default (float xmin, float ymin, float xmax, float ymax)
void BLF_shadow (int fontid, int level, float r, float g, float b, float a)
void BLF_shadow_offset (int fontid, int x, int y)
void BLF_buffer (int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch)
void BLF_buffer_col (int fontid, float r, float g, float b, float a)
void BLF_draw_buffer (int fontid, const char *str)

Variables

static FontBLFglobal_font [BLF_MAX_FONT] = {0}
static int global_font_default = -1
static int global_font_points = 11
static int global_font_dpi = 72
int blf_mono_font = -1
int blf_mono_font_render = -1

Detailed Description

Definition in file blf.c.


Define Documentation

#define BLF_MAX_FONT   16

Function Documentation

float BLF_ascender ( int  fontid)

Definition at line 667 of file blf.c.

References GlyphCacheBLF::ascender, BLF_get(), and FontBLF::glyph_cache.

Referenced by uiStyleFontDrawExt(), and uiStyleFontDrawRotated().

void BLF_aspect ( int  fontid,
float  x,
float  y,
float  z 
)

Definition at line 349 of file blf.c.

References FontBLF::aspect, and BLF_get().

Referenced by BL_print_game_line(), py_blf_aspect(), and GPC_RenderTools::RenderText3D().

void BLF_blur ( int  fontid,
int  size 
)

Definition at line 427 of file blf.c.

References BLF_get(), FontBLF::blur, and size().

Referenced by py_blf_blur().

void BLF_boundbox ( int  fontid,
const char *  str,
rctf box 
)

Definition at line 569 of file blf.c.

References blf_font_boundbox(), and BLF_get().

void BLF_buffer ( int  fontid,
float *  fbuf,
unsigned char *  cbuf,
int  w,
int  h,
int  nch 
)
void BLF_buffer_col ( int  fontid,
float  r,
float  g,
float  b,
float  a 
)

Definition at line 762 of file blf.c.

References FontBLF::b_col, BLF_get(), and g.

Referenced by BKE_stamp_buf(), and checker_board_text().

void BLF_cache_clear ( void  )

Definition at line 108 of file blf.c.

References blf_glyph_cache_clear(), BLF_MAX_FONT, and i.

void BLF_clipping ( int  fontid,
float  xmin,
float  ymin,
float  xmax,
float  ymax 
)
void BLF_clipping_default ( float  xmin,
float  ymin,
float  xmax,
float  ymax 
)
float BLF_descender ( int  fontid)

Definition at line 656 of file blf.c.

References BLF_get(), GlyphCacheBLF::descender, and FontBLF::glyph_cache.

Referenced by BKE_stamp_buf().

void BLF_disable ( int  fontid,
int  option 
)
void BLF_disable_default ( int  option)

Definition at line 340 of file blf.c.

References BLF_get(), FontBLF::flags, and global_font_default.

Referenced by UI_view2d_scrollers_draw(), and UI_view2d_text_cache_draw().

void BLF_draw ( int  fontid,
const char *  str,
size_t  len 
)
static void blf_draw__end ( GLint  mode,
GLint  param 
) [static]

Definition at line 526 of file blf.c.

Referenced by BLF_draw(), and BLF_draw_ascii().

static void blf_draw__start ( FontBLF font,
GLint *  mode,
GLint *  param 
) [static]
void BLF_draw_ascii ( int  fontid,
const char *  str,
size_t  len 
)
void BLF_draw_buffer ( int  fontid,
const char *  str 
)
void BLF_draw_default ( float  x,
float  y,
float  z,
const char *  str,
size_t  len 
)
void BLF_draw_default_ascii ( float  x,
float  y,
float  z,
const char *  str,
size_t  len 
)
void BLF_enable ( int  fontid,
int  option 
)
void BLF_enable_default ( int  option)

Definition at line 331 of file blf.c.

References BLF_get(), FontBLF::flags, and global_font_default.

Referenced by UI_view2d_scrollers_draw(), and UI_view2d_text_cache_draw().

void BLF_exit ( void  )

Definition at line 92 of file blf.c.

References blf_font_exit(), blf_font_free(), BLF_MAX_FONT, i, and NULL.

Referenced by main(), and WM_exit_ext().

float BLF_fixed_width ( int  fontid)
static FontBLF* BLF_get ( int  fontid) [static]
float BLF_height ( int  fontid,
const char *  str 
)

Definition at line 623 of file blf.c.

References blf_font_height(), BLF_get(), and FontBLF::glyph_cache.

Referenced by BLF_height_default(), file_font_pointsize(), and loggerwindow_new().

float BLF_height_default ( const char *  str)
float BLF_height_max ( int  fontid)
int BLF_init ( int  points,
int  dpi 
)

Definition at line 80 of file blf.c.

References blf_font_init(), BLF_MAX_FONT, global_font_dpi, global_font_points, i, and NULL.

Referenced by main(), and WM_init().

int BLF_load ( const char *  name)

Definition at line 145 of file blf.c.

References blf_dir_search(), blf_font_new(), blf_search(), blf_search_available(), i, and MEM_freeN().

Referenced by GetFontId(), py_blf_load(), and uiStyleInit().

int BLF_load_mem ( const char *  name,
unsigned char *  mem,
int  mem_size 
)

Definition at line 230 of file blf.c.

References blf_font_new_from_mem(), blf_search(), blf_search_available(), and i.

Referenced by GetFontId(), loggerwindow_new(), main(), and uiStyleInit().

int BLF_load_mem_unique ( const char *  name,
unsigned char *  mem,
int  mem_size 
)

Definition at line 265 of file blf.c.

References blf_font_new_from_mem(), blf_search_available(), and i.

Referenced by uiStyleInit().

int BLF_load_unique ( const char *  name)

Definition at line 185 of file blf.c.

References blf_dir_search(), blf_font_new(), blf_search_available(), i, and MEM_freeN().

void BLF_matrix ( int  fontid,
const double  m[16] 
)

Definition at line 360 of file blf.c.

References BLF_get(), and FontBLF::m.

Referenced by BL_print_game_line(), and GPC_RenderTools::RenderText3D().

void BLF_metrics_attach ( int  fontid,
unsigned char *  mem,
int  mem_size 
)

Definition at line 221 of file blf.c.

References blf_font_attach_from_mem(), and BLF_get().

void BLF_position ( int  fontid,
float  x,
float  y,
float  z 
)
void BLF_rotation ( int  fontid,
float  angle 
)

Definition at line 693 of file blf.c.

References angle(), FontBLF::angle, and BLF_get().

Referenced by py_blf_rotation(), and uiStyleFontDrawRotated().

void BLF_rotation_default ( float  angle)

Definition at line 473 of file blf.c.

References angle(), FontBLF::angle, BLF_get(), and global_font_default.

Referenced by UI_view2d_scrollers_draw().

static int blf_search ( const char *  name) [static]
static int blf_search_available ( void  ) [static]

Definition at line 134 of file blf.c.

References BLF_MAX_FONT, and i.

Referenced by BLF_load(), BLF_load_mem(), BLF_load_mem_unique(), and BLF_load_unique().

void BLF_shadow ( int  fontid,
int  level,
float  r,
float  g,
float  b,
float  a 
)

Definition at line 726 of file blf.c.

References BLF_get(), g, FontBLF::shadow, and FontBLF::shadow_col.

Referenced by py_blf_shadow(), uiStyleFontDrawExt(), and uiStyleFontDrawRotated().

void BLF_shadow_offset ( int  fontid,
int  x,
int  y 
)
void BLF_size ( int  fontid,
int  size,
int  dpi 
)
void BLF_unload ( const char *  name)

Definition at line 298 of file blf.c.

References blf_font_free(), BLF_MAX_FONT, i, FontBLF::name, and NULL.

Referenced by py_blf_unload(), and uiStyleInit().

float BLF_width ( int  fontid,
const char *  str 
)
void BLF_width_and_height ( int  fontid,
const char *  str,
float *  width,
float *  height 
)
float BLF_width_default ( const char *  str)
float BLF_width_max ( int  fontid)

Definition at line 645 of file blf.c.

References BLF_get(), FontBLF::glyph_cache, and GlyphCacheBLF::max_glyph_width.

Referenced by BKE_stamp_buf().


Variable Documentation

int blf_mono_font = -1

Definition at line 71 of file blf.c.

Referenced by BKE_stamp_buf(), and uiStyleInit().

FontBLF* global_font[BLF_MAX_FONT] = {0} [static]

Definition at line 62 of file blf.c.

int global_font_default = -1 [static]
int global_font_dpi = 72 [static]
int global_font_points = 11 [static]