prawn 1.0.0.rc2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +9 -0
  3. data/COPYING +2 -2
  4. data/Gemfile +8 -15
  5. data/LICENSE +1 -1
  6. data/Rakefile +25 -16
  7. data/data/images/16bit.alpha +0 -0
  8. data/data/images/16bit.color +0 -0
  9. data/data/images/dice.alpha +0 -0
  10. data/data/images/dice.color +0 -0
  11. data/data/images/indexed_color.dat +0 -0
  12. data/data/images/indexed_color.png +0 -0
  13. data/data/images/license.md +8 -0
  14. data/data/images/page_white_text.alpha +0 -0
  15. data/data/images/page_white_text.color +0 -0
  16. data/lib/prawn.rb +85 -23
  17. data/lib/prawn/document.rb +134 -116
  18. data/lib/prawn/document/bounding_box.rb +33 -4
  19. data/lib/prawn/document/column_box.rb +18 -6
  20. data/lib/prawn/document/graphics_state.rb +11 -74
  21. data/lib/prawn/document/internals.rb +24 -23
  22. data/lib/prawn/document/span.rb +12 -10
  23. data/lib/prawn/encoding.rb +8 -9
  24. data/lib/prawn/errors.rb +13 -32
  25. data/lib/prawn/font.rb +137 -105
  26. data/lib/prawn/font/afm.rb +76 -32
  27. data/lib/prawn/font/dfont.rb +4 -3
  28. data/lib/prawn/font/ttf.rb +33 -25
  29. data/lib/prawn/font_metric_cache.rb +47 -0
  30. data/lib/prawn/graphics.rb +177 -57
  31. data/lib/prawn/graphics/cap_style.rb +4 -3
  32. data/lib/prawn/graphics/color.rb +5 -4
  33. data/lib/prawn/graphics/dash.rb +53 -31
  34. data/lib/prawn/graphics/join_style.rb +9 -7
  35. data/lib/prawn/graphics/patterns.rb +4 -15
  36. data/lib/prawn/graphics/transformation.rb +10 -9
  37. data/lib/prawn/graphics/transparency.rb +3 -1
  38. data/lib/prawn/{layout/grid.rb → grid.rb} +72 -54
  39. data/lib/prawn/image_handler.rb +42 -0
  40. data/lib/prawn/images.rb +58 -54
  41. data/lib/prawn/images/image.rb +6 -22
  42. data/lib/prawn/images/jpg.rb +20 -14
  43. data/lib/prawn/images/png.rb +58 -121
  44. data/lib/prawn/layout.rb +12 -15
  45. data/lib/prawn/measurement_extensions.rb +10 -6
  46. data/lib/prawn/measurements.rb +27 -21
  47. data/lib/prawn/outline.rb +108 -147
  48. data/lib/prawn/repeater.rb +10 -8
  49. data/lib/prawn/security.rb +59 -40
  50. data/lib/prawn/security/arcfour.rb +52 -0
  51. data/lib/prawn/soft_mask.rb +4 -4
  52. data/lib/prawn/stamp.rb +5 -3
  53. data/lib/prawn/table.rb +83 -60
  54. data/lib/prawn/table/cell.rb +17 -21
  55. data/lib/prawn/table/cell/image.rb +2 -3
  56. data/lib/prawn/table/cell/in_table.rb +8 -2
  57. data/lib/prawn/table/cell/span_dummy.rb +5 -0
  58. data/lib/prawn/table/cell/subtable.rb +3 -2
  59. data/lib/prawn/table/cell/text.rb +14 -12
  60. data/lib/prawn/table/cells.rb +58 -14
  61. data/lib/prawn/table/column_width_calculator.rb +61 -0
  62. data/lib/prawn/text.rb +27 -26
  63. data/lib/prawn/text/box.rb +12 -6
  64. data/lib/prawn/text/formatted.rb +5 -4
  65. data/lib/prawn/text/formatted/arranger.rb +290 -0
  66. data/lib/prawn/text/formatted/box.rb +85 -57
  67. data/lib/prawn/text/formatted/fragment.rb +11 -11
  68. data/lib/prawn/text/formatted/line_wrap.rb +266 -0
  69. data/lib/prawn/text/formatted/parser.rb +11 -4
  70. data/lib/prawn/text/formatted/wrap.rb +156 -0
  71. data/lib/prawn/utilities.rb +5 -3
  72. data/manual/document_and_page_options/document_and_page_options.rb +2 -1
  73. data/manual/document_and_page_options/metadata.rb +3 -3
  74. data/manual/document_and_page_options/page_size.rb +2 -2
  75. data/manual/document_and_page_options/print_scaling.rb +20 -0
  76. data/manual/example_file.rb +2 -7
  77. data/manual/example_helper.rb +62 -81
  78. data/manual/graphics/common_lines.rb +2 -0
  79. data/manual/graphics/helper.rb +11 -4
  80. data/manual/graphics/stroke_dash.rb +19 -14
  81. data/manual/manual/cover.rb +16 -0
  82. data/manual/manual/manual.rb +1 -5
  83. data/manual/text/fallback_fonts.rb +4 -4
  84. data/manual/text/formatted_text.rb +5 -5
  85. data/manual/text/inline.rb +2 -4
  86. data/manual/text/registering_families.rb +12 -12
  87. data/manual/text/single_usage.rb +4 -4
  88. data/manual/text/text.rb +0 -2
  89. data/prawn.gemspec +21 -13
  90. data/spec/acceptance/png.rb +23 -0
  91. data/spec/annotations_spec.rb +16 -32
  92. data/spec/bounding_box_spec.rb +22 -5
  93. data/spec/cell_spec.rb +49 -5
  94. data/spec/column_box_spec.rb +32 -0
  95. data/spec/destinations_spec.rb +5 -5
  96. data/spec/document_spec.rb +112 -118
  97. data/spec/extensions/encoding_helpers.rb +5 -2
  98. data/spec/font_metric_cache_spec.rb +52 -0
  99. data/spec/font_spec.rb +121 -120
  100. data/spec/formatted_text_arranger_spec.rb +24 -24
  101. data/spec/formatted_text_box_spec.rb +31 -32
  102. data/spec/formatted_text_fragment_spec.rb +2 -2
  103. data/spec/graphics_spec.rb +63 -45
  104. data/spec/grid_spec.rb +24 -13
  105. data/spec/image_handler_spec.rb +54 -0
  106. data/spec/images_spec.rb +34 -21
  107. data/spec/inline_formatted_text_parser_spec.rb +69 -20
  108. data/spec/jpg_spec.rb +3 -3
  109. data/spec/line_wrap_spec.rb +25 -14
  110. data/spec/measurement_units_spec.rb +5 -5
  111. data/spec/outline_spec.rb +68 -64
  112. data/spec/png_spec.rb +15 -18
  113. data/spec/reference_spec.rb +2 -82
  114. data/spec/repeater_spec.rb +1 -1
  115. data/spec/security_spec.rb +41 -9
  116. data/spec/soft_mask_spec.rb +0 -40
  117. data/spec/span_spec.rb +6 -11
  118. data/spec/spec_helper.rb +20 -2
  119. data/spec/stamp_spec.rb +19 -20
  120. data/spec/stroke_styles_spec.rb +31 -13
  121. data/spec/table/span_dummy_spec.rb +17 -0
  122. data/spec/table_spec.rb +268 -43
  123. data/spec/text_at_spec.rb +13 -27
  124. data/spec/text_box_spec.rb +35 -30
  125. data/spec/text_spec.rb +56 -40
  126. data/spec/transparency_spec.rb +5 -5
  127. metadata +214 -217
  128. data/README.md +0 -98
  129. data/data/fonts/Action Man.dfont +0 -0
  130. data/data/fonts/Activa.ttf +0 -0
  131. data/data/fonts/Chalkboard.ttf +0 -0
  132. data/data/fonts/DejaVuSans.ttf +0 -0
  133. data/data/fonts/Dustismo_Roman.ttf +0 -0
  134. data/data/fonts/comicsans.ttf +0 -0
  135. data/data/fonts/gkai00mp.ttf +0 -0
  136. data/data/images/16bit.dat +0 -0
  137. data/data/images/barcode_issue.png +0 -0
  138. data/data/images/dice.dat +0 -0
  139. data/data/images/page_white_text.dat +0 -0
  140. data/data/images/rails.dat +0 -0
  141. data/data/images/rails.png +0 -0
  142. data/lib/prawn/compatibility.rb +0 -87
  143. data/lib/prawn/core.rb +0 -87
  144. data/lib/prawn/core/annotations.rb +0 -61
  145. data/lib/prawn/core/byte_string.rb +0 -9
  146. data/lib/prawn/core/destinations.rb +0 -90
  147. data/lib/prawn/core/document_state.rb +0 -79
  148. data/lib/prawn/core/literal_string.rb +0 -16
  149. data/lib/prawn/core/name_tree.rb +0 -177
  150. data/lib/prawn/core/object_store.rb +0 -320
  151. data/lib/prawn/core/page.rb +0 -212
  152. data/lib/prawn/core/pdf_object.rb +0 -125
  153. data/lib/prawn/core/reference.rb +0 -119
  154. data/lib/prawn/core/text.rb +0 -268
  155. data/lib/prawn/core/text/formatted/arranger.rb +0 -294
  156. data/lib/prawn/core/text/formatted/line_wrap.rb +0 -288
  157. data/lib/prawn/core/text/formatted/wrap.rb +0 -153
  158. data/lib/prawn/document/page_geometry.rb +0 -136
  159. data/lib/prawn/document/snapshot.rb +0 -89
  160. data/manual/manual/foreword.rb +0 -13
  161. data/manual/templates/full_template.rb +0 -23
  162. data/manual/templates/page_template.rb +0 -47
  163. data/manual/templates/templates.rb +0 -26
  164. data/manual/text/group.rb +0 -29
  165. data/spec/name_tree_spec.rb +0 -112
  166. data/spec/object_store_spec.rb +0 -170
  167. data/spec/pdf_object_spec.rb +0 -172
  168. data/spec/snapshot_spec.rb +0 -186
  169. data/spec/template_spec.rb +0 -351
@@ -41,23 +41,18 @@ describe "#height_of" do
41
41
  end
42
42
 
43
43
  it "should_not raise_error Prawn::Errors::UnknownOption if :final_gap option is provided" do
44
- lambda {
45
- @pdf.height_of("hai", :width => 300,
46
- :final_gap => true)
47
- }.should_not raise_error(Prawn::Errors::UnknownOption)
44
+ @pdf.height_of("hai", :width => 300, :final_gap => true)
48
45
  end
49
46
  end
50
47
 
51
48
  describe "#text" do
52
49
  before(:each) { create_pdf }
53
50
 
54
- it "should not fail when @output is nil when Prawn::Core::Text::LineWrap#finalize_line is called" do
51
+ it "should not fail when @output is nil when PDF::Core::Text::LineWrap#finalize_line is called" do
55
52
  # need a document with margins for these particulars to produce the
56
53
  # condition that was throwing the error
57
54
  pdf = Prawn::Document.new
58
- lambda {
59
- pdf.text "transparency " * 150, :size => 18
60
- }.should_not raise_error(TypeError)
55
+ pdf.text "transparency " * 150, :size => 18
61
56
  end
62
57
 
63
58
  it "should allow drawing empty strings to the page" do
@@ -66,7 +61,7 @@ describe "#text" do
66
61
  # If anything is rendered to the page, it should be whitespace.
