Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
Font.h
Go to the documentation of this file.
1#ifndef NW4HBM_UT_FONT_H
2#define NW4HBM_UT_FONT_H
3
4#include <revolution/gx.h>
5#include <revolution/types.h>
6
7#include "CharStrmReader.h"
8#include "fontResources.h"
9
10#include "macros.h"
11#include "global.h"
12
13#define FONT_TYPE_NNGCTEXTURE 1
14#define GLYPH_INDEX_NOT_FOUND 0xFFFF
15
16namespace nw4hbm {
17 namespace ut {
18
24
32
33 class Font {
34 public:
35 typedef enum Type {
36 /* 0xFFFF */ INVALID_CHARACTER_CODE = 0xFFFF,
37 /* 0 */ TYPE_NULL = 0,
38 /* 1 */ TYPE_ROM,
41
42 public:
43 Font() : mReaderFunc(&CharStrmReader::ReadNextCharCP1252) {}
44
45 /* 0x08 */ virtual ~Font() {}
46 /* 0x0C */ virtual int GetWidth() const = 0;
47 /* 0x10 */ virtual int GetHeight() const = 0;
48 /* 0x14 */ virtual int GetAscent() const = 0;
49 /* 0x18 */ virtual int GetDescent() const = 0;
50 /* 0x1C */ virtual int GetBaselinePos() const = 0;
51 /* 0x20 */ virtual int GetCellHeight() const = 0;
52 /* 0x24 */ virtual int GetCellWidth() const = 0;
53 /* 0x28 */ virtual int GetMaxCharWidth() const = 0;
54 /* 0x2C */ virtual Type GetType() const = 0;
55 /* 0x30 */ virtual GXTexFmt GetTextureFormat() const = 0;
56 /* 0x34 */ virtual int GetLineFeed() const = 0;
57 /* 0x38 */ virtual CharWidths GetDefaultCharWidths() const = 0;
58 /* 0x3C */ virtual void SetDefaultCharWidths(const CharWidths& widths) = 0;
59 /* 0x40 */ virtual bool SetAlternateChar(u16 c) = 0;
60 /* 0x44 */ virtual void SetLineFeed(int linefeed) = 0;
61 /* 0x48 */ virtual int GetCharWidth(u16 c) const = 0;
62 /* 0x4C */ virtual CharWidths GetCharWidths(u16 c) const = 0;
63 /* 0x50 */ virtual void GetGlyph(Glyph* glyph, u16 c) const = 0;
64 /* 0x54 */ virtual FontEncoding GetEncoding() const = 0;
65
66 void InitReaderFunc(FontEncoding encoding);
67
70 #ifndef NO_THIS_ASSERT
71 NW4HBM_ASSERT_VALID_PTR(117, this);
72 #endif
74 return reader;
75 }
76
77 private:
78 /* 0x00 (vtable) */
80 };
81
82 } // namespace ut
83} // namespace nw4hbm
84
85#endif
Ordon Goat.
Definition CharStrmReader.h:10
u16(CharStrmReader::*) ReadFunc()
Definition CharStrmReader.h:12
Definition Font.h:33
virtual CharWidths GetDefaultCharWidths() const =0
Type
Definition Font.h:35
@ INVALID_CHARACTER_CODE
Definition Font.h:36
@ TYPE_RESOURCE
Definition Font.h:39
@ TYPE_ROM
Definition Font.h:38
@ TYPE_NULL
Definition Font.h:37
void InitReaderFunc(FontEncoding encoding)
Definition ut_Font.cpp:9
virtual int GetDescent() const =0
virtual int GetBaselinePos() const =0
virtual int GetAscent() const =0
virtual int GetLineFeed() const =0
virtual int GetWidth() const =0
virtual int GetCellWidth() const =0
virtual void SetDefaultCharWidths(const CharWidths &widths)=0
Font()
Definition Font.h:43
virtual ~Font()
Definition Font.h:45
virtual FontEncoding GetEncoding() const =0
virtual void GetGlyph(Glyph *glyph, u16 c) const =0
CharStrmReader::ReadFunc mReaderFunc
Definition Font.h:79
virtual bool SetAlternateChar(u16 c)=0
virtual void SetLineFeed(int linefeed)=0
virtual int GetHeight() const =0
virtual int GetMaxCharWidth() const =0
CharStrmReader GetCharStrmReader() const NO_INLINE
Definition Font.h:68
virtual Type GetType() const =0
virtual int GetCellHeight() const =0
virtual GXTexFmt GetTextureFormat() const =0
virtual CharWidths GetCharWidths(u16 c) const =0
virtual int GetCharWidth(u16 c) const =0
enum _GXTexFmt GXTexFmt
unsigned short int u16
Definition types.h:10
FontEncoding
Definition Font.h:25
@ FONT_ENCODING_CP1252
Definition Font.h:29
@ FONT_ENCODING_SJIS
Definition Font.h:28
@ FONT_ENCODING_UTF8
Definition Font.h:26
@ NUM_OF_FONT_ENCODING
Definition Font.h:30
@ FONT_ENCODING_UTF16
Definition Font.h:27
FontMapMethod
Definition Font.h:19
@ FONT_MAPMETHOD_SCAN
Definition Font.h:22
@ FONT_MAPMETHOD_TABLE
Definition Font.h:21
@ FONT_MAPMETHOD_DIRECT
Definition Font.h:20
Definition HBMAnmController.h:6
Definition fontResources.h:11
Definition fontResources.h:24