XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Oct 20, 2017 8:45 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Fri Dec 19, 2014 11:24 pm 
Offline
n00b

Joined: Sun Nov 28, 2010 3:13 am
Posts: 13
Has thanked: 2 times
Have thanks: 13 times

merlinsvk wrote:
Great tools, indeed :)

Do you know a tool for creating BMFont besides Angel Code's Editor? It makes crappy looking fonts, especially that smaller ones.


Sorry, I forgot to add required BMFont options to make a new font. I've updated my previous post.

You can make the ads go away by registering


_________________
/* jpmod */


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Sat Dec 20, 2014 5:18 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Oct 27, 2008 12:11 am
Posts: 369
Location: Slovakia
Has thanked: 35 times
Have thanks: 98 times
Have you noticed that own fonts are shifted a bit upwards? It looks like the words are aligned to the top of line. It's around 6 or 7px. :?


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Wed Dec 24, 2014 3:04 am 
Offline
n00b

Joined: Sun Nov 28, 2010 3:13 am
Posts: 13
Has thanked: 2 times
Have thanks: 13 times
merlinsvk wrote:
Have you noticed that own fonts are shifted a bit upwards? It looks like the words are aligned to the top of line. It's around 6 or 7px. :?


Yes. I've tested several font y offset patterns and changed the codes for it's conversion. Please try new version which I've updated in my first post. New tool is required additional BMFont export option which I've also updated.

Another important thing is that you need to create a new font with same font size of the original.

It's not best but better than previous version. :)

_________________
/* jpmod */


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Wed Dec 24, 2014 12:28 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Oct 27, 2008 12:11 am
Posts: 369
Location: Slovakia
Has thanked: 35 times
Have thanks: 98 times
Oh yeah, it's definitely better. Thank you very much :)


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Sun Jun 21, 2015 2:53 pm 
Offline
advanced

Joined: Sun Nov 30, 2014 1:49 am
Posts: 66
Has thanked: 40 times
Have thanks: 3 times
Does anyone find out where are fonts?
I tried open all font in common.dat file (folder fonts)

Image

Image

Thanks!


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Wed Apr 13, 2016 6:42 pm 
Offline
ultra-n00b

Joined: Tue Apr 12, 2016 9:46 pm
Posts: 4
Has thanked: 0 time
Have thanks: 0 time
Is it possible unpack .binfont from last patch v.2.0.3?


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Wed Apr 13, 2016 8:41 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Oct 27, 2008 12:11 am
Posts: 369
Location: Slovakia
Has thanked: 35 times
Have thanks: 98 times
Just for quick view on binfont content. It was not tested on every generated binfont. (v2.0.3 game uses TTF/OTF fonts from *.lngp in LocalizationPacks folder)

Code:
# This War of Mine (v 2.0.3)
# BINFONT to DDS converter
# by MerlinSVK    Mar 2016
# version 1.2
# script for QuickBMS    http://aluigi.org/papers.htm#quickbms

get SIZE asize
get NAME basename
string HNAME = NAME
string TNAME = NAME
string HNAME += ".head"
string TNAME += ".tail"
string NAME += ".dds"

idstring "\xE4\x0A\xF2\x23"
get VERSION long
get TYPE long
get HEIGHT long
savepos OFFSET

if SIZE > 0x102000
   xmath DATASZ "(SIZE / 0x1000) * 0x1000 - 0x2000"    # length of texture data, rounding down
elif SIZE > 0x101000
   xmath DATASZ "(SIZE / 0x1000) * 0x1000 - 0x1000"
elif SIZE > 0x81000
   xmath DATASZ "(SIZE / 0x1000) * 0x1000 - 0x1000"
else
   xmath DATASZ "(SIZE / 0x1000) * 0x1000"
endif
xmath TOFFSET "OFFSET + DATASZ"                           # start of tail (font description)
xmath TSIZE "SIZE - TOFFSET"                                 # length of tail

if TYPE == 1      # L8A8 format
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x08\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x00\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x10\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
   xmath WIDTH "(DATASZ / HEIGHT) / 2"
else            # L8 format
   set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x0F\x10\x00\x00\xAA\xAA\xAA\xAA\xBB\xBB\xBB\xBB\xCC\xCC\xCC\xCC\x00\x00\x00\x00\x01\x00\x00\x00\x4D\x45\x52\x4C\x49\x4E\x3A\x29\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x08\x00\x00\x00\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
   xmath WIDTH "DATASZ / HEIGHT"
endif

print "\nFILE: %NAME%\nDATASZ: %DATASZ% B (%DATASZ|h%)\n WIDTH: %WIDTH% px (%WIDTH|h%)\nHEIGHT: %HEIGHT% px (%HEIGHT|h%)"

putVarChr MEMORY_FILE 0XC HEIGHT long
putVarChr MEMORY_FILE 0x10 WIDTH long
putVarChr MEMORY_FILE 0x14 DATASZ long

append
log MEMORY_FILE OFFSET DATASZ
append

get DDSSIZE asize MEMORY_FILE
log HNAME 0 OFFSET                                          # save header
log TNAME TOFFSET TSIZE                                    # save tail (char descriptions)
log NAME 0 DDSSIZE MEMORY_FILE                        # save DDS texture


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Fri Apr 15, 2016 4:19 pm 
Offline
ultra-n00b

