Created
August 22, 2019 10:49
-
-
Save plugnburn/99c33e47549623722eb6f3d288c8ffde to your computer and use it in GitHub Desktop.
Frakturize: a small ES6 one-liner to generate Fraktur Unicode strings from a normal Latin
This file contains hidden or 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
frakturize=s=>s.split('').map((c,i,h)=>/[a-zA-Z]/.test(c)?String.fromCodePoint((i=c.charCodeAt(0))>90?119997+i:((h='CHIRZ'.indexOf(c))>-1?8460+[33,0,5,16,28][h]:120003+i)):c).join('') | |
// Example: frakturize('ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz') => '๐๐ โญ๐๐๐๐โโ๐๐๐๐๐๐๐๐โ๐๐๐๐๐๐๐โจ ๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment