Author Topic: Feature Request: 4th font (especially for fiction viewer)  (Read 8823 times)

0 Members and 1 Guest are viewing this topic.

Feature Request: 4th font (especially for fiction viewer)
I implemented a patch which will add a forth font (font04.vf) to the game and uses it in the fiction viewer.
This doesn't change retail behavior since the font loading code doesn't crash if a font file isn't present. The font is simply marked with an invalid id which I check for
in the code.
So the code loads and uses the font for the fiction viewer if present, and it does use the default font if not present.

One could use this later to actually specify a certain front in FRED somewhere for briefings or whatever, always falling back to the default font.

Saga would really like to have this, since the default font01 isn't very readable for fullscreen pages of text and we have a better font for the ficiton viewer.
We can't simply switch font01 however since it is used in the HUD.

[attachment deleted by admin]

 
Re: Feature Request: 4th font (especially for fiction viewer)
Keldor: I think this was discussed in a previous thread. We'd much rather implement it such that mods specify a font through other means than hardcoding.
The technique implemented in that patch is ugly for just one mod.

It's not just that we check to ensure that it doesn't change retail behaviour. The implementation must always be clean and looking towards the future.

My $0.02.
STRONGTEA. Why can't the x86 be sane?

 
Re: Feature Request: 4th font (especially for fiction viewer)
I didn't see that thread or any discussion about it.
So in this case my next question would be.. is anybody working on that? And how would a mod be supposed to specify this.

And there's also one other thing in this patch which might still be worth implementing... I also added several lines where the fiction viewer actually recalculates the line length, based on the data of the actual font. Before it used hardcode data so when you switched fonts, some of the text didn't show up.
This part at least would be needed if a font switching was ever done.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Feature Request: 4th font (especially for fiction viewer)
IMHO we need something like mod.tbl or mod.xml for defining all the things needed for mods... Like this one.

And yes, i think the both the features are worth implementing - that is custom fiction viewer font as well as the rest.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: 4th font (especially for fiction viewer)
Yes, I'm planning to add the font feature shortly.  I can't simply merge your patch though, as we want to allow the user to specify different fonts.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: 4th font (especially for fiction viewer)
Okay, try this one out.  You'll need to add a new fonts.tbl to your tables directory, like this:
Code: [Select]
#Fonts

$Font: font01.vf
$Font: font02.vf
$Font: font03.vf

#End

There are slots for up to five fonts, so you can swap between two fiction viewer fonts if you want to.

You'll also need to add a line to the fiction viewer section, as follows:
Code: [Select]
#Fiction Viewer

$File: [text file]
$Font: [font file]

Builds are here:
http://fs2source.warpcore.org/exes/latest/font-test.zip

 
Re: Feature Request: 4th font (especially for fiction viewer)
Goob: I don't like the idea of adding a fonts table just for that
If we're using extra resources, they should go in a mod table, rather than have a table for every possible resource.
Also, why 5 fonts?
STRONGTEA. Why can't the x86 be sane?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: 4th font (especially for fiction viewer)
Goob: I don't like the idea of adding a fonts table just for that
If we're using extra resources, they should go in a mod table, rather than have a table for every possible resource.
No, it makes sense to have a fonts table.  This is very similar to adding a new hud gauge or shield effect; you have a list of predefined resources that you can use over the course of the game.  A table is the standard way to handle resources like that.

Quote
Also, why 5 fonts?
As I mentioned, this is so they can swap between two fiction viewer fonts if they want.

 

Offline Woolie Wool

  • 211
  • Fire main batteries
Re: Feature Request: 4th font (especially for fiction viewer)
Okay, try this one out.  You'll need to add a new fonts.tbl to your tables directory, like this:
Code: [Select]
#Fonts

$Font: font01.vf
$Font: font02.vf
$Font: font03.vf

#End

There are slots for up to five fonts, so you can swap between two fiction viewer fonts if you want to.

You'll also need to add a line to the fiction viewer section, as follows:
Code: [Select]
#Fiction Viewer

$File: [text file]
$Font: [font file]

Builds are here:
http://fs2source.warpcore.org/exes/latest/font-test.zip

