Module: Alchemist::UnicodeMonospace::StringExtensions
- Defined in:
- lib/alchemist/unicode_monospace.rb
Instance Method Summary collapse
Instance Method Details
#pad_to_unicode_monospace ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/alchemist/unicode_monospace.rb', line 4 def pad_to_unicode_monospace unpack('U*').flat_map do |c| next c if c == "\n".ord case UnicodeMonospace.east_asian_width(c) when /^F|W$/ then c else [c, ' '.ord] end end.pack('U*') end |