class Prawn::Emoji::Char
Constants
- VARIATION_SELECTORS
Attributes
char[R]
font_size[R]
to_s[R]
Public Class Methods
format_codepoint(codepoints)
click to toggle source
# File lib/prawn/emoji/char.rb, line 9 def format_codepoint(codepoints) (codepoints - VARIATION_SELECTORS).map { |c| c.rjust(4, '0') }.join('-').downcase end
new(char, font_size)
click to toggle source
# File lib/prawn/emoji/char.rb, line 17 def initialize(char, font_size) @char = char @font_size = font_size end
Public Instance Methods
==(other)
click to toggle source
# File lib/prawn/emoji/char.rb, line 22 def ==(other) char == other.to_s end
codepoint()
click to toggle source
# File lib/prawn/emoji/char.rb, line 26 def codepoint @codepoint ||= self.class.format_codepoint(char.codepoints.map { |c| c.to_s(16) }) end
height()
click to toggle source
# File lib/prawn/emoji/char.rb, line 34 def height @height ||= font_size * 0.8 end
width()
click to toggle source
# File lib/prawn/emoji/char.rb, line 30 def width @width ||= font_size * 0.85 end