Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Sat Nov 16, 2024 1:25 am
All times are UTC + 0
Westwood Font Editor
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [22 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Tue Nov 29, 2016 2:45 pm    Post subject:  Westwood Font Editor
Subject description: for Dune 2, C&C1, RA1, TS, Dune 2000, RA2...
Reply with quote  Mark this post and the followings unread

Since Siberian_GRemlin never actually released his font editor, and demand was growing from the community to have such a tool to allow more fan localisations of the older games, I thought, what the heck, I'll dive into it.

So I decided to make my own font editor in C#. With the help of the Chronoshift team (Omniblade, CCHyper & Tomsons26, anyway) I figured out the font format itself, and managed to write code to read it, write 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. And we didn't stop there...

So, without further ado... the Westwood Font Editor:

Overview page:
http://www.shikadi.net/moddingwiki/Westwood_Font_Editor

Current version: 1.13.5: (2020/03/24 18:12)

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

Download:
Downloads folder

Source code: (C#)
Sources folder

Original development thread: (at cncnet.org)
https://forums.cncnet.org/topic/5928-westwood-font-editor-development-thread/

* * *

Full list of supported types / games, as of v1.13.2:

WWFont v1
-Wargame Construction Set
-A Nightmare On Elm Street
-DragonStrike
-Circuit's Edge

WWFont v2
-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

Westwood BitFont
-Command & Conquer Red Alert 2 (unused editor fonts)
-Nox

Westwood Unicode BitFont
-Command & Conquer Red Alert 2

...and a whole bunch of non-Westwood related fonts, too.



fonteditor_20_vcr_1.7.1.png
 Description:
 Filesize:  36.66 KB
 Viewed:  6063 Time(s)

fonteditor_20_vcr_1.7.1.png



_________________

Last edited by Nyerguds on Mon Aug 19, 2024 10:33 am; edited 32 times in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Tue Nov 29, 2016 4:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well done on the release, now for TS support! Wink

Back to top
View user's profile Send private message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Tue Nov 29, 2016 8:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well all right, if you insist... Razz

Links updated above Wink



fonteditor_12_tibsun.png
 Description:
 Filesize:  43.1 KB
 Viewed:  6164 Time(s)

fonteditor_12_tibsun.png



_________________

Last edited by Nyerguds on Tue Mar 22, 2022 1:44 pm; edited 1 time in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Wed Nov 30, 2016 3:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Released version 1.2, with a load of bugfixes, and a ton of new supported old Westwood games.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Wed Nov 30, 2016 11:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Added (experimental) Dune 2000 support. Technically not a Westwood format though... and it shows. It's constructed completely differently.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Thu Dec 01, 2016 10:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

v1.2.2 released, mostly to finish implementing Dune 2000 support, including the bizarre mess of how characters are ordered in the font.

Custom palette support will hopefully be next.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Tue Dec 06, 2016 7:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Welp, v1.3 is done. I think the program's just about finished, with that Smile

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
MustaphaTR
Scorpion Sniper


Joined: 22 Jan 2015
Location: Kastamonu, Turkey

PostPosted: Thu Dec 08, 2016 1:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

So we can edit D2K font now, this may make me back to Turkish Translation i made but left unfinished. But i'm ill so i'm not sure if i'll have time.

_________________
CnCD2K Mod: http://www.moddb.com/mods/red-alert-2-yuris-revenge-cncd2k-mod
Changed Dune Mod: http://www.moddb.com/mods/changed-dune
MustaphaTR's D2K Mod: http://www.moddb.com/mods/mustaphatrs-d2k-mod
Generals Alpha: http://www.moddb.com/mods/generals-alpha
Romanov's Vengeange: https://www.moddb.com/mods/romanovs-vengeance

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Dec 08, 2016 2:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

Really cool Nyerguds, that you made it that comprehensive and cover all those WW games font formats.  Approved!

Does anyone know which font is used for which aspect in the game?
12metfnt.fnt
6point.fnt
8point.fnt
editfnt.fnt
grad6fnt.fnt
kia6pt.fnt

Is any of these fonts responsible for the 0-9 unit group numbers that you see inside the unit selection brackets?
Which palette do these fonts use normally?

The text shown in TS on the sidemenu also depends on the color for Neutral house, which is LightGrey.
By editing the font, could we change the color to one that isn't remapable?

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
tomsons26lv
Cyborg Artillery


Joined: 30 Dec 2009
Location: Latvia

PostPosted: Thu Dec 08, 2016 2:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

If you mean for TS(cause these font filenames haven't changed since TD) then

12metfnt is used for Options and Credits, options button and cash that is

6point was nowhere to be seen on the check i did when we were working out what uses what on the rapp chat

8point is used for Ready/On Hold text

editfnt despite its name is used for the version info that appears in the menu, and loading screen text and cameos

kia6pt is is tooltips

grad6fnt and 6point might be used somewhere, easiest to find out edit the font and place it in a ecache mix
The game init's both of them so they should be used somewhere

Lin Kuei Ominae wrote:
The text shown in TS on the sidemenu also depends on the color for Neutral house, which is LightGrey.
By editing the font, could we change the color to one that isn't remapable?

Maybe, you might need to know how the game internally sets the colors for a specific thing(like tooltips for example) tho

_________________
Tiberian Dawn, Red Alert, Tiberian Sun ,Red Alert 2,Renegade, Command & Conquer 3,Tiberium and Tiberium Wars and Westwood related image & video archive
https://picasaweb.google.com/113361105083292812413?noredirect=1

Skype live:tomsons26
Don't forget to state who are you otherwise i'll ignore the invite

Back to top
View user's profile Send private message Visit poster's website
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Thu Dec 08, 2016 9:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Released v1.4; the editor now finally has a preview pane. Also, I figured out that you can put stuff on the Windows clipboard in multiple types together, meaning copied content from the editor not only serves as input for the editor itself, now, but can also be pasted into any image editor.

MustaphaTR wrote:
So we can edit D2K font now, this may make me back to Turkish Translation i made but left unfinished. But i'm ill so i'm not sure if i'll have time.

If you want to get into that, be sure to read the note about Dune 2000 editing I added in the readme file. They did some strange reordering of special characters in that font, so the notes I made about it will make your life a lot easier if you're trying to add new ones Wink

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
E1 Elite
General


Joined: 28 May 2013

PostPosted: Fri Dec 09, 2016 5:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice tool. In 12metfnt (TS), above 170 index, it shows different on the character and its image.
Those characters may not be needed, but is it showing correctly?

Can the tool support the TS pcx file of dlgsysi.pcx and dlgsysa.pcx? It is an indexed image.

Back to top
View user's profile Send private message
MustaphaTR
Scorpion Sniper


Joined: 22 Jan 2015
Location: Kastamonu, Turkey

PostPosted: Fri Dec 09, 2016 10:23 am    Post subject: Reply with quote  Mark this post and the followings unread

I edited the font and started to translation. What i did was to replace some character that i won't use and use those actual letters on the .uib file. It wouldn't be a problem as each language their own font file and it works.

_________________
CnCD2K Mod: http://www.moddb.com/mods/red-alert-2-yuris-revenge-cncd2k-mod
Changed Dune Mod: http://www.moddb.com/mods/changed-dune
MustaphaTR's D2K Mod: http://www.moddb.com/mods/mustaphatrs-d2k-mod
Generals Alpha: http://www.moddb.com/mods/generals-alpha
Romanov's Vengeange: https://www.moddb.com/mods/romanovs-vengeance

Back to top
View user's profile Send private message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Fri Dec 09, 2016 11:06 am    Post subject: Reply with quote  Mark this post and the followings unread

E1 Elite wrote:
Nice tool. In 12metfnt (TS), above 170 index, it shows different on the character and its image.

It's not "different". It's just "not implemented in the font". Westwood usually uses filler characters to represent symbols they didn't include because they didn't need them in the game, that's all. You will see the same thing in pretty much every font if you go below index 32 (the space character), which is why the editor is set to automatically select the space as first character; the stuff before it is generally not useful. But if you want to implement these missing characters above index 170... well, hey, guess what. You got a font editor; you can do that now. Go nuts Razz

Also note that other fonts in there, like kia6pt.fnt, don't seem based on DOS-437, but on Windows-1252 ("Windows - Western Europe" in the dropdown). That's what that dropdown is made for; it allows the grid to show characters from any supported encoding, so you can make sure the font matches it.

Note: I define "supported encoding" in my editor as "one byte per character, extended ascii", so encodings that use multiple bytes (like UTF8/UTF16) or in which the first 128 characters do not match plain ASCII (like EBCDIC), are deemed incompatible, and are left out of the dropdown.

E1 Elite wrote:
Can the tool support the TS pcx file of dlgsysi.pcx and dlgsysa.pcx? It is an indexed image.

The goal of this editor is to support a previously uneditable format, not to make a UI for editing fonts. Even if I'd make a kind of image import function, it'd only be to save it as .fnt file, not as pcx. If you got fonts that are already in known editable image formats... just edit them in an image editor.


MustaphaTR wrote:
I edited the font and started to translation. What i did was to replace some character that i won't use and use those actual letters on the .uib file. It wouldn't be a problem as each language their own font file and it works.

There should really be no need for that... if you just rewrite font.bin as described in the readme, you can use any text encoding you want in the font itself without needing to do weird stuff with your text.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Fri Dec 09, 2016 11:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Released v1.5:
-Implemented font type conversion.
-Added global color replace function.
-Ctrl + arrow keys serve as shortcuts for image shifting.
-Ctrl + Shift + arrow keys will shift all images in the font.
-The preview image can now be copied to the clipboard with a right-click menu.
-Images can now be pasted from the clipboard. They'll adapt to the currently loaded palette. Below is a little test done by copying the editor's own icon.

[edit]

Released 1.5.1, to address a small but annoying bug where the new "paste-from-image" logic caused the original font data paste to no longer be used, causing an unnecessary data loss potential.

[edit again]

Released 1.5.2, with some much-needed close-confirmations, a "Save As" menu that finally allows you to change the save type (though given the touchups that usually requires it's advised to do this in the editor anyway), and command line argument support for opening files.



fonteditor_18_paste.png
 Description:
A little test done by copying the editor's own icon into the editor.
 Filesize:  38.52 KB
 Viewed:  6163 Time(s)

fonteditor_18_paste.png



_________________

Last edited by Nyerguds on Tue Mar 22, 2022 1:53 pm; edited 2 times in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Wed Dec 21, 2016 1:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Okay.... I wondered why changing palette colours sometimes seemed to remove any image data that was in the clipboard. Turns out some clown at Microsoft added the "feature" during the Vista development that double-clicking a label that contains text copies that text to the clipboard Confused

So that "T" on the first palette colour that indicates transparency? Yeah, that replaced the image data I was working with Rolling Eyes

Thankfully, I found a fix. So, now there's v1.5.4.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Tue May 23, 2017 7:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Welp, been a while since I added any updates in here.

Newest developments:

v1.5.5: (2017/04/08 14:24)
-Copying a symbol to the clipboard now also sets it in the clipboard as text.

v1.5.6: (2017/04/08 15:28)
-Fixed the fact changing the Y-offset didn't refresh the characters grid.

v1.5.7: (2017/04/08 19:40)
-Fixed a crash in the previewer when one of the previewed characters is the last character in the font.

v1.5.8: (2017/04/09 00:30)
-Fixed a bug in the font size changing that made it change the wrong dimension.
-Fixed assembly name; it was still "CnCFontEditor".

v1.5.9: (2017/04/09 12:49)
-Added shortcuts for bulk shifting without data loss and Y-offset changes.
-Holding down Ctrl now enables colour picker mode, for fast colour picking.
-Optimized refreshing of paint mode and colour pick mode.
-Colour picker now shows a hand cursor.

v1.6: (2017/04/11 08:30)
-Added option for limiting 8-bit font types to use only 16 colours.

v1.6.1: (2017/04/17 11:06)
-Shifting shortcuts no longer work from text fields or the characters list.
-Added better close confirmations, with prompt to save.

v1.7: (2017/04/21 17:02)
-Edited 16-colour palettes can now be saved using a new palette manager.

v1.7.1: (2017/05/23 18:40)
-Added new "Paste on symbol" option (Ctrl+Shift+V) that pastes with transparency. This can be used to easily copy diacritics.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
yjfyeyu
Civilian


Joined: 04 Feb 2018

PostPosted: Mon Feb 05, 2018 7:44 am    Post subject: Reply with quote  Mark this post and the followings unread

I come from China, is a fan of command and conquer
Thank you for making the 1.06 patch.
When I saw WWFontEditor, translation commands and conquests made it possible.
I use the phrase to replace ascii, the interface is completed,
But when I modified grad6chi.fnt for missionini_briefings, I got an error
If grad6chi.ini exceeds 33k, WWFontEditor can not open it.

Thanks again for your contribution to command and conquer



command_&_conquer-2018-02-04-20_56_30.png
 Description:
 Filesize:  40.3 KB
 Viewed:  13293 Time(s)

command_&_conquer-2018-02-04-20_56_30.png



fnt.zip
 Description:

Download
 Filename:  fnt.zip
 Filesize:  16.7 KB
 Downloaded:  21 Time(s)


Back to top
View user's profile Send private message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Tue Aug 07, 2018 2:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yeah, the addressing using signed Int16 was a bug; it should be unsigned Int16. That issue got fixed (thanks to yjfyeyu), so now the fonts should be able to address symbols up to 64k.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Tue Mar 19, 2019 3:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

I added support for the RA2 fonts.

It's still fairly experimental (hasn't been tested in the game), but it's in there.

I will probably add some more options to it eventually, like TTF font import (a feature which PD's OS Font Editor has), and changing the first font range (0000-00FF) to show up as Windows-1252 rather than ISO-8859-1, because Westwood is weird and doesn't use Unicode as it should be used.

Note that unlike OS Font Editor, my tool does not keep track of the original font internals, which has the side effect that the step to optimise the font symbols (to remove duplicate images) can take about 20 seconds. On the plus side... it actually optimises the symbols, which OS Font Editor does not do.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Thu Mar 21, 2019 3:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

Added font customization and the substitution for the 80-FF range on unicode fonts.

This version also vastly optimises RA2 font saving, reducing the save time to just 4-5 seconds.


_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Wed Apr 08, 2020 3:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Small update on this... thanks to a bug report from yjfyeyu, I fixed a bunch of issues with multithreading in this tool.

You can now close the tool and save the opened font file in the "save unsaved changes" warning which appears, an action that apparently caused a crash before due to it trying to disable the UI as part of the saving process while simultaneously closing the window.

_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [22 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.2522s ][ Queries: 17 (0.0138s) ][ Debug on ]