jordanbyron/prawn-labels

How to change font-family in prawn-label

Heng1984617 opened this issue · 1 comments

How to change font-family in prawn-label
  labels = Prawn::Labels.render(@label.sheets.times, :type => "Sheet") do |pdf, s|
    pdf.font_families.update("GillSans" => {
      :normal => "#{Rails.root}/app/assets/fonts/gillsans_regular.ttf",
      :bold => "#{Rails.root}/app/assets/fonts/gillsans_bold.ttf",
      :italic => "#{Rails.root}/app/assets/fonts/gillsans_italic.ttf",
    })
    pdf.font "GillSans"
    pdf.font_size 10

    pdf.text "FOO"
  end