Log in

View Full Version : SSA/ASS font subset tool (shrink your fonts)


pie
26th December 2012, 13:14
I made a small utility to take some SSA/ASS subtitles and fonts, parse it, and create stripped down fonts containing only the characters required (font subsets).

e.g If using only one character from a font, then it will strip the font so it too only contains that one character.

Link: dead

I found this quite useful for fonts that contained CJK characters (which are often ~3MB+ each) - practically all fonts are reduced to under 100KB each, and generally I found I could get most scripts working with fonts of a combined size of 150KB or less.

Basic usage:
1. Set mkvmerge/mkvextract paths:
typochop -p "mkvmerge:/path/to/mkvmerge" "mkvextract:/path/to/mkvextract"
2. Feed it input (both fonts and subtitles):
typochop -o . video.mkv
typochop -o subsetted-fonts font-folder subs.ass

Some interesting use cases:
1. Collect all fonts for a particular series into one folder.
2. Place all subtitles for that series into another folder
typochop -o subset fonts-folder subtitles-folder
This will generate font subsets specific to each episode.

1. Do as above, but use this for the command instead:
typochop -a -o subset fonts-folder subtitles-folder
This will generate one set of fonts that will work for any episode in that series.

This tool is written in Java and uses sfntly (http://code.google.com/p/sfntly/) to work with the fonts.

pie
14th July 2013, 10:57
A new (beta) version. (link dead)

Some improvements from last time - (hopefully) more informative output, correct handling of drawing commands (ignore {\p1234...}{\p0} blocks), correct (I think) handling of hard spaces \h. It works pretty much most of the time on the stuff I've thrown at it.

Anyone ever use {\fe} commands, or have a sample that uses it?

Plorkyeran
23rd July 2013, 03:25
Anyone ever use {\fe} commands, or have a sample that uses it?
Aegisub ignores it entirely and no one has ever complained. I don't think there's any valid reason to use it anymore.

cyberbeing
23rd July 2013, 04:08
Use of either \fe or \fn is needed with VSFilter when a style font does not contain certain Unicode glyphs because of limitations in GDI fallback behavior.

Example: http://www.sendspace.com/file/w3662w

http://imageshack.us/a/img692/2899/jci7.th.png (http://imageshack.us/a/img692/2899/jci7.png)