Search code examples
phpflashtruetype

How do you generate a font subset in PHP?


I have a flash and PHP app that is available for Chinese users. In order to have the app display all of the required characters, at the moment I'm having to embed a massive Chinese font file in my SWF (takes the SWF to over 8MB).

There are tens of thousands of characters in the font file, but I'm actually using only a few hundre. The actual characters I'm using are all available from within PHP, from various XML, JSON and database sources.

Is there a way in PHP to generate a subset of the Chinese TTF which includes only the characters I am actually using? The set of characters in use will change regularly, so a manual solution unfortunately isn't practical.


Solution

  • Try this:

    http://www.4real.gr/technical-documents-ttf-subset.html

    Try TTFv2.zip referenced at the very bottom of the page.