prawn 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. checksums.yaml +7 -0
  2. data/COPYING +2 -2
  3. data/Gemfile +18 -0
  4. data/LICENSE +1 -1
  5. data/README.md +17 -4
  6. data/Rakefile +18 -22
  7. data/data/images/indexed_color.dat +0 -0
  8. data/data/images/indexed_color.png +0 -0
  9. data/data/pdfs/nested_pages.pdf +13 -13
  10. data/lib/pdf/core.rb +35 -0
  11. data/lib/{prawn → pdf}/core/annotations.rb +6 -7
  12. data/lib/{prawn → pdf}/core/byte_string.rb +1 -1
  13. data/lib/{prawn → pdf}/core/destinations.rb +23 -23
  14. data/lib/{prawn → pdf}/core/document_state.rb +8 -8
  15. data/lib/pdf/core/filter_list.rb +51 -0
  16. data/lib/pdf/core/filters.rb +36 -0
  17. data/lib/pdf/core/graphics_state.rb +68 -0
  18. data/lib/{prawn → pdf}/core/literal_string.rb +1 -1
  19. data/lib/{prawn → pdf}/core/name_tree.rb +14 -2
  20. data/lib/{prawn → pdf}/core/object_store.rb +80 -24
  21. data/lib/pdf/core/outline.rb +315 -0
  22. data/lib/{prawn → pdf}/core/page.rb +23 -26
  23. data/lib/{prawn/document → pdf/core}/page_geometry.rb +11 -21
  24. data/lib/{prawn → pdf}/core/pdf_object.rb +48 -32
  25. data/lib/{prawn → pdf}/core/reference.rb +35 -44
  26. data/lib/pdf/core/stream.rb +98 -0
  27. data/lib/{prawn → pdf}/core/text.rb +24 -17
  28. data/lib/prawn.rb +95 -17
  29. data/lib/prawn/compatibility.rb +66 -26
  30. data/lib/prawn/document.rb +48 -30
  31. data/lib/prawn/document/bounding_box.rb +3 -3
  32. data/lib/prawn/document/column_box.rb +46 -8
  33. data/lib/prawn/document/graphics_state.rb +10 -73
  34. data/lib/prawn/document/internals.rb +24 -23
  35. data/lib/prawn/document/snapshot.rb +6 -7
  36. data/lib/prawn/document/span.rb +10 -10
  37. data/lib/prawn/encoding.rb +7 -7
  38. data/lib/prawn/errors.rb +18 -29
  39. data/lib/prawn/font.rb +64 -28
  40. data/lib/prawn/font/afm.rb +32 -74
  41. data/lib/prawn/font/dfont.rb +2 -2
  42. data/lib/prawn/font/ttf.rb +28 -57
  43. data/lib/prawn/font_metric_cache.rb +45 -0
  44. data/lib/prawn/graphics.rb +307 -41
  45. data/lib/prawn/graphics/cap_style.rb +3 -3
  46. data/lib/prawn/graphics/color.rb +12 -5
  47. data/lib/prawn/graphics/dash.rb +52 -31
  48. data/lib/prawn/graphics/join_style.rb +7 -7
  49. data/lib/prawn/graphics/patterns.rb +137 -0
  50. data/lib/prawn/graphics/transformation.rb +9 -9
  51. data/lib/prawn/graphics/transparency.rb +1 -1
  52. data/lib/prawn/image_handler.rb +30 -0
  53. data/lib/prawn/images.rb +86 -105
  54. data/lib/prawn/images/image.rb +48 -0
  55. data/lib/prawn/images/jpg.rb +14 -10
  56. data/lib/prawn/images/png.rb +50 -37
  57. data/lib/prawn/layout.rb +2 -2
  58. data/lib/prawn/layout/grid.rb +51 -51
  59. data/lib/prawn/measurement_extensions.rb +5 -5
  60. data/lib/prawn/measurements.rb +25 -21
  61. data/lib/prawn/outline.rb +4 -308
  62. data/lib/prawn/repeater.rb +8 -8
  63. data/lib/prawn/security.rb +50 -36
  64. data/lib/prawn/soft_mask.rb +94 -0
  65. data/lib/prawn/stamp.rb +3 -3
  66. data/lib/prawn/table.rb +292 -118
  67. data/lib/prawn/table/cell.rb +272 -45
  68. data/lib/prawn/table/cell/image.rb +70 -0
  69. data/lib/prawn/table/cell/in_table.rb +2 -2
  70. data/lib/prawn/table/cell/span_dummy.rb +92 -0
  71. data/lib/prawn/table/cell/subtable.rb +2 -2
  72. data/lib/prawn/table/cell/text.rb +42 -24
  73. data/lib/prawn/table/cells.rb +137 -48
  74. data/lib/prawn/text.rb +35 -23
  75. data/lib/prawn/text/box.rb +18 -5
  76. data/lib/prawn/text/formatted.rb +5 -4
  77. data/lib/prawn/text/formatted/arranger.rb +292 -0
  78. data/lib/prawn/text/formatted/box.rb +52 -13
  79. data/lib/prawn/text/formatted/fragment.rb +37 -22
  80. data/lib/prawn/text/formatted/line_wrap.rb +286 -0
  81. data/lib/prawn/text/formatted/parser.rb +14 -6
  82. data/lib/prawn/text/formatted/wrap.rb +151 -0
  83. data/lib/prawn/utilities.rb +44 -0
  84. data/manual/basic_concepts/adding_pages.rb +27 -0
  85. data/manual/basic_concepts/basic_concepts.rb +34 -0
  86. data/manual/basic_concepts/creation.rb +39 -0
  87. data/manual/basic_concepts/cursor.rb +33 -0
  88. data/manual/basic_concepts/measurement.rb +25 -0
  89. data/manual/basic_concepts/origin.rb +38 -0
  90. data/manual/basic_concepts/other_cursor_helpers.rb +40 -0
  91. data/manual/bounding_box/bounding_box.rb +39 -0
  92. data/manual/bounding_box/bounds.rb +49 -0
  93. data/manual/bounding_box/canvas.rb +24 -0
  94. data/manual/bounding_box/creation.rb +23 -0
  95. data/manual/bounding_box/indentation.rb +46 -0
  96. data/manual/bounding_box/nesting.rb +45 -0
  97. data/manual/bounding_box/russian_boxes.rb +40 -0
  98. data/manual/bounding_box/stretchy.rb +31 -0
  99. data/manual/document_and_page_options/background.rb +27 -0
  100. data/manual/document_and_page_options/document_and_page_options.rb +31 -0
  101. data/manual/document_and_page_options/metadata.rb +23 -0
  102. data/manual/document_and_page_options/page_margins.rb +38 -0
  103. data/manual/document_and_page_options/page_size.rb +34 -0
  104. data/manual/example_file.rb +116 -0
  105. data/manual/example_helper.rb +411 -0
  106. data/manual/example_package.rb +53 -0
  107. data/manual/example_section.rb +46 -0
  108. data/manual/graphics/circle_and_ellipse.rb +22 -0
  109. data/manual/graphics/color.rb +24 -0
  110. data/manual/graphics/common_lines.rb +28 -0
  111. data/manual/graphics/fill_and_stroke.rb +42 -0
  112. data/manual/graphics/fill_rules.rb +37 -0
  113. data/manual/graphics/gradients.rb +37 -0
  114. data/manual/graphics/graphics.rb +58 -0
  115. data/manual/graphics/helper.rb +24 -0
  116. data/manual/graphics/line_width.rb +35 -0
  117. data/manual/graphics/lines_and_curves.rb +41 -0
  118. data/manual/graphics/polygon.rb +29 -0
  119. data/manual/graphics/rectangle.rb +21 -0
  120. data/manual/graphics/rotate.rb +28 -0
  121. data/manual/graphics/scale.rb +41 -0
  122. data/manual/graphics/soft_masks.rb +46 -0
  123. data/manual/graphics/stroke_cap.rb +31 -0
  124. data/manual/graphics/stroke_dash.rb +48 -0
  125. data/manual/graphics/stroke_join.rb +30 -0
  126. data/manual/graphics/translate.rb +29 -0
  127. data/manual/graphics/transparency.rb +35 -0
  128. data/manual/images/absolute_position.rb +23 -0
  129. data/manual/images/fit.rb +21 -0
  130. data/manual/images/horizontal.rb +25 -0
  131. data/manual/images/images.rb +40 -0
  132. data/manual/images/plain_image.rb +18 -0
  133. data/manual/images/scale.rb +22 -0
  134. data/manual/images/vertical.rb +28 -0
  135. data/manual/images/width_and_height.rb +25 -0
  136. data/manual/layout/boxes.rb +27 -0
  137. data/manual/layout/content.rb +25 -0
  138. data/manual/layout/layout.rb +28 -0
  139. data/manual/layout/simple_grid.rb +23 -0
  140. data/manual/manual/cover.rb +35 -0
  141. data/manual/manual/foreword.rb +85 -0
  142. data/manual/manual/how_to_read_this_manual.rb +41 -0
  143. data/manual/manual/manual.rb +35 -0
  144. data/manual/outline/add_subsection_to.rb +61 -0
  145. data/manual/outline/insert_section_after.rb +47 -0
  146. data/manual/outline/outline.rb +32 -0
  147. data/manual/outline/sections_and_pages.rb +67 -0
  148. data/manual/repeatable_content/page_numbering.rb +54 -0
  149. data/manual/repeatable_content/repeatable_content.rb +31 -0
  150. data/manual/repeatable_content/repeater.rb +55 -0
  151. data/manual/repeatable_content/stamp.rb +41 -0
  152. data/manual/security/encryption.rb +31 -0
  153. data/manual/security/permissions.rb +38 -0
  154. data/manual/security/security.rb +28 -0
  155. data/manual/syntax_highlight.rb +52 -0
  156. data/manual/table/basic_block.rb +53 -0
  157. data/manual/table/before_rendering_page.rb +26 -0
  158. data/manual/table/cell_border_lines.rb +24 -0
  159. data/manual/table/cell_borders_and_bg.rb +31 -0
  160. data/manual/table/cell_dimensions.rb +30 -0
  161. data/manual/table/cell_text.rb +38 -0
  162. data/manual/table/column_widths.rb +30 -0
  163. data/manual/table/content_and_subtables.rb +39 -0
  164. data/manual/table/creation.rb +27 -0
  165. data/manual/table/filtering.rb +36 -0
  166. data/manual/table/flow_and_header.rb +17 -0
  167. data/manual/table/image_cells.rb +33 -0
  168. data/manual/table/position.rb +29 -0
  169. data/manual/table/row_colors.rb +20 -0
  170. data/manual/table/span.rb +30 -0
  171. data/manual/table/style.rb +22 -0
  172. data/manual/table/table.rb +52 -0
  173. data/manual/table/width.rb +27 -0
  174. data/manual/templates/full_template.rb +25 -0
  175. data/manual/templates/page_template.rb +48 -0
  176. data/manual/templates/templates.rb +27 -0
  177. data/manual/text/alignment.rb +44 -0
  178. data/manual/text/color.rb +24 -0
  179. data/manual/text/column_box.rb +32 -0
  180. data/manual/text/fallback_fonts.rb +37 -0
  181. data/manual/text/font.rb +41 -0
  182. data/manual/text/font_size.rb +45 -0
  183. data/manual/text/font_style.rb +23 -0
  184. data/manual/text/formatted_callbacks.rb +60 -0
  185. data/manual/text/formatted_text.rb +54 -0
  186. data/manual/text/free_flowing_text.rb +51 -0
  187. data/manual/text/group.rb +29 -0
  188. data/manual/text/inline.rb +43 -0
  189. data/manual/text/kerning_and_character_spacing.rb +39 -0
  190. data/manual/text/leading.rb +25 -0
  191. data/manual/text/line_wrapping.rb +41 -0
  192. data/manual/text/paragraph_indentation.rb +26 -0
  193. data/manual/text/positioned_text.rb +38 -0
  194. data/manual/text/registering_families.rb +48 -0
  195. data/manual/text/rendering_and_color.rb +37 -0
  196. data/manual/text/right_to_left_text.rb +43 -0
  197. data/manual/text/rotation.rb +43 -0
  198. data/manual/text/single_usage.rb +37 -0
  199. data/manual/text/text.rb +75 -0
  200. data/manual/text/text_box_excess.rb +32 -0
  201. data/manual/text/text_box_extensions.rb +45 -0
  202. data/manual/text/text_box_overflow.rb +44 -0
  203. data/manual/text/utf8.rb +28 -0
  204. data/{examples/m17n → manual/text}/win_ansi_charset.rb +14 -10
  205. data/prawn.gemspec +18 -12
  206. data/spec/acceptance/png.rb +23 -0
  207. data/spec/annotations_spec.rb +16 -32
  208. data/spec/bounding_box_spec.rb +128 -15
  209. data/spec/cell_spec.rb +169 -38
  210. data/spec/column_box_spec.rb +33 -0
  211. data/spec/destinations_spec.rb +5 -5
  212. data/spec/document_spec.rb +150 -104
  213. data/spec/extensions/encoding_helpers.rb +10 -0
  214. data/spec/extensions/mocha.rb +1 -0
  215. data/spec/filters_spec.rb +34 -0
  216. data/spec/font_metric_cache_spec.rb +52 -0
  217. data/spec/font_spec.rb +183 -97
  218. data/spec/formatted_text_arranger_spec.rb +43 -43
  219. data/spec/formatted_text_box_spec.rb +30 -20
  220. data/spec/formatted_text_fragment_spec.rb +8 -8
  221. data/spec/graphics_spec.rb +158 -69
  222. data/spec/grid_spec.rb +15 -15
  223. data/spec/image_handler_spec.rb +42 -0
  224. data/spec/images_spec.rb +49 -24
  225. data/spec/inline_formatted_text_parser_spec.rb +73 -19
  226. data/spec/jpg_spec.rb +4 -4
  227. data/spec/line_wrap_spec.rb +26 -26
  228. data/spec/measurement_units_spec.rb +6 -6
  229. data/spec/name_tree_spec.rb +21 -21
  230. data/spec/object_store_spec.rb +39 -39
  231. data/spec/outline_spec.rb +93 -53
  232. data/spec/pdf_object_spec.rb +88 -86
  233. data/spec/png_spec.rb +31 -28
  234. data/spec/reference_spec.rb +32 -32
  235. data/spec/repeater_spec.rb +25 -11
  236. data/spec/security_spec.rb +44 -12
  237. data/spec/snapshot_spec.rb +8 -9
  238. data/spec/soft_mask_spec.rb +117 -0
  239. data/spec/span_spec.rb +10 -15
  240. data/spec/spec_helper.rb +25 -8
  241. data/spec/stamp_spec.rb +29 -30
  242. data/spec/stream_spec.rb +58 -0
  243. data/spec/stroke_styles_spec.rb +36 -18
  244. data/spec/table/span_dummy_spec.rb +17 -0
  245. data/spec/table_spec.rb +697 -105
  246. data/spec/template_spec.rb +108 -54
  247. data/spec/text_at_spec.rb +18 -17
  248. data/spec/text_box_spec.rb +111 -62
  249. data/spec/text_rendering_mode_spec.rb +5 -5
  250. data/spec/text_spacing_spec.rb +4 -4
  251. data/spec/text_spec.rb +57 -49
  252. data/spec/transparency_spec.rb +5 -5
  253. metadata +421 -213
  254. data/data/fonts/Action Man.dfont +0 -0
  255. data/data/fonts/Activa.ttf +0 -0
  256. data/data/fonts/Chalkboard.ttf +0 -0
  257. data/data/fonts/DejaVuSans.ttf +0 -0
  258. data/data/fonts/Dustismo_Roman.ttf +0 -0
  259. data/data/fonts/comicsans.ttf +0 -0
  260. data/data/fonts/gkai00mp.ttf +0 -0
  261. data/data/images/rails.dat +0 -0
  262. data/data/images/rails.png +0 -0
  263. data/examples/bounding_box/russian_boxes.rb +0 -37
  264. data/examples/example_helper.rb +0 -11
  265. data/examples/general/context_sensitive_headers.rb +0 -38
  266. data/examples/graphics/cmyk.rb +0 -13
  267. data/examples/graphics/gradient.rb +0 -23
  268. data/examples/graphics/png_types.rb +0 -23
  269. data/examples/graphics/remote_images.rb +0 -13
  270. data/examples/m17n/full_win_ansi_character_list.rb +0 -20
  271. data/examples/m17n/sjis.rb +0 -29
  272. data/examples/table/bill.rb +0 -54
  273. data/examples/table/header.rb +0 -15
  274. data/examples/text/font_calculations.rb +0 -92
  275. data/examples/text/hyphenation.rb +0 -45
  276. data/examples/text/indent_paragraphs.rb +0 -24
  277. data/lib/prawn/core.rb +0 -85
  278. data/lib/prawn/core/text/formatted/arranger.rb +0 -294
  279. data/lib/prawn/core/text/formatted/line_wrap.rb +0 -273
  280. data/lib/prawn/core/text/formatted/wrap.rb +0 -153
  281. data/lib/prawn/graphics/gradient.rb +0 -84
  282. data/lib/prawn/security/arcfour.rb +0 -51
@@ -18,7 +18,7 @@ describe "#text_rendering_mode" do
18
18
  @pdf.text("hello world")
19
19
  end
20
20
  contents = PDF::Inspector::Text.analyze(@pdf.render)
21
- contents.text_rendering_mode.should.be.empty
21
+ contents.text_rendering_mode.should be_empty
22
22
  end
23
23
  it "should restore character spacing to 0" do
24
24
  create_pdf
@@ -36,10 +36,10 @@ describe "#text_rendering_mode" do
36
36
  end
37
37
  @pdf.text_rendering_mode.should == :fill
38
38
  end
39
- it "should raise an exception when passed an invalid mode" do
39
+ it "should raise_error an exception when passed an invalid mode" do
40
40
  create_pdf
41
- lambda { @pdf.text_rendering_mode(-1) }.should.raise(ArgumentError)
42
- lambda { @pdf.text_rendering_mode(8) }.should.raise(ArgumentError)
43
- lambda { @pdf.text_rendering_mode(:flil) }.should.raise(ArgumentError)
41
+ lambda { @pdf.text_rendering_mode(-1) }.should raise_error(ArgumentError)
42
+ lambda { @pdf.text_rendering_mode(8) }.should raise_error(ArgumentError)
43
+ lambda { @pdf.text_rendering_mode(:flil) }.should raise_error(ArgumentError)
44
44
  end
45
45
  end
@@ -18,7 +18,7 @@ describe "#character_spacing" do
18
18
  @pdf.text("hello world")
19
19
  end
20
20
  contents = PDF::Inspector::Text.analyze(@pdf.render)
21
- contents.character_spacing.should.be.empty
21
+ contents.character_spacing.should be_empty
22
22
  end
23
23
  it "should restore character spacing to 0" do
24
24
  create_pdf
@@ -42,7 +42,7 @@ describe "#character_spacing" do
42
42
  #
43
43
  it "should calculate character spacing widths by characters, not bytes" do
44
44
  create_pdf
45
- @pdf.font("#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf")
45
+ @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf")
46
46
 
47
47
  str = "こんにちは世界"
48
48
  @pdf.character_spacing(0) do
@@ -51,7 +51,7 @@ describe "#character_spacing" do
51
51
 
52
52
  @pdf.character_spacing(10) do
53
53
  # the new width should include seven 10-pt character spaces.
54
- @pdf.width_of(str).should.be.close(@raw_width + (10 * 7), 0.001)
54
+ @pdf.width_of(str).should be_within(0.001).of(@raw_width + (10 * 7))
55
55
  end
56
56
  end
57
57
  end
@@ -72,7 +72,7 @@ describe "#word_spacing" do
72
72
  @pdf.text("hello world")
73
73
  end
74
74
  contents = PDF::Inspector::Text.analyze(@pdf.render)
75
- contents.word_spacing.should.be.empty
75
+ contents.word_spacing.should be_empty
76
76
  end
77
77
  it "should restore word spacing to 0" do
78
78
  create_pdf
@@ -16,7 +16,7 @@ describe "#height_of" do
16
16
  original_y = @pdf.y
17
17
  @pdf.text("Foo")
18
18
  new_y = @pdf.y
19
- @pdf.height_of("Foo").should.be.close(original_y - new_y, 0.0001)
19
+ @pdf.height_of("Foo").should be_within(0.0001).of(original_y - new_y)
20
20
  end
21
21
 
22
22
  it "should omit the gap below the last descender if :final_gap => false " +
@@ -24,40 +24,35 @@ describe "#height_of" do
24
24
  original_y = @pdf.y
25
25
  @pdf.text("Foo", :final_gap => false)
26
26
  new_y = @pdf.y
27
- @pdf.height_of("Foo", :final_gap => false).should.be.close(original_y - new_y, 0.0001)
27
+ @pdf.height_of("Foo", :final_gap => false).should be_within(0.0001).of(original_y - new_y)
28
28
  end
29
29
 
30
- it "should raise CannotFit if a too-small width is given" do
30
+ it "should raise_error CannotFit if a too-small width is given" do
31
31
  lambda do
32
32
  @pdf.height_of("text", :width => 1)
33
- end.should.raise(Prawn::Errors::CannotFit)
33
+ end.should raise_error(Prawn::Errors::CannotFit)
34
34
  end
35
35
 
36
- it "should raise NotImplementedError if :indent_paragraphs option is provided" do
36
+ it "should raise_error NotImplementedError if :indent_paragraphs option is provided" do
37
37
  lambda {
38
38
  @pdf.height_of("hai", :width => 300,
39
39
  :indent_paragraphs => 60)
40
- }.should.raise(NotImplementedError)
40
+ }.should raise_error(NotImplementedError)
41
41
  end
42
42
 
43
- it "should not raise 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(Prawn::Errors::UnknownOption)
43
+ it "should_not raise_error Prawn::Errors::UnknownOption if :final_gap option is provided" do
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(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
@@ -67,6 +62,10 @@ describe "#text" do
67
62
  text.strings.each { |str| str.should =~ /\A\s*\z/ }
68
63
  end
69
64
 
65
+ it "should ignore call when string is nil" do
66
+ @pdf.text(nil).should be_false
67
+ end
68
+
70
69
  it "should correctly render empty paragraphs" do
71
70
  @pdf.text "text\n\ntext"
72
71
  text = PDF::Inspector::Text.analyze(@pdf.render)
@@ -92,13 +91,13 @@ describe "#text" do
92
91
  it "should default to use kerning information" do
93
92
  @pdf.text "hello world"
94
93
  text = PDF::Inspector::Text.analyze(@pdf.render)
95
- text.kerned[0].should.be true
94
+ text.kerned[0].should be_true
96
95
  end
97
96
 
98
97
  it "should be able to disable kerning with an option" do
99
98
  @pdf.text "hello world", :kerning => false
100
99
  text = PDF::Inspector::Text.analyze(@pdf.render)
101
- text.kerned[0].should.be false
100
+ text.kerned[0].should be_false
102
101
  end
103
102
 
104
103
  it "should be able to disable kerning document-wide" do
@@ -106,29 +105,29 @@ describe "#text" do
106
105
  @pdf.default_kerning = false
107
106
  @pdf.text "hello world"
108
107
  text = PDF::Inspector::Text.analyze(@pdf.render)
109
- text.kerned[0].should.be false
108
+ text.kerned[0].should be_false
110
109
  end
111
110
 
112
111
  it "option should be able to override document-wide kerning disabling" do
113
112
  @pdf.default_kerning = false
114
113
  @pdf.text "hello world", :kerning => true
115
114
  text = PDF::Inspector::Text.analyze(@pdf.render)
116
- text.kerned[0].should.be true
115
+ text.kerned[0].should be_true
117
116
  end
118
117
 
119
- it "should raise ArgumentError if :at option included" do
120
- lambda { @pdf.text("hai", :at => [0, 0]) }.should.raise(ArgumentError)
118
+ it "should raise_error ArgumentError if :at option included" do
119
+ lambda { @pdf.text("hai", :at => [0, 0]) }.should raise_error(ArgumentError)
121
120
  end
122
121
 
123
122
  it "should advance down the document based on font_height" do
124
123
  position = @pdf.y
125
124
  @pdf.text "Foo"
126
125
 
127
- @pdf.y.should.be.close(position - @pdf.font.height, 0.0001)
126
+ @pdf.y.should be_within(0.0001).of(position - @pdf.font.height)
128
127
 
129
128
  position = @pdf.y
130
129
  @pdf.text "Foo\nBar\nBaz"
131
- @pdf.y.should.be.close(position - 3*@pdf.font.height, 0.0001)
130
+ @pdf.y.should be_within(0.0001).of(position - 3*@pdf.font.height)
132
131
  end
133
132
 
134
133
  it "should advance down the document based on font_height" +
@@ -137,11 +136,11 @@ describe "#text" do
137
136
  @pdf.text "Foo", :size => 15
138
137
 
139
138
  @pdf.font_size = 15
140
- @pdf.y.should.be.close(position - @pdf.font.height, 0.0001)
139
+ @pdf.y.should be_within(0.0001).of(position - @pdf.font.height)
141
140
 
142
141
  position = @pdf.y
143
142
  @pdf.text "Foo\nBar\nBaz"
144
- @pdf.y.should.be.close(position - 3 * @pdf.font.height, 0.0001)
143
+ @pdf.y.should be_within(0.0001).of(position - 3 * @pdf.font.height)
145
144
  end
146
145
 
147
146
  it "should advance down the document based on font_height" +
@@ -150,11 +149,11 @@ describe "#text" do
150
149
  leading = 2
151
150
  @pdf.text "Foo", :leading => leading
152
151
 
153
- @pdf.y.should.be.close(position - @pdf.font.height - leading, 0.0001)
152
+ @pdf.y.should be_within(0.0001).of(position - @pdf.font.height - leading)
154
153
 
155
154
  position = @pdf.y
156
155
  @pdf.text "Foo\nBar\nBaz"
157
- @pdf.y.should.be.close(position - 3*@pdf.font.height, 0.0001)
156
+ @pdf.y.should be_within(0.0001).of(position - 3*@pdf.font.height)
158
157
  end
159
158
 
160
159
  it "should advance only to the bottom of the final descender "+
@@ -162,11 +161,11 @@ describe "#text" do
162
161
  position = @pdf.y
163
162
  @pdf.text "Foo", :final_gap => false
164
163
 
165
- @pdf.y.should.be.close(position - @pdf.font.ascender - @pdf.font.descender, 0.0001)
164
+ @pdf.y.should be_within(0.0001).of(position - @pdf.font.ascender - @pdf.font.descender)
166
165
 
167
166
  position = @pdf.y
168
167
  @pdf.text "Foo\nBar\nBaz", :final_gap => false
169
- @pdf.y.should.be.close(position - 2*@pdf.font.height - @pdf.font.ascender - @pdf.font.descender, 0.0001)
168
+ @pdf.y.should be_within(0.0001).of(position - 2*@pdf.font.height - @pdf.font.ascender - @pdf.font.descender)
170
169
  end
171
170
 
172
171
  it "should be able to print text starting at the last line of a page" do
@@ -253,14 +252,12 @@ describe "#text" do
253
252
  text.font_settings[1][:name].should == :Helvetica
254
253
  end
255
254
 
256
- it "should raise an exception when an unknown font is used" do
257
- lambda { @pdf.font "Pao bu" }.should.raise(Prawn::Errors::UnknownFont)
255
+ it "should raise_error an exception when an unknown font is used" do
256
+ lambda { @pdf.font "Pao bu" }.should raise_error(Prawn::Errors::UnknownFont)
258
257
  end
259
-
260
- it "should not raise an exception when providing Pathname instance as font" do
261
- lambda {
262
- @pdf.font Pathname.new("#{Prawn::BASEDIR}/data/fonts/comicsans.ttf")
263
- }.should.not.raise(Prawn::Errors::UnknownFont)
258
+
259
+ it "should_not raise_error an exception when providing Pathname instance as font" do
260
+ @pdf.font Pathname.new("#{Prawn::DATADIR}/fonts/comicsans.ttf")
264
261
  end
265
262
 
266
263
  it "should correctly render a utf-8 string when using a built-in font" do
@@ -274,7 +271,7 @@ describe "#text" do
274
271
 
275
272
  it "should correctly render a utf-8 string when using a TTF font" do
276
273
  str = "©" # copyright symbol
277
- @pdf.font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
274
+ @pdf.font "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf"
278
275
  @pdf.text str
279
276
 
280
277
  # grab the text from the rendered PDF and ensure it matches
@@ -282,6 +279,16 @@ describe "#text" do
282
279
  text.strings.first.should == str
283
280
  end
284
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
+
285
292
  it "should correctly render a string with higher bit characters across" +
286
293
  " a page break when using a built-in font" do
287
294
  str = "©"
@@ -308,29 +315,30 @@ describe "#text" do
308
315
 
309
316
  if "spec".respond_to?(:encode!)
310
317
  # Handle non utf-8 string encodings in a sane way on M17N aware VMs
311
- it "should raise an exception when a utf-8 incompatible string is rendered" do
318
+ it "should raise_error an exception when a utf-8 incompatible string is rendered" do
312
319
  str = "Blah \xDD"
313
320
  str.force_encoding("ASCII-8BIT")
314
- lambda { @pdf.text str }.should.raise(
321
+ lambda { @pdf.text str }.should raise_error(
315
322
  Prawn::Errors::IncompatibleStringEncoding)
316
323
  end
317
- it "should not raise an exception when a shift-jis string is rendered" do
318
- datafile = "#{Prawn::BASEDIR}/data/shift_jis_text.txt"
324
+ it "should_not raise_error an exception when a shift-jis string is rendered" do
325
+ datafile = "#{Prawn::DATADIR}/shift_jis_text.txt"
319
326
  sjis_str = File.open(datafile, "r:shift_jis") { |f| f.gets }
320
- @pdf.font("#{Prawn::BASEDIR}/data/fonts/gkai00mp.ttf")
321
- lambda { @pdf.text sjis_str }.should.not.raise(
322
- Prawn::Errors::IncompatibleStringEncoding)
327
+ @pdf.font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf")
328
+
329
+ # Expect that the call to text will not raise an encoding error
330
+ @pdf.text(sjis_str)
323
331
  end
324
332
  else
325
333
  # Handle non utf-8 string encodings in a sane way on non-M17N aware VMs
326
- it "should raise an exception when a corrupt utf-8 string is rendered" do
334
+ it "should raise_error an exception when a corrupt utf-8 string is rendered" do
327
335
  str = "Blah \xDD"
328
- lambda { @pdf.text str }.should.raise(
336
+ lambda { @pdf.text str }.should raise_error(
329
337
  Prawn::Errors::IncompatibleStringEncoding)
330
338
  end
331
- it "should raise an exception when a shift-jis string is rendered" do
332
- sjis_str = File.read("#{Prawn::BASEDIR}/data/shift_jis_text.txt")
333
- lambda { @pdf.text sjis_str }.should.raise(
339
+ it "should raise_error an exception when a shift-jis string is rendered" do
340
+ sjis_str = File.read("#{Prawn::DATADIR}/shift_jis_text.txt")
341
+ lambda { @pdf.text sjis_str }.should raise_error(
334
342
  Prawn::Errors::IncompatibleStringEncoding)
335
343
  end
336
344
  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: 0.12.0
5
- prerelease:
4
+ version: 0.13.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gregory Brown
@@ -13,34 +12,108 @@ authors:
13
12
  autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
- date: 2011-08-13 00:00:00.000000000 -05:00
17
- default_executable:
15
+ date: 2013-12-16 00:00:00.000000000 Z
18
16
  dependencies:
19
17
  - !ruby/object:Gem::Dependency
20
18
  name: pdf-reader
21
- requirement: &21445960 !ruby/object:Gem::Requirement
22
- none: false
19
+ requirement: !ruby/object:Gem::Requirement
23
20
  requirements:
24
- - - ! '>='
21
+ - - ~>
25
22
  - !ruby/object:Gem::Version
26
- version: 0.9.0
23
+ version: '1.2'
27
24
  type: :runtime
28
25
  prerelease: false
29
- version_requirements: *21445960
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '1.2'
30
31
  - !ruby/object:Gem::Dependency
31
32
  name: ttfunk
32
- requirement: &21445500 !ruby/object:Gem::Requirement
33
- none: false
33
+ requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 1.0.2
37
+ version: 1.0.3
38
38
  type: :runtime
39
39
  prerelease: false
40
- version_requirements: *21445500
41
- description: ! ' Prawn is a fast, tiny, and nimble PDF generator for Ruby
42
-
43
- '
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 1.0.3
45
+ - !ruby/object:Gem::Dependency
46
+ name: ruby-rc4
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ type: :runtime
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ - !ruby/object:Gem::Dependency
60
+ name: afm
61
+ requirement: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ - !ruby/object:Gem::Dependency
74
+ name: pdf-inspector
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: 1.1.0
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ~>
85
+ - !ruby/object:Gem::Version
86
+ version: 1.1.0
87
+ - !ruby/object:Gem::Dependency
88
+ name: coderay
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 1.0.7
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ~>
99
+ - !ruby/object:Gem::Version
100
+ version: 1.0.7
101
+ - !ruby/object:Gem::Dependency
102
+ name: rdoc
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ description: |2
116
+ Prawn is a fast, tiny, and nimble PDF generator for Ruby
44
117
  email:
45
118
  - gregory.t.brown@gmail.com
46
119
  - brad@bradediger.com
@@ -56,261 +129,396 @@ extra_rdoc_files:
56
129
  - GPLv2
57
130
  - GPLv3
58
131
  files:
59
- - examples/text/indent_paragraphs.rb
60
- - examples/text/hyphenation.rb
61
- - examples/text/font_calculations.rb
62
- - examples/graphics/gradient.rb
63
- - examples/graphics/png_types.rb
64
- - examples/graphics/cmyk.rb
65
- - examples/graphics/remote_images.rb
66
- - examples/example_helper.rb
67
- - examples/general/context_sensitive_headers.rb
68
- - examples/table/header.rb
69
- - examples/table/bill.rb
70
- - examples/m17n/full_win_ansi_character_list.rb
71
- - examples/m17n/sjis.rb
72
- - examples/m17n/win_ansi_charset.rb
73
- - examples/bounding_box/russian_boxes.rb
74
- - lib/prawn.rb
75
- - lib/prawn/text/box.rb
76
- - lib/prawn/text/formatted/parser.rb
77
- - lib/prawn/text/formatted/fragment.rb
78
- - lib/prawn/text/formatted/box.rb
79
- - lib/prawn/text/formatted.rb
80
- - lib/prawn/outline.rb
81
- - lib/prawn/repeater.rb
82
- - lib/prawn/measurement_extensions.rb
83
- - lib/prawn/font/ttf.rb
132
+ - lib/pdf/core/annotations.rb
133
+ - lib/pdf/core/byte_string.rb
134
+ - lib/pdf/core/destinations.rb
135
+ - lib/pdf/core/document_state.rb
136
+ - lib/pdf/core/filter_list.rb
137
+ - lib/pdf/core/filters.rb
138
+ - lib/pdf/core/graphics_state.rb
139
+ - lib/pdf/core/literal_string.rb
140
+ - lib/pdf/core/name_tree.rb
141
+ - lib/pdf/core/object_store.rb
142
+ - lib/pdf/core/outline.rb
143
+ - lib/pdf/core/page.rb
144
+ - lib/pdf/core/page_geometry.rb
145
+ - lib/pdf/core/pdf_object.rb
146
+ - lib/pdf/core/reference.rb
147
+ - lib/pdf/core/stream.rb
148
+ - lib/pdf/core/text.rb
149
+ - lib/pdf/core.rb
150
+ - lib/prawn/compatibility.rb
151
+ - lib/prawn/document/bounding_box.rb
152
+ - lib/prawn/document/column_box.rb
153
+ - lib/prawn/document/graphics_state.rb
154
+ - lib/prawn/document/internals.rb
155
+ - lib/prawn/document/snapshot.rb
156
+ - lib/prawn/document/span.rb
157
+ - lib/prawn/document.rb
158
+ - lib/prawn/encoding.rb
159
+ - lib/prawn/errors.rb
84
160
  - lib/prawn/font/afm.rb
85
161
  - lib/prawn/font/dfont.rb
86
- - lib/prawn/graphics/transparency.rb
87
- - lib/prawn/graphics/gradient.rb
88
- - lib/prawn/graphics/join_style.rb
89
- - lib/prawn/graphics/transformation.rb
162
+ - lib/prawn/font/ttf.rb
163
+ - lib/prawn/font.rb
164
+ - lib/prawn/font_metric_cache.rb
165
+ - lib/prawn/graphics/cap_style.rb
90
166
  - lib/prawn/graphics/color.rb
91
167
  - lib/prawn/graphics/dash.rb
92
- - lib/prawn/graphics/cap_style.rb
93
- - lib/prawn/core/pdf_object.rb
94
- - lib/prawn/core/text/formatted/arranger.rb
95
- - lib/prawn/core/text/formatted/line_wrap.rb
96
- - lib/prawn/core/text/formatted/wrap.rb
97
- - lib/prawn/core/reference.rb
98
- - lib/prawn/core/object_store.rb
99
- - lib/prawn/core/name_tree.rb
100
- - lib/prawn/core/destinations.rb
101
- - lib/prawn/core/byte_string.rb
102
- - lib/prawn/core/annotations.rb
103
- - lib/prawn/core/page.rb
104
- - lib/prawn/core/document_state.rb
105
- - lib/prawn/core/text.rb
106
- - lib/prawn/core/literal_string.rb
107
- - lib/prawn/errors.rb
108
- - lib/prawn/compatibility.rb
109
- - lib/prawn/table/cells.rb
110
- - lib/prawn/table/cell.rb
111
- - lib/prawn/table/cell/subtable.rb
112
- - lib/prawn/table/cell/in_table.rb
113
- - lib/prawn/table/cell/text.rb
114
- - lib/prawn/core.rb
115
- - lib/prawn/font.rb
116
- - lib/prawn/measurements.rb
168
+ - lib/prawn/graphics/join_style.rb
169
+ - lib/prawn/graphics/patterns.rb
170
+ - lib/prawn/graphics/transformation.rb
171
+ - lib/prawn/graphics/transparency.rb
172
+ - lib/prawn/graphics.rb
173
+ - lib/prawn/image_handler.rb
174
+ - lib/prawn/images/image.rb
175
+ - lib/prawn/images/jpg.rb
176
+ - lib/prawn/images/png.rb
117
177
  - lib/prawn/images.rb
118
178
  - lib/prawn/layout/grid.rb
119
- - lib/prawn/security/arcfour.rb
120
- - lib/prawn/stamp.rb
121
- - lib/prawn/encoding.rb
122
- - lib/prawn/graphics.rb
123
- - lib/prawn/document/snapshot.rb
124
- - lib/prawn/document/bounding_box.rb
125
- - lib/prawn/document/graphics_state.rb
126
- - lib/prawn/document/span.rb
127
- - lib/prawn/document/page_geometry.rb
128
- - lib/prawn/document/internals.rb
129
- - lib/prawn/document/column_box.rb
130
179
  - lib/prawn/layout.rb
131
- - lib/prawn/table.rb
180
+ - lib/prawn/measurement_extensions.rb
181
+ - lib/prawn/measurements.rb
182
+ - lib/prawn/outline.rb
183
+ - lib/prawn/repeater.rb
132
184
  - lib/prawn/security.rb
185
+ - lib/prawn/soft_mask.rb
186
+ - lib/prawn/stamp.rb
187
+ - lib/prawn/table/cell/image.rb
188
+ - lib/prawn/table/cell/in_table.rb
189
+ - lib/prawn/table/cell/span_dummy.rb
190
+ - lib/prawn/table/cell/subtable.rb
191
+ - lib/prawn/table/cell/text.rb
192
+ - lib/prawn/table/cell.rb
193
+ - lib/prawn/table/cells.rb
194
+ - lib/prawn/table.rb
195
+ - lib/prawn/text/box.rb
196
+ - lib/prawn/text/formatted/arranger.rb
197
+ - lib/prawn/text/formatted/box.rb
198
+ - lib/prawn/text/formatted/fragment.rb
199
+ - lib/prawn/text/formatted/line_wrap.rb
200
+ - lib/prawn/text/formatted/parser.rb
201
+ - lib/prawn/text/formatted/wrap.rb
202
+ - lib/prawn/text/formatted.rb
133
203
  - lib/prawn/text.rb
134
- - lib/prawn/images/png.rb
135
- - lib/prawn/images/jpg.rb
136
- - lib/prawn/document.rb
204
+ - lib/prawn/utilities.rb
205
+ - lib/prawn.rb
206
+ - spec/acceptance/png.rb
207
+ - spec/annotations_spec.rb
208
+ - spec/bounding_box_spec.rb
209
+ - spec/cell_spec.rb
210
+ - spec/column_box_spec.rb
137
211
  - spec/data/curves.pdf
138
- - spec/text_spec.rb
139
- - spec/snapshot_spec.rb
140
- - spec/png_spec.rb
141
- - spec/pdf_object_spec.rb
142
- - spec/object_store_spec.rb
143
- - spec/transparency_spec.rb
144
- - spec/span_spec.rb
145
- - spec/security_spec.rb
146
- - spec/name_tree_spec.rb
212
+ - spec/destinations_spec.rb
213
+ - spec/document_spec.rb
214
+ - spec/extensions/encoding_helpers.rb
215
+ - spec/extensions/mocha.rb
216
+ - spec/filters_spec.rb
217
+ - spec/font_metric_cache_spec.rb
218
+ - spec/font_spec.rb
219
+ - spec/formatted_text_arranger_spec.rb
147
220
  - spec/formatted_text_box_spec.rb
148
- - spec/spec_helper.rb
149
- - spec/stamp_spec.rb
221
+ - spec/formatted_text_fragment_spec.rb
150
222
  - spec/graphics_spec.rb
151
- - spec/text_with_inline_formatting_spec.rb
152
- - spec/jpg_spec.rb
153
- - spec/stroke_styles_spec.rb
154
- - spec/annotations_spec.rb
155
- - spec/text_rendering_mode_spec.rb
156
- - spec/cell_spec.rb
157
223
  - spec/grid_spec.rb
158
- - spec/font_spec.rb
159
- - spec/line_wrap_spec.rb
160
- - spec/repeater_spec.rb
161
- - spec/document_spec.rb
224
+ - spec/image_handler_spec.rb
162
225
  - spec/images_spec.rb
163
- - spec/destinations_spec.rb
164
- - spec/text_box_spec.rb
165
- - spec/formatted_text_fragment_spec.rb
166
- - spec/bounding_box_spec.rb
167
- - spec/template_spec.rb
168
- - spec/extensions/mocha.rb
169
- - spec/measurement_units_spec.rb
170
226
  - spec/inline_formatted_text_parser_spec.rb
227
+ - spec/jpg_spec.rb
228
+ - spec/line_wrap_spec.rb
229
+ - spec/measurement_units_spec.rb
230
+ - spec/name_tree_spec.rb
231
+ - spec/object_store_spec.rb
232
+ - spec/outline_spec.rb
233
+ - spec/pdf_object_spec.rb
234
+ - spec/png_spec.rb
171
235
  - spec/reference_spec.rb
172
- - spec/text_at_spec.rb
173
- - spec/formatted_text_arranger_spec.rb
236
+ - spec/repeater_spec.rb
237
+ - spec/security_spec.rb
238
+ - spec/snapshot_spec.rb
239
+ - spec/soft_mask_spec.rb
240
+ - spec/span_spec.rb
241
+ - spec/spec_helper.rb
242
+ - spec/stamp_spec.rb
243
+ - spec/stream_spec.rb
244
+ - spec/stroke_styles_spec.rb
245
+ - spec/table/span_dummy_spec.rb
174
246
  - spec/table_spec.rb
175
- - spec/outline_spec.rb
247
+ - spec/template_spec.rb
248
+ - spec/text_at_spec.rb
249
+ - spec/text_box_spec.rb
250
+ - spec/text_rendering_mode_spec.rb
176
251
  - spec/text_spacing_spec.rb
252
+ - spec/text_spec.rb
253
+ - spec/text_with_inline_formatting_spec.rb
254
+ - spec/transparency_spec.rb
255
+ - manual/basic_concepts/adding_pages.rb
256
+ - manual/basic_concepts/basic_concepts.rb
257
+ - manual/basic_concepts/creation.rb
258
+ - manual/basic_concepts/cursor.rb
259
+ - manual/basic_concepts/measurement.rb
260
+ - manual/basic_concepts/origin.rb
261
+ - manual/basic_concepts/other_cursor_helpers.rb
262
+ - manual/bounding_box/bounding_box.rb
263
+ - manual/bounding_box/bounds.rb
264
+ - manual/bounding_box/canvas.rb
265
+ - manual/bounding_box/creation.rb
266
+ - manual/bounding_box/indentation.rb
267
+ - manual/bounding_box/nesting.rb
268
+ - manual/bounding_box/russian_boxes.rb
269
+ - manual/bounding_box/stretchy.rb
270
+ - manual/document_and_page_options/background.rb
271
+ - manual/document_and_page_options/document_and_page_options.rb
272
+ - manual/document_and_page_options/metadata.rb
273
+ - manual/document_and_page_options/page_margins.rb
274
+ - manual/document_and_page_options/page_size.rb
275
+ - manual/example_file.rb
276
+ - manual/example_helper.rb
277
+ - manual/example_package.rb
278
+ - manual/example_section.rb
279
+ - manual/graphics/circle_and_ellipse.rb
280
+ - manual/graphics/color.rb
281
+ - manual/graphics/common_lines.rb
282
+ - manual/graphics/fill_and_stroke.rb
283
+ - manual/graphics/fill_rules.rb
284
+ - manual/graphics/gradients.rb
285
+ - manual/graphics/graphics.rb
286
+ - manual/graphics/helper.rb
287
+ - manual/graphics/line_width.rb
288
+ - manual/graphics/lines_and_curves.rb
289
+ - manual/graphics/polygon.rb
290
+ - manual/graphics/rectangle.rb
291
+ - manual/graphics/rotate.rb
292
+ - manual/graphics/scale.rb
293
+ - manual/graphics/soft_masks.rb
294
+ - manual/graphics/stroke_cap.rb
295
+ - manual/graphics/stroke_dash.rb
296
+ - manual/graphics/stroke_join.rb
297
+ - manual/graphics/translate.rb
298
+ - manual/graphics/transparency.rb
299
+ - manual/images/absolute_position.rb
300
+ - manual/images/fit.rb
301
+ - manual/images/horizontal.rb
302
+ - manual/images/images.rb
303
+ - manual/images/plain_image.rb
304
+ - manual/images/scale.rb
305
+ - manual/images/vertical.rb
306
+ - manual/images/width_and_height.rb
307
+ - manual/layout/boxes.rb
308
+ - manual/layout/content.rb
309
+ - manual/layout/layout.rb
310
+ - manual/layout/simple_grid.rb
311
+ - manual/manual/cover.rb
312
+ - manual/manual/foreword.rb
313
+ - manual/manual/how_to_read_this_manual.rb
314
+ - manual/manual/manual.rb
315
+ - manual/outline/add_subsection_to.rb
316
+ - manual/outline/insert_section_after.rb
317
+ - manual/outline/outline.rb
318
+ - manual/outline/sections_and_pages.rb
319
+ - manual/repeatable_content/page_numbering.rb
320
+ - manual/repeatable_content/repeatable_content.rb
321
+ - manual/repeatable_content/repeater.rb
322
+ - manual/repeatable_content/stamp.rb
323
+ - manual/security/encryption.rb
324
+ - manual/security/permissions.rb
325
+ - manual/security/security.rb
326
+ - manual/syntax_highlight.rb
327
+ - manual/table/basic_block.rb
328
+ - manual/table/before_rendering_page.rb
329
+ - manual/table/cell_border_lines.rb
330
+ - manual/table/cell_borders_and_bg.rb
331
+ - manual/table/cell_dimensions.rb
332
+ - manual/table/cell_text.rb
333
+ - manual/table/column_widths.rb
334
+ - manual/table/content_and_subtables.rb
335
+ - manual/table/creation.rb
336
+ - manual/table/filtering.rb
337
+ - manual/table/flow_and_header.rb
338
+ - manual/table/image_cells.rb
339
+ - manual/table/position.rb
340
+ - manual/table/row_colors.rb
341
+ - manual/table/span.rb
342
+ - manual/table/style.rb
343
+ - manual/table/table.rb
344
+ - manual/table/width.rb
345
+ - manual/templates/full_template.rb
346
+ - manual/templates/page_template.rb
347
+ - manual/templates/templates.rb
348
+ - manual/text/alignment.rb
349
+ - manual/text/color.rb
350
+ - manual/text/column_box.rb
351
+ - manual/text/fallback_fonts.rb
352
+ - manual/text/font.rb
353
+ - manual/text/font_size.rb
354
+ - manual/text/font_style.rb
355
+ - manual/text/formatted_callbacks.rb
356
+ - manual/text/formatted_text.rb
357
+ - manual/text/free_flowing_text.rb
358
+ - manual/text/group.rb
359
+ - manual/text/inline.rb
360
+ - manual/text/kerning_and_character_spacing.rb
361
+ - manual/text/leading.rb
362
+ - manual/text/line_wrapping.rb
363
+ - manual/text/paragraph_indentation.rb
364
+ - manual/text/positioned_text.rb
365
+ - manual/text/registering_families.rb
366
+ - manual/text/rendering_and_color.rb
367
+ - manual/text/right_to_left_text.rb
368
+ - manual/text/rotation.rb
369
+ - manual/text/single_usage.rb
370
+ - manual/text/text.rb
371
+ - manual/text/text_box_excess.rb
372
+ - manual/text/text_box_extensions.rb
373
+ - manual/text/text_box_overflow.rb
374
+ - manual/text/utf8.rb
375
+ - manual/text/win_ansi_charset.rb
177
376
  - data/encodings/win_ansi.txt
377
+ - data/images/16bit.alpha
378
+ - data/images/16bit.dat
379
+ - data/images/16bit.png
380
+ - data/images/arrow.png
381
+ - data/images/arrow2.png
382
+ - data/images/barcode_issue.png
383
+ - data/images/dice.alpha
384
+ - data/images/dice.dat
385
+ - data/images/dice.png
386
+ - data/images/dice_interlaced.png
387
+ - data/images/fractal.jpg
388
+ - data/images/indexed_color.dat
389
+ - data/images/indexed_color.png
390
+ - data/images/letterhead.jpg
391
+ - data/images/page_white_text.alpha
392
+ - data/images/page_white_text.dat
393
+ - data/images/page_white_text.png
394
+ - data/images/pigs.jpg
395
+ - data/images/prawn.png
396
+ - data/images/ruport.png
397
+ - data/images/ruport_data.dat
398
+ - data/images/ruport_transparent.png
399
+ - data/images/ruport_type0.png
400
+ - data/images/stef.jpg
401
+ - data/images/tru256.bmp
402
+ - data/images/web-links.dat
403
+ - data/images/web-links.png
404
+ - data/pdfs/complex_template.pdf
405
+ - data/pdfs/contains_ttf_font.pdf
406
+ - data/pdfs/encrypted.pdf
407
+ - data/pdfs/form.pdf
408
+ - data/pdfs/hexagon.pdf
409
+ - data/pdfs/indirect_reference.pdf
410
+ - data/pdfs/multipage_template.pdf
411
+ - data/pdfs/nested_pages.pdf
412
+ - data/pdfs/page_without_mediabox.pdf
413
+ - data/pdfs/resources_as_indirect_object.pdf
414
+ - data/pdfs/two_hexagons.pdf
415
+ - data/pdfs/version_1_6.pdf
416
+ - data/fonts/MustRead.html
178
417
  - data/fonts/Courier-Bold.afm
179
- - data/fonts/Times-Italic.afm
418
+ - data/fonts/Courier-BoldOblique.afm
180
419
  - data/fonts/Courier-Oblique.afm
181
420
  - data/fonts/Courier.afm
182
- - data/fonts/Symbol.afm
183
- - data/fonts/Helvetica-Oblique.afm
184
- - data/fonts/Helvetica-BoldOblique.afm
185
- - data/fonts/Action Man.dfont
186
- - data/fonts/Courier-BoldOblique.afm
187
- - data/fonts/MustRead.html
188
421
  - data/fonts/Helvetica-Bold.afm
422
+ - data/fonts/Helvetica-BoldOblique.afm
423
+ - data/fonts/Helvetica-Oblique.afm
424
+ - data/fonts/Helvetica.afm
425
+ - data/fonts/Symbol.afm
426
+ - data/fonts/Times-Bold.afm
189
427
  - data/fonts/Times-BoldItalic.afm
428
+ - data/fonts/Times-Italic.afm
190
429
  - data/fonts/Times-Roman.afm
191
- - data/fonts/Chalkboard.ttf
192
- - data/fonts/Dustismo_Roman.ttf
193
- - data/fonts/comicsans.ttf
194
- - data/fonts/Activa.ttf
195
430
  - data/fonts/ZapfDingbats.afm
196
- - data/fonts/DejaVuSans.ttf
197
- - data/fonts/Times-Bold.afm
198
- - data/fonts/gkai00mp.ttf
199
- - data/fonts/Helvetica.afm
200
431
  - data/shift_jis_text.txt
201
- - data/pdfs/nested_pages.pdf
202
- - data/pdfs/page_without_mediabox.pdf
203
- - data/pdfs/two_hexagons.pdf
204
- - data/pdfs/indirect_reference.pdf
205
- - data/pdfs/multipage_template.pdf
206
- - data/pdfs/resources_as_indirect_object.pdf
207
- - data/pdfs/complex_template.pdf
208
- - data/pdfs/hexagon.pdf
209
- - data/pdfs/version_1_6.pdf
210
- - data/pdfs/contains_ttf_font.pdf
211
- - data/pdfs/encrypted.pdf
212
- - data/pdfs/form.pdf
213
- - data/images/stef.jpg
214
- - data/images/web-links.dat
215
- - data/images/ruport_transparent.png
216
- - data/images/ruport_data.dat
217
- - data/images/barcode_issue.png
218
- - data/images/pigs.jpg
219
- - data/images/dice.dat
220
- - data/images/arrow2.png
221
- - data/images/dice.png
222
- - data/images/page_white_text.dat
223
- - data/images/rails.dat
224
- - data/images/page_white_text.alpha
225
- - data/images/ruport.png
226
- - data/images/16bit.alpha
227
- - data/images/fractal.jpg
228
- - data/images/web-links.png
229
- - data/images/16bit.png
230
- - data/images/page_white_text.png
231
- - data/images/prawn.png
232
- - data/images/letterhead.jpg
233
- - data/images/dice_interlaced.png
234
- - data/images/arrow.png
235
- - data/images/tru256.bmp
236
- - data/images/dice.alpha
237
- - data/images/ruport_type0.png
238
- - data/images/rails.png
239
- - data/images/16bit.dat
240
432
  - Rakefile
241
433
  - prawn.gemspec
242
- - README.md
243
- - LICENSE
434
+ - Gemfile
244
435
  - COPYING
436
+ - LICENSE
245
437
  - GPLv2
246
438
  - GPLv3
247
- has_rdoc: true
439
+ - README.md
248
440
  homepage: http://prawn.majesticseacreature.com
249
441
  licenses: []
250
- post_install_message: ! "\n ********************************************\n\n\n A
251
- lot has changed since 0.8.4\n\n Please read the changelog for details:\n\n https://github.com/sandal/prawn/wiki/CHANGELOG\n\n\n
252
- \ ********************************************\n\n"
442
+ metadata: {}
443
+ post_install_message: |2+
444
+
445
+ ********************************************
446
+
447
+
448
+ A lot has changed recently in Prawn.
449
+
450
+ Please read the changelog for details:
451
+
452
+ https://github.com/prawnpdf/prawn/wiki/CHANGELOG
453
+
454
+
455
+ ********************************************
456
+
253
457
  rdoc_options:
254
458
  - --title
255
459
  - Prawn Documentation
256
460
  - --main
257
- - README
461
+ - README.md
258
462
  - -q
259
463
  require_paths:
260
464
  - lib
261
465
  required_ruby_version: !ruby/object:Gem::Requirement
262
- none: false
263
466
  requirements:
264
- - - ! '>='
467
+ - - '>='
265
468
  - !ruby/object:Gem::Version
266
- version: 1.8.7
469
+ version: 1.9.3
267
470
  required_rubygems_version: !ruby/object:Gem::Requirement
268
- none: false
269
471
  requirements:
270
- - - ! '>='
472
+ - - '>='
271
473
  - !ruby/object:Gem::Version
272
474
  version: 1.3.6
273
475
  requirements: []
274
476
  rubyforge_project: prawn
275
- rubygems_version: 1.6.2
477
+ rubygems_version: 2.0.14
276
478
  signing_key:
277
- specification_version: 3
479
+ specification_version: 4
278
480
  summary: A fast and nimble PDF generator for Ruby
279
481
  test_files:
280
- - spec/text_spec.rb
281
- - spec/snapshot_spec.rb
282
- - spec/png_spec.rb
283
- - spec/pdf_object_spec.rb
284
- - spec/object_store_spec.rb
285
- - spec/transparency_spec.rb
286
- - spec/span_spec.rb
287
- - spec/security_spec.rb
288
- - spec/name_tree_spec.rb
289
- - spec/formatted_text_box_spec.rb
290
- - spec/stamp_spec.rb
291
- - spec/graphics_spec.rb
292
- - spec/text_with_inline_formatting_spec.rb
293
- - spec/jpg_spec.rb
294
- - spec/stroke_styles_spec.rb
295
482
  - spec/annotations_spec.rb
296
- - spec/text_rendering_mode_spec.rb
483
+ - spec/bounding_box_spec.rb
297
484
  - spec/cell_spec.rb
298
- - spec/grid_spec.rb
299
- - spec/font_spec.rb
300
- - spec/line_wrap_spec.rb
301
- - spec/repeater_spec.rb
302
- - spec/document_spec.rb
303
- - spec/images_spec.rb
485
+ - spec/column_box_spec.rb
304
486
  - spec/destinations_spec.rb
305
- - spec/text_box_spec.rb
487
+ - spec/document_spec.rb
488
+ - spec/filters_spec.rb
489
+ - spec/font_metric_cache_spec.rb
490
+ - spec/font_spec.rb
491
+ - spec/formatted_text_arranger_spec.rb
492
+ - spec/formatted_text_box_spec.rb
306
493
  - spec/formatted_text_fragment_spec.rb
307
- - spec/bounding_box_spec.rb
308
- - spec/template_spec.rb
309
- - spec/measurement_units_spec.rb
494
+ - spec/graphics_spec.rb
495
+ - spec/grid_spec.rb
496
+ - spec/image_handler_spec.rb
497
+ - spec/images_spec.rb
310
498
  - spec/inline_formatted_text_parser_spec.rb
499
+ - spec/jpg_spec.rb
500
+ - spec/line_wrap_spec.rb
501
+ - spec/measurement_units_spec.rb
502
+ - spec/name_tree_spec.rb
503
+ - spec/object_store_spec.rb
504
+ - spec/outline_spec.rb
505
+ - spec/pdf_object_spec.rb
506
+ - spec/png_spec.rb
311
507
  - spec/reference_spec.rb
312
- - spec/text_at_spec.rb
313
- - spec/formatted_text_arranger_spec.rb
508
+ - spec/repeater_spec.rb
509
+ - spec/security_spec.rb
510
+ - spec/snapshot_spec.rb
511
+ - spec/soft_mask_spec.rb
512
+ - spec/span_spec.rb
513
+ - spec/stamp_spec.rb
514
+ - spec/stream_spec.rb
515
+ - spec/stroke_styles_spec.rb
314
516
  - spec/table_spec.rb
315
- - spec/outline_spec.rb
517
+ - spec/template_spec.rb
518
+ - spec/text_at_spec.rb
519
+ - spec/text_box_spec.rb
520
+ - spec/text_rendering_mode_spec.rb
316
521
  - spec/text_spacing_spec.rb
522
+ - spec/text_spec.rb
523
+ - spec/text_with_inline_formatting_spec.rb
524
+ - spec/transparency_spec.rb