lib/prawn/emoji/image.rb in prawn-emoji-3.3.0 vs lib/prawn/emoji/image.rb in prawn-emoji-4.0.0.beta.1
- old
+ new
@@ -1,35 +1,21 @@
# frozen_string_literal: true
-require 'yaml'
-require_relative 'unicode'
-
module Prawn
module Emoji
class Image
STORE = Emoji.root.join 'emoji', 'images'
- attr_reader :unicode, :font_size
-
- def initialize(unicode, font_size)
- @unicode = unicode
- @font_size = font_size
+ def initialize(emoji_char)
+ @emoji_char = emoji_char
end
def path
- STORE.join("#{unicode.codepoint}.png").to_s
+ STORE.join("#{emoji_char.codepoint}.png").to_s
end
- def adjust_x(base_x)
- base_x + (font_size - width) / 2
- end
+ private
- def adjust_y(base_y)
- base_y + font_size * 0.8
- end
-
- def width
- font_size * 0.85
- end
+ attr_reader :emoji_char
end
end
end