Joined: Tue Apr 12, 2016 9:46 pm
Posts: 4
Has thanked: 0 time
Have thanks: 0 time
merlinsvk wrote:
Just for quick view on binfont content. It was not tested on every generated binfont. (v2.0.3 game uses TTF/OTF fonts from *.lngp in LocalizationPacks folder)


I need translate this game to my language and tested your code but can't unpack all binfont.

If v2.0.3 used TTF/OTF fonts from *.lngp, is it possible replace to other fonts file or unpack and repack .lngp ?

https://www.dropbox.com/s/61ilgd0grxn3gog/LocalizationBinFontsandPacksV2.0.3.zip?dl=0


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Fri Apr 15, 2016 8:11 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Oct 27, 2008 12:11 am
Posts: 369
Location: Slovakia
Has thanked: 35 times
Have thanks: 98 times
Forget on modifying binfonts. They would be re-written by game, when player choose another language in Settings.
You need modify included TTF fonts in .lngp pack.

LNGP consist of:
    1) info header
    2) text (same text, same format as .lang files, but at this moment game doesn't read included text in .lngp, so you don't need to edit it)
    3) TTF or OTF fonts
    4) font license (always empty)

This script will separate lngp pack into single files. You will have to use hex editor to put new fonts into .lngp. But it's doable.


Code:
# This War of Mine .LNGP extractor
# Written by MerlinSVK, 03/2016
###########################################
get FNAME basename
string NAME = FNAME

############### header section ###############
get HDRSIZE long                           # Header size (-4 bytes)
get LNGID clsid                              # LanguagePackHeader
get UNK1 long                              # Game version, 01 00 00 00
get UNK2 long                              # Game version, 04 00 00 00
get UNK3 long                              # Game version, 01 00 00 00
get TIMET time64                           # Creation time
get TIMET time64                           # Creation time
getct LNGNAME string 0x00               # Language name
getct LNGLOCNAME unicode 0x00      # Native language name
getct TRANSLATOR unicode 0x00         # Author
getct CONTACT unicode 0x00            # Author e-mail address

string NAME += ".head"
math HDRSIZE += 0x4
  log NAME 0 HDRSIZE                     # Extract header
savepos POSITION

############### text section ###############
get TXTSIZE long
math TXTSIZE += 0x4
string NAME = FNAME                     # Name reset
string NAME += ".lang"
  log NAME POSITION TXTSIZE            # Extract text (.lang file)

math POSITION += TXTSIZE
goto POSITION

############### font section ###############
get FNTCOUNT short                        # Number of included fonts
for i = 0 < FNTCOUNT
  get FNTBLOCKSIZE long                  # Size of the font block
  get BYTE byte                              # Unknown
  getct FNTVAR string 0x00               # Font variable
  get BYTE byte                              # Unknown
  getct FNTID string 0x00                  # Font ID
  get SCALE float                              # Scale parameter
  get SCALEX float                           # ScaleX parameter
  get SCALEY float                           # ScaleY parameter
  get OFFSETX float                           # OffsetX
  get OFFSETY float                           # OffsetY
  get MAXSIZE float                           # Font's max. size
  get LINESPACING float                     # Linespacing parameter
  get FNTSIZE long                           # Size of TTF/OTF font
  savepos POSITION
    log FNTID POSITION FNTSIZE
  math POSITION += FNTSIZE
  goto POSITION
  getct LICENSE unicode 0x00            # License
  get NULL long
next i



And BTW, game has some bugs, like missing words, small linespacing or cutted sentences, so it will be not your fault :)


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Sat Apr 16, 2016 5:55 am 
Offline
ultra-n00b

Joined: Tue Apr 12, 2016 9:46 pm
Posts: 4
Has thanked: 0 time
Have thanks: 0 time
I replaced TTF and OTF in .lngp by other fonts file, but in game nothing change. :(

https://www.dropbox.com/s/dejbkektum8om ... s.zip?dl=0


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Sat Apr 16, 2016 10:34 am 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Oct 27, 2008 12:11 am
Posts: 369
Location: Slovakia
Has thanked: 35 times
Have thanks: 98 times
Did you delete LocalizationBinFonts folder after lngp editing?


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Sat Apr 16, 2016 5:10 pm 
Offline
ultra-n00b

Joined: Tue Apr 12, 2016 9:46 pm
Posts: 4
Has thanked: 0 time
Have thanks: 0 time
merlinsvk wrote:
Did you delete LocalizationBinFonts folder after lngp editing?

Thanks works with other language except English, if I edited English.lngp game will crash on startup.


Top
 Profile  
 
 Post subject: Re: This War of Mine (.binfont, .texture)
PostPosted: Sun Apr 17, 2016 9:19 am 
Offline
ultra-veteran
ultra-veteran

Joined: Mon Oct 27, 2008 12:11 am
Posts: 369
Location: Slovakia
Has thanked: 35 times
Have thanks: 98 times
Yes, I also had problems with crashing. Unfortunatelly I don't know what was the problem, but I somehow made a modified English.lngp, which actually works (:



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group