Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Lynx on December 14, 2004, 07:00:18 pm

Title: Question regarding fonts
Post by: Lynx on December 14, 2004, 07:00:18 pm
Hey there,

Is it possible to make the game use another font than the stock ones for text like mission briefings, message tex and the likes? If so, how?
Title: Question regarding fonts
Post by: Grimloq on December 14, 2004, 09:00:19 pm
uh, theres some thing called 'volition font' files in the VPs. i would guess those are the fonts, but i dont think theres any way to MAKE that kind of file. it doesnt use the standard(-ish) ones.
Title: Question regarding fonts
Post by: Bobboau on December 14, 2004, 09:08:57 pm
you can make new fonts, there is a tool, I don't know how to use it
Title: Question regarding fonts
Post by: taylor on December 15, 2004, 12:28:40 am
You have to use fonttool.  I played with it a little when porting to Linux but didn't really experiment that much.  Basically you use a PCX file set out in a particular format.  16 colors max, 0 is the background (should be black), 15 is the box outline color (probably green), 1-14 are shades between black and white used for the letters.  You create the PCX with boxes set into groups with the characters in a particular order.  After you use fonttool to convert the PCX to a VF (volition font) you can edit the kerning and then it should be ready to use in game.  Easy ain't it! :D

I didn't think so at first either.  Here is what font02.vf looks like in it's PCX form (from the Freespace 1 Demo VPs):
Title: Question regarding fonts
Post by: karajorma on December 15, 2004, 03:42:09 pm
But you can only use one font at a time in game. Right?
Title: Question regarding fonts
Post by: taylor on December 15, 2004, 04:30:09 pm
Quote
Originally posted by karajorma
But you can only use one font at a time in game. Right?

Right, but different sizes (font01, font02, font03).  Mods could include new fonts if they wanted though.  I was going to do one as a demonstration for TBP but the Babylon Industrial font is just too heavy weight to have readable at 8pt. and I don't want to fight with it at present.
Title: Question regarding fonts
Post by: karajorma on December 15, 2004, 04:48:43 pm
How would you go about selecting a different size in FRED?
Title: Question regarding fonts
Post by: taylor on December 15, 2004, 06:59:14 pm
Quote
Originally posted by karajorma
How would you go about selecting a different size in FRED?

You don't, it's done in the code.  At least for all interface stuff.  Whenever something is set to be drawn to screen you call gr_set_font() to set FONT1, FONT2 or FONT3.  That's for the interface (menus, HUD stuff) but I suppose it would be possible to make something like a billboard floating in space with it's text controlled by a SEXP.  It should also be possible to make a font size change on the HUD controled by a SEXP, sort of like a modified EMP effect.  It would affect an entire string and not just individual characters which limits the coolness of it but maybe someone could make use of such a thing.  Assuming that something in FRED would use a specific text (like the requested name plate thing) then a SEXP setting the text would also be requesting which font and color to use.

The main problem with using fonts on a ship/model is that each character is drawn by itself so it would be rather slow to use.  I've been thinking about modifying the code to draw an entire string at the time but haven't had a chance to do it yet.  I'm really a bit too busy to think about any of that in detail right now but if you're interested in seeing something tagible then hit me up for it after Christmas.  Or you could get lucky and someone else will take care of it. :)
Title: Question regarding fonts
Post by: karajorma on December 16, 2004, 01:30:09 pm
Actually MG would need font changes more for the debriefs and briefings. How possible would it be to add another qualifier (Like $h, $f etc ) to change the font size a word or paragraph at a time?
Title: heh
Post by: Getter Robo G on December 17, 2004, 10:12:35 am
I'm lucky, the Robotech mod would use the Robotech TT font. Just have to get it converted now...