This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


Reduce the size of a font file

When you distribute a small example script of Ren'Py, the size of the font file will be larger than your script's one. However, your script will only use a part of glyphs in many cases, so you can strip unused glyphs to reduce the size.

This page describes how to strip unused glyphs in the font file using FontForge.

Test environment:

Step

1. Download all scripts from the following place and extract it: Media:Strip_unused_glyphs.tar.gz‎

2. Set the executable path of FontForge to FONTFORGE variable in strip_unused.py.

3. Run the following commands in the unpacked directory:

$ python strip_unused.py [orig_font] [dest_font] [script_dir]

# orig_font  ... original font file
# dest_font  ... destination
# script_dir ... rpy file's directory

Details of this script

strip_unused.py takes character codes which are contained in rpy files and all codes from U+0000 to U+00FF and passes these codes to strip_glyphs.pe

strip_glyphs.pe is a script file of FontForge and it selects given codes, inverts selections, removes them and saves the new font file.

Then, the reduced font file is created to dest_font.

Notes

When you use the stripped font file, spaces of each lines may be decreased. In this case, please update style.default.line_spacing