Further discussions about modding the Silent Hill games.
 
 

belek666

Posts: 22

Joined: Feb 18, 2012

Silent Hill 2/3/4 PC Font Extractor

Post by belek666 on Sun Dec 10, 2017 8:58 am

Hi
I've created simple cli application to extract, insert or delete single character from Silent Hill 2/3/4 PC font files (sh2pc.exe and fontdata_x.bin files).
Character will be converted to/from 8bit indexed tga - fonts are using only 7 colours, do not change palette. Games use two size of fonts: normal for dialogues, messages, options and small for inventory. Latin characters from 0 to 223 (encoding number based on *.mes files) can have different width, all rest chars have fixed width value (normal - 20, small - 16, sh4: - normal - 25, small - 20). It's alpha version, not well tested.

Code: Select all
Usage:
Extract single character from font file to tga:
<FontFile> <FontSize> e <CharacterNumber> <tgaFile>

Insert single character from tga to font file:
<FontFile> <FontSize> i <CharacterNumber> <tgaFile>

Delete single character from font file:
<FontFile> <FontSize> d <CharacterNumber>

Where:
<FontFile> - name of main file with fonts (*.exe, *.bin files)
<FontSize> - size of game's font, options: n - normal, s - small
<CharacterNumber> - encoding number of character in decimal
<tgaFile> - name of tga file that will be created/used

Don't forget to make backup of the main file - it will be overwritten


Example of extracting 'a' (65 encoding number) from sh2pc.exe, normal size:
Code: Select all
sh234font sh2pc.exe n e 65 a.tga


https://www.sendspace.com/file/fur4uw
 
 
 
 
 
 

AdamSaeed

Posts: 4

Joined: Nov 23, 2017

Silent Hill 2/3/4 PC Font Extractor

Post by AdamSaeed on Tue Dec 12, 2017 6:47 am

Awesome, keep up the good work.
 
 
 
 
 
 

abuali

Posts: 2

Joined: Jan 04, 2018

Silent Hill 2/3/4 PC Font Extractor

Post by abuali on Thu Jan 04, 2018 6:59 pm

I tried the tool with various programs to edit, all gave this error

Opening font file sh2pc.exe size 6123520
Wrong tga format!

Tested on Normal Font
I provide sample, I just opened the .tga in photoshop then saved the modded file to .tga nothing changes, still gives the error
https://mega.nz/#!vQ9DhKQJ!W70NHEZB6ob9 ... Rqh3Z9eFxI
 
 
 
 
 
 

abuali

Posts: 2

Joined: Jan 04, 2018

Silent Hill 2/3/4 PC Font Extractor

Post by abuali on Fri Jan 05, 2018 10:32 am

edit: I was mistaken... problem still not solved
 
 
 
 
 
 

belek666

Posts: 22

Joined: Feb 18, 2012

Silent Hill 2/3/4 PC Font Extractor

Post by belek666 on Sun Jan 07, 2018 6:02 am

abuali wrote:I tried the tool with various programs to edit, all gave this error

Opening font file sh2pc.exe size 6123520
Wrong tga format!

Tested on Normal Font
I provide sample, I just opened the .tga in photoshop then saved the modded file to .tga nothing changes, still gives the error
https://mega.nz/#!vQ9DhKQJ!W70NHEZB6ob9 ... Rqh3Z9eFxI


Image editor needs to support importing and exporting indexed colour tga. It needs to keep original tga format. I've found that mtPaint works http://mtpaint.sourceforge.net/
In mtPaint setting, files, set "Write TGAs in bottom-up row order" to get proper format.
 
 
 
 


Return to General Modding



Who is online

Users browsing this forum: No registered users and 1 guest