A Ruby wrapper for FontForge that can be used to convert fonts into different formats (TTF, OTF, WOFF, SVG)
gem "fontforge-ruby"
This gem requires FontForge command lines tools to be installed. For more info on installation, please refer to the FontForge documentation.
Linux (Debian based)
sh sudo add-apt-repository ppa:fontforge/fontforge; sudo apt-get update; sudo apt-get install fontforge
Mac OS X
brew install fontforge
require 'fontforge_ruby'
FontforgeRuby.convert("input_font.ttf", "output_font.svg") # Converts ttf into svg font
The convert
method will return false (not fail) if FontForge could not convert the font. You can handle this situation like so:
require 'fontforge_ruby'
success = FontforgeRuby.convert("input_font.ttf", "output_font.svg") # Converts ttf into svg font
if success
# continue
else
raise "Could not convert font"
end
This is completely unofficial and is not related to FontForge in any way.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request