Hey, we have forums!

Author Topic: Is font.glf file actually being used?  (Read 9905 times)

0 Members and 1 Guest are viewing this topic.

Offline Nacery

  • Mini Bit
  • **
  • Posts: 2
    • View Profile
Is font.glf file actually being used?
« on: October 17, 2011, 11:13:34 pm »
I was using GLFont2 to remake the aquaria TROJAN PRO REGULAR font that is used in menus and subtitles so it contains all the 32-255 character set that are needed to render all european languages as can be Spanish or Polish but seems that this file isn't used anymore and the font coordinates are hard coded into the game to only use english alphabet.

Is there any way to modify this?
« Last Edit: October 17, 2011, 11:15:54 pm by Nacery »

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: Is font.glf file actually being used?
« Reply #1 on: October 18, 2011, 04:19:17 am »
You are right, the game uses only data/font-small.glf and data/font.ttf.

Code: [Select]
void DSQ::loadFonts()
{
debugLog("loadFonts...");

destroyFonts();

font.load("data/font-small.glf", 1, false);
font.fontTopColor = Vector(0.9,0.9,1);
font.fontBtmColor = Vector(0.5,0.8,1);
font.overrideTexture = core->addTexture("font");

smallFont.load("data/font-small.glf", 0.6, false);
smallFont.fontTopColor = Vector(0.9,0.9,1);
smallFont.fontBtmColor = Vector(0.5,0.8,1);
smallFont.overrideTexture = core->addTexture("font");

smallFontRed.load("data/font-small.glf", 0.6, false);
smallFontRed.fontTopColor = Vector(1,0.9,0.9);
smallFontRed.fontBtmColor = Vector(1,0.8,0.5);
smallFontRed.overrideTexture = core->addTexture("font");

subsFont.load("data/font-small.glf", 0.5, false);
subsFont.fontTopColor = Vector(1,1,1);
subsFont.fontBtmColor = Vector(0.5,0.8,1);
subsFont.overrideTexture = core->addTexture("font");

goldFont.load("data/font-small.glf", 1, false);
goldFont.fontTopColor = Vector(1,0.9,0.5);
goldFont.fontBtmColor = Vector(0.6,0.5,0.25);
goldFont.overrideTexture = core->addTexture("font");

debugLog("ttf...");
arialFontData = (unsigned char *)readFile("data/font.ttf", &arialFontDataSize);
if (arialFontData)
{
fontArialSmall   .create(arialFontData, arialFontDataSize, 12);
fontArialBig     .create(arialFontData, arialFontDataSize, 18);
fontArialSmallest.create(arialFontData, arialFontDataSize, 10);
}
debugLog("done loadFonts");

/*
//gold
smallFont.fontTopColor = Vector(1,0.9,0.5);
smallFont.fontBtmColor = Vector(0.6,0.5,0.25);
*/

//Texture::format = GL_LUMINANCE_ALPHA;

//Texture::format = 0;
}

Does it work when you rename the file to font-small.glf ? I can't seem to find any evidence in the code that the coordinates are hard-coded... So it should be possible to use other glyphs as well.
The file data/font.txt is not used either. Looks like an older version of the game read its font coordinates from this file, but not anymore.

Also, could you post your modfied glf file? I want to see how it works :)

Offline Nacery

  • Mini Bit
  • **
  • Posts: 2
    • View Profile
Re: Is font.glf file actually being used?
« Reply #2 on: October 18, 2011, 12:34:36 pm »
This is the font.glf that I made thinking that aquaria still used it, but it seems that it only uses the font.png texture and it's coordinates are coded into the game without requiring a font.glf file anymore.

http://www.mediafire.com/?10nx2cb72h52gxc
« Last Edit: October 18, 2011, 12:51:44 pm by Nacery »

Offline Alec

  • Administrator
  • Dream Bit
  • **********
  • Posts: 2211
    • View Profile
Re: Is font.glf file actually being used?
« Reply #3 on: November 19, 2011, 10:36:53 am »
I always read .glf as GILF. Terrible of me.  O0

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: Is font.glf file actually being used?
« Reply #4 on: November 19, 2011, 04:40:09 pm »
Off topic: this ? Wut? :o