Class: Prawn::Emoji::Substitution

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/prawn/emoji/substitution.rb

Constant Summary collapse

FULL_SIZE_SPACE =
' '.freeze
HALF_SIZE_SPACE =
Prawn::Text::NBSP

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ Substitution

Returns a new instance of Substitution.



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

def initialize(document)
  @document = document
  @font = document.font
  @font_size = document.font_size
end

Instance Method Details

#to_sObject



21
22
23
# File 'lib/prawn/emoji/substitution.rb', line 21

def to_s
  emoji_width == full_size_space_width ? FULL_SIZE_SPACE : half_size_spaces
end