Sha256: 0e0fd662f215d21d36ff4cce01bda81cb8c271c475b674d6ddb3429e512c21d7

Contents?: true

Size: 849 Bytes

Versions: 8

Compression:

Stored size: 849 Bytes

Contents

# encoding: utf-8
# 
# Most font families come with some styles other than normal. Most common are
# <code>bold</code>, <code>italic</code> and <code>bold_italic</code>.
#
# The style can be set the using the <code>:style</code> option, with either the
# <code>font</code> method which will set the font and style for rest of the
# document, or with the inline text methods.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::Example.generate(filename) do
  ["Courier", "Helvetica", "Times-Roman"].each do |example_font|
    move_down 20
    
    [:bold, :bold_italic, :italic, :normal].each do |style|
      font example_font, :style => style
      text "I'm writing in #{example_font} (#{style})"
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
prawn-1.0.0 manual/text/font_style.rb
prawn-0.15.0 manual/text/font_style.rb
prawn-0.14.0 manual/text/font_style.rb
prawn-0.13.2 manual/text/font_style.rb
prawn-0.13.1 manual/text/font_style.rb
prawn-0.13.0 manual/text/font_style.rb
prawn-1.0.0.rc2 manual/text/font_style.rb
nurettin-prawn-1.0.0.rc1 manual/text/font_style.rb