67
62
  text.strings.each { |str| str.should =~ /\A\s*\z/ }
68
63
  end
69
-
64
+
70
65
  it "should ignore call when string is nil" do
71
66
  @pdf.text(nil).should be_false
72
67
  end
@@ -260,11 +255,9 @@ describe "#text" do
260
255
  it "should raise_error an exception when an unknown font is used" do
261
256
  lambda { @pdf.font "Pao bu" }.should raise_error(Prawn::Errors::UnknownFont)
262
257
  end
263
-
258
+
264
259
  it "should_not raise_error an exception when providing Pathname instance as font" do
265
- lambda {
266
- @pdf.font Pathname.new("#{Prawn::DATADIR}/fonts/comicsans.ttf")
267
- }.should_not raise_error(Prawn::Errors::UnknownFont)
260
+ @pdf.font Pathname.new("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf")
268
261
  end
269
262
 
270
263
  it "should correctly render a utf-8 string when using a built-in font" do
@@ -286,6 +279,16 @@ describe "#text" do
286
279
  text.strings.first.should == str
287
280
  end
288
281
 
282
+ it "subsets mixed low-ASCII and non-ASCII characters when they can be " +
283
+ "subsetted together" do
284
+ str = "It’s super effective!"
285
+ @pdf.font "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf"
286
+ @pdf.text str
287
+
288
+ text = PDF::Inspector::Text.analyze(@pdf.render)
289
+ text.strings.first.should == str
290
+ end
291
+
289
292
  it "should correctly render a string with higher bit characters across" +
290
293
  " a page break when using a built-in font" do
291
294
  str = "©"
@@ -310,33 +313,20 @@ describe "#text" do
310
313
  pages[1][:strings].should == [str]
311
314
  end
312
315
 
313
- if "spec".respond_to?(:encode!)
314
- # Handle non utf-8 string encodings in a sane way on M17N aware VMs
315
- it "should raise_error an exception when a utf-8 incompatible string is rendered" do
316
- str = "Blah \xDD"
317
- str.force_encoding("ASCII-8BIT")
318
- lambda { @pdf.text str }.should raise_error(
319
- Prawn::Errors::IncompatibleStringEncoding)
320
- end
321
- it "should_not raise_error an exception when a shift-jis string is rendered" do
322
- datafile = "#{Prawn::DATADIR}/shift_jis_text.txt"
323
- sjis_str = File.open(datafile, "r:shift_jis") { |f| f.gets }
324
- @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf")
325
- lambda { @pdf.text sjis_str }.should_not raise_error(
326
- Prawn::Errors::IncompatibleStringEncoding)
327
- end
328
- else
329
- # Handle non utf-8 string encodings in a sane way on non-M17N aware VMs
330
- it "should raise_error an exception when a corrupt utf-8 string is rendered" do
331
- str = "Blah \xDD"
332
- lambda { @pdf.text str }.should raise_error(
333
- Prawn::Errors::IncompatibleStringEncoding)
334
- end
335
- it "should raise_error an exception when a shift-jis string is rendered" do
336
- sjis_str = File.read("#{Prawn::DATADIR}/shift_jis_text.txt")
337
- lambda { @pdf.text sjis_str }.should raise_error(
338
- Prawn::Errors::IncompatibleStringEncoding)
339
- end
316
+ it "should raise_error an exception when a utf-8 incompatible string is rendered" do
317
+ str = "Blah \xDD"
318
+ str.force_encoding(Encoding::ASCII_8BIT)
319
+ lambda { @pdf.text str }.should raise_error(
320
+ Prawn::Errors::IncompatibleStringEncoding)
321
+ end
322
+
323
+ it "should_not raise_error an exception when a shift-jis string is rendered" do
324
+ datafile = "#{Prawn::DATADIR}/shift_jis_text.txt"
325
+ sjis_str = File.open(datafile, "r:shift_jis") { |f| f.gets }
326
+ @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf")
327
+
328
+ # Expect that the call to text will not raise an encoding error
329
+ @pdf.text(sjis_str)
340
330
  end
341
331
 
342
332
  it "should call move_past_bottom when printing more text than can fit" +
@@ -418,4 +408,30 @@ describe "#text" do
418
408
  @pdf.text "VAT", :kerning => false
419
409
  end
420
410
  end
411
+
412
+ describe "#shrink_to_fit with special utf-8 text" do
413
+ it "Should not throw an exception",
414
+ :unresolved, :issue => 603 do
415
+ pages = 0
416
+ doc = Prawn::Document.new(page_size: 'A4', margin: [2, 2, 2, 2]) do |pdf|
417
+ add_unicode_fonts(pdf)
418
+ pdf.bounding_box([1, 1], :width => 90, :height => 50) do
419
+ broken_text = " Sample Text\nSAMPLE SAMPLE SAMPLEoddělení ZMĚN\nSAMPLE"
420
+ pdf.text broken_text, :overflow => :shrink_to_fit
421
+ end
422
+ end
423
+ end
424
+ end
425
+
426
+
427
+ def add_unicode_fonts(pdf)
428
+ dejavu = "#{::Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
429
+ pdf.font_families.update("dejavu" => {
430
+ :normal => dejavu,
431
+ :italic => dejavu,
432
+ :bold => dejavu,
433
+ :bold_italic => dejavu
434
+ })
435
+ pdf.fallback_fonts = ["dejavu"]
436
+ end
421
437
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper")
1
+ require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper")
2
2
 
3
3
  module TransparencyHelper
4
4
  def make_transparent(opacity, stroke_opacity=opacity)
@@ -17,7 +17,7 @@ describe "Document with transparency" do
17
17
  str = @pdf.render
18
18
  str[0,8].should == "%PDF-1.4"
19
19
  end
20
-
20
+
21
21
  it "a new extended graphics state should be created for "+
22
22
  "each unique transparency setting" do
23
23
  create_pdf
@@ -27,7 +27,7 @@ describe "Document with transparency" do
27
27
  extgstates = PDF::Inspector::ExtGState.analyze(@pdf.render).extgstates
28
28
  extgstates.length.should == 2
29
29
  end
30
-
30
+
31
31
  it "a new extended graphics state should not be created for "+
32
32
  "each duplicate transparency setting" do
33
33
  create_pdf
@@ -70,7 +70,7 @@ describe "Document with transparency" do
70
70
  extgstate[:opacity].should == 1.0
71
71
  extgstate[:stroke_opacity].should == 1.0
72
72
  end
73
-
73
+
74
74
  describe "with more than one page" do
75
75
  include TransparencyHelper
76
76
 
@@ -78,7 +78,7 @@ describe "Document with transparency" do
78
78
  create_pdf
79
79
  make_transparent(0.5, 0.2)
80
80
  @pdf.start_new_page
81
- make_transparent(0.5, 0.2)
81
+ make_transparent(0.5, 0.2)
82
82
  extgstates = PDF::Inspector::ExtGState.analyze(@pdf.render).extgstates
83
83
  extgstate = extgstates[0]
84
84
  extgstates.length.should == 2
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc2
5
- prerelease: 6
4
+ version: 1.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gregory Brown
@@ -13,129 +12,150 @@ authors:
13
12
  autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
- date: 2013-03-01 00:00:00.000000000 Z
15
+ date: 2014-03-17 00:00:00.000000000 Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
- name: pdf-reader
18
+ name: ttfunk
20
19
  requirement: !ruby/object:Gem::Requirement
21
- none: false
22
20
  requirements:
23
- - - ! '>='
21
+ - - "~>"
24
22
  - !ruby/object:Gem::Version
25
- version: 0.9.0
26
- - - <
23
+ version: 1.1.1
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - "~>"
27
29
  - !ruby/object:Gem::Version
28
- version: '2.0'
30
+ version: 1.1.1
31
+ - !ruby/object:Gem::Dependency
32
+ name: pdf-core
33
+ requirement: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - "~>"
36
+ - !ruby/object:Gem::Version
37
+ version: 0.2.2
29
38
  type: :runtime
30
39
  prerelease: false
31
40
  version_requirements: !ruby/object:Gem::Requirement
32
- none: false
33
41
  requirements:
34
- - - ! '>='
42
+ - - "~>"
43
+ - !ruby/object:Gem::Version
44
+ version: 0.2.2
45
+ - !ruby/object:Gem::Dependency
46
+ name: pdf-inspector
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
35
50
  - !ruby/object:Gem::Version
36
- version: 0.9.0
37
- - - <
51
+ version: 1.1.0
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "~>"
38
57
  - !ruby/object:Gem::Version
39
- version: '2.0'
58
+ version: 1.1.0
40
59
  - !ruby/object:Gem::Dependency
41
- name: ttfunk
60
+ name: coderay
42
61
  requirement: !ruby/object:Gem::Requirement
43
- none: false
44
62
  requirements:
45
- - - ~>
63
+ - - "~>"
46
64
  - !ruby/object:Gem::Version
47
- version: 1.0.3
48
- type: :runtime
65
+ version: 1.0.7
66
+ type: :development
49
67
  prerelease: false
50
68
  version_requirements: !ruby/object:Gem::Requirement
51
- none: false
52
69
  requirements:
53
- - - ~>
70
+ - - "~>"
54
71
  - !ruby/object:Gem::Version
55
- version: 1.0.3
72
+ version: 1.0.7
56
73
  - !ruby/object:Gem::Dependency
57
- name: ruby-rc4
74
+ name: yard
58
75
  requirement: !ruby/object:Gem::Requirement
59
- none: false
60
76
  requirements:
61
- - - ! '>='
77
+ - - ">="
62
78
  - !ruby/object:Gem::Version
63
79
  version: '0'
64
- type: :runtime
80
+ type: :development
65
81
  prerelease: false
66
82
  version_requirements: !ruby/object:Gem::Requirement
67
- none: false
68
83
  requirements:
69
- - - ! '>='
84
+ - - ">="
70
85
  - !ruby/object:Gem::Version
71
86
  version: '0'
72
87
  - !ruby/object:Gem::Dependency
73
- name: afm
88
+ name: rspec
74
89
  requirement: !ruby/object:Gem::Requirement
75
- none: false
76
90
  requirements:
77
- - - ! '>='
91
+ - - ">="
78
92
  - !ruby/object:Gem::Version
79
93
  version: '0'
80
- type: :runtime
94
+ type: :development
81
95
  prerelease: false
82
96
  version_requirements: !ruby/object:Gem::Requirement
83
- none: false
84
97
  requirements:
85
- - - ! '>='
98
+ - - ">="
86
99
  - !ruby/object:Gem::Version
87
100
  version: '0'
88
101
  - !ruby/object:Gem::Dependency
89
- name: pdf-inspector
102
+ name: mocha
90
103
  requirement: !ruby/object:Gem::Requirement
91
- none: false
92
104
  requirements:
93
- - - ~>
105
+ - - ">="
94
106
  - !ruby/object:Gem::Version
95
- version: 1.0.1
107
+ version: '0'
96
108
  type: :development
97
109
  prerelease: false
98
110
  version_requirements: !ruby/object:Gem::Requirement
99
- none: false
100
111
  requirements:
101
- - - ~>
112
+ - - ">="
102
113
  - !ruby/object:Gem::Version
103
- version: 1.0.1
114
+ version: '0'
104
115
  - !ruby/object:Gem::Dependency
105
- name: coderay
116
+ name: rake
106
117
  requirement: !ruby/object:Gem::Requirement
107
- none: false
108
118
  requirements:
109
- - - ~>
119
+ - - ">="
110
120
  - !ruby/object:Gem::Version
111
- version: 1.0.7
121
+ version: '0'
112
122
  type: :development
113
123
  prerelease: false
114
124
  version_requirements: !ruby/object:Gem::Requirement
115
- none: false
116
125
  requirements:
117
- - - ~>
126
+ - - ">="
118
127
  - !ruby/object:Gem::Version
119
- version: 1.0.7
128
+ version: '0'
120
129
  - !ruby/object:Gem::Dependency
121
- name: rdoc
130
+ name: simplecov
122
131
  requirement: !ruby/object:Gem::Requirement
123
- none: false
124
132
  requirements:
125
- - - ! '>='
133
+ - - ">="
126
134
  - !ruby/object:Gem::Version
127
135
  version: '0'
128
136
  type: :development
129
137
  prerelease: false
130
138
  version_requirements: !ruby/object:Gem::Requirement
131
- none: false
132
139
  requirements:
133
- - - ! '>='
140
+ - - ">="
134
141
  - !ruby/object:Gem::Version
135
142
  version: '0'
136
- description: ! ' Prawn is a fast, tiny, and nimble PDF generator for Ruby
137
-
138
- '
143
+ - !ruby/object:Gem::Dependency
144
+ name: pdf-reader
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '1.2'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '1.2'
157
+ description: |2
158
+ Prawn is a fast, tiny, and nimble PDF generator for Ruby
139
159
  email:
140
160
  - gregory.t.brown@gmail.com
141
161
  - brad@bradediger.com
@@ -144,135 +164,20 @@ email:
144
164
  - jimmy@deefa.com
145
165
  executables: []
146
166
  extensions: []
147
- extra_rdoc_files:
148
- - README.md
149
- - LICENSE
167
+ extra_rdoc_files: []
168
+ files:
169
+ - ".yardopts"
150
170
  - COPYING
151
171
  - GPLv2
152
172
  - GPLv3
153
- files:
154
- - lib/prawn/compatibility.rb
155
- - lib/prawn/core/annotations.rb
156
- - lib/prawn/core/byte_string.rb
157
- - lib/prawn/core/destinations.rb
158
- - lib/prawn/core/document_state.rb
159
- - lib/prawn/core/literal_string.rb
160
- - lib/prawn/core/name_tree.rb
161
- - lib/prawn/core/object_store.rb
162
- - lib/prawn/core/page.rb
163
- - lib/prawn/core/pdf_object.rb
164
- - lib/prawn/core/reference.rb
165
- - lib/prawn/core/text/formatted/arranger.rb
166
- - lib/prawn/core/text/formatted/line_wrap.rb
167
- - lib/prawn/core/text/formatted/wrap.rb
168
- - lib/prawn/core/text.rb
169
- - lib/prawn/core.rb
170
- - lib/prawn/document/bounding_box.rb
171
- - lib/prawn/document/column_box.rb
172
- - lib/prawn/document/graphics_state.rb
173
- - lib/prawn/document/internals.rb
174
- - lib/prawn/document/page_geometry.rb
175
- - lib/prawn/document/snapshot.rb
176
- - lib/prawn/document/span.rb
177
- - lib/prawn/document.rb
178
- - lib/prawn/encoding.rb
179
- - lib/prawn/errors.rb
180
- - lib/prawn/font/afm.rb
181
- - lib/prawn/font/dfont.rb
182
- - lib/prawn/font/ttf.rb
183
- - lib/prawn/font.rb
184
- - lib/prawn/graphics/cap_style.rb
185
- - lib/prawn/graphics/color.rb
186
- - lib/prawn/graphics/dash.rb
187
- - lib/prawn/graphics/join_style.rb
188
- - lib/prawn/graphics/patterns.rb
189
- - lib/prawn/graphics/transformation.rb
190
- - lib/prawn/graphics/transparency.rb
191
- - lib/prawn/graphics.rb
192
- - lib/prawn/images/image.rb
193
- - lib/prawn/images/jpg.rb
194
- - lib/prawn/images/png.rb
195
- - lib/prawn/images.rb
196
- - lib/prawn/layout/grid.rb
197
- - lib/prawn/layout.rb
198
- - lib/prawn/measurement_extensions.rb
199
- - lib/prawn/measurements.rb
200
- - lib/prawn/outline.rb
201
- - lib/prawn/repeater.rb
202
- - lib/prawn/security.rb
203
- - lib/prawn/soft_mask.rb
204
- - lib/prawn/stamp.rb
205
- - lib/prawn/table/cell/image.rb
206
- - lib/prawn/table/cell/in_table.rb
207
- - lib/prawn/table/cell/span_dummy.rb
208
- - lib/prawn/table/cell/subtable.rb
209
- - lib/prawn/table/cell/text.rb
210
- - lib/prawn/table/cell.rb
211
- - lib/prawn/table/cells.rb
212
- - lib/prawn/table.rb
213
- - lib/prawn/text/box.rb
214
- - lib/prawn/text/formatted/box.rb
215
- - lib/prawn/text/formatted/fragment.rb
216
- - lib/prawn/text/formatted/parser.rb
217
- - lib/prawn/text/formatted.rb
218
- - lib/prawn/text.rb
219
- - lib/prawn/utilities.rb
220
- - lib/prawn.rb
221
- - spec/annotations_spec.rb
222
- - spec/bounding_box_spec.rb
223
- - spec/cell_spec.rb
224
- - spec/column_box_spec.rb
225
- - spec/data/curves.pdf
226
- - spec/destinations_spec.rb
227
- - spec/document_spec.rb
228
- - spec/extensions/encoding_helpers.rb
229
- - spec/extensions/mocha.rb
230
- - spec/font_spec.rb
231
- - spec/formatted_text_arranger_spec.rb
232
- - spec/formatted_text_box_spec.rb
233
- - spec/formatted_text_fragment_spec.rb
234
- - spec/graphics_spec.rb
235
- - spec/grid_spec.rb
236
- - spec/images_spec.rb
237
- - spec/inline_formatted_text_parser_spec.rb
238
- - spec/jpg_spec.rb
239
- - spec/line_wrap_spec.rb
240
- - spec/measurement_units_spec.rb
241
- - spec/name_tree_spec.rb
242
- - spec/object_store_spec.rb
243
- - spec/outline_spec.rb
244
- - spec/pdf_object_spec.rb
245
- - spec/png_spec.rb
246
- - spec/reference_spec.rb
247
- - spec/repeater_spec.rb
248
- - spec/security_spec.rb
249
- - spec/snapshot_spec.rb
250
- - spec/soft_mask_spec.rb
251
- - spec/span_spec.rb
252
- - spec/spec_helper.rb
253
- - spec/stamp_spec.rb
254
- - spec/stroke_styles_spec.rb
255
- - spec/table_spec.rb
256
- - spec/template_spec.rb
257
- - spec/text_at_spec.rb
258
- - spec/text_box_spec.rb
259
- - spec/text_rendering_mode_spec.rb
260
- - spec/text_spacing_spec.rb
261
- - spec/text_spec.rb
262
- - spec/text_with_inline_formatting_spec.rb
263
- - spec/transparency_spec.rb
173
+ - Gemfile
174
+ - LICENSE
175
+ - Rakefile
264
176
  - data/encodings/win_ansi.txt
265
- - data/fonts/Action Man.dfont
266
- - data/fonts/Activa.ttf
267
- - data/fonts/Chalkboard.ttf
268
- - data/fonts/comicsans.ttf
269
177
  - data/fonts/Courier-Bold.afm
270
178
  - data/fonts/Courier-BoldOblique.afm
271
179
  - data/fonts/Courier-Oblique.afm
272
180
  - data/fonts/Courier.afm
273
- - data/fonts/DejaVuSans.ttf
274
- - data/fonts/Dustismo_Roman.ttf
275
- - data/fonts/gkai00mp.ttf
276
181
  - data/fonts/Helvetica-Bold.afm
277
182
  - data/fonts/Helvetica-BoldOblique.afm
278
183
  - data/fonts/Helvetica-Oblique.afm
@@ -285,24 +190,24 @@ files:
285
190
  - data/fonts/Times-Roman.afm
286
191
  - data/fonts/ZapfDingbats.afm
287
192
  - data/images/16bit.alpha
288
- - data/images/16bit.dat
193
+ - data/images/16bit.color
289
194
  - data/images/16bit.png
290
195
  - data/images/arrow.png
291
196
  - data/images/arrow2.png
292
- - data/images/barcode_issue.png
293
197
  - data/images/dice.alpha
294
- - data/images/dice.dat
198
+ - data/images/dice.color
295
199
  - data/images/dice.png
296
200
  - data/images/dice_interlaced.png
297
201
  - data/images/fractal.jpg
202
+ - data/images/indexed_color.dat
203
+ - data/images/indexed_color.png
298
204
  - data/images/letterhead.jpg
205
+ - data/images/license.md
299
206
  - data/images/page_white_text.alpha
300
- - data/images/page_white_text.dat
207
+ - data/images/page_white_text.color
301
208
  - data/images/page_white_text.png
302
209
  - data/images/pigs.jpg
303
210
  - data/images/prawn.png
304
- - data/images/rails.dat
305
- - data/images/rails.png
306
211
  - data/images/ruport.png
307
212
  - data/images/ruport_data.dat
308
213
  - data/images/ruport_transparent.png
@@ -324,6 +229,62 @@ files:
324
229
  - data/pdfs/two_hexagons.pdf
325
230
  - data/pdfs/version_1_6.pdf
326
231
  - data/shift_jis_text.txt
232
+ - lib/prawn.rb
233
+ - lib/prawn/document.rb
234
+ - lib/prawn/document/bounding_box.rb
235
+ - lib/prawn/document/column_box.rb
236
+ - lib/prawn/document/graphics_state.rb
237
+ - lib/prawn/document/internals.rb
238
+ - lib/prawn/document/span.rb
239
+ - lib/prawn/encoding.rb
240
+ - lib/prawn/errors.rb
241
+ - lib/prawn/font.rb
242
+ - lib/prawn/font/afm.rb
243
+ - lib/prawn/font/dfont.rb
244
+ - lib/prawn/font/ttf.rb
245
+ - lib/prawn/font_metric_cache.rb
246
+ - lib/prawn/graphics.rb
247
+ - lib/prawn/graphics/cap_style.rb
248
+ - lib/prawn/graphics/color.rb
249
+ - lib/prawn/graphics/dash.rb
250
+ - lib/prawn/graphics/join_style.rb
251
+ - lib/prawn/graphics/patterns.rb
252
+ - lib/prawn/graphics/transformation.rb
253
+ - lib/prawn/graphics/transparency.rb
254
+ - lib/prawn/grid.rb
255
+ - lib/prawn/image_handler.rb
256
+ - lib/prawn/images.rb
257
+ - lib/prawn/images/image.rb
258
+ - lib/prawn/images/jpg.rb
259
+ - lib/prawn/images/png.rb
260
+ - lib/prawn/layout.rb
261
+ - lib/prawn/measurement_extensions.rb
262
+ - lib/prawn/measurements.rb
263
+ - lib/prawn/outline.rb
264
+ - lib/prawn/repeater.rb
265
+ - lib/prawn/security.rb
266
+ - lib/prawn/security/arcfour.rb
267
+ - lib/prawn/soft_mask.rb
268
+ - lib/prawn/stamp.rb
269
+ - lib/prawn/table.rb
270
+ - lib/prawn/table/cell.rb
271
+ - lib/prawn/table/cell/image.rb
272
+ - lib/prawn/table/cell/in_table.rb
273
+ - lib/prawn/table/cell/span_dummy.rb
274
+ - lib/prawn/table/cell/subtable.rb
275
+ - lib/prawn/table/cell/text.rb
276
+ - lib/prawn/table/cells.rb
277
+ - lib/prawn/table/column_width_calculator.rb
278
+ - lib/prawn/text.rb
279
+ - lib/prawn/text/box.rb
280
+ - lib/prawn/text/formatted.rb
281
+ - lib/prawn/text/formatted/arranger.rb
282
+ - lib/prawn/text/formatted/box.rb
283
+ - lib/prawn/text/formatted/fragment.rb
284
+ - lib/prawn/text/formatted/line_wrap.rb
285
+ - lib/prawn/text/formatted/parser.rb
286
+ - lib/prawn/text/formatted/wrap.rb
287
+ - lib/prawn/utilities.rb
327
288
  - manual/basic_concepts/adding_pages.rb
328
289
  - manual/basic_concepts/basic_concepts.rb
329
290
  - manual/basic_concepts/creation.rb
@@ -344,6 +305,7 @@ files:
344
305
  - manual/document_and_page_options/metadata.rb
345
306
  - manual/document_and_page_options/page_margins.rb
346
307
  - manual/document_and_page_options/page_size.rb
308
+ - manual/document_and_page_options/print_scaling.rb
347
309
  - manual/example_file.rb
348
310
  - manual/example_helper.rb
349
311
  - manual/example_package.rb
@@ -381,7 +343,6 @@ files:
381
343
  - manual/layout/layout.rb
382
344
  - manual/layout/simple_grid.rb
383
345
  - manual/manual/cover.rb
384
- - manual/manual/foreword.rb
385
346
  - manual/manual/how_to_read_this_manual.rb
386
347
  - manual/manual/manual.rb
387
348
  - manual/outline/add_subsection_to.rb
@@ -414,9 +375,6 @@ files:
414
375
  - manual/table/style.rb
415
376
  - manual/table/table.rb
416
377
  - manual/table/width.rb
417
- - manual/templates/full_template.rb
418
- - manual/templates/page_template.rb
419
- - manual/templates/templates.rb
420
378
  - manual/text/alignment.rb
421
379
  - manual/text/color.rb
422
380
  - manual/text/column_box.rb
@@ -427,7 +385,6 @@ files:
427
385
  - manual/text/formatted_callbacks.rb
428
386
  - manual/text/formatted_text.rb
429
387
  - manual/text/free_flowing_text.rb
430
- - manual/text/group.rb
431
388
  - manual/text/inline.rb
432
389
  - manual/text/kerning_and_character_spacing.rb
433
390
  - manual/text/leading.rb
@@ -445,44 +402,87 @@ files:
445
402
  - manual/text/text_box_overflow.rb
446
403
  - manual/text/utf8.rb
447
404
  - manual/text/win_ansi_charset.rb
448
- - Rakefile
449
405
  - prawn.gemspec
