Sha256: daf286f070c98aa79650593f7149c32eef1ffae40665c1504b9b93c24e11864d

Contents?: true

Size: 858 Bytes

Versions: 2

Compression:

Stored size: 858 Bytes

Contents

# All example code may be executed by calling `rake legend`

require 'prawn'
require_relative '../lib/prawn/icon'
require_relative 'example_helper'

Prawn::Document.generate('octicons.pdf') do
  deja_path = File.join \
    Prawn::Icon::FONTDIR, 'DejaVuSans.ttf'

  font_families.update({
    'deja' => { normal: deja_path }
  })

  font('deja')

  icons = icon_keys(self, 'octicon')
  required_pages = number_of_pages(self, 'octicon')

  define_grid(columns: 6, rows: 12, gutter: 16)

  sub_header = 'GitHub Octicons'
  link = 'https://octicons.github.com'
  page_header sub_header, link

  first_page_icons icons do |icon_key|
    # Just call the +icon+ method and pass in an icon key
    icon icon_key, size: 20, align: :center
  end

  start_new_page

  page_icons icons, required_pages do |icon_key|
    icon icon_key, size: 20, align: :center
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prawn-icon-0.5.1 examples/octicons.rb
prawn-icon-0.5.0 examples/octicons.rb