How to convert WOFF to TTF/OTF via command line?

前端 未结 2 1632
梦谈多话
梦谈多话 2020-12-23 03:47

I know about services like Online Font Converter, but I am interested in offline solution, preferably over command line. Does anyone know a tool or workflow how to convert W

相关标签:
2条回答
  • 2020-12-23 04:40

    Here is the reference code for making WOFF files: http://people.mozilla.org/~jkew/woff/ I have a mirror: https://github.com/samboy/WOFF

    To compile and install, make sure you have the zlib development libraries installed (e.g. in CentOS6 yum -y install zlib-devel as root), then

    git clone https://github.com/samboy/WOFF
    cd WOFF
    make
    

    Then, as root:

    cp sfnt2woff /usr/local/bin
    

    Once this is done, to make a webfont, enter the directory with the .ttf file, then run sfnt2woff

    sfnt2woff Chortle2014f.ttf
    

    This creates a Chortle2014f.woff webfont file. Replace “Chortle2014f.ttf” with the name of the actual webfont to convert.

    The first link I provide has Windows and MacOS binaries for people who do not wish to install a compiler.

    Here is the reference code for making WOFF2 files: https://github.com/google/woff2 Note that this code will not install in CentOS6, but compiles and installs just fine in CentOS7:

    git clone --recursive https://github.com/google/woff2.git
    cd woff2
    make clean all
    

    woff2 font generation is similar:

    woff2_compress Chortle2014f.ttf
    
    0 讨论(0)
  • 2020-12-23 04:43

    I wrote a simple tool for that:

    https://github.com/hanikesn/woff2otf

    Currently only tested with ttf files.

    0 讨论(0)
提交回复
热议问题