Sha256: fb7cf6d5d09c85640e7dd1c996873573b42ba110305c16f1f945818d25e5d5ed

Contents?: true

Size: 742 Bytes

Versions: 5

Compression:

Stored size: 742 Bytes

Contents

# encoding: utf-8
#
# This example demonstrates using the :style option for Document#text.
# If you are working with TTF fonts, you'll want to check out the 
# documentation for Document#font_families and register your fonts with it.
#
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
require "prawn"

Prawn::Document.generate("family_style.pdf") do
  ["Courier","Helvetica","Times-Roman"].each do |f|
    [:bold,:bold_italic,:italic,:normal].each do |s|
      font f, :style => s
      text "I'm writing in #{f} (#{s})"
    end
  end
  
  font "Helvetica"
  
  text "Normal"
  text "Bold",        :style => :bold
  text "Bold Italic", :style => :bold_italic
  text "Italic",      :style => :italic
  text "Normal"
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
kavu-prawn-core-0.4.100 examples/text/family_based_styling.rb
kavu-prawn-core-0.4.99 examples/text/family_based_styling.rb
prawn-0.3.0 examples/text/family_based_styling.rb
prawn-0.4.1 examples/text/family_based_styling.rb
prawn-0.4.0 examples/text/family_based_styling.rb