fallout2-ce/src/text_font.h

56 lines
2.1 KiB
C
Raw Normal View History

2022-05-19 01:51:26 -07:00
#ifndef TEXT_FONT_H
#define TEXT_FONT_H
2022-09-23 05:43:44 -07:00
namespace fallout {
2022-05-19 01:51:26 -07:00
typedef void FontManagerSetCurrentFontProc(int font);
typedef void FontManagerDrawTextProc(unsigned char* buffer, const char* string, int length, int pitch, int color);
typedef int FontManagerGetLineHeightProc();
typedef int FontManagerGetStringWidthProc(const char* string);
typedef int FontManagerGetCharacterWidthProc(int ch);
typedef int FontManagerGetMonospacedStringWidthProc(const char* string);
typedef int FontManagerGetLetterSpacingProc();
typedef int FontManagerGetBufferSizeProc(const char* string);
typedef int FontManagerGetMonospacedCharacterWidth();
typedef struct FontManager {
int minFont;
int maxFont;
FontManagerSetCurrentFontProc* setCurrentProc;
FontManagerDrawTextProc* drawTextProc;
FontManagerGetLineHeightProc* getLineHeightProc;
FontManagerGetStringWidthProc* getStringWidthProc;
FontManagerGetCharacterWidthProc* getCharacterWidthProc;
FontManagerGetMonospacedStringWidthProc* getMonospacedStringWidthProc;
FontManagerGetLetterSpacingProc* getLetterSpacingProc;
FontManagerGetBufferSizeProc* getBufferSizeProc;
FontManagerGetMonospacedCharacterWidth* getMonospacedCharacterWidthProc;
} FontManager;
#define FONT_SHADOW (0x10000)
#define FONT_UNDERLINE (0x20000)
#define FONT_MONO (0x40000)
extern FontManager gTextFontManager;
extern int gCurrentFont;
extern int gFontManagersCount;
extern FontManagerDrawTextProc* fontDrawText;
extern FontManagerGetLineHeightProc* fontGetLineHeight;
extern FontManagerGetStringWidthProc* fontGetStringWidth;
extern FontManagerGetCharacterWidthProc* fontGetCharacterWidth;
extern FontManagerGetMonospacedStringWidthProc* fontGetMonospacedStringWidth;
extern FontManagerGetLetterSpacingProc* fontGetLetterSpacing;
extern FontManagerGetBufferSizeProc* fontGetBufferSize;
extern FontManagerGetMonospacedCharacterWidth* fontGetMonospacedCharacterWidth;
int textFontsInit();
void textFontsExit();
int textFontLoad(int font);
int fontManagerAdd(FontManager* fontManager);
int fontGetCurrent();
void fontSetCurrent(int font);
2022-09-23 05:43:44 -07:00
} // namespace fallout
2022-05-19 01:51:26 -07:00
#endif /* TEXT_FONT_H */