q3font problems


(chavo_one) #1

Has anyone used q3font to create custom fonts for their menus and such? I tried using it, but when I loaded the game, letters were drawn overtop of each other and it was generally a mess.

So I took the time to figure out the glyph system in the code so that I could understand why my font wasn’t working. During my investigation, I decided to create my own courier bold 21 font (just like the official font used in ET) to see if q3font would create the same output as the official .dat/.tga files. Well, it didn’t. And the problem is the pitch value of the characters are all wrong in the q3font generated output. Has anyone experienced this? I can’t imagine that everyone is going to use the same fonts as ET in their mods.

For those of you wondering what in the world pitch is, here’s a quick rundown on the important properties related to character spacing.

pitch, imageWidth, and xSkip

Ignoring any scaling (which would be constant across all three values), here’s my understanding of how the game spaces characters:


                 ########                       
                ##########                      ###
               ###      ###                     ###
               ###      ###                     
               ############                     ###
               ############                     ###
               ###      ###                     ###
               ###      ###                     ###
|<--pitch-->||<-imageWidth->|   |<-pitch->||<-iWidth->|
|<------------xSkip----------->||<---------xSkip-------->|

where:
imageWidth is the width of the character
pitch is the indentation
xSkip is the sum of the character and the left and right margins

But again, does anyone know why q3font spits out really bad pitch values?


(Domipheus) #2

yep, its becaust ‘current’ q3font is not compatible with ET.

The ET system was totally rehauled because the q3 way can lead to really limited font choices. I would suggest you just make your own, put a layer over the old font map, fade the old font map out so it is just visible, and then view a grid over the image so u know where to put the characters, messy, but unless you can grasp the new 'q3’font from sd its your only choice.


(hollowgrave) #3

I have the same problem, the letters seem to overlap everytime you use the q3font generator. Wish there was a better solution.


(Domipheus) #4

did you even read my reply?


(hollowgrave) #5

yeah i read your reply, but i don’t have the time to do that, i have too much other code to do for the Price of Peace mod…

http://pop.rtcwfiles.com


(chavo_one) #6

The output from the ‘current’ 'q3’font is not completely worthless though. It’s only the pitch values that are wrong. I haven’t tried it yet, but I am going to try substituting the pitch values from the ET courierbd21 into my homemade courierbd21 and see if it works properly.

In general, if you make sure that pitch + imageHeight = xSkip then you should get passable results.


(RR2DO2) #7

We got an updated q3font that produces correct tga/dat files, I’ll just need to poke some people to get it released.

  • Arnout ‘RR2DO2’

(chavo_one) #8

great news! :slight_smile:


(hollowgrave) #9

Hey Arnout, any luck with the poking of people and allowing you to release the updated q3font?


(faltytower) #10

:poke:

Ummm, I think you need to poke them with a torch.


(RR2DO2) #11

ET compatible q3font: http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&p=86583

use -createex


(faltytower) #12

^^ yeX ^^ :clap: :clap:

Much <3 to RR2DO2.


(hollowgrave) #13

Thanks RR2DO2, your the best!!! :clap: :clap: :banana: :banana: :notworthy: :notworthy:


(chavo_one) #14

Thanks so much RR2DO2 !
Looking good faltytower!

Unfortunately, I’m having problems getting it to work. Perhaps one of you can help me out:

This error has occurred for me on two different PCs. Am I missing an argument? If I change -createex to -create, it doesn’t have this error.


(RR2DO2) #15

Put the font in the same directory as the tool, else it will try to write to “fonts/c:\windows\fonts\courdb_0_21.tga”

whoops :slight_smile:

I’ll see if I can put a new version out soonish

EDIT: new version up, will now handle absolute paths properly.


(chavo_one) #16

:fiesta: Works like a charm.


(nUllSkillZ) #17

I’ve got a problem with custom fonts.
I would like to make a grphic mod.
o I’ve created the fonts using q3font.
I’ve renamed the files to “ariblk_x.tga” / “ariblk_y.dat” and packed them using the path “fonts” into a pk3-file.
But if I startthe game I only see the black / orange “no texture” texture where the fonts should be.
Thnx in advance.


(nUllSkillZ) #18

Easy solution of my problem:
The ttf-font-file has to be renamed to for example ariblk.ttf before converting it with q3font.


(Magic_Al) #19

Sorry if I’m slightly off-topic but I can’t find much q3font discussion elsewhere.

I’m trying to create a font for Jedi Knight II: Jedi Outcast and Jedi Academy and although it looks like q3font is giving me a nice .tga I’m not sure if the .dat file is compatible. I’m trying to replace one of the game’s default fonts and I notice JK2 uses .fontdat instead of .dat files. When I decompile it appears very similar. But, fonts I create aren’t working. I rename .dat to .fontdat. If I don’t replace the game font’s original .fontdat file I see bits and pieces of my font in game (my .tga being misaligned with the game’s original .fontdat), but if I load my custom .fontdat then the in-game text is completely blank.

I notice after decompiling the custom .dat file, it contains a filename that would be incorrect since it’s not the same as the game’s default font filename, but I corrected this and recompiled, so that’s not why it doesn’t work.

Comparing the game’s original .tga to mine, I notice the characters in the game’s original .tga are spaced out much more horizontally than in the .tga created by q3font, and there are more blank characters at the beginning of the first line. I thought the custom .dat/.fontdat file would compensate for these differences but I’m getting nothing in game.

Any ideas, anyone?

(My project is to replace JK2’s fugly “ergoec” font used for cutscene captions with the Franklin Gothic font used in the Star Wars movies. It’ll look nice if I get it working!)


(hellkn1ght) #20

Hi,

I’ve got a problem with the changed font in Enemy Territory.
Used q3font to create a custom font which worked quite well: The font in ET has changed, BUT: The personal Killmessage that appears in the Lower Mid of the screen (“You killed XYZ”) is still written in the default ET font.

How can I change this one, too?

pic: