Font Asset

From COD Engine Research
Revision as of 21:15, 28 October 2014 by CraigChrist8239 (talk | contribs)

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

Modern Warfare 2 font image for PS3
#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 Font_s
{
  const char * name;
  int pixelHeight;
  int unknown2;
  int glyphCount;
  int unknownCount1;
  Material * material;
  Material * glowMaterial;
  Glyph * glyphs;
  char * unknownData;		//Size = unknownCount1 << 3
};