Sha256: 64701c3899faaf993dda2d6d6572ee1fbc261f926a31bd3f20324192e65b2942

Contents?: true

Size: 710 Bytes

Versions: 21

Compression:

Stored size: 710 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.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

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

21 entries across 21 versions & 7 rubygems

Version Path
piglop-prawn-0.10.2.3 examples/text/family_based_styling.rb
piglop-prawn-0.10.2.2 examples/text/family_based_styling.rb
piglop-prawn-0.10.2.1 examples/text/family_based_styling.rb
prawn-0.11.1.pre examples/text/family_based_styling.rb
goodwill-prawn-edge-0.10.0 examples/text/family_based_styling.rb
alphasights-prawn-0.10.4 examples/text/family_based_styling.rb
alphasights-prawn-0.10.3 examples/text/family_based_styling.rb
alphasights-prawn-0.10.2 examples/text/family_based_styling.rb
alphasights-prawn-0.10.1 examples/text/family_based_styling.rb
alphasights-prawn-0.10.0 examples/text/family_based_styling.rb
prawn-core-0.8.4 examples/text/family_based_styling.rb
prawn-graph-0.0.2 vendor/prawn-core/examples/text/family_based_styling.rb
prawn-graph-0.0.1 vendor/prawn-core/examples/text/family_based_styling.rb
prawn-core-0.7.2 examples/text/family_based_styling.rb
prawn-core-0.7.1 examples/text/family_based_styling.rb
prawn-layout-0.3.2 vendor/prawn-core/examples/text/family_based_styling.rb
prawn-core-0.6.3 examples/text/family_based_styling.rb
prawn-core-0.6.2 examples/text/family_based_styling.rb
prawn-layout-0.3.1 vendor/prawn-core/examples/text/family_based_styling.rb
prawn-core-0.6.1 examples/text/family_based_styling.rb