Transform a string to its equivalent using unicode fonts:
unicode-fonts --list
* ๐๐๐๐๐ ๐๐๐๐๐, ๐๐๐๐๐๐๐๐๐๐๐ : bold
* ๐ป๐ธ๐ฟ๐ฟ๐ ๐๐๐
๐ฟ๐ท, 01234567689 : italic
* ๐ฏ๐ฌ๐ณ๐ณ๐ถ ๐พ๐ถ๐น๐ณ๐ซ, 01234567689 : boldItalic
* He๐ง๐งo ๐ฒo๐ญ๐ง๐, 01234567689 : scriptItalic
* ๐๐๐๐๐ ๐ฆ๐๐ก๐๐, 01234567689 : scriptBold
* H๐๐๐๐ ๐๐๐๐๐, 01234567689 : fraktur
* ๐ณ๐ฐ๐ท๐ท๐บ ๐๐บ๐ฝ๐ท๐ฏ, 01234567689 : boldFraktur
* H๐ผ๐๐๐ ๐๐๐๐๐ป, ๐๐๐๐๐๐๐๐๐๐ ๐ก : doubleStruck
* ๐ง๐ค๐ซ๐ซ๐ฎ ๐ถ๐ฎ๐ฑ๐ซ๐ฃ, ๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐จ๐ช๐ซ : sansSerif
* ๐๐๐๐๐ข ๐ช๐ข๐ฅ๐๐, ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ฒ๐ด๐ต : sansSerifBold
* ๐๐๐๐๐ ๐๐๐๐๐, 01234567689 : sansSerifItalic
* ๐๐๐๐๐ ๐๐๐๐๐ฟ, 01234567689 : sansSerifBoldItalic
* ๐ท๐ด๐ป๐ป๐พ ๐๐พ๐๐ป๐ณ, ๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐ผ๐พ๐ฟ : monospace
* แดดแดฑแดธแดธแดผ แตแดผแดฟแดธแดฐ, โฐยนยฒยณโดโตโถโทโถโธโน : super
* ๐๐๐๐๐ ๐ฆ๐๐ก๐๐, 0โดโตโถโทโธโนโบโนโปโผ : parenthesized
* โฝโบโโโ โโโโโน, 0โ โกโขโฃโคโฅโฆโฅโงโจ : circled
* ๐ท๐ด๐ป๐ป๐พ ๐
๐พ๐
๐ป๐ณ, 01234567689 : squaredCapital
* ๐
๐
๐
๐
๐
๐
ฆ๐
๐
ก๐
๐
, 01234567689 : negativeCircledCapital
* ๐
ท๐
ด๐
ป๐
ป๐
พ ๐๐
พ๐๐
ป๐
ณ, 01234567689 : negativeSquaredCapital
* ๐ญ๐ช๐ฑ๐ฑ๐ด ๐ผ๐ด๐ท๐ฑ๐ฉ, 01234567689 : regionalIndicatorSymbol
* ๏ผจ๏ผฅ๏ผฌ๏ผฌ๏ผฏ ๏ผท๏ผฏ๏ผฒ๏ผฌ๏ผค, ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ : fullWidth
* ๊ง๊ฐ๊ก๊ก๊ณ ๊ช๊ณ๊ฃ๊ก๊, 01234567689 : myanmar
* แปแฌแแแค แแคแกแแ , แพแ23แ5แฎ7แฎ8แญ : cherokee
* Hello World, โ
โ
กโ
ขโ
ฃโ
คโ
ฅโ
ฆโ
งโ
ฆโ
จโ
ฉ : romanNumerals
* Hello World, โ
ณโ
ดโ
ตโ
ถโ
ทโ
ธโ
นโ
บโ
นโ
ปโ
ผ : romanNumeralsSmall
Explanation: unicode charset supports extra font families, so we replace normal character 'a' (char code 97) with character '๐ช' (char code 55349). So this are not currently font families or different fonts, it's the same font, that provides this special characters, some of them.
Note: these are not using any ansi escape sequences. We could use those to add colors, bold, underline, etc in the command line.
Some Unicode categories that contain these type of characters are:
- Mathematical Alphanumeric Symbols
npm i -g unicode-fonts
unicode-fonts --list
unicode-fonts --font scriptItalic --input "My name is Sebastian Gurin"
cat package.json | unicode-fonts --font boldItalic
cat package.json | unicode-fonts --font circled --join "0x3000" --outputFile package-boldItalic.json
const fonts = getFonts()
const s = transform('Hello', fonts['scriptItalic'])
Both CLI and API supports the same options
- if no
input
is given, then it will read from stdin - if no
outputFile
is given then it will write to stdout font
is required. uselist
to see the available fonts
The option join
will join the characters with given character. Take the following examples with different space characters:
unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled
โถโทโธโนโบโปโZโโโ
โโจโ โกโขโฃ โฝโบโโโ โโโโโน
unicode-font --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x2009"
โถโโทโโธโโนโโบโโปโโโZโโโโโโ
โโโโจโโ โโกโโขโโฃโ โโฝโโบโโโโโโโ โโโโโโโโโโน
unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x3000" # hair space
โถ โท โธ โน โบ โป โ Z โ โ โ
โ โจ โ โก โข โฃ โฝ โบ โ โ โ โ โ โ โ โน
unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x200b"
โถโโทโโธโโนโโบโโปโโโZโโโโโโ
โโโโจโโ โโกโโขโโฃโ โโฝโโบโโโโโโโ โโโโโโโโโโน
unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x0008"
โน
In general it's a bad idea to use these characters to store text. The only useful situatoin where you would want to store text using these, is if you want to prevent text searches to find a string.
These characters should be only used to render normal text in mediums with limited fonts, like a terminal.