Commit 37917c38 authored by Cédric Boutillier's avatar Cédric Boutillier

Refresh patches

parent 32ed590e
Description: remove rubygems and bundler stuff from specs
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2015-04-29
Last-Update: 2018-12-30
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -2,17 +2,7 @@
@@ -1,16 +1,6 @@
puts "Prawn specs: Running on Ruby Version: #{RUBY_VERSION}"
-require "bundler"
-require 'bundler'
-Bundler.setup
-
-if ENV["COVERAGE"]
- require "simplecov"
-if ENV['COVERAGE']
- require 'simplecov'
- SimpleCov.start do
- add_filter "/spec/"
- add_filter '/spec/'
- end
-end
-
-require_relative "../lib/prawn"
+require "prawn"
-require_relative '../lib/prawn'
+require 'prawn'
Prawn.debug = true
Prawn::Font::AFM.hide_m17n_warning = true
Description: redefine BASEDIR and DATADIR
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2016-06-07
Last-Update: 2019-01-07
--- a/lib/prawn.rb
+++ b/lib/prawn.rb
@@ -19,7 +19,9 @@
@@ -15,7 +15,9 @@
#
#
BASEDIR = File.expand_path(File.join(dir, '..'))
......@@ -15,14 +15,14 @@ Last-Update: 2016-06-07
FLOAT_PRECISION = 1.0e-9
--- a/spec/acceptance/png_spec.rb
+++ b/spec/acceptance/png_spec.rb
@@ -3,7 +3,7 @@
require_relative "../../spec/spec_helper"
--- a/spec/prawn/images/png_spec.rb
+++ b/spec/prawn/images/png_spec.rb
@@ -9,7 +9,7 @@
describe "When making a pdf file with png images" do
- image_dir = "#{Prawn::BASEDIR}/data/images"
+ image_dir = "#{Prawn::DATADIR}/images"
images = [
["Type 0", "#{image_dir}/web-links.png"],
["Type 0 with transparency", "#{image_dir}/ruport_type0.png"],
describe Prawn::Images::PNG do
describe 'When making a pdf file with png images' do
- image_dir = "#{Prawn::BASEDIR}/data/images"
+ image_dir = "#{Prawn::DATADIR}/images"
images = [
['Type 0', "#{image_dir}/web-links.png"],
['Type 0 with transparency', "#{image_dir}/ruport_type0.png"],
Description: fix fonts path to use only prawn's fonts directory
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2015-07-24
Last-Update: 2019-01-07
--- a/lib/prawn/font/afm.rb
+++ b/lib/prawn/font/afm.rb
@@ -33,9 +33,7 @@
@metrics_path ||= m.split(':')
else
@metrics_path ||= [
- ".", "/usr/lib/afm",
- "/usr/local/lib/afm",
- "/usr/openwin/lib/fonts/afm",
+ # use Prawn's font directories (Debian patch)
Prawn::DATADIR + '/fonts'
]
end
ENV['METRICS'].split(':')
else
[
- '.', '/usr/lib/afm',
- '/usr/local/lib/afm',
- '/usr/openwin/lib/fonts/afm',
+ # use Prawn's font directories (Debian patch)
Prawn::DATADIR + '/fonts'
]
end
This diff is collapsed.
Description: use system fonts when possible
Upstream ships embedded copies of several truetype fonts. Some are available in Debian.
0805_manual_hash.patch
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-07-24
Last-Update: 2019-01-07
--- a/manual/text/single_usage.rb
+++ b/manual/text/single_usage.rb
@@ -19,7 +19,7 @@
@@ -16,7 +16,7 @@
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
# Using a TTF font file
- font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") do
+ font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") do
text "Written with the DejaVu Sans TTF font."
text 'Written with the DejaVu Sans TTF font.'
end
move_down 20
--- a/manual/text/line_wrapping.rb
+++ b/manual/text/line_wrapping.rb
@@ -29,7 +29,7 @@
"nearer your destination the more you're slip#{nbsp}sliding away."
@@ -26,7 +26,7 @@
"nearer your destination the more you're slip#{nbsp}sliding away."
move_down 20
- font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do
+ font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", :size => 16) do
long_text = "No word boundaries:\n更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。更可怕的是,同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,这样的话,你就非常被动了。"
text long_text
move_down 20
- font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", size: 16) do
+ font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", size: 16) do
long_text = "No word boundaries:\n更可怕的是,"\
'同质化竞争对手可以按照URL中后面这个ID来遍历您的DB中的内容,'\
'写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事,'\
--- a/manual/text/right_to_left_text.rb
+++ b/manual/text/right_to_left_text.rb
@@ -21,7 +21,7 @@
@@ -19,7 +19,7 @@
# set the direction document-wide
self.text_direction = :rtl
- font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", :size => 16) do
+ font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", :size => 16) do
long_text = "写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小"
text long_text
move_down 20
- font("#{Prawn::DATADIR}/fonts/gkai00mp.ttf", size: 16) do
+ font("/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf", size: 16) do
long_text = '写个小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个'\
'小爬虫把你的页面上的关键信息顺次爬下来也不是什么难事写个小爬虫把你的页'\
'面上的关键信息顺次爬下来也不是什么难事写个小'
--- a/manual/text/registering_families.rb
+++ b/manual/text/registering_families.rb
@@ -16,7 +16,7 @@
@@ -13,7 +13,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"
'DejaVu Sans' => {
- normal: "#{Prawn::DATADIR}/fonts/DejaVuSans.ttf"
+ normal: "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
}
)
--- a/manual/text/utf8.rb
+++ b/manual/text/utf8.rb
@@ -21,7 +21,7 @@
text "For full internationalized text support, we need to use TTF fonts:"
@@ -18,7 +18,7 @@
text 'For full internationalized text support, we need to use TTF fonts:'
move_down 20
- font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") do
+ font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") do
text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει."
text "There you go."
text 'ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει.'
text 'There you go.'
end
--- a/manual/text/fallback_fonts.rb
+++ b/manual/text/fallback_fonts.rb
@@ -9,7 +9,7 @@
@@ -6,7 +6,7 @@
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
- file = "#{Prawn::DATADIR}/fonts/gkai00mp.ttf"
+ file = "/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf"
font_families["Kai"] = {
:normal => { :file => file, :font => "Kai" }
font_families['Kai'] = {
normal: { file: file, font: 'Kai' }
}
--- a/spec/prawn/images/png_spec.rb
+++ b/spec/prawn/images/png_spec.rb
@@ -217,7 +217,7 @@
let(:alpha_data_filename) { "#{Prawn::DATADIR}/images/dice.alpha" }
let(:img_data) { File.binread("#{Prawn::DATADIR}/images/dice.png") }
- it 'reads the attributes from the header chunk correctly' do
+ xit 'reads the attributes from the header chunk correctly' do
png = described_class.new(img_data)
expect(png.width).to eq(320)
@@ -229,7 +229,7 @@
expect(png.interlace_method).to eq(0)
end
- it 'correctly returns the raw image data (with no alpha channel) from '\
+ xit 'correctly returns the raw image data (with no alpha channel) from '\
'the image data chunk' do
png = described_class.new(img_data)
png.split_alpha_channel!
@@ -237,7 +237,7 @@
expect(png.img_data).to eq(data)
end
- it 'correctly extracts the alpha channel data from the image data chunk' do
+ xit 'correctly extracts the alpha channel data from the image data chunk' do
png = described_class.new(img_data)
png.split_alpha_channel!
data = File.binread(alpha_data_filename)
......@@ -3,15 +3,13 @@ Description: replace require_relative with a require statement with an absolute
relatively to the manual files.
Author: Cédric Boutillier
Forwaded: no
Last-Update: 2014-09-08
Last-Update: 2019-01-07
--- a/manual/example_helper.rb
+++ b/manual/example_helper.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8
-require_relative "../lib/prawn"
+require "prawn"
require "prawn/manual_builder"
@@ -1,4 +1,4 @@
-require_relative '../lib/prawn'
+require 'prawn'
require 'prawn/manual_builder'
Prawn::ManualBuilder.manual_dir = File.dirname(__FILE__)
......@@ -7,7 +7,7 @@ Description: Use deterministic values for gradients
at 1.
Author: Jérémy Bobbio <lunar@debian.org>
Forwarded: https://github.com/prawnpdf/prawn/pull/844
Last-Update: 2016-06-07
Last-Update: 2019-01-07
--- a/lib/prawn/graphics/patterns.rb
+++ b/lib/prawn/graphics/patterns.rb
......
......@@ -7,13 +7,13 @@ 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-07-24
Last-Update: 2019-01-07
--- a/manual/cover.rb
+++ b/manual/cover.rb
@@ -23,14 +23,17 @@
:size => 60 }
], :at => [170, cursor - 160])
@@ -20,17 +20,20 @@
at: [170, cursor - 160]
)
+ last_update = Time.at(ENV['BUILD_EPOCH'].to_i) if ENV['BUILD_EPOCH']
if Dir.exist?("#{Prawn::BASEDIR}/.git")
......@@ -21,31 +21,26 @@ Last-Update: 2015-07-24
git_commit = "git commit: #{commit.lines.first}"
+ last_update ||= Time.at(`git log -1 --pretty='%ct'`.to_i)
else
git_commit = ""
+ last_update ||= Time.now
git_commit = ''
+ last_update ||= Time.at(`git log -1 --pretty='%ct'`.to_i)
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 }
unless ENV['CI']
formatted_text_box(
[{
- text: "Last Update: #{Time.now.strftime('%Y-%m-%d')}\n" \
+ 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
@@ -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
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
@@ -14,7 +14,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
Prawn::Document.generate(filename, 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