Skip to content

Prawn::Emoji is an extention for Prawn, provides feature for drawing Emoji.

License

Notifications You must be signed in to change notification settings

notabli/prawn-emoji

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prawn::Emoji

Gem Version Build Status

Prawn::Emoji is an extention for Prawn, provides feature for drawing Emoji.

Installation

Add this line to your application's Gemfile:

gem 'prawn-emoji', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install prawn-emoji

Usage

In order to run the following code, you need to place both DejaVuSans.ttf and ipag.ttf in the same directory as the script file.

require 'prawn'
require 'prawn/emoji'

Prawn::Document.generate 'foo.pdf' do
  font 'DejaVuSans.ttf'
  text '🐟 + 🔪 = 🍣'

  font 'ipag.ttf'
  text_box '🍣が食べたい', at: [100, 100], width: 300

  draw_text '🍣🍣🍣🍣🍣', at: [100, 200]
end

IMPORTANT

In order to draw emoji, you must use a TTF - True Type Font. I recommend you use a Japanese font.

Feature

  • Over 1600 emoji support provided by Emoji One
  • RTL support
  • Character specing support
  • Rotation support
  • Alignment support
  • Font size support

Supported versions

  • Ruby 2.1, 2.2, 2.3
  • Prawn 1.3, 2.0.2

See https://travis-ci.org/hidakatsuya/prawn-emoji.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hidakatsuya/prawn-emoji.

Credit

Emoji One

Emoji provided free by Emoji One.

IPA Font

IPA Font License Agreement v1.0

License

© 2015 Katsuya HIDAKA. See MIT-LICENSE for further details.

About

Prawn::Emoji is an extention for Prawn, provides feature for drawing Emoji.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.7%
  • Roff 1.3%