Skip to content

Commit

Permalink
Merge pull request #33 from jessedoyle/fa-5
Browse files Browse the repository at this point in the history
FontAwesome 5
  • Loading branch information
Jesse Doyle authored Mar 8, 2018
2 parents d1fb4bf + 0547879 commit 3dcefcc
Show file tree
Hide file tree
Showing 36 changed files with 1,284 additions and 1,155 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 2.0.0 - March 7, 2018

* [**breaking change**] Update to FontAwesome 5.0.8. FontAwesome 5 now provides 3 different font families: `brands`, `regular` and `solid`. The specifiers for these font icons are now: `fab`, `far` and `fas`.
* [**breaking change**] Remove GitHub Octicons because Octicons are now only [delivered via SVG](https://github.com/blog/2112-delivering-octicons-with-svg).
* [**breaking change**] Make the font specifier a required attribute for `Prawn::Icon::FontData#new`. Previously it was assumed to be `fa`.
* Write a new tool `tool/fontawesome/converter.rb` that accepts the FontAwesome metadata YAML file ([link](https://github.com/FortAwesome/Font-Awesome/blob/31281606f5205b0191c17c3b4d2d56e1ddbb2dc6/advanced-options/metadata/icons.yml)), and generates the correct legend files for `brands`, `regular` and `solid` styles.
* Require 'prawn/icon/version' with by default.

# 1.4.0 - Sept 11, 2017

- Update dependency gems to latest version.
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The following icon fonts ship with Prawn::Icon:

* FontAwesome (http://fontawesome.io/icons/)
* Foundation Icons (http://zurb.com/playground/foundation-icon-fonts-3)
* GitHub Octicons (https://octicons.github.com)
* PaymentFont (http://paymentfont.io)

Prawn::Icon was originally written by Jesse Doyle.
Expand All @@ -31,13 +30,13 @@ Prawn::Icon was designed to have an API familiar to Prawn. A single icon may be
require 'prawn/icon'

Prawn::Document.generate('icons.pdf') do |pdf|
pdf.icon 'fa-beer', size: 60
pdf.icon 'fas-beer', size: 60
end
```

produces:

![FontAwesome Beer](https://raw.github.com/jessedoyle/prawn-icon/master/examples/fa-beer.png)
![FontAwesome Beer](https://raw.github.com/jessedoyle/prawn-icon/master/examples/fas-beer.png)

## Inline Icons

Expand All @@ -47,13 +46,13 @@ You can also provide the `inline_format: true` option to Prawn::Icon:
require 'prawn/icon'

Prawn::Document.generate('inline_icons.pdf') do |pdf|
pdf.icon 'Enjoy: <icon size="20" color="AAAAAA">fa-beer</icon>', inline_format: true
pdf.icon 'Enjoy: <icon size="20" color="AAAAAA">fas-beer</icon>', inline_format: true
end
```

produces:

![FontAwesome Beer Inline](https://raw.github.com/jessedoyle/prawn-icon/master/examples/fa-beer-inline.png)
![FontAwesome Beer Inline](https://raw.github.com/jessedoyle/prawn-icon/master/examples/fas-beer-inline.png)

When using `inline_format: true`, you may supply `<icon>` tags with `color` and `size` attributes.

Expand All @@ -69,7 +68,7 @@ Prawn::Document.generate('table_icons.pdf') do |pdf|

data = [
# Explicit brackets must be used here
[pdf.table_icon('fa-birthday-cake'), 'Cake'],
[pdf.table_icon('fas-birthday-cake'), 'Cake'],
['is', 'Great!']
]

Expand All @@ -85,10 +84,11 @@ Prawn::Icon uses the prefix of an icon key to determine which font family is use

Currently supported prefixes include:

* `fa` - Fontawesome (eg. `fa-arrows`)
* `fi` - Foundation Icons (eg. `fi-compass`)
* `octicon` - Github Octicons (eg. `octicon-calendar`)
* `pf` - PaymentFont (eg. `pf-cash`)
* `fab` - [FontAwesome Brands](https://fontawesome.com/icons?d=gallery&s=brands&m=free) (eg. `fab-amazon`).
* `far` - [FontAwesome Regular](https://fontawesome.com/icons?d=gallery&s=regular&m=free) (eg. `far-address-book`).
* `fas` - [FontAwesome Solid](https://fontawesome.com/icons?d=gallery&s=solid&m=free) (eg. `fas-location-arrow`).
* `fi` - [Foundation Icons](https://zurb.com/playground/foundation-icon-fonts-3) (eg. `fi-compass`).
* `pf` - [PaymentFont](https://paymentfont.com/#icons) (eg. `pf-cash`).

## How It Works

Expand Down
4 changes: 0 additions & 4 deletions data/fonts/fa/LICENSE

This file was deleted.

Loading

0 comments on commit 3dcefcc

Please sign in to comment.