Board Thread:Plants vs. Zombies 2/@comment-5079138-20150709150036

YAY! I found ALL the PvZ2 fonts thanks to OBBPatcher! Also, they're all in TTF format so I've uploaded ALL of them here, and admins can edit the Wikia.css to make the fonts usable on this wiki. Well, the story is really long, but I'll explain it below.

BTW, the REAL PvZ2 font is NOT Cafeteria, it's "fbUsv8C5eI" (according to the filename inside the OBB). I know, it's pretty weird and rather gibberish, but hey.

How I get them
The story is very long, so click "Expand" to see it.

It's a pretty complicated process to extract all the fonts successfully (I have some problems extracting them correctly), but using the XVI32 hex editor I was be able to do it.

Well, I was bored and decided to mess around with OBBPatcher to see what I can find, but after a few moments I decided to find the PvZ2 fonts inside the OBB, since no one ever done that yet.

At first, I learned the characteristics of TTF fonts. Well, surprisingly enough, there are some unique characteristics of TTF:


 * The header is always "00 01 00 00".
 * If you use a hex editor to view the font's data, you'll ALWAYS find the text "OS/2" inside the font's data, which possibly means that TTF fonts are compatible with the really old IBM OS/2 from the 90's.

I used these characteristics to my advantage, since these applies to every single TTF fonts.

Then, I learned the characteristic of OBB files:


 * As mentioned in the OBBPatcher's readme, the pattern of compressed files are always like this:  pgsr   . See the OBBPatcher's readme file for more info.

This is where the fun begins: I'm started playing with the XVI32 hex editor. I opened the OBB, then using the find command, I typed this on the text box: "OS/2", but got no results. After a while, I realised that OBBs are compressed and therefore all of the data inside the OBB are compressed. I've tried to directly find the TTF file by searching ".TTF" in the search box. Still, no results.

I didn't give up, instead, I looked at the versions.cfg, just to see the offset of the RTON file and find a way to get the TTF filename. Actually, every filenames listed in the OBB are spaced by three 00 bytes for each letters, and the first letter in the filename has some gibberish characters in it, e.g., Pico12 --> P(random characters here) I C O 1 2, so that's why I didn't get the file! However, since .TTF is the file extension, then the dot (.) is obviously not the first character in the filename, so no need to find the gibberish things manually.

After that, I typed ".TTF" again, but clicked the "Text -> Hex" button, just to convert it to hex, and add three 00 bytes on each characters: 2E 00 00 00 54 00 00 00 54 00 00 00 46 (which means ". T T F"). Hit search, and BAM! Found some TTF's. The first offset found is at 0x2875E, but it's not the actual files, I kept pressing F3 (to find the next thing that contains ". T T F"), and found another one, it's at 0x2E880CA. They're the actual files, and I found where the compressed block starts and ends, it starts at 0x2E89000 and ends at 0x2EBC1B3. I fired up the Windows built-in calculator, switched to programmer mode, switched the mode to hex, then subtracted 2EBC1B2 by 2E89000. The result is 331B2, then I switched to decimal mode to see the decimal of it, and it says 209330, so I typed this on the versions.cfg:

fontsobb: 507596800, 48795648, 209317

After that, I fired up OBBPatcher, selected the OBB, used the fontsobb preset, and extracted it. It says "Extraction incomplete", but I found out that it still wrote the file to fontsobb.section.

Actually, it failed to extract the files successfully because some bytes are not selected (my bad!) It should be

fontsobb: 507596800, 48795648, 209332

When I compressed both files, they have different CRC32 checksums, so that means there are some corruptions going on with the failed one. The fonts uploaded here are the one that successfully extracted, so don't worry. I just realised this when I double-checked the offsets.

I was actually confused at first, since it only outputted one font (Ashley Script), but when I hex edited it, I found the problem: The fonts seem to be mixed into one file. So, I searched for "OS/2", then pressed F3 (to search for the next font after Ashley Script), scrolled upwards to find the end of Ashley Script font. They're actually full of 00's so that's why I know it's the end of file, used "Edit > Delete from" to delete any stuff after the end of Ashley Script font, saved, renamed the file from "fontobb.section" to ttf.ttf (well, at first I didn't know what font is it). After opened the font, I noticed that the font name is "Ashley Script MT", so I renamed it to AshleyScriptMTStd (from the OBB filename), and done. For the next fonts, I extracted the file using OBBPatcher again, fired XVI32 and opened the section file, searched for OS/2 again, scrolled upwards to find the beginning of the file (it's marked with the bytes "00 01 00 00" as mentioned above), used "Edit > Delete to" to delete any stuff before it, searched for OS/2 again, scrolled upwards to see the end of file again, then used "Edit > Delete from" again. Renamed the file to "ttf.ttf", opened the font, looked at the name, then renamed the file based on the OBB filename again. I repeated this whole process few times until I get all the fonts. For the final font, I scrolled downwards to see some 00's, scrolled upwards to see the end of file, then used "Edit > Delete from" to delete all the 00's.

