00001
00002
00003 #ifndef _nvbitfont_h_
00004 #define _nvbitfont_h_
00005
00006 #include <NvFoundation.h>
00007
00008 #include <NvUI/NvPackedColor.h>
00009
00010
00042 struct NvBftAlign {
00043 enum Enum {
00044 LEFT=0,
00045 RIGHT=1,
00046 CENTER=2,
00048 TOP=0,
00049 BOTTOM=1
00050 };
00051 };
00052
00063 struct NvBftStyle {
00064 enum Enum {
00065 NORMAL = 0x10,
00066 BOLD,
00067
00068
00069 MAX
00070 };
00071 };
00072
00075
00077 #define NVBF_STYLESTR_NORMAL "\020"
00078
00079 #define NVBF_STYLESTR_BOLD "\021"
00080
00081
00083
00084
00085
00096 typedef enum
00097 {
00098 NVBF_COLORCODE_WHITE = 0,
00099 NVBF_COLORCODE_GRAY,
00100 NVBF_COLORCODE_BLACK,
00101 NVBF_COLORCODE_RED,
00102 NVBF_COLORCODE_GREEN,
00103 NVBF_COLORCODE_BLUE,
00104 NVBF_COLORCODE_MAX
00105 } NvBftColorCode;
00106
00109
00111 #define NVBF_COLORSTR_WHITE "\001"
00112
00113 #define NVBF_COLORSTR_GRAY "\002"
00114
00115 #define NVBF_COLORSTR_BLACK "\003"
00116
00117 #define NVBF_COLORSTR_RED "\004"
00118
00119 #define NVBF_COLORSTR_GREEN "\005"
00120
00121 #define NVBF_COLORSTR_BLUE "\006"
00122
00123 #define NVBF_COLORSTR_NORMAL "\007"
00124
00125
00131
00132
00141 extern int32_t NVBFInitialize(uint8_t count, const char* filename[][2]);
00143 extern void NVBFCleanup(void);
00144
00156 extern uint8_t NVBFGetFontID(const char *filename);
00157
00159 extern void NVBFSetScreenRes(float width, float height);
00161 extern void NVBFGetScreenRes(float *width, float *height);
00163 extern void NVBFSetScreenRot(float degrees);
00164
00165
00166
00167
00168 class BFText;
00169
00170
00171
00172
00179
00180
00182 extern BFText *NVBFTextAlloc(void);
00184 extern void NVBFTextFree(BFText *bftin);
00185
00187 extern void NVBFTextSetVisibility(BFText *bftin, bool vis);
00196 extern void NVBFTextSetColor(BFText *bftin, NvPackedColor color);
00200 extern void NVBFTextSetMultiplyColor(BFText *bftin, NvPackedColor color);
00209 extern void NVBFTextSetShadow(BFText *bftin, char offset, NvPackedColor color);
00217 extern void NVBFSetDrawnChars(BFText *bftin, int32_t num);
00218
00230 extern void NVBFTextSetBox(BFText *bftin, float width, float height, int32_t lines, uint32_t dots);
00232 extern void NVBFTextUpdateBox(BFText *bftin, float width, float height);
00233
00235 extern void NVBFTextSetFont(BFText *bftin, uint8_t font);
00237 extern void NVBFTextSetSize(BFText *bftin, float size);
00239 extern void NVBFTextSetString(BFText *bftin, const char* str);
00240
00242 extern float NVBFTextGetWidth(BFText *bftin);
00244 extern float NVBFTextGetHeight(BFText *bftin);
00245
00246
00247
00248
00249
00255 extern void NVBFTextCursorAlign(BFText *bftin, NvBftAlign::Enum horizontal, NvBftAlign::Enum vertical);
00256
00265 extern void NVBFTextCursorPos(BFText *bftin, float horiz, float vert);
00266
00267
00268
00269
00270
00271
00272
00275
00276
00277
00285 extern void NVBFTextRenderPrep(void);
00287 extern void NVBFTextRenderDone(void);
00288
00291 extern void NVBFTextMatrix(const float *mtx);
00292
00293
00295 extern void NVBFTextRender(BFText *bftin);
00296
00297
00298
00317 extern void NVBFTextRebuildCache(BFText *bftin, bool internal);
00318
00319
00320
00321 #endif //_nvbitfont_h_