Font Asset: Difference between revisions
Red-EyeX32 (talk | contribs) |
Aerosoul94 (talk | contribs) |
||
| Line 59: | Line 59: | ||
}; | }; | ||
#pragma pack(pop) | #pragma pack(pop) | ||
struct KerningPairs | |||
{ | |||
unsigned __int16 wFirst; | |||
unsigned __int16 wSecond; | |||
int iKernAmount; | |||
}; | |||
struct Font_s | struct Font_s | ||
{ | { | ||
const char * | const char *fontName; | ||
int pixelHeight; | int pixelHeight; | ||
int | int isScalingAllowed; | ||
int glyphCount; | int glyphCount; | ||
int | int kerningPairsCount; | ||
Material * material; | Material *material; | ||
Material * glowMaterial; | Material *glowMaterial; | ||
Glyph * glyphs; | Glyph *glyphs; | ||
KerningPairs *kerningPairs; | |||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:46, 27 December 2014
Font assets control what else; the fonts! Every Call of Duty game so far has had a font asset type, and it has changed very little.
Infinity Ward Games & World at War & Black Ops 1

Note that S1 (Advanced Warfare) is an extension of IW6, therefore it fits here.
#pragma pack(push, 2)
struct Glyph
{
unsigned __int16 letter;
char x0;
char y0;
char dx;
char pixelWidth;
char pixelHeight;
float s0;
float t0;
float s1;
float t1;
};
#pragma pack(pop)
struct Font_s
{
const char * name;
int pixelHeight;
int glyphCount;
Material * material;
Material * glowMaterial;
Glyph * glyphs;
};Black Ops 2
Black Ops 2 is proving to be the only game that changes the font structure so far.
#pragma pack(push, 2)
struct Glyph
{
unsigned __int16 letter;
char x0;
char y0;
char dx;
char pixelWidth;
char pixelHeight;
float s0;
float t0;
float s1;
float t1;
};
#pragma pack(pop)
struct KerningPairs
{
unsigned __int16 wFirst;
unsigned __int16 wSecond;
int iKernAmount;
};
struct Font_s
{
const char *fontName;
int pixelHeight;
int isScalingAllowed;
int glyphCount;
int kerningPairsCount;
Material *material;
Material *glowMaterial;
Glyph *glyphs;
KerningPairs *kerningPairs;
};