lib/resumetools/resume/pdf.rb in resumetools-0.2.8.5 vs lib/resumetools/resume/pdf.rb in resumetools-0.2.9.0

- old
+ new

@@ -42,10 +42,12 @@ } DATE_FORMAT = "%B, %Y" # Render to PDF def render_pdf(opts={}) + default_font = opts.delete(:default_font) || "SourceSansPro" + pdf = Prawn::Document.new( :info => {}, :top_margin => MARGINS[0].in, :left_margin => MARGINS[1].in, :bottom_margin => MARGINS[2].in, @@ -56,14 +58,20 @@ "VeraSans" => { :normal => File.expand_path("Vera.ttf", FONT_DIR), :bold => File.expand_path("VeraBd.ttf", FONT_DIR), :italic => File.expand_path("VeraIt.ttf", FONT_DIR), :bold_italic => File.expand_path("VeraBI.ttf", FONT_DIR) + }, + "SourceSansPro" => { + :normal => File.expand_path("SourceSansPro-Regular.ttf", FONT_DIR), + :bold => File.expand_path("SourceSansPro-Semibold.ttf", FONT_DIR), + :italic => File.expand_path("SourceSansPro-It.ttf", FONT_DIR), + :bold_italic => File.expand_path("SourceSansPro-SemiboldIt.ttf", FONT_DIR) } ) # Set default font - pdf.font("Helvetica", :style => :normal, :size => FONT_SIZES[:default], :kerning => true) + pdf.font(default_font, :style => :normal, :size => FONT_SIZES[:default], :kerning => true) # Name pdf.text self.full_name, :style => :bold, :size => FONT_SIZES[:header], :align => :center # Contact info