prawn 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/COPYING +2 -2
- data/Gemfile +18 -0
- data/LICENSE +1 -1
- data/README.md +17 -4
- data/Rakefile +18 -22
- data/data/images/indexed_color.dat +0 -0
- data/data/images/indexed_color.png +0 -0
- data/data/pdfs/nested_pages.pdf +13 -13
- data/lib/pdf/core.rb +35 -0
- data/lib/{prawn → pdf}/core/annotations.rb +6 -7
- data/lib/{prawn → pdf}/core/byte_string.rb +1 -1
- data/lib/{prawn → pdf}/core/destinations.rb +23 -23
- data/lib/{prawn → pdf}/core/document_state.rb +8 -8
- data/lib/pdf/core/filter_list.rb +51 -0
- data/lib/pdf/core/filters.rb +36 -0
- data/lib/pdf/core/graphics_state.rb +68 -0
- data/lib/{prawn → pdf}/core/literal_string.rb +1 -1
- data/lib/{prawn → pdf}/core/name_tree.rb +14 -2
- data/lib/{prawn → pdf}/core/object_store.rb +80 -24
- data/lib/pdf/core/outline.rb +315 -0
- data/lib/{prawn → pdf}/core/page.rb +23 -26
- data/lib/{prawn/document → pdf/core}/page_geometry.rb +11 -21
- data/lib/{prawn → pdf}/core/pdf_object.rb +48 -32
- data/lib/{prawn → pdf}/core/reference.rb +35 -44
- data/lib/pdf/core/stream.rb +98 -0
- data/lib/{prawn → pdf}/core/text.rb +24 -17
- data/lib/prawn.rb +95 -17
- data/lib/prawn/compatibility.rb +66 -26
- data/lib/prawn/document.rb +48 -30
- data/lib/prawn/document/bounding_box.rb +3 -3
- data/lib/prawn/document/column_box.rb +46 -8
- data/lib/prawn/document/graphics_state.rb +10 -73
- data/lib/prawn/document/internals.rb +24 -23
- data/lib/prawn/document/snapshot.rb +6 -7
- data/lib/prawn/document/span.rb +10 -10
- data/lib/prawn/encoding.rb +7 -7
- data/lib/prawn/errors.rb +18 -29
- data/lib/prawn/font.rb +64 -28
- data/lib/prawn/font/afm.rb +32 -74
- data/lib/prawn/font/dfont.rb +2 -2
- data/lib/prawn/font/ttf.rb +28 -57
- data/lib/prawn/font_metric_cache.rb +45 -0
- data/lib/prawn/graphics.rb +307 -41
- data/lib/prawn/graphics/cap_style.rb +3 -3
- data/lib/prawn/graphics/color.rb +12 -5
- data/lib/prawn/graphics/dash.rb +52 -31
- data/lib/prawn/graphics/join_style.rb +7 -7
- data/lib/prawn/graphics/patterns.rb +137 -0
- data/lib/prawn/graphics/transformation.rb +9 -9
- data/lib/prawn/graphics/transparency.rb +1 -1
- data/lib/prawn/image_handler.rb +30 -0
- data/lib/prawn/images.rb +86 -105
- data/lib/prawn/images/image.rb +48 -0
- data/lib/prawn/images/jpg.rb +14 -10
- data/lib/prawn/images/png.rb +50 -37
- data/lib/prawn/layout.rb +2 -2
- data/lib/prawn/layout/grid.rb +51 -51
- data/lib/prawn/measurement_extensions.rb +5 -5
- data/lib/prawn/measurements.rb +25 -21
- data/lib/prawn/outline.rb +4 -308
- data/lib/prawn/repeater.rb +8 -8
- data/lib/prawn/security.rb +50 -36
- data/lib/prawn/soft_mask.rb +94 -0
- data/lib/prawn/stamp.rb +3 -3
- data/lib/prawn/table.rb +292 -118
- data/lib/prawn/table/cell.rb +272 -45
- data/lib/prawn/table/cell/image.rb +70 -0
- data/lib/prawn/table/cell/in_table.rb +2 -2
- data/lib/prawn/table/cell/span_dummy.rb +92 -0
- data/lib/prawn/table/cell/subtable.rb +2 -2
- data/lib/prawn/table/cell/text.rb +42 -24
- data/lib/prawn/table/cells.rb +137 -48
- data/lib/prawn/text.rb +35 -23
- data/lib/prawn/text/box.rb +18 -5
- data/lib/prawn/text/formatted.rb +5 -4
- data/lib/prawn/text/formatted/arranger.rb +292 -0
- data/lib/prawn/text/formatted/box.rb +52 -13
- data/lib/prawn/text/formatted/fragment.rb +37 -22
- data/lib/prawn/text/formatted/line_wrap.rb +286 -0
- data/lib/prawn/text/formatted/parser.rb +14 -6
- data/lib/prawn/text/formatted/wrap.rb +151 -0
- data/lib/prawn/utilities.rb +44 -0
- data/manual/basic_concepts/adding_pages.rb +27 -0
- data/manual/basic_concepts/basic_concepts.rb +34 -0
- data/manual/basic_concepts/creation.rb +39 -0
- data/manual/basic_concepts/cursor.rb +33 -0
- data/manual/basic_concepts/measurement.rb +25 -0
- data/manual/basic_concepts/origin.rb +38 -0
- data/manual/basic_concepts/other_cursor_helpers.rb +40 -0
- data/manual/bounding_box/bounding_box.rb +39 -0
- data/manual/bounding_box/bounds.rb +49 -0
- data/manual/bounding_box/canvas.rb +24 -0
- data/manual/bounding_box/creation.rb +23 -0
- data/manual/bounding_box/indentation.rb +46 -0
- data/manual/bounding_box/nesting.rb +45 -0
- data/manual/bounding_box/russian_boxes.rb +40 -0
- data/manual/bounding_box/stretchy.rb +31 -0
- data/manual/document_and_page_options/background.rb +27 -0
- data/manual/document_and_page_options/document_and_page_options.rb +31 -0
- data/manual/document_and_page_options/metadata.rb +23 -0
- data/manual/document_and_page_options/page_margins.rb +38 -0
- data/manual/document_and_page_options/page_size.rb +34 -0
- data/manual/example_file.rb +116 -0
- data/manual/example_helper.rb +411 -0
- data/manual/example_package.rb +53 -0
- data/manual/example_section.rb +46 -0
- data/manual/graphics/circle_and_ellipse.rb +22 -0
- data/manual/graphics/color.rb +24 -0
- data/manual/graphics/common_lines.rb +28 -0
- data/manual/graphics/fill_and_stroke.rb +42 -0
- data/manual/graphics/fill_rules.rb +37 -0
- data/manual/graphics/gradients.rb +37 -0
- data/manual/graphics/graphics.rb +58 -0
- data/manual/graphics/helper.rb +24 -0
- data/manual/graphics/line_width.rb +35 -0
- data/manual/graphics/lines_and_curves.rb +41 -0
- data/manual/graphics/polygon.rb +29 -0
- data/manual/graphics/rectangle.rb +21 -0
- data/manual/graphics/rotate.rb +28 -0
- data/manual/graphics/scale.rb +41 -0
- data/manual/graphics/soft_masks.rb +46 -0
- data/manual/graphics/stroke_cap.rb +31 -0
- data/manual/graphics/stroke_dash.rb +48 -0
- data/manual/graphics/stroke_join.rb +30 -0
- data/manual/graphics/translate.rb +29 -0
- data/manual/graphics/transparency.rb +35 -0
- data/manual/images/absolute_position.rb +23 -0
- data/manual/images/fit.rb +21 -0
- data/manual/images/horizontal.rb +25 -0
- data/manual/images/images.rb +40 -0
- data/manual/images/plain_image.rb +18 -0
- data/manual/images/scale.rb +22 -0
- data/manual/images/vertical.rb +28 -0
- data/manual/images/width_and_height.rb +25 -0
- data/manual/layout/boxes.rb +27 -0
- data/manual/layout/content.rb +25 -0
- data/manual/layout/layout.rb +28 -0
- data/manual/layout/simple_grid.rb +23 -0
- data/manual/manual/cover.rb +35 -0
- data/manual/manual/foreword.rb +85 -0
- data/manual/manual/how_to_read_this_manual.rb +41 -0
- data/manual/manual/manual.rb +35 -0
- data/manual/outline/add_subsection_to.rb +61 -0
- data/manual/outline/insert_section_after.rb +47 -0
- data/manual/outline/outline.rb +32 -0
- data/manual/outline/sections_and_pages.rb +67 -0
- data/manual/repeatable_content/page_numbering.rb +54 -0
- data/manual/repeatable_content/repeatable_content.rb +31 -0
- data/manual/repeatable_content/repeater.rb +55 -0
- data/manual/repeatable_content/stamp.rb +41 -0
- data/manual/security/encryption.rb +31 -0
- data/manual/security/permissions.rb +38 -0
- data/manual/security/security.rb +28 -0
- data/manual/syntax_highlight.rb +52 -0
- data/manual/table/basic_block.rb +53 -0
- data/manual/table/before_rendering_page.rb +26 -0
- data/manual/table/cell_border_lines.rb +24 -0
- data/manual/table/cell_borders_and_bg.rb +31 -0
- data/manual/table/cell_dimensions.rb +30 -0
- data/manual/table/cell_text.rb +38 -0
- data/manual/table/column_widths.rb +30 -0
- data/manual/table/content_and_subtables.rb +39 -0
- data/manual/table/creation.rb +27 -0
- data/manual/table/filtering.rb +36 -0
- data/manual/table/flow_and_header.rb +17 -0
- data/manual/table/image_cells.rb +33 -0
- data/manual/table/position.rb +29 -0
- data/manual/table/row_colors.rb +20 -0
- data/manual/table/span.rb +30 -0
- data/manual/table/style.rb +22 -0
- data/manual/table/table.rb +52 -0
- data/manual/table/width.rb +27 -0
- data/manual/templates/full_template.rb +25 -0
- data/manual/templates/page_template.rb +48 -0
- data/manual/templates/templates.rb +27 -0
- data/manual/text/alignment.rb +44 -0
- data/manual/text/color.rb +24 -0
- data/manual/text/column_box.rb +32 -0
- data/manual/text/fallback_fonts.rb +37 -0
- data/manual/text/font.rb +41 -0
- data/manual/text/font_size.rb +45 -0
- data/manual/text/font_style.rb +23 -0
- data/manual/text/formatted_callbacks.rb +60 -0
- data/manual/text/formatted_text.rb +54 -0
- data/manual/text/free_flowing_text.rb +51 -0
- data/manual/text/group.rb +29 -0
- data/manual/text/inline.rb +43 -0
- data/manual/text/kerning_and_character_spacing.rb +39 -0
- data/manual/text/leading.rb +25 -0
- data/manual/text/line_wrapping.rb +41 -0
- data/manual/text/paragraph_indentation.rb +26 -0
- data/manual/text/positioned_text.rb +38 -0
- data/manual/text/registering_families.rb +48 -0
- data/manual/text/rendering_and_color.rb +37 -0
- data/manual/text/right_to_left_text.rb +43 -0
- data/manual/text/rotation.rb +43 -0
- data/manual/text/single_usage.rb +37 -0
- data/manual/text/text.rb +75 -0
- data/manual/text/text_box_excess.rb +32 -0
- data/manual/text/text_box_extensions.rb +45 -0
- data/manual/text/text_box_overflow.rb +44 -0
- data/manual/text/utf8.rb +28 -0
- data/{examples/m17n → manual/text}/win_ansi_charset.rb +14 -10
- data/prawn.gemspec +18 -12
- data/spec/acceptance/png.rb +23 -0
- data/spec/annotations_spec.rb +16 -32
- data/spec/bounding_box_spec.rb +128 -15
- data/spec/cell_spec.rb +169 -38
- data/spec/column_box_spec.rb +33 -0
- data/spec/destinations_spec.rb +5 -5
- data/spec/document_spec.rb +150 -104
- data/spec/extensions/encoding_helpers.rb +10 -0
- data/spec/extensions/mocha.rb +1 -0
- data/spec/filters_spec.rb +34 -0
- data/spec/font_metric_cache_spec.rb +52 -0
- data/spec/font_spec.rb +183 -97
- data/spec/formatted_text_arranger_spec.rb +43 -43
- data/spec/formatted_text_box_spec.rb +30 -20
- data/spec/formatted_text_fragment_spec.rb +8 -8
- data/spec/graphics_spec.rb +158 -69
- data/spec/grid_spec.rb +15 -15
- data/spec/image_handler_spec.rb +42 -0
- data/spec/images_spec.rb +49 -24
- data/spec/inline_formatted_text_parser_spec.rb +73 -19
- data/spec/jpg_spec.rb +4 -4
- data/spec/line_wrap_spec.rb +26 -26
- data/spec/measurement_units_spec.rb +6 -6
- data/spec/name_tree_spec.rb +21 -21
- data/spec/object_store_spec.rb +39 -39
- data/spec/outline_spec.rb +93 -53
- data/spec/pdf_object_spec.rb +88 -86
- data/spec/png_spec.rb +31 -28
- data/spec/reference_spec.rb +32 -32
- data/spec/repeater_spec.rb +25 -11
- data/spec/security_spec.rb +44 -12
- data/spec/snapshot_spec.rb +8 -9
- data/spec/soft_mask_spec.rb +117 -0
- data/spec/span_spec.rb +10 -15
- data/spec/spec_helper.rb +25 -8
- data/spec/stamp_spec.rb +29 -30
- data/spec/stream_spec.rb +58 -0
- data/spec/stroke_styles_spec.rb +36 -18
- data/spec/table/span_dummy_spec.rb +17 -0
- data/spec/table_spec.rb +697 -105
- data/spec/template_spec.rb +108 -54
- data/spec/text_at_spec.rb +18 -17
- data/spec/text_box_spec.rb +111 -62
- data/spec/text_rendering_mode_spec.rb +5 -5
- data/spec/text_spacing_spec.rb +4 -4
- data/spec/text_spec.rb +57 -49
- data/spec/transparency_spec.rb +5 -5
- metadata +421 -213
- data/data/fonts/Action Man.dfont +0 -0
- data/data/fonts/Activa.ttf +0 -0
- data/data/fonts/Chalkboard.ttf +0 -0
- data/data/fonts/DejaVuSans.ttf +0 -0
- data/data/fonts/Dustismo_Roman.ttf +0 -0
- data/data/fonts/comicsans.ttf +0 -0
- data/data/fonts/gkai00mp.ttf +0 -0
- data/data/images/rails.dat +0 -0
- data/data/images/rails.png +0 -0
- data/examples/bounding_box/russian_boxes.rb +0 -37
- data/examples/example_helper.rb +0 -11
- data/examples/general/context_sensitive_headers.rb +0 -38
- data/examples/graphics/cmyk.rb +0 -13
- data/examples/graphics/gradient.rb +0 -23
- data/examples/graphics/png_types.rb +0 -23
- data/examples/graphics/remote_images.rb +0 -13
- data/examples/m17n/full_win_ansi_character_list.rb +0 -20
- data/examples/m17n/sjis.rb +0 -29
- data/examples/table/bill.rb +0 -54
- data/examples/table/header.rb +0 -15
- data/examples/text/font_calculations.rb +0 -92
- data/examples/text/hyphenation.rb +0 -45
- data/examples/text/indent_paragraphs.rb +0 -24
- data/lib/prawn/core.rb +0 -85
- data/lib/prawn/core/text/formatted/arranger.rb +0 -294
- data/lib/prawn/core/text/formatted/line_wrap.rb +0 -273
- data/lib/prawn/core/text/formatted/wrap.rb +0 -153
- data/lib/prawn/graphics/gradient.rb +0 -84
- 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
|
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
|
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
|
42
|
-
lambda { @pdf.text_rendering_mode(8) }.should
|
43
|
-
lambda { @pdf.text_rendering_mode(:flil) }.should
|
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
|
data/spec/text_spacing_spec.rb
CHANGED
@@ -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
|
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::
|
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.
|
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
|
75
|
+
contents.word_spacing.should be_empty
|
76
76
|
end
|
77
77
|
it "should restore word spacing to 0" do
|
78
78
|
create_pdf
|
data/spec/text_spec.rb
CHANGED
@@ -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.
|
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.
|
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
|
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
|
33
|
+
end.should raise_error(Prawn::Errors::CannotFit)
|
34
34
|
end
|
35
35
|
|
36
|
-
it "should
|
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
|
40
|
+
}.should raise_error(NotImplementedError)
|
41
41
|
end
|
42
42
|
|
43
|
-
it "
|
44
|
-
|
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
|
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
|
-
|
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
|
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
|
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
|
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
|
115
|
+
text.kerned[0].should be_true
|
117
116
|
end
|
118
117
|
|
119
|
-
it "should
|
120
|
-
lambda { @pdf.text("hai", :at => [0, 0]) }.should
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
257
|
-
lambda { @pdf.font "Pao bu" }.should
|
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 "
|
261
|
-
|
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::
|
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
|
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
|
321
|
+
lambda { @pdf.text str }.should raise_error(
|
315
322
|
Prawn::Errors::IncompatibleStringEncoding)
|
316
323
|
end
|
317
|
-
it "
|
318
|
-
datafile = "#{Prawn::
|
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::
|
321
|
-
|
322
|
-
|
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
|
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
|
336
|
+
lambda { @pdf.text str }.should raise_error(
|
329
337
|
Prawn::Errors::IncompatibleStringEncoding)
|
330
338
|
end
|
331
|
-
it "should
|
332
|
-
sjis_str = File.read("#{Prawn::
|
333
|
-
lambda { @pdf.text sjis_str }.should
|
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
|
data/spec/transparency_spec.rb
CHANGED
@@ -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.
|
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:
|
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:
|
22
|
-
none: false
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
23
20
|
requirements:
|
24
|
-
- -
|
21
|
+
- - ~>
|
25
22
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
23
|
+
version: '1.2'
|
27
24
|
type: :runtime
|
28
25
|
prerelease: false
|
29
|
-
version_requirements:
|
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:
|
33
|
-
none: false
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.0.
|
37
|
+
version: 1.0.3
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
|
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
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
- lib/
|
75
|
-
- lib/
|
76
|
-
- lib/
|
77
|
-
- lib/prawn/
|
78
|
-
- lib/prawn/
|
79
|
-
- lib/prawn/
|
80
|
-
- lib/prawn/
|
81
|
-
- lib/prawn/
|
82
|
-
- lib/prawn/
|
83
|
-
- lib/prawn/
|
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/
|
87
|
-
- lib/prawn/
|
88
|
-
- lib/prawn/
|
89
|
-
- lib/prawn/graphics/
|
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/
|
93
|
-
- lib/prawn/
|
94
|
-
- lib/prawn/
|
95
|
-
- lib/prawn/
|
96
|
-
- lib/prawn/
|
97
|
-
- lib/prawn/
|
98
|
-
- lib/prawn/
|
99
|
-
- lib/prawn/
|
100
|
-
- lib/prawn/
|
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/
|
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/
|
135
|
-
- lib/prawn
|
136
|
-
-
|
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/
|
139
|
-
- spec/
|
140
|
-
- spec/
|
141
|
-
- spec/
|
142
|
-
- spec/
|
143
|
-
- spec/
|
144
|
-
- spec/
|
145
|
-
- spec/
|
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/
|
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/
|
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/
|
173
|
-
- spec/
|
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/
|
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/
|
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
|
-
-
|
243
|
-
- LICENSE
|
434
|
+
- Gemfile
|
244
435
|
- COPYING
|
436
|
+
- LICENSE
|
245
437
|
- GPLv2
|
246
438
|
- GPLv3
|
247
|
-
|
439
|
+
- README.md
|
248
440
|
homepage: http://prawn.majesticseacreature.com
|
249
441
|
licenses: []
|
250
|
-
|
251
|
-
|
252
|
-
|
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.
|
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:
|
477
|
+
rubygems_version: 2.0.14
|
276
478
|
signing_key:
|
277
|
-
specification_version:
|
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/
|
483
|
+
- spec/bounding_box_spec.rb
|
297
484
|
- spec/cell_spec.rb
|
298
|
-
- spec/
|
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/
|
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/
|
308
|
-
- spec/
|
309
|
-
- spec/
|
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/
|
313
|
-
- spec/
|
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/
|
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
|