Coder Social home page Coder Social logo

unicode-fonts's Introduction

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

Usage

Install

npm i -g unicode-fonts

CLI

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

API

const fonts = getFonts()
const s = transform('Hello', fonts['scriptItalic'])

Options

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. use list to see the available fonts

Join

The option join will join the characters with given character. Take the following examples with different space characters:

no join

unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled
โ’ถโ’ทโ’ธโ’นโ’บโ’ปโ“Zโ“Žโ“Šโ“…โ“„โ‘จโ‘ โ‘กโ‘ขโ‘ฃ โ’ฝโ’บโ“โ“โ“„ โ“Œโ“„โ“‡โ“โ’น

thin space

unicode-font --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x2009"
โ’ถโ€‰โ’ทโ€‰โ’ธโ€‰โ’นโ€‰โ’บโ€‰โ’ปโ€‰โ“โ€‰Zโ€‰โ“Žโ€‰โ“Šโ€‰โ“…โ€‰โ“„โ€‰โ‘จโ€‰โ‘ โ€‰โ‘กโ€‰โ‘ขโ€‰โ‘ฃโ€‰ โ€‰โ’ฝโ€‰โ’บโ€‰โ“โ€‰โ“โ€‰โ“„โ€‰ โ€‰โ“Œโ€‰โ“„โ€‰โ“‡โ€‰โ“โ€‰โ’น 

ideographic space

unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x3000" # hair space
โ’ถใ€€โ’ทใ€€โ’ธใ€€โ’นใ€€โ’บใ€€โ’ปใ€€โ“ใ€€Zใ€€โ“Žใ€€โ“Šใ€€โ“…ใ€€โ“„ใ€€โ‘จใ€€โ‘ ใ€€โ‘กใ€€โ‘ขใ€€โ‘ฃใ€€ ใ€€โ’ฝใ€€โ’บใ€€โ“ใ€€โ“ใ€€โ“„ใ€€ ใ€€โ“Œใ€€โ“„ใ€€โ“‡ใ€€โ“ใ€€โ’น

zero width space

unicode-fonts --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x200b"
โ’ถโ€‹โ’ทโ€‹โ’ธโ€‹โ’นโ€‹โ’บโ€‹โ’ปโ€‹โ“โ€‹Zโ€‹โ“Žโ€‹โ“Šโ€‹โ“…โ€‹โ“„โ€‹โ‘จโ€‹โ‘ โ€‹โ‘กโ€‹โ‘ขโ€‹โ‘ฃโ€‹ โ€‹โ’ฝโ€‹โ’บโ€‹โ“โ€‹โ“โ€‹โ“„โ€‹ โ€‹โ“Œโ€‹โ“„โ€‹โ“‡โ€‹โ“โ€‹โ’น

backspace

unicode-fonts  --input "abcdefXZYUPO91234 hello WORLD" --font circled --join "0x0008"
โ’น

WARNING

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.

TODO

TODO.md

unicode-fonts's People

Contributors

huan086 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.