Sha256: 55f4b748af8e49335afea4952ff2cb9da75e6c98d97620d9ddfd27442a3ff2ed

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

# font-converter

This is a Ruby wrapper for [FontForge](https://fontforge.github.io/en-US/documentation/), which can be used to parse font file and extract the font name, or convert fonts into different formats (.ttf, .otf, .woff, etc.)

[![Build Status](https://travis-ci.org/renny-ren/font-converter.svg?branch=master)](https://travis-ci.org/renny-ren/font-converter)

## Installation

`$ gem install font-converter`

In Rails, add it to your Gemfile:

`gem 'font-converter'`

then run `$ bundle install`

## Usage

You should first have fontforge installed on your machine:

`brew install fontforge`

#### parse

```ruby
FontForge.parse('/my_path/test.woff')  # => { font_name: 'xxx', full_name: 'xxx', family_name: 'xxx' }
```

#### convert

```ruby
# FontForge.convert(path, new_path)
FontForge.convert('/my_path/test.ttf', '/my_path/test.woff') # convert .ttf format to .woff
```


## Contributing

1. Fork it (https://github.com/renny-ren/font-converter)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
font-converter-0.1.2 README.md