Font TBL file
Moderators: Necrolis, Nefarius
-
- Champion of the Light
- Posts: 392
- Joined: Mon Apr 12, 2004 1:12 am
- Location: Newcastle upon Tyne
Font TBL file
Hi. I've been looking into custom Fonts recently.
I can get the character glyphs converted properly to dc6.
However, I need a tbl file for it (at the moment, the characters have the wrong dimensions).
I have looked at the contents of the font tbl files (in local\font\latin\), and they seem to be binary files, starting with "Woo!" - does anyone know the format of these files?
I can get the character glyphs converted properly to dc6.
However, I need a tbl file for it (at the moment, the characters have the wrong dimensions).
I have looked at the contents of the font tbl files (in local\font\latin\), and they seem to be binary files, starting with "Woo!" - does anyone know the format of these files?
-
- Dominion
- Posts: 6921
- Joined: Mon May 27, 2002 7:19 am
- Location: Orsay
the font tbl are unused and , IIRC, there is a another file next to them
that contains txt information about character size and kerning.
that contains txt information about character size and kerning.
"How much suffering, mortal, does it take before you lose your grace?"
Shadow Empire (coming soon) | forum
Shadow Empire (coming soon) | forum
-
- Cherub
- Posts: 11607
- Joined: Sat Jun 15, 2002 8:13 pm
- Location: Where the blood forever rains
Re: Font TBL file
You can tap into the location it crashes at and see how it decyphers the files.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots
Black Omen Productions | MetalStorm: Progress Report | Screenshots
-
- Champion of the Light
- Posts: 392
- Joined: Mon Apr 12, 2004 1:12 am
- Location: Newcastle upon Tyne
I know. Was just wondering if anyone had done this before. No point in duplicating effort!
I will be off the net until early January. Will post my findings when I get back.
[EDIT]
From my investigation, this file appears to be made up of two parts
The Header
12 Bytes in length.
First four = "Woo!"
Next six = 01 00 00 00 00 01
Next one = Expected Height of character cell
Next one = Expected Width of character cell
The Character
There are 256 of these - one per 8-bit character
14 bytes in length.
Byte 1 = character code
Byte 2 = 00
Byte 3 = 00
Byte 4 = Character cell width
Byte 5 = Character cell height
Byte 6 = 01
Byte 7 = 00
Byte 8 = 00
Byte 9 = character code
Bytes 10-14 = 00
I will be off the net until early January. Will post my findings when I get back.
[EDIT]
From my investigation, this file appears to be made up of two parts
The Header
12 Bytes in length.
First four = "Woo!"
Next six = 01 00 00 00 00 01
Next one = Expected Height of character cell
Next one = Expected Width of character cell
The Character
There are 256 of these - one per 8-bit character
14 bytes in length.
Byte 1 = character code
Byte 2 = 00
Byte 3 = 00
Byte 4 = Character cell width
Byte 5 = Character cell height
Byte 6 = 01
Byte 7 = 00
Byte 8 = 00
Byte 9 = character code
Bytes 10-14 = 00
Last edited by Havvoric on Sun Feb 25, 2007 8:37 am, edited 2 times in total.
-
- Posts: 3
- Joined: Fri Aug 08, 2008 3:30 pm
Re: Font TBL file
Bytes 1 & 2 are actually word with Unicode character value; byte 9 is ANSI code.
-
- Posts: 4
- Joined: Mon Aug 11, 2008 7:13 pm
Re: Font TBL file
In case nobody else has managed it so far, I've created a new font16 using some hacky python scripts.
I have it all code and generated files hosted on my website.
I used the python imaging library to generate a pcx file that dc6font would be happy about, the script also creates the kerning .tbl file needed.
I use a bitmap font from the Xorg project as I've had no luck yet with truetype fonts. It messes up in the antialiasing so it looks really horrible.
Think I have to load the diablo palette into the image before rendering the text, that is what I am working on right now.
(Oh, and first post from me!)
I have it all code and generated files hosted on my website.
I used the python imaging library to generate a pcx file that dc6font would be happy about, the script also creates the kerning .tbl file needed.
I use a bitmap font from the Xorg project as I've had no luck yet with truetype fonts. It messes up in the antialiasing so it looks really horrible.
Think I have to load the diablo palette into the image before rendering the text, that is what I am working on right now.
(Oh, and first post from me!)
Its probably easier to use sdls truetype lib for the images(i have some code sitting around that would work perfectly for this, and the dc6 conv code, could throw this together if any one needs it[just shortens the process])
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal
-
- Posts: 4
- Joined: Mon Aug 11, 2008 7:13 pm
Re: Font TBL file
Necroing this thread as I notice I forgot to put a link in my post.
My font rendering tool is at http://ogun.org/diablo2/
Simple but works, I never got antialiased fonts to work well, hence the usage of a X font.
Rather hardcoded python, but commented as to what is going on.
Screenshot:
My font rendering tool is at http://ogun.org/diablo2/
Simple but works, I never got antialiased fonts to work well, hence the usage of a X font.
Rather hardcoded python, but commented as to what is going on.
Screenshot:
My small diablo font hacks: http://ogun.org/diablo2/
Re: Font TBL file
HerioMortis, font8.dc6 (and possibly tbl) from your site seems to be broken (something with the height of characters)
cross-platform tools:
- QTblEditor - 2-panel tbl editor
- qdc6 - dc6 converter CLI
- QD2CharRenamer - character renamer
- MpqLangChanger - MPQ language changer
-
- Posts: 35
- Joined: Tue Dec 10, 2002 11:14 pm
- Location: Denmark
Re: Font TBL file
Hey,
Is there an easy way to get the font that is used in the polish version of Diablo 2? Or are you stuck with the language as well then?
Example:
Is there an easy way to get the font that is used in the polish version of Diablo 2? Or are you stuck with the language as well then?
Example:
-
- Posts: 4
- Joined: Mon Aug 11, 2008 7:13 pm
Re: Font TBL file
Polish fonts would be stored in the polish mpq:s. I do not have any of those so I cannot verify.
Presumably I should work in the same way.
Presumably I should work in the same way.
My small diablo font hacks: http://ogun.org/diablo2/
Re:
in RUS font the number in bold is 05. can it mean the ISO 8859-x table? (8859-1 is basic latin, 8859-5 is cyrillic)Havvoric" wrote:The Header
12 Bytes in length.
First four = "Woo!"
Next six = 01 00 00 00 00 01
cross-platform tools:
- QTblEditor - 2-panel tbl editor
- qdc6 - dc6 converter CLI
- QD2CharRenamer - character renamer
- MpqLangChanger - MPQ language changer
-
- Posts: 4
- Joined: Mon Aug 11, 2008 7:13 pm
Re: Re:
Sounds reasonable, seeing as 5 is the latin/cyrillic table of 8859.kambala" wrote: in RUS font the number in bold is 05. can it mean the ISO 8859-x table? (8859-1 is basic latin, 8859-5 is cyrillic)
I've updated the code so it can now deal with antialiased fonts, currently playing the game using verdana bold
Still have some issues with the kerning, but working on it.
My small diablo font hacks: http://ogun.org/diablo2/
Re: Font TBL file
currently I'm looking into chinese font16.tbl, and the last 4 bytes of header are
which doesn't make a lot of sense...
and the character structure is also other. here's a sample chinese symbol U+5377:
Code: Select all
EE 35 0D 01
and the character structure is also other. here's a sample chinese symbol U+5377:
Code: Select all
77 53 00 0D 0D 01 00 00 8D 05 00 00 00 00
Last edited by kambala on Fri Jan 15, 2010 4:55 pm, edited 1 time in total.
cross-platform tools:
- QTblEditor - 2-panel tbl editor
- qdc6 - dc6 converter CLI
- QD2CharRenamer - character renamer
- MpqLangChanger - MPQ language changer
Re: Font TBL file
you won't get too far just looking at the headers of files, you need to check the code that reads it, cause, for instance, the last for bytes could be read as a DWORD, making it 0x010D35EE or 2 WORDs, making it 0x35EE and 0x010D etc. also just a note here, most the games pixel length funcs use ave width and height, and not the length and height of each char
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal
-
- Champion of the Light
- Posts: 385
- Joined: Mon Dec 20, 2004 6:01 am
- Location: IL, USA
Re: Font TBL file
Apologies for resurrecting this old topic, but I wanted to correct some info...
In the 12-byte header of a font tbl file, byte 11 is actually the leading and byte 12 is the cap height in pixels.
In the 12-byte header of a font tbl file, byte 11 is actually the leading and byte 12 is the cap height in pixels.
Re: Font TBL file
Demon9ne" wrote:Apologies for resurrecting this old topic, but I wanted to correct some info...
In the 12-byte header of a font tbl file, byte 11 is actually the leading and byte 12 is the cap height in pixels.
Code: Select all
struct D2CharStrc //sizeof 0x0E
{
WORD wChar; //+00
BYTE nUnk; //+02
BYTE nWidth; //+03
BYTE nHeight; //+04
bool bTrue; //+05
WORD wUnkEx; //+06
WORD wImageIndex; //+08
DWORD dwUnk; //+0A
};
struct D2FontStrc //sizeof 0x108 ? sizeof 0xE0B
{
DWORD dwHeader; //+00 - 'Woo!'
WORD wOne; //+04
int nLocale; //+06
BYTE nLineHeight; //+0A
BYTE nUnk; //+0B
D2CharStrc pChars[0]; //+0C - variable amoutn based on the langauge
};
struct D2FontCache //sizeof 0x14
{
D2CellFileStrc* pImage; //+00
D2FontStrc* pFontInfo[2]; //+04
D2CharStrc* pCharInfo; //+0C
DWORD dwTick; //+10
};
Feb 2021: Some small changes since there where some big errors that affected a few people
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal