Sha256: 8690c41a1faa6f7c94c72c5d6488facd8382799cba3741c53017b1911316ad4e

Contents?: true

Size: 999 Bytes

Versions: 8

Compression:

Stored size: 999 Bytes

Contents

# encoding: utf-8
# 
# Multilingualization isn't much of a problem on Prawn as its default encoding
# is UTF-8. The only thing you need to worry about is if the font support the
# glyphs of your language.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::Example.generate(filename) do
  text "Take this example, a simple Euro sign:"
  text "€", :size => 32
  move_down 20
  
  text "Seems ok. Now let's try something more complex:"
  text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει."
  move_down 20
  
  text "Looks like the current font (#{font.inspect}) doesn't support those."
  text "Let's try them with another font."
  move_down 20
  
  font("#{Prawn::DATADIR}/fonts/DejaVuSans.ttf") do
    text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει."
    text "There you go."
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

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