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