Blender V2.61 - r43446
Defines | Functions

bmfont.cpp File Reference

#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BKE_global.h"
#include "IMB_imbuf_types.h"
#include "BKE_bmfont.h"
#include "BKE_bmfont_types.h"

Go to the source code of this file.

Defines

#define MAX2(x, y)   ( (x)>(y) ? (x) : (y) )
#define MAX3(x, y, z)   MAX2( MAX2((x),(y)) , (z) )

Functions

void calcAlpha (ImBuf *ibuf)
void readBitmapFontVersion0 (ImBuf *ibuf, unsigned char *rect, int step)
void detectBitmapFont (ImBuf *ibuf)
int locateGlyph (bmFont *bmfont, unsigned short unicode)
void matrixGlyph (ImBuf *ibuf, unsigned short unicode, float *centerx, float *centery, float *sizex, float *sizey, float *transx, float *transy, float *movex, float *movey, float *advance)

Detailed Description

Definition in file bmfont.cpp.


Define Documentation

#define MAX2 (   x,
 
)    ( (x)>(y) ? (x) : (y) )

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 76 of file bmfont.cpp.

#define MAX3 (   x,
  y,
 
)    MAX2( MAX2((x),(y)) , (z) )

Definition at line 77 of file bmfont.cpp.


Function Documentation

void calcAlpha ( ImBuf ibuf)

Definition at line 79 of file bmfont.cpp.

References i, MAX3, ImBuf::rect, ImBuf::x, and ImBuf::y.

Referenced by readBitmapFontVersion0().

void detectBitmapFont ( ImBuf ibuf)
int locateGlyph ( bmFont bmfont,
unsigned short  unicode 
)

Definition at line 227 of file bmfont.cpp.

References bmFont::glyphcount, bmFont::glyphs, max, min, and bmGlyph::unicode.

Referenced by matrixGlyph().

void matrixGlyph ( ImBuf ibuf,
unsigned short  unicode,
float *  centerx,
float *  centery,
float *  sizex,
float *  sizey,
float *  transx,
float *  transy,
float *  movex,
float *  movey,
float *  advance 
)
void readBitmapFontVersion0 ( ImBuf ibuf,
unsigned char *  rect,
int  step 
)