It's really a long process (and story!), but hope you enjoy the results. You can download the fonts below (note that those are the successfully extracted ones, not the failed ones, so don't worry).

NO SARCASM PLEASE. I WORKED HARD TO GET ALL THE FONTS. YOU OBVIOUSLY DON'T WANT TO BE INSULTED AFTER YOU DID THINGS LIKE THIS, RIGHT? THEN DON'T DO THE SAME AT ME.

Extra technical details
The stack shown via hex editing:

Ashley Script > fbUsv8C5eI > Pico12 > BrianneTod > HouseofTerror

OBB hex editing shows this.

offset 0x2E87FF2 mentions...

\primefonts\ashleyscriptmtstd.ttf

briannetod.ttf

fbusv8c5ei.ttf

houseofterror.ttf

pico12.ttf

The stack is kinda different for some reason. Maybe someone can investigate this?

I also found this when further searching the OBB.

Offset: 0x1E03B149

Text found: PrimeFont, ASHLEYSCRIPTMTSTD, primefonts, AshleyScriptMTStd.ttf, FBUSV8C5EI, fbUsv8C5eI.ttf, PICO12_, PICO12__.ttf, BRIANNETOD, BrianneTod.ttf, HOUSE_OF_TERROR, House Of Terror.ttf

I used the proper TTF filenames mentioned here.

Font usage
Ashley Script MT Std: Zomboss's message font.

fbUsv8C5eI: The main GUI font.

Pico12: Penny's message font.

BrianneTod: Dave's message font.

House of Terror: Unknown, leftover from PvZ. It's used in PvZGW though.

Downloads
Ashley Script

PvZ2 UI (fbUsv8C5eI)

Pico12

BrianneTod

House of Terror

Install guide (to install the fonts to your computer)
Open the font, then click "Install" on the top-left corner of the font viewer window. Repeat for every font.

CSS install guide (to add the fonts to this wikia)
Add these to Wikia.css:

@font-face { font-family: Ashley Script MT Std; src: url('http://img3.wikia.nocookie.net/__cb20150709144524/plantsvszombies/images/c/cd/AshleyScriptMTStd.ttf') format('truetype'); }

@font-face { font-family: Ashley Script MT; src: url('http://img3.wikia.nocookie.net/__cb20150709144524/plantsvszombies/images/c/cd/AshleyScriptMTStd.ttf') format('truetype'); }

@font-face { font-family: BrianneTod; src: url('http://img4.wikia.nocookie.net/__cb20150709144525/plantsvszombies/images/1/1e/BrianneTod.ttf') format('truetype'); }

@font-face { font-family: Brianne Tod; src: url('http://img4.wikia.nocookie.net/__cb20150709144525/plantsvszombies/images/1/1e/BrianneTod.ttf') format('truetype'); }

@font-face { font-family: fbUsv8C5eI; src: url('http://img3.wikia.nocookie.net/__cb20150709144525/plantsvszombies/images/1/16/FbUsv8C5eI.ttf') format('truetype'); }

@font-face { font-family: PvZ2 UI; src: url('http://img3.wikia.nocookie.net/__cb20150709144525/plantsvszombies/images/1/16/FbUsv8C5eI.ttf') format('truetype'); }

@font-face { font-family: House of Terror; src: url('http://img1.wikia.nocookie.net/__cb20150709144525/plantsvszombies/images/9/9b/House_Of_Terror.ttf') format('truetype'); }

@font-face { font-family: PICO12; src: url('http://img2.wikia.nocookie.net/__cb20150709145104/plantsvszombies/images/2/2c/PICO12_.ttf') format('truetype'); }

then save it. Try to use the fonts for your userpage/wordbubble!

Usable font names
This section lists all possible font family variations you can use to get those fonts on this wiki. Useful for wordbubble making.

Ashley Script MT
Ashley Script MT Std, Ashley Script MT

BrianneTod
BrianneTod, Brianne Tod

fbUsv8C5eI
fbUsv8C5eI, PvZ2 UI

House of Terror
House of Terror

Pico12
PICO12

Mystery font
I can't seem to find the font used in the game's ads. It's different than the others since this font uses double-story G ( g ), compared to the others which use normal G's (g). I think it's only used in the ads, which are automatically downloaded if you're connected to the internet, and since the ads are images, they're not actual fonts.

Additional notes
For some reason, Brianne's hand font is renamed to BrianneTod in PvZ2. Both of the fonts are the exact same fonts, but the BrianneTod is bigger than Brianne's hand. Brianne Tod has around 27 KB filesize, while Brianne's hand is only 14 KB. I don't know why it's bigger, but probably it has some more characters to use than the original Brianne's hand.

BrianneTod is also used on PvZ, and uses the same name. 