I am looking for a library that will convert a ttf or otf font to a js font.

I am aware of this converter tool http://typeface.neocracy.org/fonts.html

However I would like to know how this site is making the conversion. So I can implement the conversions of the font files myself.

Ideally I am looking for a JS or PHP library to accomplish this.

有帮助吗?

解决方案

The converter from typeface.js uses server-side perl scripts and the sources are on Launchpad.

Here is an extract from its README:

 use TypefaceJS;

 my $typeface = TypefaceJS::new->( input_filename => "truetype_font.ttf",
 unicode_range_names => ['Basic Latin', 'Latin-1 Supplement'], );

 $typeface->write_file( output_filename => 'font.typeface.js' );

其他提示

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top