Commit 9403c90e authored by Cédric Boutillier's avatar Cédric Boutillier

Refresh patches

parent e2b10425
Description: redefine BASEDIR and DATADIR
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2014-09-28
Last-Update: 2015-07-24
--- a/lib/prawn.rb
+++ b/lib/prawn.rb
......@@ -21,16 +21,16 @@ Last-Update: 2014-09-28
require_relative "../../lib/prawn"
images = [
- ["Type 0", "#{Prawn::BASEDIR}/data/images/web-links.png"],
- ["Type 2", "#{Prawn::BASEDIR}/data/images/ruport.png"],
- ["Type 3", "#{Prawn::BASEDIR}/data/images/indexed_color.png"],
- ["Type 4", "#{Prawn::BASEDIR}/data/images/page_white_text.png"],
- ["Type 6", "#{Prawn::BASEDIR}/data/images/dice.png"],
+ ["Type 0", "#{Prawn::DATADIR}/images/web-links.png"],
+ ["Type 2", "#{Prawn::DATADIR}/images/ruport.png"],
+ ["Type 3", "#{Prawn::DATADIR}/images/indexed_color.png"],
+ ["Type 4", "#{Prawn::DATADIR}/images/page_white_text.png"],
+ ["Type 6", "#{Prawn::DATADIR}/images/dice.png"],
- ["Type 0", "#{Prawn::BASEDIR}/data/images/web-links.png"],
- ["Type 2", "#{Prawn::BASEDIR}/data/images/ruport.png"],
- ["Type 3", "#{Prawn::BASEDIR}/data/images/indexed_color.png"],
- ["Type 4", "#{Prawn::BASEDIR}/data/images/page_white_text.png"],
- ["Type 6", "#{Prawn::BASEDIR}/data/images/dice.png"]
+ ["Type 0", "#{Prawn::DATADIR}/images/web-links.png"],
+ ["Type 2", "#{Prawn::DATADIR}/images/ruport.png"],
+ ["Type 3", "#{Prawn::DATADIR}/images/indexed_color.png"],
+ ["Type 4", "#{Prawn::DATADIR}/images/page_white_text.png"],
+ ["Type 6", "#{Prawn::DATADIR}/images/dice.png"]
]
Prawn::Document.generate("png_types.pdf", :page_size => "A5") do
Description: fix fonts path to use only prawn's fonts directory
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2015-04-29
Last-Update: 2015-07-24
--- a/lib/prawn/font/afm.rb
+++ b/lib/prawn/font/afm.rb
@@ -34,9 +34,7 @@
@@ -33,9 +33,7 @@
@metrics_path ||= m.split(':')
else
@metrics_path ||= [
......@@ -12,6 +12,6 @@ Last-Update: 2015-04-29
- "/usr/local/lib/afm",
- "/usr/openwin/lib/fonts/afm",
+ # use Prawn's font directories (Debian patch)
Prawn::DATADIR+'/fonts']
Prawn::DATADIR + '/fonts'
]
end
end
This diff is collapsed.
......@@ -3,7 +3,7 @@ Description: use system fonts when possible
These copies have been removed from the Debian source package, and system
fonts are used instead.
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2015-04-29
Last-Update: 2015-07-24
--- a/manual/text/single_usage.rb
+++ b/manual/text/single_usage.rb
......@@ -40,15 +40,15 @@ Last-Update: 2015-04-29
move_down 20
--- a/manual/text/registering_families.rb
+++ b/manual/text/registering_families.rb
@@ -15,7 +15,7 @@
Prawn::ManualBuilder::Example.generate(filename) do
@@ -16,7 +16,7 @@
# Registering a single TTF font
font_families.update("DejaVu Sans" => {
- :normal => "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf"
+ :normal => "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
})
font_families.update(
"DejaVu Sans" => {
- :normal => "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf"
+ :normal => "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
}
)
font("DejaVu Sans") do
--- a/manual/text/utf8.rb
+++ b/manual/text/utf8.rb
@@ -21,7 +21,7 @@
......
......@@ -3,30 +3,29 @@ Description: disable some specs after removal of some files from the source pack
non-free fonts. These are disabled because they cannot be run since these
files have been removed from the Debian source package.
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2015-04-29
Last-Update: 2015-07-24
--- a/spec/images_spec.rb
+++ b/spec/images_spec.rb
@@ -69,21 +69,24 @@
@@ -68,21 +68,23 @@
end
it "should raise_error an UnsupportedImageType if passed a BMP" do
+ pending "spec disabled since tru256.bmp removed from source package (Debian patch)"
+ pending "spec disabled since tru256.bmp removed from source package (Debian patch)
filename = "#{Prawn::DATADIR}/images/tru256.bmp"
lambda { @pdf.image filename, :at => [100,100] }.should raise_error(Prawn::Errors::UnsupportedImageType)
expect { @pdf.image filename, :at => [100, 100] }.to raise_error(Prawn::Errors::UnsupportedImageType)
end
it "should raise_error an UnsupportedImageType if passed an interlaced PNG" do
+ pending "spec disabled since dice_interlaced.png removed from source package (Debian patch)"
filename = "#{Prawn::DATADIR}/images/dice_interlaced.png"
lambda { @pdf.image filename, :at => [100,100] }.should raise_error(Prawn::Errors::UnsupportedImageType)
expect { @pdf.image filename, :at => [100, 100] }.to raise_error(Prawn::Errors::UnsupportedImageType)
end
- it "should bump PDF version to 1.5 or greater on embedding 16-bit PNGs" do
+ xit "should bump PDF version to 1.5 or greater on embedding 16-bit PNGs" do
+ pending "spec disabled since 16bit.png removed from source package (Debian patch)"
@pdf.image "#{Prawn::DATADIR}/images/16bit.png"
@pdf.state.version.should >= 1.5
expect(@pdf.state.version).to be >= 1.5
end
- it "should embed 16-bit alpha channels for 16-bit PNGs" do
......@@ -36,7 +35,7 @@ Last-Update: 2015-04-29
output = @pdf.render
--- a/spec/png_spec.rb
+++ b/spec/png_spec.rb
@@ -17,7 +17,7 @@
@@ -16,7 +16,7 @@
@img_data = File.binread(@filename)
end
......@@ -44,26 +43,26 @@ Last-Update: 2015-04-29
+ xit "should read the attributes from the header chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.width.should == 21
@@ -29,7 +29,7 @@
png.interlace_method.should == 0
expect(png.width).to eq(21)
@@ -28,7 +28,7 @@
expect(png.interlace_method).to eq(0)
end
- it "should read the image data chunk correctly" do
+ xit "should read the image data chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
data = Zlib::Inflate.inflate(File.binread(@data_filename))
png.img_data.should == data
@@ -47,7 +47,7 @@
expect(png.img_data).to eq(data)
@@ -45,7 +45,7 @@
# that indicates the color that should be interpreted as transparent.
#
# http://www.w3.org/TR/PNG/#11tRNS
- it "should read the tRNS chunk correctly" do
+ xit "should read the tRNS chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.transparency[:grayscale].should == 255
expect(png.transparency[:grayscale]).to eq(255)
end
@@ -61,7 +61,7 @@
@@ -58,7 +58,7 @@
@img_data = File.binread(@filename)
end
......@@ -71,26 +70,26 @@ Last-Update: 2015-04-29
+ xit "should read the attributes from the header chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.width.should == 258
@@ -73,7 +73,7 @@
png.interlace_method.should == 0
expect(png.width).to eq(258)
@@ -70,7 +70,7 @@
expect(png.interlace_method).to eq(0)
end
- it "should read the image data chunk correctly" do
+ xit "should read the image data chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
data = Zlib::Inflate.inflate(File.binread(@data_filename))
png.img_data.should == data
@@ -92,7 +92,7 @@
expect(png.img_data).to eq(data)
@@ -88,7 +88,7 @@
# case it's green.
#
# http://www.w3.org/TR/PNG/#11tRNS
- it "should read the tRNS chunk correctly" do
+ xit "should read the tRNS chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.transparency[:rgb].should == [0, 255, 0]
expect(png.transparency[:rgb]).to eq([0, 255, 0])
end
@@ -116,7 +116,7 @@
@@ -109,7 +109,7 @@
@img_data = File.binread(@filename)
end
......@@ -98,17 +97,17 @@ Last-Update: 2015-04-29
+ xit "should read the attributes from the header chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.width.should == 150
@@ -128,7 +128,7 @@
png.interlace_method.should == 0
expect(png.width).to eq(150)
@@ -121,7 +121,7 @@
expect(png.interlace_method).to eq(0)
end
- it "should read the image data chunk correctly" do
+ xit "should read the image data chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
data = Zlib::Inflate.inflate(File.binread(@data_filename))
png.img_data.should == data
@@ -144,7 +144,7 @@
expect(png.img_data).to eq(data)
@@ -136,7 +136,7 @@
@img_data = File.binread(@filename)
end
......@@ -116,9 +115,9 @@ Last-Update: 2015-04-29
+ xit "should read the attributes from the header chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.width.should == 16
@@ -156,14 +156,14 @@
png.interlace_method.should == 0
expect(png.width).to eq(16)
@@ -148,14 +148,14 @@
expect(png.interlace_method).to eq(0)
end
- it "should correctly return the raw image data (with no alpha channel) from the image data chunk" do
......@@ -126,7 +125,7 @@ Last-Update: 2015-04-29
png = Prawn::Images::PNG.new(@img_data)
png.split_alpha_channel!
data = File.binread(@color_data_filename)
png.img_data.should == data
expect(png.img_data).to eq(data)
end
- it "should correctly extract the alpha channel data from the image data chunk" do
......@@ -134,7 +133,7 @@ Last-Update: 2015-04-29
png = Prawn::Images::PNG.new(@img_data)
png.split_alpha_channel!
data = File.binread(@alpha_data_filename)
@@ -180,7 +180,7 @@
@@ -171,7 +171,7 @@
@img_data = File.binread(@filename)
end
......@@ -142,9 +141,9 @@ Last-Update: 2015-04-29
+ xit "should read the attributes from the header chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.width.should == 320
@@ -192,14 +192,14 @@
png.interlace_method.should == 0
expect(png.width).to eq(320)
@@ -183,14 +183,14 @@
expect(png.interlace_method).to eq(0)
end
- it "should correctly return the raw image data (with no alpha channel) from the image data chunk" do
......@@ -152,7 +151,7 @@ Last-Update: 2015-04-29
png = Prawn::Images::PNG.new(@img_data)
png.split_alpha_channel!
data = File.binread(@color_data_filename)
png.img_data.should == data
expect(png.img_data).to eq(data)
end
- it "should correctly extract the alpha channel data from the image data chunk" do
......@@ -160,7 +159,7 @@ Last-Update: 2015-04-29
png = Prawn::Images::PNG.new(@img_data)
png.split_alpha_channel!
data = File.binread(@alpha_data_filename)
@@ -217,7 +217,7 @@
@@ -207,7 +207,7 @@
@img_data = File.binread(@filename)
end
......@@ -168,9 +167,9 @@ Last-Update: 2015-04-29
+ xit "should read the attributes from the header chunk correctly" do
png = Prawn::Images::PNG.new(@img_data)
png.width.should == 32
@@ -229,14 +229,14 @@
png.interlace_method.should == 0
expect(png.width).to eq(32)
@@ -219,14 +219,14 @@
expect(png.interlace_method).to eq(0)
end
- it "should correctly return the raw image data (with no alpha channel) from the image data chunk" do
......@@ -178,7 +177,7 @@ Last-Update: 2015-04-29
png = Prawn::Images::PNG.new(@img_data)
png.split_alpha_channel!
data = File.binread(@color_data_filename)
png.img_data.should == data
expect(png.img_data).to eq(data)
end
- it "should correctly extract the alpha channel data from the image data chunk" do
......
......@@ -7,12 +7,12 @@ Description: Enable manual to be built reproducibly
the Git index is available, the date of the last commit will be used.
Author: Jérémy Bobbio <lunar@debian.org>
Forwarded: https://github.com/prawnpdf/prawn/pull/844
Last-Update: 2015-04-29
Last-Update: 2015-07-24
--- a/manual/cover.rb
+++ b/manual/cover.rb
@@ -23,14 +23,17 @@
:size => 60}
:size => 60 }
], :at => [170, cursor - 160])
+ last_update = Time.at(ENV['BUILD_EPOCH'].to_i) if ENV['BUILD_EPOCH']
......@@ -25,27 +25,27 @@ Last-Update: 2015-04-29
+ last_update ||= Time.now
end
- formatted_text_box([ {:text => "Last Update: #{Time.now.strftime("%Y-%m-%d")}\n"+
+ formatted_text_box([ {:text => "Last Update: #{last_update.utc.strftime('%Y-%m-%d')}\n"+
"Prawn Version: #{Prawn::VERSION}\n"+
git_commit,
:size => 12}
- formatted_text_box([ { :text => "Last Update: #{Time.now.strftime("%Y-%m-%d")}\n" +
+ formatted_text_box([ { :text => "Last Update: #{last_update.utc.strftime("%Y-%m-%d")}\n" +
"Prawn Version: #{Prawn::VERSION}\n" +
git_commit,
:size => 12 }
--- a/manual/document_and_page_options/metadata.rb
+++ b/manual/document_and_page_options/metadata.rb
@@ -7,6 +7,7 @@
@@ -6,6 +6,7 @@
#
require File.expand_path(File.join(File.dirname(__FILE__),
%w[.. example_helper]))
+creation_date = ENV['BUILD_EPOCH'] ? Time.at(ENV['BUILD_EPOCH'].to_i) : Time.now
Prawn::Document.generate("metadata.pdf",
:info => {
:Title => "My title",
@@ -15,7 +16,7 @@
:Keywords => "test metadata ruby pdf dry",
:Creator => "ACME Soft App",
:Producer => "Prawn",
- :CreationDate => Time.now
+ :CreationDate => creation_date.utc
}) do
text "This is a test of setting metadata properties via the info option."
info = {
:Title => "My title",
@@ -14,7 +15,7 @@
:Keywords => "test metadata ruby pdf dry",
:Creator => "ACME Soft App",
:Producer => "Prawn",
- :CreationDate => Time.now
+ :CreationDate => creation_date.utc
}
Prawn::Document.generate("metadata.pdf", :info => info) do
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment