Author Topic: Fonttool  (Read 5217 times)

0 Members and 2 Guests are viewing this topic.

Offline wojta

  • 25
    • http://fsworld.wz.cz
I've seen some tool which could convert PCX to the .VF files. It's in the source code released by Volition. Unfortunately I haven't required C++ compiler.  Has anyone FONTTOOL compiled ?

 

Offline Axel Wers

  • 26
  • I remember Descent: FreeSpace as a new game.
    • FreeSpace

 

Offline Stunaep

  • Thread Necrotech.... we bring the dead to life!
  • 210
It's that time again.

WelcomeBeam, target wojta and AxelWars.

Gunnery control, OPEN FIRE!

(you'd think I'd memorised the link by now, but still have to look it up every single time)

*points rear and left*

exits

*points to heavy artillery*

don't go near the exits.

*points to ventilation ducts*

Shivans

*points to carl*

LoveShivan
"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n
Bah. You're an admin, you've had practice at this spanking business. - Odyssey

 
 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
*hands Axel an anatomically correct Inflate-O-Shivan*
You never know when it might come in handy.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Yes, yes, welcome, welcome ;)

Back on topic: I doubt if anyone's ever tried to compile the fonttool.  But since I doubt anyone's messed with it, the odds of it working are pretty good...
your source code slave

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Never mind, it didn't even make it into fs2_open...

If you need it you've gotta get it out of the freespace2_public repository on warpcore... this is the initial release from Volition that Inquisitor put up there, so it hasn't been touched since then...

(I know this still doesn't answer the original post, but I can't imagine why it wouldn't work -- it appears to have no dependencies on any other FS2 code, it's just a converter.)
your source code slave

 

Offline wojta

  • 25
    • http://fsworld.wz.cz
Is it possible to create national characters for use with the Freespace ?

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Quote
Originally posted by wojta
Is it possible to create national characters for use with the Freespace ?
I don't see any reason why not...   But I only spent about 10 minutes looking at the font code; don't take this as the final word ;)  Look at .../code/graphics/font.* for details.

It looks like there are no restrictions on the number of characters that can be in a font, so theoretically you could have up to 255 in a font, since FS2 uses char * strings, not Unicode nor "wide" (multi-byte) characters.

The only thing that caught me was that a bitmap is allocated for each character in each font, so if there were a huge number of extra characters added, the system might run out of bitmaps, not sure if there's a hard limit on that or not.

In other words, adding Eastern European characters would be OK, putting in all of the Japanese kanji probably wouldn't...
your source code slave

 

Offline DTP

  • ImPortant Coder
  • 28
    • http://www.c4-group.dk
Quote
Originally posted by penguin
I don't see any reason why not...   But I only spent about 10 minutes looking at the font code; don't take this as the final word ;)  Look at .../code/graphics/font.* for details.

It looks like there are no restrictions on the number of characters that can be in a font, so theoretically you could have up to 255 in a font, since FS2 uses char * strings, not Unicode nor "wide" (multi-byte) characters.

The only thing that caught me was that a bitmap is allocated for each character in each font, so if there were a huge number of extra characters added, the system might run out of bitmaps, not sure if there's a hard limit on that or not.

In other words, adding Eastern European characters would be OK, putting in all of the Japanese kanji probably wouldn't...

E:\NEW_DIR\fs2_open\code\bmpman\bmpman.h(172):   #define MAX_BITMAPS 3500
VBB member; reg aug 1999; total posts 600.
War is a lion, on whos back you fall, never to get up.
Think big. Invade Space.

 

Offline Axel Wers

  • 26
  • I remember Descent: FreeSpace as a new game.
    • FreeSpace

 

Offline wojta

  • 25
    • http://fsworld.wz.cz
Quote
Originally posted by penguin


(I know this still doesn't answer the original post, but I can't imagine why it wouldn't work -- it appears to have no dependencies on any other FS2 code, it's just a converter.)

It's dependent on code.lib (over 900 files to compile). I have tried to compile it at the school. There are too slow computers. It could take several hours to complete the compilation. I haven't time to do it.
:(

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Quote
Originally posted by wojta

It's dependent on code.lib (over 900 files to compile). I have tried to compile it at the school. There are too slow computers. It could take several hours to complete the compilation. I haven't time to do it.
:(
ugh - good point.  Even though fonttool probably only needs a small subset of the objects in code.lib, there's no mechanism to make only those files...

One way to find out what's needed would be to take code.lib out of the fonttool project, and see what symbols are undefined.  Then build the object files that contain those symbols, and link them in... Rinse. Repeat.
your source code slave

  

Offline Inquisitor

I'll post a compiled 3.5 code lib with this release as well as a tarball of the fs2_open source.
No signature.

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
Using the original release FontTool will compile if you build it as a debug build. (It's not designed for a release build so you get linker errors about undefined functions due to, I assume, #ifdefs.) I've got one I compiled and could upload somewhere, though it's got the MSVC6 Introductory version nag screen. (BTW, it's a command line program.) Haven't actually tried doing anything with it as I don't really have any files for it to convert and nothing to test the resulting fonts with, but it runs and ought to work. Not sure if it will link right with the fs2_open version of code.lib.
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
(This is a little OT, sorry)

This thread brings up a bigger issue, some stuff that I was discussing in private w/ Maeglamor: as has been noted by a lot of people, there's some spaghetti code here :D

In particular, it's very difficult (to say the least) to extract one component of the fs2 code without including everything... Fonttool is a good example -- all it needs is to be able to read and write bitmaps and font files, but the entire code lib is pulled in (because the file system is tied to localization, bitmaps are tied to the graphics systems, etc...)

Again, no offense to DaveB and Volition -- their goals were different then ours: they needed to get a product out the door; they were paying real money to the developers, artists, testers, etc; they only had one platform they needed to support, etc...  And with a commercial product like FS2, maintenance isn't as big a deal: other than squashing post-release bugs, once it's out the door, you never need to look at the code again.  Taking all that into consideration, the FS2 code is pretty well organized, and it certainly suited their purposes, and obviously it's a damn fine game.

We live in a different world -- none of us are getting paid to do this (at least I'm not :nervous: ), so we don't have to worry about blowing the budget; we don't have a game publisher breathing down our necks to meet a release schedule (we have Quiz ;)); and it's more important for us to write our code in such a way that someone with less experience can pick up the pieces and do something useful.

Anyhow, this is my (minor) rant.  I guess what I'd like to see come out of this (at some point) is to split things up into more manageable modules that can be safely isolated from one another.  So if you need PCX utilities, you can just grab those parts.

Components I see that should be isolated from one another:
  • file management, including VP files -- used by everyone (fs2, FRED, fonttool, etc.)
  • bitmap, pcx, tga, etc. utilities (file format manipulators)
  • the graphics subsystems; each one -- DirectDraw, OpenGL, software, etc. -- should be independent
  • low-level TBL file parser
  • higher-level TBL file parsers (weapons, missions, etc.) Each one should be independent
  • input stuff (kb, mouse, joystick)
  • gameplay stuff -- this actually shouldn't be part of the code lib, as it's only relevant to fs2.exe
  • UI
  • sound and music
  • networking
I'm sure I'm missing some stuff here, but hopefully you get where I'm going with this...
your source code slave

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
There is one advantage to the way Volition structured the code: As long as you don't change any of the files that make up code.lib, you won't have to recompile it every time you make a change to a program that uses it. It only compiles code.lib if it doesn't exist or files it's made of were changed. And all the programs that needed it would share the same library. (And fred2_open can directly use the code.lib from fs2_open, as long as it knows where to find it.) A lot of the code is dependent on things in other files too which would make splitting it up harder and I don't see that it would be of much benefit. (FYI, they didn't just toss the code aside when the game was released, after all the code was originally made for FS1, updated for Slient Threat, and then upgraded to FS2. :) )
For the SCP, the minor programs have been dropped out of the codebase so fred2_open, fs2_open, and any new programs people want to make are all we need to worry about. And both fred2_open and fs2_open use most of the stuff in code.lib. On a file level, the various parts of the game are split up throughout the codebase which can make isolating a particular piece of the program easier, but makes tracing a function back to where it's originally called from take longer.
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I was thinking it might be good to do some objects, not a complete overhaul but for things like vectors, makeing an object that has oveloaded operators might be a good thing, right now vector math is... quite complex, you have to pick one of four vm_vec functions for any basic vecmath you oftine have to make sure that you don't give destenation vectors are source vector and it would be cool to beable to do things like vec*float rather than just going in and manualy changeing each value in the structure
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Quote
Originally posted by Bobboau
I was thinking it might be good to do some objects, not a complete overhaul but for things like vectors, makeing an object that has oveloaded operators might be a good thing, right now vector math is... quite complex, you have to pick one of four vm_vec functions for any basic vecmath you oftine have to make sure that you don't give destenation vectors are source vector and it would be cool to beable to do things like vec*float rather than just going in and manualy changeing each value in the structure

Yeah, a lot of this stuff could use a more object oriented interface.  And before everyone gets all agitated about this, let me qualify that... ;)

I don't mean huge layers of abstraction, polymorphism, etc.  Just having constructors and destructors and overloaded methods wouldn't affect performance at all, and would make development a lot easier.  Like Bob said, start small with things like the math package.
your source code slave

 

Offline wojta

  • 25
    • http://fsworld.wz.cz
Could anyone send me the compiled Fonttool ?

Why Volition didn't use a truetype font instead of creating the font from bitmaps ? It's my idea of improving FS2_OPEN.
« Last Edit: March 08, 2003, 10:56:17 am by 1066 »