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.



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

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

Instance Method Details

#draw(text, text_options) ⇒ Object



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

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