Game Development Community

Font appearance varies with target computer

by Conor O Kane · in Torque Game Builder · 01/05/2008 (11:35 pm) · 2 replies

I'm using a custom .ttf font in my game, which I've converted to a .uft to distribute with the game. Here's how it looks on 3 different computers:

cokane.com/temp/font_glitch.jpg
The top line is how it looks on my development computer.
The 2nd line is how it looks on my laptop, and the 3rd line is how it looks on another computer.

I tried installing the .ttf on one of the other computers, and the appearance didn't change. Anyone else encountered it, and does anyone have a solution?

All 3 machines are running the same code, at 800 x 600 resolution, with a camera size of 800 x 600 also.

This is how the fonts are stored in the .t2d file:

new t2dTextObject() {
      canSaveDynamicFields = "1";
      superclass = "hudText";
      Position = "348.000 -277.000";
      size = "77.000 20.000";
      Layer = "2";
      CollisionPhysicsSend = "0";
      CollisionPhysicsReceive = "0";
      LinkPoints = "0.061 0.201";
      text = "damage";
      font = "hooge 05_53";
      wordWrap = "0";
      hideOverflow = "1";
      textAlign = "Center";
      lineHeight = "20";
      aspectRatio = "1";
      lineSpacing = "0";
      characterSpacing = "0";
      autoSize = "1";
      fontSizes = "20";
      textColor = "1 1 1 1";
         hideOverlap = "0";
         mountID = "81";
   };

#1
01/06/2008 (7:19 pm)
I've done some further testing...

here's a screenshot of the font not working on one of my computers:

cokane.com/temp/font_glitch2.jpg
and here's the exact same text object with the font changed to arial:

cokane.com/temp/font_glitch3.jpg
#2
01/06/2008 (9:01 pm)
Ok I fixed my own bug. By adding .1 to all the X and Y positions of bugged text objects, the problem went away. It looks like the font rendering system has trouble with objects that sit on whole number co-ordinates.

Text objects that I had manually dragged into position worked fine, only the ones where I had typed in whole number values for their X and Y locations were bugged.