1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
Description: use system fonts when possible
Upstream ships embedded copies of several truetype fonts. Some are available in Debian.
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
--- a/manual/text/single_usage.rb
+++ b/manual/text/single_usage.rb
@@ -19,7 +19,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."
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."
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
--- a/manual/text/right_to_left_text.rb
+++ b/manual/text/right_to_left_text.rb
@@ -21,7 +21,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
--- a/manual/text/registering_families.rb
+++ b/manual/text/registering_families.rb
@@ -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"
}
)
--- 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:"
move_down 20
- font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") do
+ font("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf") do
text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει."
text "There you go."
end
--- a/manual/text/fallback_fonts.rb
+++ b/manual/text/fallback_fonts.rb
@@ -9,7 +9,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" }
}
|