What sort of fonts are supported? VF? How would one make such a font? I think if this is really pursued to a serious degree, then TTF support should be added as well.
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: 4th font (especially for fiction viewer)
Only .vf.  Taylor wanted to add .ttf support at one point, but there are currently no plans to do so.

 
Re: Feature Request: 4th font (especially for fiction viewer)
Goob: Why 5? Why not use a SCP_vector and make support for a whole lot more while you're there?
5 doesn't really allow you to do something like have a different font for every fiction thing, OR allow you to mix fonts in the same screen.
STRONGTEA. Why can't the x86 be sane?

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Feature Request: 4th font (especially for fiction viewer)
Hmm... SCP_vector might well fit into this one. Also another thing.. How about moving this potential other tables into something like 'mod.tbl'. That is instead of having multiple rather small table files floating around.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Feature Request: 4th font (especially for fiction viewer)
I don't see what that would accomplish... (mod.tbl fonts)

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: 4th font (especially for fiction viewer)
Goob: Why 5? Why not use a SCP_vector and make support for a whole lot more while you're there?
5 doesn't really allow you to do something like have a different font for every fiction thing, OR allow you to mix fonts in the same screen.
Because I wasn't interesting in coding a huge new feature just for the sake of doing so, or making more changes than were necessary.  I was using the philosophy "make everything as simple as possible, but no simpler".

The feature I coded meets all the requirements for Wing Commander Saga and any other campaign that might use a separate font for the fiction viewer (like Scroll or MindGames).  It allows a separate font to be used, while avoiding the pitfall of hard-coding it to the WCS mod or any other mod.  It is flexible, allowing different font names to be used - not only for the viewer, but for the main interface as well.  Finally, it is designed in such a way that it can be upgraded easily in the future: if someone decides that they absolutely must have dynamic font limits, it would be very straightforward to convert the array to use SCP_vector.  In the meantime, none of that extra work is needed.

As for mixing fonts in the same screen, that is a feature that's orders of magnitude more complicated than what was requested here.  It is not necessary for either WCS or SA.


How about moving this potential other tables into something like 'mod.tbl'. That is instead of having multiple rather small table files floating around.
What would that accomplish?  FreeSpace is already designed around "multiple rather small table files".  Separation of concerns is ideal for organization as well as for keeping features distinct.  There's no reason to have, for example, species_defs.tbl and fonts.tbl merged into the same "mod.tbl".  It's counterproductive and sloppy.

There is only one valid reason for combining tables, and that's to avoid the overhead required for opening and closing multiple files in sequence.  But even that can be solved by packaging the mod in a .vp file.

 

Offline Woolie Wool

  • 211
  • Fire main batteries
Re: Feature Request: 4th font (especially for fiction viewer)
Only .vf.  Taylor wanted to add .ttf support at one point, but there are currently no plans to do so.

So how do you make a .vf? I have never heard of any tools capable of doing such a thing.
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Feature Request: 4th font (especially for fiction viewer)
So how do you make a .vf? I have never heard of any tools capable of doing such a thing.
You make a bitmap, and then you use the fonttool program (in the retail code release) to turn it into a .vf file.

 
Re: Feature Request: 4th font (especially for fiction viewer)
Btw, does anyone have that fonttool working correctly? I can easily create fonts with it, but loading the font to edit the kerning doesn't work because the tool somehow fails to initialize the graphics. Probably because it isn't compiled against the new library. Does anyone have a  current build of that tool among the SCP which loads up the fullscreen kerning editing without problems?

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Feature Request: 4th font (especially for fiction viewer)
Where's this fiction viewer that people speak of?
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Feature Request: 4th font (especially for fiction viewer)
As far as I know, it appears before(?) some missions, sort of like a briefing I guess, but just text.

Edit:

http://www.hard-light.net/wiki/index.php/Fiction_Viewer

Edit, the Second:



Edit Numero Trois:

Odd, that image won't display. Here's the URL: http://www.hard-light.net/wiki/index.php/File:FictionViewer.jpg

Quatrième Edition:

Here we go! Damn, I feel stupid...

« Last Edit: December 28, 2009, 08:53:26 pm by Aardwolf »

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Re: Feature Request: 4th font (especially for fiction viewer)
Nice.
I'll look into this.
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png