prawn-icon 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -1
- data/README.md +10 -10
- data/data/fonts/fab/LICENSE +34 -0
- data/data/fonts/fab/fa-brands.ttf +0 -0
- data/data/fonts/fab/fab.yml +333 -0
- data/data/fonts/far/LICENSE +34 -0
- data/data/fonts/far/fa-regular.ttf +0 -0
- data/data/fonts/far/far.yml +119 -0
- data/data/fonts/fas/LICENSE +34 -0
- data/data/fonts/fas/fa-solid.ttf +0 -0
- data/data/fonts/fas/fas.yml +503 -0
- data/data/fonts/pf/paymentfont-webfont.ttf +0 -0
- data/data/fonts/pf/pf.yml +118 -97
- data/examples/fas-beer-inline.png +0 -0
- data/examples/fas-beer.png +0 -0
- data/examples/fontawesome.rb +28 -20
- data/lib/prawn/icon.rb +1 -0
- data/lib/prawn/icon/errors.rb +8 -0
- data/lib/prawn/icon/font_data.rb +1 -1
- data/lib/prawn/icon/interface.rb +5 -6
- data/lib/prawn/icon/version.rb +1 -1
- data/prawn-icon.gemspec +9 -10
- data/spec/integration/icon_spec.rb +44 -35
- data/spec/unit/errors/icon_not_found_spec.rb +1 -1
- data/spec/unit/font_data_spec.rb +14 -15
- data/spec/unit/icon_spec.rb +14 -14
- data/spec/unit/parser_spec.rb +26 -26
- metadata +27 -25
- data/data/fonts/fa/LICENSE +0 -4
- data/data/fonts/fa/fa.yml +0 -732
- data/data/fonts/fa/fontawesome.ttf +0 -0
- data/data/fonts/octicon/LICENSE +0 -9
- data/data/fonts/octicon/octicon.yml +0 -192
- data/data/fonts/octicon/octicons.ttf +0 -0
- data/examples/fa-beer-inline.png +0 -0
- data/examples/fa-beer.png +0 -0
- data/examples/octicons.rb +0 -35
Binary file
|
data/data/fonts/pf/pf.yml
CHANGED
@@ -1,98 +1,119 @@
|
|
1
|
+
---
|
1
2
|
pf:
|
2
|
-
__font_version__:
|
3
|
-
amazon: "
|
4
|
-
american-express: "
|
5
|
-
american-express-alt: "
|
6
|
-
atm: "
|
7
|
-
bankomat: "
|
8
|
-
bank-transfer: "
|
9
|
-
bitcoin: "
|
10
|
-
bitcoin-sign: "
|
11
|
-
braintree: "
|
12
|
-
btc: "
|
13
|
-
card: "
|
14
|
-
carta-si: "
|
15
|
-
cash: "
|
16
|
-
cash-on-delivery: "
|
17
|
-
cb: "
|
18
|
-
cirrus: "
|
19
|
-
cirrus-alt: "
|
20
|
-
clickandbuy: "
|
21
|
-
credit-card: "
|
22
|
-
diners: "
|
23
|
-
discover: "
|
24
|
-
ec: "
|
25
|
-
eps: "
|
26
|
-
eur: "
|
27
|
-
facture: "
|
28
|
-
fattura: "
|
29
|
-
flattr: "
|
30
|
-
giropay: "
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
invoice: "
|
40
|
-
invoice-sign: "
|
41
|
-
invoice-sign-alt: "
|
42
|
-
invoice-sign-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
maestro: "
|
48
|
-
|
49
|
-
mastercard: "
|
50
|
-
mastercard-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
paypal: "
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
visa: "
|
74
|
-
|
75
|
-
western-union: "
|
76
|
-
|
77
|
-
|
78
|
-
sepa: "
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
elo: "
|
90
|
-
|
91
|
-
|
92
|
-
mercado-pago: "
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
3
|
+
__font_version__: 1.2.5
|
4
|
+
amazon: ""
|
5
|
+
american-express: ""
|
6
|
+
american-express-alt: ""
|
7
|
+
atm: ""
|
8
|
+
bankomat: ""
|
9
|
+
bank-transfer: ""
|
10
|
+
bitcoin: ""
|
11
|
+
bitcoin-sign: ""
|
12
|
+
braintree: ""
|
13
|
+
btc: ""
|
14
|
+
card: ""
|
15
|
+
carta-si: ""
|
16
|
+
cash: ""
|
17
|
+
cash-on-delivery: ""
|
18
|
+
cb: ""
|
19
|
+
cirrus: ""
|
20
|
+
cirrus-alt: ""
|
21
|
+
clickandbuy: ""
|
22
|
+
credit-card: ""
|
23
|
+
diners: ""
|
24
|
+
discover: ""
|
25
|
+
ec: ""
|
26
|
+
eps: ""
|
27
|
+
eur: ""
|
28
|
+
facture: ""
|
29
|
+
fattura: ""
|
30
|
+
flattr: ""
|
31
|
+
giropay: ""
|
32
|
+
google-wallet: ""
|
33
|
+
google-wallet-alt: ""
|
34
|
+
gpb: ""
|
35
|
+
gratipay: ""
|
36
|
+
ideal: ""
|
37
|
+
ils: ""
|
38
|
+
inr: ""
|
39
|
+
invoice: ""
|
40
|
+
invoice-sign: ""
|
41
|
+
invoice-sign-alt: ""
|
42
|
+
invoice-sign-alt-o: ""
|
43
|
+
invoice-sign-o: ""
|
44
|
+
jcb: ""
|
45
|
+
jpy: ""
|
46
|
+
krw: ""
|
47
|
+
maestro: ""
|
48
|
+
maestro-alt: ""
|
49
|
+
mastercard: ""
|
50
|
+
mastercard-alt: ""
|
51
|
+
mastercard-securecode: ""
|
52
|
+
ogone: ""
|
53
|
+
paybox: ""
|
54
|
+
paylife: ""
|
55
|
+
paypal: ""
|
56
|
+
paypal-alt: ""
|
57
|
+
paysafecard: ""
|
58
|
+
postepay: ""
|
59
|
+
quick: ""
|
60
|
+
rechnung: ""
|
61
|
+
ripple: ""
|
62
|
+
rub: ""
|
63
|
+
skrill: ""
|
64
|
+
sofort: ""
|
65
|
+
square: ""
|
66
|
+
stripe: ""
|
67
|
+
truste: ""
|
68
|
+
try: ""
|
69
|
+
unionpay: ""
|
70
|
+
usd: ""
|
71
|
+
verified-by-visa: ""
|
72
|
+
verisign: ""
|
73
|
+
visa: ""
|
74
|
+
visa-electron: ""
|
75
|
+
western-union: ""
|
76
|
+
western-union-alt: ""
|
77
|
+
wirecard: ""
|
78
|
+
sepa: ""
|
79
|
+
sepa-alt: ""
|
80
|
+
apple-pay: ""
|
81
|
+
interac: ""
|
82
|
+
paymill: ""
|
83
|
+
dankort: ""
|
84
|
+
bancontact-mister-cash: ""
|
85
|
+
moip: ""
|
86
|
+
pagseguro: ""
|
87
|
+
cash-on-pickup: ""
|
88
|
+
sage: ""
|
89
|
+
elo: ""
|
90
|
+
elo-alt: ""
|
91
|
+
payu: ""
|
92
|
+
mercado-pago: ""
|
93
|
+
mercado-pago-sign: ""
|
94
|
+
payshop: ""
|
95
|
+
multibanco: ""
|
96
|
+
gratipay-sign: ""
|
97
|
+
six: ""
|
98
|
+
cashcloud: ""
|
99
|
+
interac-alt: ""
|
100
|
+
klarna: ""
|
101
|
+
bitpay: ""
|
102
|
+
venmo: ""
|
103
|
+
visa-debit: ""
|
104
|
+
alipay: ""
|
105
|
+
diners-alt: ""
|
106
|
+
hipercard: ""
|
107
|
+
skrill-alt: ""
|
108
|
+
shopify: ""
|
109
|
+
direct-debit: ""
|
110
|
+
sodexo: ""
|
111
|
+
bpay: ""
|
112
|
+
contactless: ""
|
113
|
+
contactless-alt: ""
|
114
|
+
eth: ""
|
115
|
+
ltc: ""
|
116
|
+
visa-pay: ""
|
117
|
+
wechat-pay: ""
|
118
|
+
amazon-pay: ""
|
119
|
+
amazon-pay-alt: ""
|
Binary file
|
Binary file
|
data/examples/fontawesome.rb
CHANGED
@@ -3,33 +3,41 @@
|
|
3
3
|
require_relative '../lib/prawn/icon'
|
4
4
|
require_relative 'example_helper'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
STYLES = {
|
7
|
+
fab: 'Brands',
|
8
|
+
far: 'Regular',
|
9
|
+
fas: 'Solid'
|
10
|
+
}.freeze
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
STYLES.each do |specifier, type|
|
13
|
+
Prawn::Document.generate("fontawesome_#{type.downcase}.pdf") do
|
14
|
+
deja_path = File.join \
|
15
|
+
Prawn::Icon::Base::FONTDIR, 'DejaVuSans.ttf'
|
13
16
|
|
14
|
-
|
17
|
+
font_families.update(
|
18
|
+
'deja' => { normal: deja_path }
|
19
|
+
)
|
15
20
|
|
16
|
-
|
17
|
-
required_pages = number_of_pages(self, 'fa')
|
21
|
+
font('deja')
|
18
22
|
|
19
|
-
|
23
|
+
icons = icon_keys(self, specifier.to_s)
|
24
|
+
required_pages = number_of_pages(self, specifier.to_s)
|
20
25
|
|
21
|
-
|
22
|
-
link = 'http://fontawesome.io/icons/'
|
23
|
-
page_header sub_header, link
|
26
|
+
define_grid(columns: 6, rows: 12, gutter: 16)
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
sub_header = "FontAwesome | #{type}"
|
29
|
+
link = 'http://fontawesome.io/icons/'
|
30
|
+
page_header sub_header, link
|
31
|
+
|
32
|
+
first_page_icons icons do |icon_key|
|
33
|
+
# Just call the +icon+ method and pass in an icon key
|
34
|
+
icon icon_key, size: 20, align: :center
|
35
|
+
end
|
29
36
|
|
30
|
-
|
37
|
+
start_new_page
|
31
38
|
|
32
|
-
|
33
|
-
|
39
|
+
page_icons icons, required_pages do |icon_key|
|
40
|
+
icon icon_key, size: 20, align: :center
|
41
|
+
end
|
34
42
|
end
|
35
43
|
end
|
data/lib/prawn/icon.rb
CHANGED
data/lib/prawn/icon/errors.rb
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# errors.rb - Prawn::Icon standard errors.
|
4
|
+
#
|
5
|
+
# Copyright September 2016, Jesse Doyle. All rights reserved.
|
6
|
+
#
|
7
|
+
# This is free software. Please see the LICENSE and COPYING files for details.
|
8
|
+
|
1
9
|
module Prawn
|
2
10
|
class Icon
|
3
11
|
module Errors
|
data/lib/prawn/icon/font_data.rb
CHANGED
data/lib/prawn/icon/interface.rb
CHANGED
@@ -9,8 +9,7 @@
|
|
9
9
|
module Prawn
|
10
10
|
# Easy icon font usage within Prawn. Currently
|
11
11
|
# supported icon fonts include: FontAwesome,
|
12
|
-
# Zurb Foundicons
|
13
|
-
# PaymentFont.
|
12
|
+
# Zurb Foundicons and PaymentFont.
|
14
13
|
#
|
15
14
|
# = Icon Keys
|
16
15
|
#
|
@@ -58,8 +57,8 @@ module Prawn
|
|
58
57
|
# the underlying +text+ method call.
|
59
58
|
#
|
60
59
|
# == Examples:
|
61
|
-
# pdf.icon '
|
62
|
-
# pdf.icon '<icon color="0099FF">
|
60
|
+
# pdf.icon 'fas-beer'
|
61
|
+
# pdf.icon '<icon color="0099FF">fas-user-circle</icon>',
|
63
62
|
# inline_format: true
|
64
63
|
#
|
65
64
|
def icon(key, opts = {})
|
@@ -135,7 +134,7 @@ module Prawn
|
|
135
134
|
# that match the data necessary for the
|
136
135
|
# specified icon.
|
137
136
|
#
|
138
|
-
# eg. { font: '
|
137
|
+
# eg. { font: 'fas', content: "\uf2b9" }
|
139
138
|
#
|
140
139
|
# Note that the +font+ key will not be set
|
141
140
|
# if +inline_format: true+.
|
@@ -145,7 +144,7 @@ module Prawn
|
|
145
144
|
#
|
146
145
|
# data = [
|
147
146
|
# # Explicit brackets must be used here
|
148
|
-
# [pdf.table_icon('
|
147
|
+
# [pdf.table_icon('fas-coffee'), 'Cell 1'],
|
149
148
|
# ['Cell 2', 'Cell 3']
|
150
149
|
# ]
|
151
150
|
#
|
data/lib/prawn/icon/version.rb
CHANGED
data/prawn-icon.gemspec
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
basedir = File.expand_path(File.dirname(__FILE__))
|
2
2
|
require "#{basedir}/lib/prawn/icon/version"
|
3
3
|
|
4
|
-
# rubocop:disable Metrics/BlockLength
|
5
4
|
Gem::Specification.new do |spec|
|
6
5
|
spec.name = 'prawn-icon'
|
7
6
|
spec.version = Prawn::Icon::VERSION
|
8
7
|
spec.platform = Gem::Platform::RUBY
|
9
8
|
spec.summary = 'Provides icon fonts for PrawnPDF'
|
10
9
|
spec.files = Dir.glob('{lib,spec,data,examples}/**/**/*') +
|
11
|
-
%w
|
12
|
-
%w
|
13
|
-
%w
|
10
|
+
%w[prawn-icon.gemspec Gemfile Rakefile] +
|
11
|
+
%w[README.md CHANGELOG.md] +
|
12
|
+
%w[COPYING LICENSE GPLv2 GPLv3]
|
14
13
|
|
15
14
|
spec.require_path = 'lib'
|
16
15
|
spec.required_ruby_version = '>= 1.9.3'
|
@@ -25,16 +24,16 @@ Gem::Specification.new do |spec|
|
|
25
24
|
|
26
25
|
spec.add_dependency('prawn', '>= 1.1.0', '< 3.0.0')
|
27
26
|
|
28
|
-
spec.add_development_dependency('pdf-inspector', '
|
29
|
-
spec.add_development_dependency('rspec', '
|
30
|
-
spec.add_development_dependency('rubocop', '~> 0.
|
27
|
+
spec.add_development_dependency('pdf-inspector', '>= 1.2.1')
|
28
|
+
spec.add_development_dependency('rspec', '>= 3.5.0')
|
29
|
+
spec.add_development_dependency('rubocop', '~> 0.49.1')
|
31
30
|
spec.add_development_dependency('rake')
|
32
|
-
spec.add_development_dependency('pdf-reader', '
|
33
|
-
spec.add_development_dependency('simplecov'
|
31
|
+
spec.add_development_dependency('pdf-reader', '>= 1.4')
|
32
|
+
spec.add_development_dependency('simplecov')
|
34
33
|
|
35
34
|
spec.description = <<-END_DESC
|
36
35
|
Prawn::Icon provides various icon fonts including
|
37
|
-
FontAwesome,
|
36
|
+
FontAwesome, PaymentFont and Foundation Icons
|
38
37
|
for use with the Prawn PDF toolkit.
|
39
38
|
END_DESC
|
40
39
|
end
|
@@ -13,7 +13,7 @@ describe Prawn::Icon::Interface do
|
|
13
13
|
context 'valid icon key' do
|
14
14
|
context 'with options' do
|
15
15
|
it 'should handle text options (size)' do
|
16
|
-
pdf.icon '
|
16
|
+
pdf.icon 'far-address-book', size: 60
|
17
17
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
18
18
|
|
19
19
|
expect(text.font_settings.first[:size]).to eq(60)
|
@@ -22,27 +22,27 @@ describe Prawn::Icon::Interface do
|
|
22
22
|
|
23
23
|
context 'inline_format: true' do
|
24
24
|
it 'should handle text options (size)' do
|
25
|
-
pdf.icon '<icon size="60">
|
25
|
+
pdf.icon '<icon size="60">far-address-book</icon>', inline_format: true
|
26
26
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
27
27
|
|
28
|
-
expect(text.strings.first).to eq(
|
28
|
+
expect(text.strings.first).to eq('')
|
29
29
|
expect(text.font_settings.first[:size]).to eq(60.0)
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should be able to render on multiple documents' do
|
33
33
|
pdf1 = create_pdf
|
34
34
|
pdf2 = create_pdf
|
35
|
-
pdf1.icon '<icon>
|
36
|
-
pdf2.icon '<icon>
|
35
|
+
pdf1.icon '<icon>far-address-book</icon>', inline_format: true
|
36
|
+
pdf2.icon '<icon>far-address-book</icon>', inline_format: true
|
37
37
|
text1 = PDF::Inspector::Text.analyze(pdf1.render)
|
38
38
|
text2 = PDF::Inspector::Text.analyze(pdf2.render)
|
39
39
|
|
40
|
-
expect(text1.strings.first).to eq(
|
41
|
-
expect(text2.strings.first).to eq(
|
40
|
+
expect(text1.strings.first).to eq('')
|
41
|
+
expect(text2.strings.first).to eq('')
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'renders the icon at the proper cursor position (#24)' do
|
45
|
-
icon_text = '<icon>
|
45
|
+
icon_text = '<icon>fas-info-circle</icon> icon here!'
|
46
46
|
pdf.text 'Start'
|
47
47
|
pdf.move_down 10
|
48
48
|
pdf.text 'More'
|
@@ -57,7 +57,7 @@ describe Prawn::Icon::Interface do
|
|
57
57
|
|
58
58
|
context 'with final_gap: false' do
|
59
59
|
it 'renders the icon without a final gap' do
|
60
|
-
icon = pdf.icon '<icon size="60">
|
60
|
+
icon = pdf.icon '<icon size="60">far-address-book</icon>',
|
61
61
|
inline_format: true,
|
62
62
|
final_gap: false
|
63
63
|
expect(icon.at.last.round).to eq(792)
|
@@ -67,17 +67,17 @@ describe Prawn::Icon::Interface do
|
|
67
67
|
|
68
68
|
context 'without options' do
|
69
69
|
it 'should render an icon to document' do
|
70
|
-
pdf.icon '
|
70
|
+
pdf.icon 'far-address-book'
|
71
71
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
72
72
|
|
73
|
-
expect(text.strings.first).to eq(
|
73
|
+
expect(text.strings.first).to eq('')
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
78
|
context 'invalid icon key' do
|
79
79
|
it 'should raise IconNotFound' do
|
80
|
-
proc = Proc.new { pdf.icon '
|
80
|
+
proc = Proc.new { pdf.icon 'far-__INVALID' }
|
81
81
|
|
82
82
|
expect(proc).to raise_error(Prawn::Icon::Errors::IconNotFound)
|
83
83
|
end
|
@@ -95,7 +95,7 @@ describe Prawn::Icon::Interface do
|
|
95
95
|
describe '::make_icon' do
|
96
96
|
context ':inline_format => false (default)' do
|
97
97
|
it 'should return a Prawn::Icon instance' do
|
98
|
-
icon = pdf.make_icon '
|
98
|
+
icon = pdf.make_icon 'far-address-book'
|
99
99
|
|
100
100
|
expect(icon).to be_a(Prawn::Icon)
|
101
101
|
end
|
@@ -103,7 +103,7 @@ describe Prawn::Icon::Interface do
|
|
103
103
|
|
104
104
|
context ':inline_format => true' do
|
105
105
|
it 'should return a Prawn::::Text::Formatted::Box instance' do
|
106
|
-
icon = pdf.make_icon '<icon>
|
106
|
+
icon = pdf.make_icon '<icon>far-address-book</icon>', inline_format: true
|
107
107
|
|
108
108
|
expect(icon).to be_a(Prawn::Text::Formatted::Box)
|
109
109
|
end
|
@@ -112,7 +112,7 @@ describe Prawn::Icon::Interface do
|
|
112
112
|
|
113
113
|
describe '::inline_icon' do
|
114
114
|
it 'should return a Prawn::Text::Formatted::Box instance' do
|
115
|
-
icon = pdf.inline_icon '<icon>
|
115
|
+
icon = pdf.inline_icon '<icon>far-address-book</icon>'
|
116
116
|
|
117
117
|
expect(icon).to be_a(Prawn::Text::Formatted::Box)
|
118
118
|
end
|
@@ -121,20 +121,20 @@ describe Prawn::Icon::Interface do
|
|
121
121
|
describe '::table_icon' do
|
122
122
|
context 'inline_format: false (default)' do
|
123
123
|
it 'should return a hash with font and content keys' do
|
124
|
-
icon = pdf.table_icon '
|
124
|
+
icon = pdf.table_icon 'far-address-book'
|
125
125
|
|
126
126
|
expect(icon).to be_a(Hash)
|
127
|
-
expect(icon[:font]).to eq('
|
128
|
-
expect(icon[:content]).to eq(
|
127
|
+
expect(icon[:font]).to eq('far')
|
128
|
+
expect(icon[:content]).to eq('')
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
132
|
context 'inline_format: true' do
|
133
133
|
it 'should convert <icon> to <font> tags' do
|
134
|
-
icon = pdf.table_icon '<icon>
|
134
|
+
icon = pdf.table_icon '<icon>fas-user</icon>', inline_format: true
|
135
135
|
|
136
136
|
expect(icon).to be_a(Hash)
|
137
|
-
expect(icon[:content]).to eq('<font name="
|
137
|
+
expect(icon[:content]).to eq('<font name="fas"></font>')
|
138
138
|
expect(icon[:inline_format]).to be true
|
139
139
|
end
|
140
140
|
|
@@ -149,8 +149,8 @@ describe Prawn::Icon::Interface do
|
|
149
149
|
|
150
150
|
context 'multiple icons' do
|
151
151
|
it 'should ignore any text not in an icon tag' do
|
152
|
-
a = ['<icon>
|
153
|
-
out = '<font name="
|
152
|
+
a = ['<icon>fas-user</icon> Some Text <icon>fi-laptop</icon>', inline_format: true]
|
153
|
+
out = '<font name="fas"></font> Some Text <font name="fi"></font>'
|
154
154
|
icon = pdf.table_icon(*a)
|
155
155
|
|
156
156
|
expect(icon).to be_a(Hash)
|
@@ -165,30 +165,39 @@ end
|
|
165
165
|
describe Prawn::Icon do
|
166
166
|
let(:pdf) { create_pdf }
|
167
167
|
|
168
|
-
context 'FontAwesome' do
|
169
|
-
it 'should render
|
170
|
-
pdf.icon '
|
168
|
+
context 'FontAwesome | Regular' do
|
169
|
+
it 'should render regular glyphs' do
|
170
|
+
pdf.icon 'far-user'
|
171
171
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
172
172
|
|
173
|
-
expect(text.strings.first).to eq(
|
173
|
+
expect(text.strings.first).to eq('')
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
177
|
-
context '
|
178
|
-
it 'should render
|
179
|
-
pdf.icon '
|
177
|
+
context 'FontAwesome | Solid' do
|
178
|
+
it 'should render solid glyphs' do
|
179
|
+
pdf.icon 'fas-user'
|
180
180
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
181
181
|
|
182
|
-
expect(text.strings.first).to eq(
|
182
|
+
expect(text.strings.first).to eq('')
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
|
-
context '
|
187
|
-
it 'should render
|
188
|
-
pdf.icon '
|
186
|
+
context 'FontAwesome | Brands' do
|
187
|
+
it 'should render FontAwesome glyphs' do
|
188
|
+
pdf.icon 'fab-amazon'
|
189
|
+
text = PDF::Inspector::Text.analyze(pdf.render)
|
190
|
+
|
191
|
+
expect(text.strings.first).to eq('')
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
context 'Foundation Icons' do
|
196
|
+
it 'should render Foundation glyphs' do
|
197
|
+
pdf.icon 'fi-laptop'
|
189
198
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
190
199
|
|
191
|
-
expect(text.strings.first).to eq(
|
200
|
+
expect(text.strings.first).to eq('')
|
192
201
|
end
|
193
202
|
end
|
194
203
|
|
@@ -197,7 +206,7 @@ describe Prawn::Icon do
|
|
197
206
|
pdf.icon 'pf-amazon'
|
198
207
|
text = PDF::Inspector::Text.analyze(pdf.render)
|
199
208
|
|
200
|
-
expect(text.strings.first).to eq(
|
209
|
+
expect(text.strings.first).to eq('')
|
201
210
|
end
|
202
211
|
end
|
203
212
|
end
|