alphasights-prawn 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/prawn/font.rb +17 -17
- metadata +4 -4
data/lib/prawn/font.rb
CHANGED
@@ -38,7 +38,7 @@ module Prawn
|
|
38
38
|
#
|
39
39
|
# If a ttf font is specified, the glyphs necessary to render your document
|
40
40
|
# will be embedded in the rendered PDF. This should be your preferred option
|
41
|
-
# in most cases. It will increase the size of the resulting file, but also
|
41
|
+
# in most cases. It will increase the size of the resulting file, but also
|
42
42
|
# make it more portable.
|
43
43
|
#
|
44
44
|
# The options parameter is an optional hash providing size and style. To use
|
@@ -49,9 +49,9 @@ module Prawn
|
|
49
49
|
return((defined?(@font) && @font) || font("Helvetica")) if name.nil?
|
50
50
|
|
51
51
|
if state.pages.empty? && !state.page.in_stamp_stream?
|
52
|
-
raise Prawn::Errors::NotOnPage
|
52
|
+
raise Prawn::Errors::NotOnPage
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
new_font = find_font(name, options)
|
56
56
|
|
57
57
|
if block_given?
|
@@ -134,18 +134,18 @@ module Prawn
|
|
134
134
|
# font will be embedded twice. Since we do font subsetting, this double
|
135
135
|
# embedding won't be catastrophic, just annoying.
|
136
136
|
# ++
|
137
|
-
def find_font(name, options={}) #:nodoc:
|
138
|
-
if font_families.key?(name)
|
139
|
-
family, name = name, font_families[name][options[:style] || :normal]
|
140
|
-
if name.is_a?(Hash)
|
141
|
-
options = options.merge(name)
|
142
|
-
name = options[:file]
|
143
|
-
end
|
144
|
-
end
|
145
|
-
key = "#{name}:#{options[:font] || 0}"
|
146
|
-
font_registry[key] ||= Font.load(self, name, options.merge(:family => family))
|
147
|
-
end
|
148
|
-
|
137
|
+
def find_font(name, options={}) #:nodoc:
|
138
|
+
if font_families.key?(name)
|
139
|
+
family, name = name, font_families[name][options[:style] || :normal]
|
140
|
+
if name.is_a?(Hash)
|
141
|
+
options = options.merge(name)
|
142
|
+
name = options[:file]
|
143
|
+
end
|
144
|
+
end
|
145
|
+
key = "#{name}:#{options[:font] || 0}"
|
146
|
+
font_registry[key] ||= Font.load(self, name, options.merge(:family => family))
|
147
|
+
end
|
148
|
+
|
149
149
|
# Hash of Font objects keyed by names
|
150
150
|
#
|
151
151
|
def font_registry #:nodoc:
|
@@ -254,12 +254,12 @@ module Prawn
|
|
254
254
|
|
255
255
|
@family = options[:family]
|
256
256
|
|
257
|
-
@identifier = :"F#{@document.font_registry.size + 1}"
|
257
|
+
@identifier = :"F#{@document.font_registry.size + 1 + 50}"
|
258
258
|
|
259
259
|
@references = {}
|
260
260
|
end
|
261
261
|
|
262
|
-
# The size of the font ascender in PDF points
|
262
|
+
# The size of the font ascender in PDF points
|
263
263
|
#
|
264
264
|
def ascender
|
265
265
|
@ascender / 1000.0 * size
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphasights-prawn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 49
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 3
|
10
|
+
version: 0.10.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gregory Brown
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-28 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|