Jump to content

CnCNet Forums

Search In
  • More options...
Find results that contain...
Find results in...

Westwood Font Editor [Development thread]


Nyerguds
 Share

Recommended Posts

Current version: 1.13.3 (2019/03/21 16:28)

fonteditor_20_vcr_1.7.1.png

The project is built on the .Net framework v3.5
Its code is licensed under the WTFPL.

Download:
Downloads folder
Full readme

Source code: (C#)
Sources folder

 

Full list of supported types / games:
 

WWFont v1:

  • Wargame Construction Set
  • A Nightmare On Elm Street
  • DragonStrike
  • Circuit's Edge

WWFont v2: (Note: the save routine for this type is currently set to optimise the size by removing duplicate image data, but I'm not sure if the games support this)

  • BattleTech: The Crescent Hawk's Revenge
  • Eye of the Beholder
  • Eye of the Beholder II: The Legend of Darkmoon

WWFont v3:

  • The Legend of Kyrandia
  • Dune II
  • Lands of Lore The Throne of Chaos
  • The Legend of Kyrandia Hand of Fate
  • The Legend of Kyrandia Malcolm's Revenge
  • The Legend of Kyrandia Malcolm's Revenge Installer
  • Command & Conquer
  • Command & Conquer Installer
  • Command & Conquer Red Alert
  • Command & Conquer Red Alert Installer
  • Lands of Lore Guardians of Destiny
  • Lands of Lore Guardians of Destiny Installer
  • Command & Conquer Sole Survivor
  • Lands of Lore III

WWFont v4:

  • Tiberian Sun
  • Tiberian Sun Installer
  • Tiberian Sun Firestorm
  • Tiberian Sun Firestorm Installer
  • Lands of Lore III Installer

IGFont (Dune 2000 was made by Intelligent Games, not by Westwood)

  • Dune 2000

BitFont:

  • Red Alert 2 (internal developed use only)

Unicode BitFont:

  • Red Alert 2

Original first post:


As I sort of mentioned a while back, I got tired of the lack of font editor for C&C1, and even more tired of Siberian_GRemlin sitting on his (working) version for about 10 years now.

So I've decided to make my own in c#. With the help of the RA++ team (Omniblade, CCHyper & Tomsons26, anyway) I figured out the font format itself, and managed to make code to read it and show it as image. Apparently this format is used for quite a bit more than C&C1 and RA1; we used fonts from Legend of Kyrandia as test material as well, and apparently this should support Dune II too.

Fonts have no colour palette of their own. They are 4-bit (meaning, 16 colour) images that, much like SHP files, receive colours from the game at the moment they're drawn. So I started off by generating a simple black-to-white fade for the palette, with black as the background color. This version also already moved the character down according to the extra Y-offset in the file.

fonteditor_00.png

Next step: making an actual editor. I already had a zooming pixel image viewer from a little C&C-N64 project I worked on in the past few weeks, so that part was no problem (as already seen in the previous image). So the next step: drawing an editing grid on it. Well, I say "on it", but actually I needed three extra image layers positioned both behind and in front of the original image to pull it off, lol. Transparency is a strange thing in .Net controls.

fonteditor_02_grid.png

Next was getting a pixel drawn on that to indicate your editing position. That was easier than expected, really, and now I had a nifty giant pixel following my mouse around. Also note the fancy program icon; Tomsons26 made that :)

fonteditor_03_mousetrackpixel.png

I decided, around this time, to switch to a more colourful palette that would let you easily distinguish the different indices when editing. I just basically went over all hue values and made a nice little rainbow. I also coded in some extra behaviour to allow disabling the grid, and the red frame that shows you which part of it is actually editable.

fonteditor_05_rainbowpalette.png

Of course, an editor is utterly useless if it can't actually save files, a little detail Siberian_GRemlin seemed to forget when he released a "demo" of his editor... eight years ago now. So after editing worked, I went into the mess of trying to save the image data back to palette.

It took a few tries to get it right. :huh:

But, finally, I managed to get a saved file!

HO0ulQxp.png

No, wait, crap, that's one of the failed ones. Ahem. Anyway. The pic I linked before shows the final successful attempt. There's a little pixel I made transparent, in the middle, to prove it was actually edited. Trust me, it was orange originally :P

Now, there's just one thing still missing from the editor... and that's, well, the actual editing, more or less. I could only change the colour to one specific one with the left mouse button, and to background (transparency) with the right mouse button. So I dug up another nice control I had lying around for one of my older projects, namely a palette-loading colour selector. Took some time to adapt it, since the original was meant for 256 colours, but, I'm happy with the final result!

fonteditor_07_palette.png

It's starting to look good, no? :)

At this moment, it's still missing some vital features, though; you can't change the size of the images or their Y-offset, and you can't add new character images to a font. These will come later, but at this moment, I do actually have a working editor.

It's obviously still beta at the moment, but to anyone who wants to mess around with it, here it is:

Westwood Font Editor v0.4

The source code is in the folder too, for those who are interested.

Link to comment
Share on other sites

Not ANOTHER tool Nyer! You're hooked making extremely useful things for us all :P

 

I will try to resist the urge to make a new font for my C&C game as scope creep is a leading cause of death among mod developers but even so, sweet work dude! :cncsmirk:

 

Your 2 looks very Hotline Miami in that editor :P hehe

Link to comment
Share on other sites

New progress: editable Y-offset! Also, a revert button to undo all changes to the current character. I also changed the internal architecture somewhat, by putting all different properties of one character entry into a single object, so I only have one list of internal data instead of four parallel ones. Much more manageable.

 

fonteditor_08_y_oh_y.png

 

After I implement editable width and height, and X and Y shifting of the image data, I'll make another public release :)

 

Dune 2000 fonts are not supported I guess?

I honestly have no idea, but given the fact that game barely uses any WW file formats, I suppose not. If you got any specs and test files, though, I might be able to implement it. You never know; might not be too hard. The current editor is focused on 4-bit fonts though.

Link to comment
Share on other sites

Two of the main features finished:

  • A real list of characters, replacing the small index based number selector.
  • A listing of text encodings, so you can immediately compare your characters with the target encoding.

Showcased on the Central European font used in the Polish language pack:

fonteditor_09_list.png

Link to comment
Share on other sites

A little experiment for possibly implementing Dune 2000 font support (since that's an 8-bit font)... dynamic changing of the palette control to adapt to a larger amount of colors. Basically, they're calculated to use 1/8th of the color label size as in-between spacing.

The hardest part was actually modifying the font size for the transparency/empty indicators so they'd still be visible.

fonteditor_10_eightbitpal.png

Link to comment
Share on other sites

v1.0 is finished! This adds pretty much all features I wanted for it:

  • Changing image dimensions
  • Shifting image data up/down/left/right
  • Copying/pasting entire characters
  • Color picker
  • Adding/removing characters
  • Changing the overall font's maximum size

Note that the mouse scroll wheel is specifically disabled in the main font's settings (number of character and max width & height) to avoid accidentally messing stuff up; decreasing the amount of characters simply removes the excess without prompt, and decreasing the font size cuts all characters in the entire font down to the new size.

fonteditor_11_firstrelease.png

The only thing still left to do for now is figuring out how to add some kind of real palette loading/saving support. Currently, colours can be edited by double-clicking them, but these palette changes can't be saved inside the program, and the only way to reset the palette is to restart the program.

Link to comment
Share on other sites

Cool

 

Dune 2000 fonts are not supported I guess?

I added experimental Dune 2000 support in the new version (1.2.1), but the format is pretty weird, and several of the letters in the font seem to have errors even when read exactly like the header describes, and there's no extra info anywhere in the file that could fix it. Could you give it a test run, and see if the game accepts the fonts produced by the editor?

 

It's possible that you need to edit the first byte in the file to 00 to make it work. Please test that too.

 

By the way, I couldn't match the characters to any existing text encoding... really weird. I even disabled my internal filtering on ascii-compatible and 1-byte-only encodings, and still nothing matched.

Link to comment
Share on other sites

Well, it's more like, 5 formats, now. I added the games list tomsons26 so kindly provided :P

We've been digging through some really ancient Westwood games, lol.

On 2016-11-28 at 1:51 AM, Kilkakon said:

Ah you are right, I see that now :) I've never tried putting numbers there. Heh, lose a mission and get "Error code: 2"? :P

I took the number 2 mostly because its center showed off all the colours nicely  :P

Link to comment
Share on other sites

Um. The TS ones? Inside the .mix files, where else? Anything ending with .fnt is a safe bet.

 

I just implemented a new feature: color tracking. In color picker mode, the palette will highlight the color entry you're currently hovering over in the image, and a popup with the color index and value will appear on the editing grid.

 

fonteditor_15_colorpicker_upgrade.png

 

Next is palette support. When that's finished I'll be making a new release.

Link to comment
Share on other sites

Whoo, did some bug fixes, and ended up adding some new features.

v1.4:

  • Clipboard copy can now also be pasted as image in other applications.
  • The correct symbol will be opened even when the grid columns are reordered.
  • Added preview pane at the bottom.
  • Opening a file by double-clicking in the dialog can no longer paint a pixel.
  • The symbol image now refreshes correctly after a palette revert.
  • Symbols in the grid are no longer centered but drawn at the correct position.

fonteditor_17_preview.png

Link to comment
Share on other sites

lol. "Here's a test with special characters! Very pretty, isn't it?"

It's funny, actually; for the characters listing in the grid I only needed to make that Dune 2000 text encoding one-way (byte -> character), but I decided to implement the other way (character -> byte) while I was at it anyway. And because of that, this thing worked with it right away :D

Then again, the Dune 2000 reordering system was only ever meant for character -> byte (well, character to font index, but that's the same thing, really), so that one was easy compared to the one I originally needed.

On the actual preview generation side, the thing that took the longest was actually auto-wrapping (yes, it does auto-wrapping, though, character based, not word based) and support for line breaks, heh.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Similar Content

    • By Turbotol
      edit:
      Had to do with my screen settings. I have 3 27inch monitors and the software does not like that.
    • By [Spro]Sin
      The new update the game has made this game a far worse game for me 
      I have been doing much Research of my own hours of testing 
      This is a complex topic that have too sides i understand this 
       
      nicknamed Steroid Tanking by crush, many alternative ways of tanking turned out too exist
       the known ways of tanking are q tanking gq tanking & sgq tanking
      the crush video link cheat methed to used here  ,,,> https://www.youtube.com/watch?v=J7Qhj9Nqtx8
       
      alt & g & q  tanking worked before the update for some pros 
      it no longer works
      I don^t fully understand the buttons used or the timing needed 
       
      also gq & q together sametime I used myself mostly in mini q master games vs others pros noobs & the ai no longer works 
      too understand what this is dual q & gq marge into one 
      gq-ing your tanks & q-ing your tanks at the same time has the traits of both q & gq is powerfull tanks auto fire like in gq but by also q-ing u also fire kill more tanks by aiming your self as well
       
      The topic cheating come up on Steroid Tanking  yes many players used the hotkey editer too bind keys into one button yes I agree this is cheating
      but Steroid Tanking its self is not cheating and should not be considerd as cheating it was used be possable hold down 2 buttons on your keyboard same time tank this way do the same kind of thing without cheating of any kind at least with my way of using it 
       
      Steroid Tanking was  a closely guarded secret by many pros who used it myself too i didn't know other pros had there own ways of using it but also I know there was lot more out there then what meets the eye 
      In a black & white world of q gq & sgq its turns out colour existed too
       
      i wish only too preserve game mechanics from being lost forever 
       
      I have many online friends on cncnet i don't want lose my friend ships and the game used to the best game in the world to me there never be a game as this one was 
      however am looking for a new game get into now. red alert 1 was good in its day 
       
      i don't want to cause a butterfly effect but i know philly retire too if I do a lot players be upset too petersky cloutiers return not go well 13clan members be upset many others friends of mine too 
      but the fun in the game is gone for me becouse this patch and update has set the game on the wrong path 
       
      what am asking for is fix the patch so hotkeys work without using cheats too gq & q same time is a tanking style where tanks can be in a q & gq state at the same time and i wish safe as many other ways of tanking as possable
       
      but i dont want players using key binding as this is cheating but there is a differences holding down many buttons with fingers on keyboard and using the hotkey editer to do this 
       
      The level of play in red alert 1 has gone up over the years for many years players didn't know gq existed only use q
      ehy used gq as well he know of it before many others its what made him so powerful in tank batties  
      sadly my understanding of far past is limited but I been here for a long time about 7 years online back then updates didn't hurt the game in any way i know of at least
      ehy was skilled at making super tesla too ended up getting a update that got super tesla added bug fix settings  
       
      i think another fix is just add Steroid Tanking as a setting players room host can turn on or off  same way super tesla works 
      it make both sides happy 
       
      red alert 1 is a very unique game hotkeys & base walking 
      being able too q & gq simultaneously 1 group of tanks is what made game fun for me 
       
      my decision too retire or not is not set in stone all options are on the table its not too late yet 
      its depends on if this update patch gets fixed or not and the responses too my posts 
       
       
       
       
       
       
       
       
       
       
       
    • By Archangel777
      C&C yuri's revenge campaign cuz i prefer just playing the campaign on repeat lol. So basically everything works great except for right past the loading screen when u really get into a game and it tweaks out by freezing the screen. if i tab out and back in its fine until i finish the misson. when it tries to leave the mission to go to the post campaign mission screen it freezes up for good and i couldnt do anything to fix it. and i will say this im kinda an idiot when it comes to the computer stuff but i can do enough to get the game started thanks to tutorials. my question is does any one know how to fix this? the it freezes like this anytime it starts or ends a mission.

    • By Ford (retired)
      In Red Alert 1 since there are so few players already, there is a big issue of players camping the top 3 spots and then not playing at all which effectively causes the ladder to be unplayable on certain days.  I think a decay system should be an option for each ladder to be enabled and mitigate this issue.  Decay settings would be a signifcant improvement, but the grace period and amount of decay should be customizable like the other settings.
       - add ability to set grace period
       - ability to set the % of total points lost per day after grace period is up
       - ability to set the lowest rank to be affected and/or make it so points cannot decay lower than (ie. 5th rank's points)
       - display to players if they are going to decay and how long until they do
           Thank you for creating the quickmatch ladder.  I hope the devs all enjoyed doing so.
      Cheers
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...