prawn-icon 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec51a24710039426e3be1813e3a646b8f3bddbc6
4
- data.tar.gz: e3c7921cc6d0bdb8fad15ebf7db72aa179fcfe9e
3
+ metadata.gz: 4afdc4554a8b808e2c8f6e9d1671613065866172
4
+ data.tar.gz: 9f543c9a1a41a6a4daa5a991e5b78bc65551d018
5
5
  SHA512:
6
- metadata.gz: d1ff3e1377258207ce033841fbd4bb279fa221024f2362145e1afdba1304744a8f9b174ba31d27ed17eec66c0093a50f2702f8eb6ca51e7f326b6ea5bb2b3625
7
- data.tar.gz: c9d51b98b80c2197c378f3a162d73d229444effb687bd9bace6690b1852be5addeed7ba4434bcbdffeab8fdd4645eea4e7ab96707dca2a8849853a552131fbdf
6
+ metadata.gz: 94d7961757cf3b1efc79b6cfed0dbf14d9aede80fce4fb8e8e1cc584bd1cacfd4c9d337e62b4cd7d22712898dbfcfa101e1591f98e8c8e8f707894e338da59b0
7
+ data.tar.gz: 37de952a3ee296ec162b0aaa2b9414abe46812a8fdf1b18a1679ed3ec3d1fa1a8ece222224d96b0d5b01ff45636e256b040efec269e14a516474a0a656bff886
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.6.4 - May 4, 2015
2
+
3
+ - [PaymentFont](http://paymentfont.io) is now supported and included in `Prawn::Icon`.
4
+
1
5
  # 0.6.3 - March 4, 2015
2
6
 
3
7
  - Relaxed Prawn runtime dependency from >= 1.3.0 to >= 1.1.0.
data/README.md CHANGED
@@ -11,6 +11,7 @@ The following icon fonts ship with Prawn::Icon:
11
11
  * FontAwesome (http://fontawesome.io/icons/)
12
12
  * Foundation Icons (http://zurb.com/playground/foundation-icon-fonts-3)
13
13
  * GitHub Octicons (https://octicons.github.com)
14
+ * PaymentFont (http://paymentfont.io)
14
15
 
15
16
  Prawn::Icon was originally written by Jesse Doyle.
16
17
 
@@ -87,6 +88,7 @@ Currently supported prefixes include:
87
88
  * `fa` - Fontawesome (eg. `fa-arrows`)
88
89
  * `fi` - Foundation Icons (eg. `fi-compass`)
89
90
  * `octicon` - Github Octicons (eg. `octicon-calendar`)
91
+ * `pf` - PaymentFont (eg. `pf-cash`)
90
92
 
91
93
  ## How It Works
92
94
 
@@ -0,0 +1,35 @@
1
+ # All example code may be executed by calling `rake legend`
2
+
3
+ require_relative '../lib/prawn/icon'
4
+ require_relative 'example_helper'
5
+
6
+ Prawn::Document.generate('paymentfont.pdf') do
7
+ deja_path = File.join \
8
+ Prawn::Icon::FONTDIR, 'DejaVuSans.ttf'
9
+
10
+ font_families.update({
11
+ 'deja' => { normal: deja_path }
12
+ })
13
+
14
+ font('deja')
15
+
16
+ icons = icon_keys(self, 'pf')
17
+ required_pages = number_of_pages(self, 'pf')
18
+
19
+ define_grid(columns: 6, rows: 12, gutter: 16)
20
+
21
+ sub_header = 'PaymentFont'
22
+ link = 'http://paymentfont.io'
23
+ page_header sub_header, link
24
+
25
+ first_page_icons icons do |icon_key|
26
+ # Just call the +icon+ method and pass in an icon key
27
+ icon icon_key, size: 20, align: :center
28
+ end
29
+
30
+ start_new_page
31
+
32
+ page_icons icons, required_pages do |icon_key|
33
+ icon icon_key, size: 20, align: :center
34
+ end
35
+ end
data/fonts/pf/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
Binary file
data/fonts/pf/pf.yml ADDED
@@ -0,0 +1,98 @@
1
+ pf:
2
+ __font_version__: '1.1.2'
3
+ amazon: "\uf000"
4
+ american-express: "\uf001"
5
+ american-express-alt: "\uf002"
6
+ atm: "\uf003"
7
+ bankomat: "\uf004"
8
+ bank-transfer: "\uf005"
9
+ bitcoin: "\uf006"
10
+ bitcoin-sign: "\uf007"
11
+ braintree: "\uf008"
12
+ btc: "\uf009"
13
+ card: "\uf00a"
14
+ carta-si: "\uf00b"
15
+ cash: "\uf00c"
16
+ cash-on-delivery: "\uf00d"
17
+ cb: "\uf00e"
18
+ cirrus: "\uf00f"
19
+ cirrus-alt: "\uf010"
20
+ clickandbuy: "\uf011"
21
+ credit-card: "\uf012"
22
+ diners: "\uf013"
23
+ discover: "\uf014"
24
+ ec: "\uf015"
25
+ eps: "\uf016"
26
+ eur: "\uf017"
27
+ facture: "\uf018"
28
+ fattura: "\uf019"
29
+ flattr: "\uf01a"
30
+ giropay: "\uf01b"
31
+ gittip: "\uf01c"
32
+ gratipay: "\uf01c"
33
+ google-wallet: "\uf01d"
34
+ google-wallet-alt: "\uf01e"
35
+ gbp: "\uf01f"
36
+ ideal: "\uf020"
37
+ ils: "\uf021"
38
+ inr: "\uf022"
39
+ invoice: "\uf023"
40
+ invoice-sign: "\uf024"
41
+ invoice-sign-alt: "\uf025"
42
+ invoice-sign-alt-o: "\uf026"
43
+ invoice-sign-o: "\uf027"
44
+ jcb: "\uf028"
45
+ jpy: "\uf029"
46
+ krw: "\uf02a"
47
+ maestro: "\uf02b"
48
+ maestro-alt: "\uf02c"
49
+ mastercard: "\uf02d"
50
+ mastercard-alt: "\uf02e"
51
+ mastercard-securecode: "\uf02f"
52
+ ogone: "\uf030"
53
+ paybox: "\uf031"
54
+ paylife: "\uf032"
55
+ paypal: "\uf033"
56
+ paypal-alt: "\uf034"
57
+ paysafecard: "\uf035"
58
+ postepay: "\uf036"
59
+ quick: "\uf037"
60
+ rechnung: "\uf038"
61
+ ripple: "\uf039"
62
+ rub: "\uf03a"
63
+ skrill: "\uf03b"
64
+ sofort: "\uf03c"
65
+ square: "\uf03d"
66
+ stripe: "\uf03e"
67
+ truste: "\uf03f"
68
+ try: "\uf040"
69
+ unionpay: "\uf041"
70
+ usd: "\uf042"
71
+ verified-by-visa: "\uf043"
72
+ verisign: "\uf044"
73
+ visa: "\uf045"
74
+ visa-electron: "\uf046"
75
+ western-union: "\uf047"
76
+ western-union-alt: "\uf048"
77
+ wirecard: "\uf049"
78
+ sepa: "\uf04a"
79
+ sepa-alt: "\uf04b"
80
+ apple-pay: "\uf04c"
81
+ interac: "\uf04d"
82
+ paymill: "\uf04e"
83
+ dankort: "\uf04f"
84
+ bancontact-mister-cash: "\uf050"
85
+ moip: "\uf051"
86
+ pagseguro: "\uf052"
87
+ cash-on-pickup: "\uf053"
88
+ sage: "\uf054"
89
+ elo: "\uf055"
90
+ elo-alt: "\uf056"
91
+ payu: "\uf057"
92
+ mercado-pago: "\uf058"
93
+ mercado-pago-sign: "\uf059"
94
+ payshop: "\uf05a"
95
+ multibanco: "\uf05b"
96
+ gratipay-sign: "\uf05c"
97
+ six: "\uf05d"
98
+ cashcloud: "\uf05e"
@@ -8,6 +8,6 @@
8
8
 
9
9
  module Prawn
10
10
  class Icon
11
- VERSION = '0.6.3'.freeze
11
+ VERSION = '0.6.4'.freeze
12
12
  end
13
13
  end
@@ -29,7 +29,7 @@ describe Prawn::Icon::Interface do
29
29
  expect(text.font_settings.first[:size]).to eq(60.0)
30
30
  end
31
31
 
32
- it 'should be able to render on mulitple documents' do
32
+ it 'should be able to render on multiple documents' do
33
33
  pdf1 = create_pdf
34
34
  pdf2 = create_pdf
35
35
  pdf1.icon '<icon>fa-arrows</icon>', inline_format: true
@@ -118,4 +118,46 @@ describe Prawn::Icon::Interface do
118
118
  expect(proc).to raise_error(Prawn::Errors::UnknownOption)
119
119
  end
120
120
  end
121
- end
121
+ end
122
+
123
+ describe Prawn::Icon do
124
+ context 'FontAwesome' do
125
+ it 'should render FontAwesome glyphs' do
126
+ pdf = create_pdf
127
+ pdf.icon 'fa-user'
128
+ text = PDF::Inspector::Text.analyze(pdf.render)
129
+
130
+ expect(text.strings.first).to eq("")
131
+ end
132
+ end
133
+
134
+ context 'Foundation Icons' do
135
+ it 'should render Foundation glyphs' do
136
+ pdf = create_pdf
137
+ pdf.icon 'fi-laptop'
138
+ text = PDF::Inspector::Text.analyze(pdf.render)
139
+
140
+ expect(text.strings.first).to eq("")
141
+ end
142
+ end
143
+
144
+ context 'GitHub Octicons' do
145
+ it 'should render GitHub Octicon glyphs' do
146
+ pdf = create_pdf
147
+ pdf.icon 'octicon-logo-github'
148
+ text = PDF::Inspector::Text.analyze(pdf.render)
149
+
150
+ expect(text.strings.first).to eq("")
151
+ end
152
+ end
153
+
154
+ context 'PaymentFont' do
155
+ it 'should render PaymentFont glyphs' do
156
+ pdf = create_pdf
157
+ pdf.icon 'pf-amazon'
158
+ text = PDF::Inspector::Text.analyze(pdf.render)
159
+
160
+ expect(text.strings.first).to eq("")
161
+ end
162
+ end
163
+ end
@@ -93,7 +93,7 @@ describe Prawn::Icon::Parser do
93
93
  expect(inner).to be_empty
94
94
  end
95
95
 
96
- it 'should return an array containing a signle hash of attrs' do
96
+ it 'should return an array containing a single hash of attrs' do
97
97
  string = '<icon size="12" color="CCCCCC">fa-arrows</icon>'
98
98
  tokens = tokenize_string(string)
99
99
  config = Prawn::Icon::Parser.config_from_tokens(tokens)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-icon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Doyle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -152,6 +152,7 @@ files:
152
152
  - examples/fontawesome.rb
153
153
  - examples/foundation_icons.rb
154
154
  - examples/octicons.rb
155
+ - examples/paymentfont.rb
155
156
  - fonts/DejaVuSans.ttf
156
157
  - fonts/fa/LICENSE
157
158
  - fonts/fa/fa.yml
@@ -162,6 +163,9 @@ files:
162
163
  - fonts/octicon/LICENSE
163
164
  - fonts/octicon/octicon.yml
164
165
  - fonts/octicon/octicons.ttf
166
+ - fonts/pf/LICENSE
167
+ - fonts/pf/paymentfont-webfont.ttf
168
+ - fonts/pf/pf.yml
165
169
  - lib/prawn/icon.rb
166
170
  - lib/prawn/icon/font_data.rb
167
171
  - lib/prawn/icon/parser.rb