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

toggl/prawn-emoji

 
 

Repository files navigation

Prawn::Emoji

Gem Version Build Status Maintainability

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

Fork info

In this fork the emoji images are provided by Noto Color 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

Known Issues

See prawn-emoji/issues

Supported versions

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

Ruby

2.1, 2.2, 2.3, 2.4, 2.5

Prawn

2.1, 2.2

INFO: Version 1.x supports Prawn 1.3 and 2.0. See README in 1.0-stable branch.

Contributing

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

How to update emoji/index.yml

If you update emoji image in emoji/images, you need to update emoji/index.yml to run the following task:

$ bundle exec rake emoji:generate_index

Credit

Noto Color Emoji

Emoji provided free by Noto Color Emoji.

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.2%
  • Roff 1.8%