vendor/gems/prawn-0.3.0/lib/prawn/font.rb
# Without arguments, this returns the currently selected font. Otherwise,
# it sets the current font.
#
# The single parameter must be a string. It can be one of the 14 built-in
# fonts supported by PDF, or the location of a TTF file. The BUILT_INS
# array specifies the valid built in font values.
#
#   pdf.font "Times-Roman"
#   pdf.font "Chalkboard.ttf"
#
# If a ttf font is specified, the full file will be embedded in the 
# rendered PDF. This should be your preferred option in most cases. 
# It will increase the size of the resulting file, but also make it 
# more portable.
#
Without arguments, this returns the currently selected font. Otherwise,
it sets the current font.

The single parameter must be a string. It can be one of the 14 built-in
fonts supported by PDF, or the location of a TTF file. The BUILT_INS
array specifies the valid built in font values.



If a ttf font is specified, the full file will be embedded in the
rendered PDF. This should be your preferred option in most cases.
It will increase the size of the resulting file, but also make it
more portable.
Without arguments this returns the currently selected font . Otherwise it sets the current font . The single parameter must be a string . It can be one of the 14 built - in fonts supported by PDF or the location of a TTF file . The BUILT_INS array specifies the valid built in font values . If a ttf font is specified the full file will be embedded in the rendered PDF . This should be your preferred option in most cases . It will increase the size of the resulting file but also make it more portable .
def font(name=nil, options={}) 
      return @font || font("Helvetica") if name.nil?
      if block_given?
        original_name = font.name
        original_size = font.size
      end
      @font = find_font(name, options)
      @font.add_to_current_page
      @font.size = options[:size] if options[:size]
      if block_given?
        yield
        font(original_name, :size => original_size)
      else
        @font
      end
    end
def font ( name = nil , options = { } ) return @font || font ( "Helvetica" ) if name . nil? if block_given? original_name = font . name original_size = font . size end @font = find_font ( name , options ) @font . add_to_current_page @font . size = options [ :size ] if options [ :size ] if block_given? yield font ( original_name , :size => original_size ) else @font end end
Without arguments, this returns the currently selected font.
Without arguments this returns the currently selected font .
name
<not_specific>
options
<not_specific>