450
- - COPYING
451
- - LICENSE
452
- - GPLv2
453
- - GPLv3
454
- - Gemfile
455
- - README.md
406
+ - spec/acceptance/png.rb
407
+ - spec/annotations_spec.rb
408
+ - spec/bounding_box_spec.rb
409
+ - spec/cell_spec.rb
410
+ - spec/column_box_spec.rb
411
+ - spec/data/curves.pdf
412
+ - spec/destinations_spec.rb
413
+ - spec/document_spec.rb
414
+ - spec/extensions/encoding_helpers.rb
415
+ - spec/extensions/mocha.rb
416
+ - spec/font_metric_cache_spec.rb
417
+ - spec/font_spec.rb
418
+ - spec/formatted_text_arranger_spec.rb
419
+ - spec/formatted_text_box_spec.rb
420
+ - spec/formatted_text_fragment_spec.rb
421
+ - spec/graphics_spec.rb
422
+ - spec/grid_spec.rb
423
+ - spec/image_handler_spec.rb
424
+ - spec/images_spec.rb
425
+ - spec/inline_formatted_text_parser_spec.rb
426
+ - spec/jpg_spec.rb
427
+ - spec/line_wrap_spec.rb
428
+ - spec/measurement_units_spec.rb
429
+ - spec/outline_spec.rb
430
+ - spec/png_spec.rb
431
+ - spec/reference_spec.rb
432
+ - spec/repeater_spec.rb
433
+ - spec/security_spec.rb
434
+ - spec/soft_mask_spec.rb
435
+ - spec/span_spec.rb
436
+ - spec/spec_helper.rb
437
+ - spec/stamp_spec.rb
438
+ - spec/stroke_styles_spec.rb
439
+ - spec/table/span_dummy_spec.rb
440
+ - spec/table_spec.rb
441
+ - spec/text_at_spec.rb
442
+ - spec/text_box_spec.rb
443
+ - spec/text_rendering_mode_spec.rb
444
+ - spec/text_spacing_spec.rb
445
+ - spec/text_spec.rb
446
+ - spec/text_with_inline_formatting_spec.rb
447
+ - spec/transparency_spec.rb
456
448
  homepage: http://prawn.majesticseacreature.com
457
- licenses: []
458
- post_install_message: ! "\n ********************************************\n\n\n A
459
- lot has changed recently in Prawn.\n\n Please read the changelog for details:\n\n
460
- \ https://github.com/prawnpdf/prawn/wiki/CHANGELOG\n\n\n ********************************************\n\n"
461
- rdoc_options:
462
- - --title
463
- - Prawn Documentation
464
- - --main
465
- - README.md
466
- - -q
449
+ licenses:
450
+ - RUBY
451
+ - GPL-2
452
+ - GPL-3
453
+ metadata: {}
454
+ post_install_message: |2+
455
+
456
+ ********************************************
457
+
458
+
459
+ A lot has changed recently in Prawn.
460
+
461
+ Please read the changelog for details:
462
+
463
+ https://github.com/prawnpdf/prawn/wiki/CHANGELOG
464
+
465
+
466
+ ********************************************
467
+
468
+ rdoc_options: []
467
469
  require_paths:
468
470
  - lib
469
471
  required_ruby_version: !ruby/object:Gem::Requirement
470
- none: false
471
472
  requirements:
472
- - - ! '>='
473
+ - - ">="
473
474
  - !ruby/object:Gem::Version
474
- version: 1.8.7
475
+ version: 1.9.3
475
476
  required_rubygems_version: !ruby/object:Gem::Requirement
476
- none: false
477
477
  requirements:
478
- - - ! '>='
478
+ - - ">="
479
479
  - !ruby/object:Gem::Version
480
480
  version: 1.3.6
481
481
  requirements: []
482
482
  rubyforge_project: prawn
483
- rubygems_version: 1.8.23
483
+ rubygems_version: 2.2.2
484
484
  signing_key:
485
- specification_version: 3
485
+ specification_version: 4
486
486
  summary: A fast and nimble PDF generator for Ruby
487
487
  test_files:
488
488
  - spec/annotations_spec.rb
@@ -491,32 +491,29 @@ test_files:
491
491
  - spec/column_box_spec.rb
492
492
  - spec/destinations_spec.rb
493
493
  - spec/document_spec.rb
494
+ - spec/font_metric_cache_spec.rb
494
495
  - spec/font_spec.rb
495
496
  - spec/formatted_text_arranger_spec.rb
496
497
  - spec/formatted_text_box_spec.rb
497
498
  - spec/formatted_text_fragment_spec.rb
498
499
  - spec/graphics_spec.rb
499
500
  - spec/grid_spec.rb
501
+ - spec/image_handler_spec.rb
500
502
  - spec/images_spec.rb
501
503
  - spec/inline_formatted_text_parser_spec.rb
502
504
  - spec/jpg_spec.rb
503
505
  - spec/line_wrap_spec.rb
504
506
  - spec/measurement_units_spec.rb
505
- - spec/name_tree_spec.rb
506
- - spec/object_store_spec.rb
507
507
  - spec/outline_spec.rb
508
- - spec/pdf_object_spec.rb
509
508
  - spec/png_spec.rb
510
509
  - spec/reference_spec.rb
511
510
  - spec/repeater_spec.rb
512
511
  - spec/security_spec.rb
513
- - spec/snapshot_spec.rb
514
512
  - spec/soft_mask_spec.rb
515
513
  - spec/span_spec.rb
516
514
  - spec/stamp_spec.rb
517
515
  - spec/stroke_styles_spec.rb
518
516
  - spec/table_spec.rb
519
- - spec/template_spec.rb
520
517
  - spec/text_at_spec.rb
521
518
  - spec/text_box_spec.rb
522
519
  - spec/text_rendering_mode_spec.rb