Giter Site home page Giter Site logo

z64font's Introduction

z64font

z64font is a font tool that rasterizes TrueType font (.ttf) files into a format compatible with Ocarina of Time and Majora's Mask. Whether you're looking to localize these games into new languages that rely on brand new character sets, or you're just adding a fresh coat of paint to your romhack, this program makes your job a whole lot easier.

preview.gif

How to use

z64font requires you to provide only two files:

  • A UTF8-encoded text document containing a sample string and a list of codepoints.
  • The TrueType font (.ttf) file you wish to convert.

Here are the latest codepoint files (simply Ctrl + S in your browser):

You can use your scroll wheel to effortlessly tweak each control.

What you do next depends on your workflow.

Traditional hackers

Once you are happy with how your font is displaying in the preview window, click the Export Binaries button. You will be prompted to select a location and filename for them. Let's assume you chose the name wow.

Once you have done that, two files will be generated: wow.font_static and wow.font_width.

Inject the files into your decompressed game using a hex editor. For Windows users, I recommend HxD.

Game .font_static .font_width
OoT debug 0x008C1000 0x00BCABA0
OoT NTSC 1.0 0x00928000 0x00B88EA0
MM USA 0x00ACC000 0x00C669B0 and 0x00C66E50

If you don't know how to decompress your copy of the game, look no further than z64decompress.

To export for OoT decomp first make sure decompMode is checked. You must provide a text file with the names of the png files to export. An oot_decomp_fn.txt is included already.

Once you are happy with how your font is displaying in the preview window, click the Export Decomp button. You will be prompted to select a location and filename for the export. Let's assume you chose the name wow.

Once you have done that, a .png will be generated for every character, as well as a wow.font_width.h.

To add all the textures to your decomp repository, navigate to oot/assets/textures/nes_font_static, and place all of the generated files in this folder, overwriting as necessary.

Next, we need to update the spacing between each character. To do so, open oot/src/code/z_message_PAL.c, and find the sFontWidths array. Next, replace the entire array with this:

f32 sFontWidths[] = {
#include "textures/nes_font_static/wow.font_width.h"
};

Now make clean && make to compile the new font.

MM decomp users

The MM decomp will be made targetable once it finalizes its font handling.

z64font's People

Contributors

zelllll avatar z64me avatar

Stargazers

Jefferson Martines avatar Zephyr Lykos avatar Martin Anderson avatar Benjamin DeCamp avatar Simone avatar bperris avatar 49fl avatar  avatar Tim Fox avatar Midnoclose avatar

Watchers

James Cloos avatar Martin Anderson avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.