samples https://www.sendspace.com/file/xjprye
Original vertical flip tex image
font tex file;sharedassets1~msPGothic_0 distance map.tex
font index file(UTF-16LE);sharedassets1~sharedassets1_4113.-3
Add dds header
resoulution 2048x2048


Code: Select all
命
00 00 10 3D 00 00 8D 3D 00 60 77 3F 00 00 80 3F C8 65 C5 BC 6C 0F 39 3F BC D1 54 3F BC D1 54 3F F6 90 4B 3F 00 00 00 00 00 00 00 00
效
00 00 D3 3D 00 00 0B 3E 00 60 77 3F 00 00 80 3F C8 65 45 BC 6C 0F 39 3F 8D A6 4E 3F BC D1 54 3F F6 90 4B 3F 00 00 00 00 00 00 00 00
下
00 00 00 00 00 00 F8 3C 00 00 50 3D 00 00 A5 3D C8 65 C5 3C 4A 78 23 3F 9A 3A 3F 3F 03 25 3C 3F F6 90 4B 3F 00 00 00 00 00 00 00 00
了
00 00 FC 3C 00 00 74 3D 00 00 50 3D 00 00 A5 3D C8 65 45 3D 4A 78 23 3F D4 F9 35 3F 03 25 3C 3F F6 90 4B 3F 00 00 00 00 00 00 00 00
已
00 00 76 3D 00 00 B5 3D 00 00 50 3D 00 00 A5 3D 3A BF 76 3D 0F B9 2C 3F 3D E4 32 3F 03 25 3C 3F F6 90 4B 3F 00 00 00 00 00 00 00 00
匠
00 00 B6 3D 00 00 F0 3D 00 00 50 3D 00 00 A5 3D C8 65 45 3D E1 8D 26 3F 3D E4 32 3F 03 25 3C 3F F6 90 4B 3F 00 00 00 00 00 00 00 00


Thanks a lot. However, there are some problems.WRS wrote:this is a unity font.
a tool to calculate distance markers is here - http://catlikecoding.com/unity/products ... generator/
*edit* uh, it doesn't pack the font though. not sure if that is a standard unity thing ?
here is a very rough parser





Code: Select all
//--------------------------------------
//--- 010 Editor v5.0 Binary Template
//--------------------------------------
// Unity binary font atlas format
// Documented by WRS
//--------------------------------------
struct UnityFontAtlas
{
uint unknown_0[2];
uint unknown_1[2];
uint version; // ?
uint unknown_02;
uint len <bgcolor=0x00ff80>;
char name[len] <bgcolor=0x80ff00>;
if(len&3)ubyte name_pad[4-(len&3)]; // Aligned to 4 bytes
};
struct UnityGlyph
{
wchar_t character[2] <bgcolor=0x8080ff>;
float x,w,y,h; // mult by image dim (512,2048)
float pool[7]; // other glyph info (kerning, etc)
};
//--------------------------------------
UnityFontAtlas hdr <bgcolor=0xc0c0c0>;
if(hdr.version>1728) { Printf("Warning: May fail to parse\n"); }
uint ascii_count <bgcolor=0xffff00>;
UnityGlyph ascii_glyphs[ascii_count];
uint unicode_count <bgcolor=0xffff00>;
UnityGlyph unicode_glyphs[unicode_count];
local uint rem_count = (FileSize()-FTell()) / sizeof(float);
float tail[rem_count];
//--------------------------------------
Printf("------ Info -------\n");
Printf("Font: %s\n", hdr.name);
Printf("Ascii: %d\n", ascii_count);
Printf("Unicode: %d\n", unicode_count);
Printf("Tail: %d\n", rem_count);
//--------------------------------------
local int used_space = 0;
void Process(UnityGlyph& g, uint d)
{
local uint x1 = g.x*d;
local uint x2 = g.w*d;
local uint y1 = g.y*d;
local uint y2 = g.h*d;
local uint space = (y2-y1)*(x2-x1);
used_space += space;
}
local uint dim = 2048;
local uint i;
i=0;while(i<ascii_count)
{
Process(ascii_glyphs[i],dim);
++i;
}
i=0;while(i<unicode_count)
{
Process(unicode_glyphs[i],dim);
++i;
}
Printf("------ Metrics -------\n");
Printf("Pixels: %d\n", (dim*dim));
Printf("In-use: %d\n", used_space);
local float p=(float)used_space/(float)(dim*dim);
Printf("Used: %.03f%%\n", p);
//--------------------------------------
Latest unity quickbms script supports unity 5.x http://aluigi.altervista.org/papers/bms/unity.bmsTheReaperCooL wrote:Sorry to hijack the topic for a bit, but how did you manage to unpack the files (I assume you can also repack them as well)?
Please share your info in this topic, it would be appreciated -> viewtopic.php?f=35&t=12699
Thanks a lot!!WRS wrote:thanks for your info. the script was written very quickly but i'll update it again with your suggestions: here you go
hope this helps
Thanks! Although I think it doesn't work, as it extracts lots of the same files, and it overwrites them, plus I can't find some of it. Please pm me with more info if you can! Thanks in advance!adol365 wrote:Latest unity quickbms script supports unity 5.x http://aluigi.altervista.org/papers/bms/unity.bmsTheReaperCooL wrote:Sorry to hijack the topic for a bit, but how did you manage to unpack the files (I assume you can also repack them as well)?
Please share your info in this topic, it would be appreciated -> viewtopic.php?f=35&t=12699
Duplicated files are needless things for making translation patch. Just use a option to overwrite it.TheReaperCooL wrote:Thanks! Although I think it doesn't work, as it extracts lots of the same files, and it overwrites them, plus I can't find some of it. Please pm me with more info if you can! Thanks in advance!adol365 wrote:Latest unity quickbms script supports unity 5.x http://aluigi.altervista.org/papers/bms/unity.bmsTheReaperCooL wrote:Sorry to hijack the topic for a bit, but how did you manage to unpack the files (I assume you can also repack them as well)?
Please share your info in this topic, it would be appreciated -> viewtopic.php?f=35&t=12699
Okay, but I can't seem to find the string files, as most Unity games use .bcg files, and this one doesn't have, yet when I open up the files in a HEX Editor I can find in-game text lying around here and there. And I still can't import them back inadol365 wrote:Duplicated files are needless things for making translation patch. Just use a option to overwrite it.
Hi! Could you help me repack .assets file? Thanks!adol365 wrote:Is there a tool for generate this kind of font file? If there a no tools for it then can someone make 010 template for it?
samples https://www.sendspace.com/file/xjprye
Original vertical flip tex image
font tex file;sharedassets1~msPGothic_0 distance map.tex
font index file(UTF-16LE);sharedassets1~sharedassets1_4113.-3
Add dds header
resoulution 2048x2048