Small utility to print Unicode symbol names. The main reference is https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt.
$> ucn [FLAGS] [CP...]
Prints Unicode symbols to Stdout. All processing remains local, no external service is triggered. Any non-flag argument provided is used to filter the built in code points.
-ofmt.alfred
use special JSON format ready to be used in http://alfredapp.com
-ofmt.etab (default)
use Elastic Tabstops (default)
-ofmt.json
use JSON to print the symbols
-ofmt.tsv
use tab-separated values
-source value
data source: unicode, nerdfont, all (default: all)
-limit value
limit results to <value> symbols
-filter.fuzzy value
fuzzy filter all symbol names for <value>
-filter.partial value
filter all symbol names for a partial match on <value>
-filter.starts-with value
filter all symbol names for the ones which starts-with <value>
-reverse value
reverse list of symbols
-license
print license information and exit
-v
print version and exit
The filter flags -filter.*, -limit and -reverse can be given multiple
times: they are applied in the order they are provided. See Examples down below.
The output format flags -ofmt.* can be given multiple times: the last one
given wins.
The -ofmt.* flags define the output format for the (filtered) Unicode symbols.
Print (filtered) Unicode symbols as properly aligned text by using the Elastic Tabstop algorithm, see http://nickgravgaard.com/elastictabstops/index.html for more information.
The columns are (in order):
- the symbol
- code point number in HEX
- code point in Unicode format (see https://pkg.go.dev/fmt#hdr-Printing)
- HTML entity
- JSON encoded
- the name / description
Print (filtered) Unicode symbols as tab-separated values.
The columns are (in order):
- the symbol
- code point number in HEX
- code point in Unicode format (see https://pkg.go.dev/fmt#hdr-Printing)
- HTML entity
- JSON encoded
- the name / description
Print (filtered) Unicode symbols as JSON.
[
{
"name": "MATHEMATICAL BOLD SMALL PI",
"cp": "U+1D6D1",
"html": "d6d1;",
"json": "\\u1d6d1",
"symbol": "๐",
"www": "https://symbl.cc/en/1d6d1"
},
โฆ
]AlfredApp is using the JSON formatted output to interactively render the results of a search to its UI. See also the #Extras section.
{
"items": [
{
"title": "๐ - MATHEMATICAL BOLD SMALL PI",
"subtitle": "U+1D6D1 - d6d1; - https://symbol.cc/en/1d6d1",
"arg": "๐",
"variables": {
"cp": "U+1D6D1",
"html": "d6d1;",
"json": "\\u1d6d1",
"symbol": "๐",
"www": "https://symbol.cc/en/1d6d1"
}
},
...Search for the ๐ symbol:
$> ucn -filter.partial math -filter.partial "pi" -limit 5
'๐ท' 1d6b7 U+1D6B7 d6b7; \\u1d6b7 MATHEMATICAL BOLD CAPITAL PI
'๐' 1d6d1 U+1D6D1 d6d1; \\u1d6d1 MATHEMATICAL BOLD SMALL PI
'๐ก' 1d6e1 U+1D6E1 d6e1; \\u1d6e1 MATHEMATICAL BOLD PI SYMBOL
'๐ฑ' 1d6f1 U+1D6F1 d6f1; \\u1d6f1 MATHEMATICAL ITALIC CAPITAL PI
'๐' 1d70b U+1D70B d70b; \\u1d70b MATHEMATICAL ITALIC SMALL PIPrint info about code point 1D6B7:
ucn 1D6D1
'๐' 1d6d1 U+1D6D1 d6d1; \\u1d6d1 MATHEMATICAL BOLD SMALL PISearch for "upward arrows":
$> ucn -filter.starts-with "upwards -filter.starts-with "arrow" -limit 5
''อ' 34e U+034E "e; \\u34e COMBINING UPWARDS ARROW BELOW
'โ' 2191 U+2191 ↑ \\u2191 UPWARDS ARROW
'โ' 219f U+219F ↟ \\u219f UPWARDS TWO HEADED ARROW
'โฅ' 21a5 U+21A5 ↥ \\u21a5 UPWARDS ARROW FROM BAR
'โฐ' 21b0 U+21B0 ↰ \\u21b0 UPWARDS ARROW WITH TIP LEFTWARDSCount the number of embedded Unicode symbols:
$> ucn | wc -l
40074Limit the available runes to the first 1000, then filter for "pi":
$> ucn -limit 1000 -filter.starts-with pi
'ยถ' b6 U+00B6 ¶ \\ub6 PILCROW SIGN
'ฮ ' 3a0 U+03A0 Π \\u3a0 GREEK CAPITAL LETTER PI
'ฯ' 3c0 U+03C0 π \\u3c0 GREEK SMALL LETTER PI
'ฯ' 3d6 U+03D6 ϖ \\u3d6 GREEK PI SYMBOLFirst filter "pi" in all symbols, then limit the output to 1000 results:
$> ucn -filter.starts-with pi -limit 1000
'ยถ' b6 U+00B6 ¶ \\ub6 PILCROW SIGN
'ฮ ' 3a0 U+03A0 Π \\u3a0 GREEK CAPITAL LETTER PI
'ฯ' 3c0 U+03C0 π \\u3c0 GREEK SMALL LETTER PI
'ฯ' 3d6 U+03D6 ϖ \\u3d6 GREEK PI SYMBOL
'ี' 553 U+0553 ȩ \\u553 ARMENIAN CAPITAL LETTER PIWR
'ึ' 583 U+0583 ɇ \\u583 ARMENIAN SMALL LETTER PIWR
...
'๐งฉ' 1f9e9 U+1F9E9 f9e9; \\u1f9e9 JIGSAW PUZZLE PIECE
'๐งท' 1f9f7 U+1F9F7 f9f7; \\u1f9f7 SAFETY PIN
'๐ฉท' 1fa77 U+1FA77 fa77; \\u1fa77 PINK HEART
'๐ช
' 1fa85 U+1FA85 fa85; \\u1fa85 PINATA
'๐ชฎ' 1faae U+1FAAE faae; \\u1faae HAIR PICK186 entries in total
In addition to the Unicode Character Database, ucn ships names for
the glyphs bundled in Nerd Fonts. These
live entirely in Unicode's Private Use Area and only render if a Nerd
Font is installed on your host โ otherwise you'll see tofu (โ).
The -source flag selects which data set to list:
unicodeโ only the UCD entriesnerdfontโ only the Nerd Fonts glyphsallโ both (this is the default)
Example: search Nerd Fonts for github:
$> ucn -source nerdfont -filter.partial github -limit 5
'๎ช' ea84 U+EA84 &#ea84; \\uea84 COD GITHUB
'๎ซฟ' eaff U+EAFF &#eaff; \\ueaff COD GITHUB ACTION
'๎ฌ' eb00 U+EB00 &#eb00; \\ueb00 COD GITHUB ALT
'๎ฎก' eba1 U+EBA1 &#eba1; \\ueba1 COD GITHUB INVERTED
'๎ฝ' e5fd U+E5FD &#e5fd; \\ue5fd CUSTOM FOLDER GITHUBThe glyph metadata is sourced from ryanoasis/nerd-fonts'
glyphnames.json (MIT-licensed). The pinned upstream version lives in
internal/pkg/nerdfont/data_gen.go; bumping it is an intentional act.
Installation:
- Get AlfredApp + Powerpack - https://www.alfredapp.com
- Grab the Alfred-Workflow file (a .zip) from the releases page
- Import it into Alfred.
- Use it - the default triggers are
ucanducf(fuzzy)
