Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 4.86 KB

README.md

File metadata and controls

79 lines (52 loc) · 4.86 KB

G1N Font Editor

This program allows to create or modify the .g1n font format used in some Koei Tecmo games.

Requires .NET Framework v4.8.

Download latest release.

Features

  • Create a new .g1n font or modify an existing one.
  • Automatically import glyph metrics and draw their bitmaps from TrueType fonts.
  • Export/import glyph bitmaps and manually modify their metrics.

Guide

G1N is a font format utilized in various Koei Tecmo games like Fatal Frame, Nioh, and Wo Long, etc. This program aims to simplify the process of modifying that format.

I. Convert from TrueType Font

  • Create new or open existing an .g1n font via File → New or File → Open. A G1N font can contain many subfonts (pages). If you create a new font, you should keep the number of pages the same as the font used in the game.
  • If the original .g1n file contains multiple pages, identify the specific page containing the font you want to modify and switch to that page.
  • Choose the TrueType font (.ttf) you want to convert, customize its size and style, and proceed to input the characters you desire to include in the font.
  • Click Generate Bitmap from TrueType Font and wait for the program to process it, then save the .g1n file.

Note: The G1N format utilizes one byte to store each value, you should not set the font size too large (should be less than 127).

II. Modify Glyphs Manually

1. Glyph Metrics

Some converted TrueType fonts may not display properly in the game. To address this, you can manually adjust their glyph metrics by left-clicking on a specific character on the bitmap to modify it, or adjusting the parameters in the Glyph Options section to apply to all glyphs.

There are three editable metrics:

  • Baseline: The baseline is the invisible line upon which letters rest. Put simply, if you want a character to be positioned higher, increase it, and vice versa.
  • XOffset: XOffset is a value that specifies the horizontal shift of each character. Increasing the XOffset will shift the character to the right, and vice versa.
  • XAdvance: XAdvance is a value that determines the horizontal distance that needs to be advanced after displaying each character. It is almost the same as width, but is affected by XOffset.

Note: The G1N format utilizes one byte to store each value, these metrics cannot be greater than 127.

For example, the generated characters are positioned quite low, so I increased the Baseline value by 20 to align them with the icon:

2. Add/Remove Glyphs

If you do not want to automatically generate from TrueType font, you can manually add the desired characters via Edit → Add Glyph or by right-clicking on an empty space on the bitmap. The program will prompt you to select an image for the glyph and input the necessary values. The image should have a transparent background and must not exceed the size of 127x127 pixels.

Note: The Character field can only accept characters within the range of 0x00 to 0xFFFF. If the character you want to add is outside this range, you should assign it to an unused character.

To remove a glyph, right-click the character on the bitmap and select Remove Glyph.

3. Import/Export Bitmap Images

Similar to removing a glyph, you can right-click a character on a bitmap to import or export its bitmap.

III. Customize Color

In addition, you can also customize the color of the characters in the game.

Result

Known Issues

  • The spacing between characters in Fatal Frame's menus is excessively tight (and possibly in some other games.) It appears that this is a problem specific to these games because their fonts include slightly more spacing between characters than what is necessary in other games. To address this, manual adjustment of the XAdvance value is recommended (Add Custom XAdvance to apply to all glyphs.)

Bug Report

If there are any problems with the program or there is an unsupported G1N format, feel free to create an issue.

Helpful Links

Special Thanks