Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Extras / CDTestFramework / AntTweakBar / src / TwFonts.h
1 //  ---------------------------------------------------------------------------
2 //
3 //  @file       TwFonts.h
4 //  @brief      Bitmaps fonts
5 //  @author     Philippe Decaudin - http://www.antisphere.com
6 //  @license    This file is part of the AntTweakBar library.
7 //              For conditions of distribution and use, see License.txt
8 //
9 //  note:       Private header
10 //
11 //  ---------------------------------------------------------------------------
12
13
14 #if !defined ANT_TW_FONTS_INCLUDED
15 #define ANT_TW_FONTS_INCLUDED
16
17 //#include <AntTweakBar.h>
18
19 /*
20 A source bitmap includes 224 characters starting from ascii char 32 (i.e. space) to ascii char 255:
21   
22  !"#$%&'()*+,-./0123456789:;<=>?
23 @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
24 `abcdefghijklmnopqrstuvwxyz{|}~\7f
25 \80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f
26  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿
27 ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
28 àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
29
30 First column of a source bitmap is a delimiter with color=zero at the end of each line of characters.
31 Last row of a line of characters is a delimiter with color=zero at the last pixel of each character.
32
33 */
34
35
36 struct CTexFont
37 {
38     unsigned char * m_TexBytes;
39     int             m_TexWidth;     // power of 2
40     int             m_TexHeight;    // power of 2
41     float           m_CharU0[256];
42     float           m_CharV0[256];
43     float           m_CharU1[256];
44     float           m_CharV1[256];
45     int             m_CharWidth[256];
46     int             m_CharHeight;
47     int             m_NbCharRead;
48
49     CTexFont();
50     ~CTexFont();
51 };
52
53
54 CTexFont *TwGenerateFont(const unsigned char *_Bitmap, int _BmWidth, int _BmHeight);
55
56
57 extern CTexFont *g_DefaultSmallFont;
58 extern CTexFont *g_DefaultNormalFont;
59 extern CTexFont *g_DefaultLargeFont;
60 extern CTexFont *g_DefaultFixed1Font;
61
62 void TwGenerateDefaultFonts();
63 void TwDeleteDefaultFonts();
64
65
66 #endif  // !defined ANT_TW_FONTS_INCLUDED