OpenArena Message Boards

OpenArena => General => Topic started by: ibrown on September 13, 2005, 09:01:16 AM



Title: font1_prop.tga badly baselined
Post by: ibrown on September 13, 2005, 09:01:16 AM
I've noticed that the characters in font1_prop.tga are badly aligned. I  would like to use this resource in a GPL Q3 derived game I am developing - and so have been looking at fixing it. I have been tweaking the numbers in the ui.vm code and it looks almost okay now. It's just a hack though, and I was wondering what your thoughts are on how to do it properly.

i.e. Is the best way to change the numbers in the array used to locate the characters within the bitmap (ui_atoms.c), or is it best to change the bitmap to fix the existing matrix?
Are you planning on changing the bitmap? If so, could you please send me a copy?
How did you make the original bitmap? Did you use a tool or did you do it by hand?
Finally (phew) what was the original font that you used - was it one of the GPL'd verdana fonts or something like that.

Ian


Title:
Post by: fromhell on September 13, 2005, 10:06:29 AM
The font used was Bitstream Vera.

I did the font1_prop.tga manually :(


Title:
Post by: ibrown on September 14, 2005, 02:22:24 AM
okay, change the propmap array as follows and the baselines are correct. Some of the widths are still wrong, but it looks a lot better than it did:

static int   propMap[128][3] = {
{0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1},
{0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1},

{0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1},
{0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1}, {0, 0, -1},

{0, 0, PROP_SPACE_WIDTH},      // SPACE
{11, 122, 7},   // !
{154, 181, 14},   // "
{55, 122, 17},   // #
{79, 122, 18},   // $
{101, 122, 23},   // %
{153, 122, 18},   // &
{9, 93, 7},      // '
{207, 122, 8},   // (
{230, 122, 9},   // )
{177, 122, 18},   // *
{30, 152, 18},   // +
{85, 181, 7},   // ,
{34, 93, 11},   // -
{110, 181, 6},   // .
{130, 152, 14},   // /

{22, 64, 17},   // 0
{41, 64, 12},   // 1
{58, 64, 17},   // 2
{78, 64, 18},   // 3
{98, 64, 19},   // 4
{120, 64, 18},   // 5
{141, 64, 18},   // 6
{204, 64, 16},   // 7
{162, 64, 17},   // 8
{182, 64, 18},   // 9
{59, 181, 7},   // :
{35,181, 7},   // ;
{203, 152, 14},   // <
{56, 93, 14},   // =
{228, 152, 14},   // >
{177, 181, 18},   // ?

{28, 122, 22},   // @
{5, 4, 18},      // A
{27, 4, 18},   // B
{48, 4, 18},   // C
{69, 4, 17},   // D
{90, 4, 13},   // E
{106, 4, 13},   // F
{121, 4, 18},   // G
{143, 4, 17},   // H
{164, 4, 8},   // I
{175, 0, 16},   // J
{195, 4, 18},   // K
{216, 4, 12},   // L
{230, 4, 23},   // M
{6, 35, 18},   // N
{27, 34, 18},   // O

{48, 34, 18},   // P
{68, 32, 18},   // Q
{90, 34, 17},   // R
{110, 34, 18},   // S
{130, 34, 14},   // T
{146, 34, 18},   // U
{166, 34, 19},   // V
{185, 33, 29},   // W
{215, 34, 18},   // X
{234, 34, 18},   // Y
{5, 64, 14},   // Z
{60, 152, 7},   // [
{106, 151, 13},   // '\'
{83, 152, 7},   // ]
{128, 122, 17},   // ^
{4, 152, 21},   // _

{134, 181, 5},   // '
{5, 4, 18},      // A
{27, 4, 18},   // B
{48, 4, 18},   // C
{69, 4, 17},   // D
{90, 4, 13},   // E
{106, 4, 13},   // F
{121, 4, 18},   // G
{143, 4, 17},   // H
{164, 4, 8},   // I
{175, 0, 16},   // J
{195, 4, 18},   // K
{216, 4, 12},   // L
{230, 4, 23},   // M
{6, 35, 18},   // N
{27, 34, 18},   // O

{48, 34, 18},   // P
{68, 32, 18},   // Q
{90, 34, 17},   // R
{110, 34, 18},   // S
{130, 34, 14},   // T
{146, 34, 18},   // U
{166, 34, 19},   // V
{185, 33, 29},   // W
{215, 34, 18},   // X
{234, 34, 18},   // Y
{5, 64, 14},   // Z
{153, 152, 13},   // {
{11, 181, 5},   // |
{180, 152, 13},   // }
{79, 93, 17},   // ~
{0, 0, -1}      // DEL
};

static int propMapB[26][3] = {
{11, 12, 33},
{49, 12, 31},
{85, 12, 31},
{120, 12, 30},
{156, 12, 21},
{183, 12, 21},
{207, 12, 32},

{13, 55, 30},
{49, 55, 13},
{66, 55, 29},
{101, 55, 31},
{135, 55, 21},
{158, 55, 40},
{204, 55, 32},

{12, 97, 31},
{48, 97, 31},
{82, 97, 30},
{118, 97, 30},
{153, 97, 30},
{185, 97, 25},
{213, 97, 30},

{11, 139, 32},
{42, 139, 51},
{93, 139, 32},
{126, 139, 31},
{158, 139, 25},
};

You'll need to change it in both ui_atoms.c and also in cg_drawtools.

Ian


Title:
Post by: ibrown on September 16, 2005, 12:43:46 AM
Quote
Originally posted by jzero
One issue we should explore is the font redistribution one. I remember some major game -- I think Half-Life -- showing credits that told who they'd licensed the menu font from. I think this is because when you distribute a full character set, you're technically re-distributing the font design.
 

That's why I asked what the original font was. It's okay though because Bitstream Vera is a GPL font (they donated it to the gnome project). Look on the gnome page.

On a related note - I think it is actually the font program that is copyright rather than the design in general. So by the letter of the law it is okay to distribute the bitmaps.
Still, even though it is okay by the letter of the law, it is not really in the spirit of it and so it is better to use a 'free' font.

A better aligned font would be a better solution than hacking the numbers of course :)

Ian

[Edited on 16-9-2005 by ibrown]


Title:
Post by: fromhell on September 16, 2005, 03:06:07 AM
Well I only really hacked the font in quickly to replace what was previously used (evil Verdana)

I'm not going to change any code just to support the new font, for compatibility reasons.