Class: Prawn::Emoji::Drawer

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/emoji/drawer.rb

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ Drawer

Returns a new instance of Drawer.



11
12
13
14
# File 'lib/prawn/emoji/drawer.rb', line 11

def initialize(document:)
  @document = document
  @emoji_index = Emoji::Index.new
end

Instance Method Details

#draw(text, text_options) ⇒ Object



16
17
18
19
20
21
# File 'lib/prawn/emoji/drawer.rb', line 16

def draw(text, text_options)
  # Skip if text encoding is not UTF-8.
  return text unless text.encoding == ::Encoding::UTF_8

  draw_emoji(text, text_options)
end