Font CustomICON 字體生成器
Font Custom 可使用命令行從 SVG 集合生成跨瀏覽器 ICON 字體和支持文件。
安裝
需要Ruby 1.9.3+ 、WOFF2 、帶有 Python 腳本的FontForge 。
# On Mac
brew tap bramstein/webfonttools
brew update
brew install woff2
brew install fontforge --with-python
brew install eot-utils
gem install fontcustom
# On Linux
sudo apt-get install zlib1g-dev fontforge
git clone https://github.com/bramstein/sfnt2woff-zopfli.git sfnt2woff-zopfli && cd sfnt2woff-zopfli && make && mv sfnt2woff-zopfli /usr/local/bin/sfnt2woff
git clone --recursive https://github.com/google/woff2.git && cd woff2 && make clean all && sudo mv woff2_compress /usr/local/bin/ && sudo mv woff2_decompress /usr/local/bin/
gem install fontcustom
Windows注意事項(xiàng):
- 安裝 fontforge: http://fontforge.github.io/en-US/downloads/windows/
- 安裝到?jīng)]有空格的路徑,例如 c:\FontForgeBuilds
- 在安裝程序結(jié)束時(shí),選中“運(yùn)行 fontforge”框,它完成了一些設(shè)置。
- 將安裝路徑添加到您的系統(tǒng) PATH 變量 (c:\FontForgeBuilds\bin)
- 打開(kāi)一個(gè)新的
fontforge -help命令提示符并測(cè)試它。 - gem 安裝 fontcustom
快速開(kāi)始
fontcustom compile my/vectors # Compiles icons into `fontcustom/`
fontcustom watch my/vectors # Compiles when vectors are changed/added/removed
fontcustom compile # Uses options from `./fontcustom.yml` or `config/fontcustom.yml`
fontcustom config # Generate a blank a config file
fontcustom help # See all options
配置
要管理編譯之間的設(shè)置,請(qǐng)運(yùn)行fontcustom config以生成配置文件。在里面可找到所有選項(xiàng)的列表。
每個(gè)選項(xiàng)也可用作覆蓋配置文件的破折號(hào)命令行標(biāo)志(例如 --css-selector)。
評(píng)論
圖片
表情
