Blender V2.61 - r43446
|
Go to the source code of this file.
Functions | |
void | printfGlyph (struct bmGlyph *glyph) |
void | calcAlpha (struct ImBuf *ibuf) |
void | readBitmapFontVersion0 (struct ImBuf *ibuf, unsigned char *rect, int step) |
void | detectBitmapFont (struct ImBuf *ibuf) |
int | locateGlyph (struct bmFont *bmfont, unsigned short unicode) |
void | matrixGlyph (struct ImBuf *ibuf, unsigned short unicode, float *centerx, float *centery, float *sizex, float *sizey, float *transx, float *transy, float *movex, float *movey, float *advance) |
Definition in file BKE_bmfont.h.
void calcAlpha | ( | struct ImBuf * | ibuf | ) |
Definition at line 71 of file bmfont.c.
References i, MAX3, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by readBitmapFontVersion0().
void detectBitmapFont | ( | struct ImBuf * | ibuf | ) |
Definition at line 171 of file bmfont.c.
References i, is_power_of_two, NULL, readBitmapFontVersion0(), ImBuf::rect, ImBuf::userdata, ImBuf::x, and ImBuf::y.
Referenced by image_load_image_file().
int locateGlyph | ( | struct bmFont * | bmfont, |
unsigned short | unicode | ||
) |
Definition at line 213 of file bmfont.c.
References bmFont::glyphcount, bmFont::glyphs, max, min, and bmGlyph::unicode.
Referenced by matrixGlyph().
void matrixGlyph | ( | struct ImBuf * | ibuf, |
unsigned short | unicode, | ||
float * | centerx, | ||
float * | centery, | ||
float * | sizex, | ||
float * | sizey, | ||
float * | transx, | ||
float * | transy, | ||
float * | movex, | ||
float * | movey, | ||
float * | advance | ||
) |
Definition at line 245 of file bmfont.c.
References bmGlyph::advance, bmFont::glyphs, IB_BITMAPFONT, if(), locateGlyph(), bmGlyph::locx, bmGlyph::locy, bmGlyph::ofsx, bmGlyph::ofsy, bmGlyph::sizex, bmGlyph::sizey, ImBuf::userdata, ImBuf::userflags, ImBuf::x, and ImBuf::y.
Referenced by GPU_render_text().
void printfGlyph | ( | bmGlyph * | glyph | ) |
Two external functions:
void detectBitmapFont(ImBuf *ibuf) detects if an image buffer contains a bitmap font. It makes the specific bitmap data which is stored in the bitmap invisible to blender.
void matrixGlyph(ImBuf * ibuf, unsigned short unicode, *float x 7) returns all the information about the character (unicode) in the floats
Room for improvement: add kerning data in the bitmap all calculations in matrixGlyph() are static and could be done during initialization
Definition at line 59 of file bmfont.c.
References bmGlyph::advance, bmGlyph::locx, bmGlyph::locy, bmGlyph::ofsx, bmGlyph::ofsy, bmGlyph::reserved, bmGlyph::sizex, bmGlyph::sizey, and bmGlyph::unicode.
Referenced by readBitmapFontVersion0().
void readBitmapFontVersion0 | ( | struct ImBuf * | ibuf, |
unsigned char * | rect, | ||
int | step | ||
) |
Definition at line 85 of file bmfont.c.
References bmGlyph::advance, calcAlpha(), G, G_DEBUG, bmFont::glyphcount, bmFont::glyphs, i, IB_BITMAPFONT, bmGlyph::locx, bmGlyph::locy, bmFont::magic, MEM_freeN(), MEM_mallocN(), bmGlyph::ofsx, bmGlyph::ofsy, ImBuf::planes, printfGlyph(), bmGlyph::reserved, bmGlyph::sizex, bmGlyph::sizey, step(), bmGlyph::unicode, ImBuf::userdata, ImBuf::userflags, bmFont::version, ImBuf::x, bmFont::xsize, ImBuf::y, and bmFont::ysize.
Referenced by detectBitmapFont().