Sha256: 0ebf02f442ec5456b2e483e247057d1372ea0f8f5085ec04b386b341818d113e

Contents?: true

Size: 580 Bytes

Versions: 7

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

require_relative 'drawer'

module Prawn
  module Emoji
    module Drawable
      # == Additional Options
      # <tt>:emoji</tt>:: <tt>boolean</tt>. Whether or not to draw an emoji [true]
      def draw_text!(text, options)
        draw_emoji = options.delete(:emoji) { true }

        if draw_emoji && Emoji::Drawer.drawable?(text)
          emoji_drawer.draw(text.to_s, options)
        else
          super
        end
      end

      private

      def emoji_drawer
        @emoji_drawer ||= Emoji::Drawer.new(self)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
prawn-emoji-5.3.0 lib/prawn/emoji/drawable.rb
prawn-emoji-5.2.0 lib/prawn/emoji/drawable.rb
prawn-emoji-5.1.0 lib/prawn/emoji/drawable.rb
prawn-emoji-5.0.0 lib/prawn/emoji/drawable.rb
prawn-emoji-4.2.0 lib/prawn/emoji/drawable.rb
prawn-emoji-4.1.0 lib/prawn/emoji/drawable.rb
prawn-emoji-4.0.0 lib/prawn/emoji/drawable.rb