github.com/heyitspaul/aesthetify.cr
0.1.0 / published Apr 4, 2018 / repository
aesthetify is a gem that lets you transform ASCII text into fullwidth text of 2 distinct flavors: regular Fullwidth and AESTHETIC
aesthetify
aesthetify.cr is a Crystal port of the Ruby gem aesthetify, which makes it simple to take any string and transform it for the AESTHETIC. In addition, it also makes creating Fullwidth text just as simple.
aesthetify.cr comes with regular methods just like its Ruby sibling, however it
omits the bang versions as there isn't support for String#replace in Crystal.
Installation
Add this to your application's shard.yml:
dependencies:
aesthetify:
github: TheAssailant/aesthetify.cr
Usage
require "aesthetify"
Using String#aesthetify:
text = "vaporwave".aesthetify
puts text
#=> VAPORWAVE
Using String#fullwidth:
text = "long boy".fullwidth
puts text
#=> long boy
Using concatenation:
text = "This is the " + "sad boys ".aesthetify + "club"
puts text
#=> This is the SAD BOYS club
Contributing
- Fork it ( https://github.com/TheAssailant/aesthetify.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- TheAssailant - creator, maintainer
API
- Aesthetify
- String
The basic premise is we shift characters into the Fullwidth and Halfwidth Unicode character space using simple arithmetic and a 0x0020 (32) character offset since the ASCII characters with fullwidth replacements only begin showing up at 0x0021 in Unicode (0x0020 is the space character).