Last active
November 22, 2017 16:30
-
-
Save EJTH/faf4aadba1a67f5b513efd48d991df87 to your computer and use it in GitHub Desktop.
For making vaporwave UTF8 text.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fonts: Either a string containing s single letter "A" from the utf code space you want to use or a number for one of these code spaces: | |
// 0 ๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ | |
// 1 ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐๐๐๐๐๐ | |
// 2 ๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐ฟ๐๐ | |
// 3 ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ง๐จ๐ฉ | |
// 4 ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐ | |
// 5 ๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ท๐ธ๐น | |
// 6 ๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ซ๐ฌ๐ญ | |
// 7 ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก | |
// 8 ๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ | |
// 9 ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐๐ | |
// 10 ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ | |
function coolType(font, string){ | |
if(typeof font === "number"){ | |
font = "๐ ๐ด ๐จ ๐ ๐ฌ ๐ ๐ ๐ ๐ผ ๐ฐ ๏ฝ".split(" ")[font]; | |
} | |
string = string.toUpperCase(); | |
var cp = font.codePointAt(0); | |
var a = 65; | |
var s = ""; | |
string.split("").forEach(function(c){ | |
var cc = c.charCodeAt(0); | |
if(cc < 65 || cc > 65+26) s += c; | |
else s += String.fromCodePoint(cp + (c.charCodeAt(0) - a)); | |
}); | |
return s; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment