OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
BmfFile.h
Go to the documentation of this file.
1
8#ifndef BMF_FILE_H
9#define BMF_FILE_H
10
11#pragma pack(1)
12
13typedef struct {
15 UINT32 size;
17
19 sizeof (BMF_BLOCK_HEADER) == 5,
20 "BMF_BLOCK_HEADER struct must be packed"
21 );
22
23#define BMF_BLOCK_INFO_ID 1
24
25#define BMF_BLOCK_INFO_BF_UNICODE BIT1
26
27//
28// This tag holds information on how the font was generated.
29//
30typedef PACKED struct {
31 INT16 fontSize; // The size of the true type font.
32 UINT8 bitField;
33 UINT8 charSet; // The name of the OEM charset used (when not unicode).
34 UINT16 stretchH; // The font height stretch in percentage. 100% means no stretch.
35 UINT8 aa; // The supersampling level used. 1 means no supersampling was used
36 UINT8 paddingUp; // The padding for each character (up, right, down, left).
37 UINT8 paddingRight; // The padding for each character (up, right, down, left).
38 UINT8 paddingDown; // The padding for each character (up, right, down, left).
39 UINT8 paddingLeft; // The padding for each character (up, right, down, left).
40 UINT8 spacingHoriz; // The spacing for each character (horizontal, vertical).
41 UINT8 spacingVert; // The spacing for each character (horizontal, vertical).
42 UINT8 outline; // The outline thickness for the characters.
43 CHAR8 fontName[]; // This is the name of the true type font.
45
47 sizeof (BMF_BLOCK_INFO) == 14,
48 "BMF_BLOCK_INFO struct must be packed"
49 );
50
51#define BMF_BLOCK_COMMON_ID 2
52
53//
54// This tag holds information common to all characters.
55//
56typedef PACKED struct {
57 UINT16 lineHeight; // This is the distance in pixels between each line of text.
58 UINT16 base; // The number of pixels from the absolute top of the line to the base of the characters.
59 UINT16 scaleW; // The width of the texture, normally used to scale the x pos of the character image.
60 UINT16 scaleH; // The height of the texture, normally used to scale the y pos of the character image.
61 UINT16 pages; // The number of texture pages included in the font.
62 UINT8 bitField;
63 UINT8 alphaChnl; // Set to 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
64 UINT8 redChnl; // Set to 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
65 UINT8 greenChnl; // Set to 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
66 UINT8 blueChnl; // Set to 0 if the channel holds the glyph data, 1 if it holds the outline, 2 if it holds the glyph and the outline, 3 if its set to zero, and 4 if its set to one.
68
70 sizeof (BMF_BLOCK_COMMON) == 15,
71 "BMF_BLOCK_COMMON struct must be packed"
72 );
73
74#define BMF_BLOCK_PAGES_ID 3
75
76//
77// This tag gives the name of a texture file. There is one for each page in the font.
78//
79typedef CHAR8 BMF_BLOCK_PAGES;
80
81typedef PACKED struct {
82 UINT32 id; // The character id.
83 UINT16 x; // The left position of the character image in the texture.
84 UINT16 y; // The top position of the character image in the texture.
85 UINT16 width; // The width of the character image in the texture.
86 UINT16 height; // The height of the character image in the texture.
87 INT16 xoffset; // How much the current position should be offset when copying the image from the texture to the screen.
88 INT16 yoffset; // How much the current position should be offset when copying the image from the texture to the screen.
89 INT16 xadvance; // How much the current position should be advanced after drawing the character.
90 UINT8 page; // The texture page where the character image is found.
91 UINT8 chnl; // The texture channel where the character image is found (1 = blue, 2 = green, 4 = red, 8 = alpha, 15 = all channels).
93
95 sizeof (BMF_CHAR) == 20,
96 "BMF_CHAR struct must be packed"
97 );
98
99#define BMF_BLOCK_CHARS_ID 4
100
101//
102// This tag describes on character in the font. There is one for each included character in the font.
103//
105
106typedef PACKED struct {
107 UINT32 first; // The first character id.
108 UINT32 second; // The second character id.
109 INT16 amount; // How much the x position should be adjusted when drawing the second character immediately following the first.
111
113 sizeof (BMF_KERNING_PAIR) == 10,
114 "BMF_KERNING_PAIR struct must be packed"
115 );
116
117#define BMF_BLOCK_KERNING_PAIRS_ID 5
118
119//
120// The kerning information is used to adjust the distance between certain characters, e.g. some characters should be placed closer to each other than others.
121//
123
124typedef PACKED struct {
125 UINT8 signature[3];
126 UINT8 version;
128
130 sizeof (BMF_HEADER) == 4,
131 "BMF_HEADER struct must be packed"
132 );
133
134#pragma pack()
135
136#endif // BMF_FILE_H
UINT16 lineHeight
Definition BmfFile.h:57
UINT8 redChnl
Definition BmfFile.h:64
UINT8 spacingVert
Definition BmfFile.h:41
UINT16 width
Definition BmfFile.h:85
UINT8 paddingDown
Definition BmfFile.h:38
UINT8 greenChnl
Definition BmfFile.h:65
UINT16 y
Definition BmfFile.h:84
UINT8 paddingRight
Definition BmfFile.h:37
UINT32 second
Definition BmfFile.h:108
UINT16 x
Definition BmfFile.h:83
STATIC_ASSERT(sizeof(BMF_BLOCK_HEADER)==5, "BMF_BLOCK_HEADER struct must be packed")
UINT8 alphaChnl
Definition BmfFile.h:63
BMF_CHAR BMF_BLOCK_CHARS
Definition BmfFile.h:104
INT16 yoffset
Definition BmfFile.h:88
UINT8 outline
Definition BmfFile.h:42
INT16 xadvance
Definition BmfFile.h:89
UINT16 scaleW
Definition BmfFile.h:59
UINT8 page
Definition BmfFile.h:90
PACKED struct @103 BMF_BLOCK_INFO
UINT16 pages
Definition BmfFile.h:61
PACKED struct @107 BMF_HEADER
CHAR8 fontName[]
Definition BmfFile.h:43
PACKED struct @106 BMF_KERNING_PAIR
UINT8 paddingLeft
Definition BmfFile.h:39
UINT8 paddingUp
Definition BmfFile.h:36
BMF_KERNING_PAIR BMF_BLOCK_KERNING_PAIRS
Definition BmfFile.h:122
PACKED struct @105 BMF_CHAR
UINT32 id
Definition BmfFile.h:82
UINT32 first
Definition BmfFile.h:107
UINT16 scaleH
Definition BmfFile.h:60
CHAR8 BMF_BLOCK_PAGES
Definition BmfFile.h:79
PACKED struct @104 BMF_BLOCK_COMMON
INT16 xoffset
Definition BmfFile.h:87
UINT8 chnl
Definition BmfFile.h:91
UINT16 stretchH
Definition BmfFile.h:34
UINT16 base
Definition BmfFile.h:58
UINT8 version
Definition BmfFile.h:126
UINT8 aa
Definition BmfFile.h:35
UINT8 blueChnl
Definition BmfFile.h:66
UINT16 height
Definition BmfFile.h:86
UINT8 bitField
Definition BmfFile.h:32
INT16 amount
Definition BmfFile.h:109
UINT8 spacingHoriz
Definition BmfFile.h:40
UINT8 charSet
Definition BmfFile.h:33
UINT8 signature[3]
Definition BmfFile.h:125
INT16 fontSize
Definition BmfFile.h:31
UINT8 identifier
Definition BmfFile.h:14