Diablo 2 Custom Fonts

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Re: Diablo 2 Custom Fonts

Post by GregMXL on Thu Feb 19, 2015 7:01 pm

I'll move this to tools.

_____________________
We mortals are but shadows and dust, shadows and dust, Maximus!

GregMXL
Zorun Tzin

Epic Admin
Posts : 13835
TGBest Transferred
Country : United States

View user profile

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by void on Thu Feb 19, 2015 7:40 pm

<3

BTW good news, I think I can make Cyrillic font work. Bad news, I THINK. Razz
Been trying to find out how it works. This is what I've come up with so far, you might find it interesting:
Spoiler:
Sample codes:
Code:
FF04000C0A0100001F0000000000
FF01000C0A0100001F0000000000
FF0000080A0100001F0000000000
CYR
-------------------------------
LAT
FF00000A0C010000FF0000000000
y:

210000080A010000210000000000
2102000C0A010000010000000000
2103000C0A010000010000000000
CYR
-------------------------------
LAT
210000050D010000210000000000
!

C00000000000110400060A010000
C001000C0A010000000000000000
C002000C0A010000000000000000
CYR
-------------------------------
LAT
C000000A10010000C00000000000
À

4203000C0A010000020000000000
420000070A010000420000000000
420400080A010000F20000000000
4201000C0A010000020000000000
CYR
-------------------------------
LAT
4200000A0C010000420000000000
B

430400090A010000F30000000000
4301000C0A010000030000000000
CYR
-------------------------------
LAT
430000090C010000430000000000
C

5A04000C0A0100001A0000000000
5A01000C0A0100001A0000000000
CYR
-------------------------------
LAT
5A00000B0C0100005A0000000000
Z
Explanation of what one line does (note that each bracket stands for a number between x00 and xFF)
Code:
(=input char/number)(+[x*256] for multiple alphabets?)(??)(=xoff)(=yoff)(01=used)(00=?)(00=?)(=remapchar?)(00=?)(00=?)(00=?)(00=?)(01=end)
Honestly I can't see why it would be a good idea to have multiple alphabets or more than 256 entries in Cyrillic font... but oh well, I'm still investigating.

void
Prince Albrecht

Cool Font Guy
Posts : 3022
TGBest Transferred
Country : ???

View user profile

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by kambala on Thu Feb 19, 2015 10:27 pm

uh... which file contents is that?

btw Cyrillic uses ISO 8859-5 table

kambala
Follower of Akarat

Posts : 1417
Country : Ukraine

View user profile http://worldofplayers.ru/forums/769/

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by void on Thu Feb 19, 2015 10:30 pm

All of this is the same file (Cyrillic).
The same charset is repeated there 4 or 5 times.
IMO the number at the start you're talking about might not be the ISO standard, but rather the number of repetitions of the same charset in the file. Just an idea.

void
Prince Albrecht

Cool Font Guy
Posts : 3022
TGBest Transferred
Country : ???

View user profile

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by kambala on Thu Feb 19, 2015 10:52 pm

which file exactly? default.map? if yes, then it's structued the following way:
Code:
{
  char[]="KAMAP\x0aISO\x0a";
  DWORD unknown;
  WORD entries;
  BYTE ranges;
  struct
  {
    BYTE first_char;
    BYTE last_char;
  } [ranges];
  struct
  {
    WORD ascii_char;
    WORD unicode_char;
  } [entries];
  WORD glyph_index[entries];
}

if you mean the .tbl, then...
Code:
HEADER - 12 Bytes
00h          57  6F  6F  21
04h          01  00  00  00
08h          00  01  H   W

-----------------------------------------------------------------------------------------------------------------------------------------------------------

The Header
12 Bytes in length.
First four = Woo!
Next four = 01 00 00 00 (one)
Next two = locale, 00 x in ISO 8859-x (01 - basic latin, 05 - cyrillic)
Next one = Expected Height of character cell (leading?)
Next one = Expected Width of character cell (cap height?)

The Character
There are 256 of these, 14 bytes in length.
Bytes 1 and 2 = character code (word) in unicode (e.g., 20 00 - ANSI space; 30 04 - cyrillic small "а")
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 symbol (ISO code)
Bytes 10-14 = 00

struct D2CharStrc      //sizeof 0x0E
{
   WORD wChar;      //+00
   BYTE nUnk;      //+02  
   BYTE nWidth;      //+03
   BYTE nHeight;      //+04
   bool bTrue;      //+05
   WORD wUnkEx;      //+06
   BYTE nImageIndex;   //+08
   BYTE nChar;      //+09
   DWORD dwUnk;      //+0A      
};

struct D2FontStrc      //sizeof 0x108 ? sizeof 0xE0B
{
   DWORD dwHeader;      //+00 - 'Woo!'
   WORD wOne;      //+04
   int nLocale;      //+06
   BYTE nLeading;      //+0A
   BYTE nCapHeight;      //+0B
   D2CharStrc pChars[256]; //+0C
};

kambala
Follower of Akarat

Posts : 1417
Country : Ukraine

View user profile http://worldofplayers.ru/forums/769/

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by void on Fri Feb 20, 2015 12:10 am

font16.tbl I believe. I can't check right now. Point is that characters seem to get remapped. You see the first byte of one character which is the input then you look at remap char like in my description and that's the char you get onscreen then. The reason I say this is because it would explain why all the unused symbols were used in the game when I tried to use the standard tbl output.
Basically it is alphabet 2 or 3 or 4 that codes Cyrillic chars whereas alphabet 1 codes latin ones. In some old pic you can see secret jewel bonus is displayed flawlessly when I was testing Cyrillic(!) font. The Cyrillic mapping wasn't in the file hence x00 was default char which coincidentally is an unused one.

I wouldn't mind it too much at the moment though. My plan is to write a script that will convert the alphabets and then see what the results of that might be.
I'd bet it'll work.

void
Prince Albrecht

Cool Font Guy
Posts : 3022
TGBest Transferred
Country : ???

View user profile

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by Edo on Sat Feb 21, 2015 12:34 pm

good! font 1 looks cute :v

Edo
Prowler

Posts : 11
Country : Vietnam

View user profile http://vn-sharing.net/forum

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by void on Mon Mar 30, 2015 2:07 am

^ TY! Very Happy

Testing big font for my bad eyes. Check out the pics if you want.
Big font:




It's a bit... too much. Not for my eyes but for the display, lol. Razz

void
Prince Albrecht

Cool Font Guy
Posts : 3022
TGBest Transferred
Country : ???

View user profile

Back to top Go down

Re: Diablo 2 Custom Fonts

Post by Clariska on Wed Apr 01, 2015 9:51 am

@void wrote:^ TY! Very Happy

Testing big font for my bad eyes. Check out the pics if you want.
Big font:




It's a bit... too much. Not for my eyes but for the display, lol. Razz

They say gaming reduces your eye sight...We all are practically blind Hitting a Wall

Clariska
Daystar

Posts : 82
Country : South Africa

View user profile

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum