aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-06-12 00:38:25 -0400
committerRalph Amissah <ralph@amissah.com>2010-06-12 00:38:28 -0400
commit906976cf0fd8326ed212524e309c823efdedbda1 (patch)
tree81abf94915e36f1cd9dac909f52bce5e63199e4f
parentsha256 (2.5.0) (diff)
texpdf, ensure default font is set (Liberation Sans)
* a fix, (before this unless configured breaks)
-rw-r--r--lib/sisu/v2/sysenv.rb1
-rw-r--r--lib/sisu/v2/texpdf_format.rb9
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb
index 8a9e38be..26e842ec 100644
--- a/lib/sisu/v2/sysenv.rb
+++ b/lib/sisu/v2/sysenv.rb
@@ -1268,6 +1268,7 @@ WOK
def font
def texpdf
(defined? @rc['default']['texpdf_font']) \
+ && (@rc['default']['texpdf_font']=~/\S{3,}/) \
? @rc['default']['texpdf_font'] \
: 'Liberation Sans' #'Liberation Sans' #'Liberation Serif'
end
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index e756aa03..ba615749 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -585,6 +585,7 @@ module SiSU_TeX_Pdf
class Format_head
def initialize(md,t_o)
@md,@t_o=md,t_o
+ @env=SiSU_Env::Info_env.new(@md.fns)
if t_o.class==Hash
@txt =t_o[:txt] || nil
@subtitle=t_o[:subtitle] || nil
@@ -642,13 +643,19 @@ module SiSU_TeX_Pdf
end
end
def tex_head_encode
+ texpdf_font=if defined? @md.make.texpdf_font \
+ and not @md.make.texpdf_font.nil? \
+ and @md.make.texpdf_font=~/\S{3,}/
+ @md.make.texpdf_font
+ else @env.font.texpdf
+ end
case @tex2pdf
when /xe/
<<WOK
\\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode}
\\setmainlanguage{#{tex_head_lang}}
\\setotherlanguage{english}
-\\setmainfont{#{@md.make.texpdf_font}}
+\\setmainfont{#{texpdf_font}}
WOK
when /pdf/
if @md.file_encoding =~ /iso-?8859/i #% iso8859