I am looking into using a custom wcwidth function/library (https://github.com/termux/wcwidth; via LD_PRELOAD), where I'd like it to return the proper width for the wide glyphs (which appear to be all/most, right?).
Therefore a list of used codepoints would be useful.
I've came up with the following, but it does not seem to be accurate, e.g. the Linux symbol from Font Awesome () is at 0xe712, although the range is {0xf000, 0xf295}, // symbolsFontAwesomeRangeStart (https://github.com/ryanoasis/nerd-fonts/blob/72ca7b7c1f9e8e3c5e319e0703fd95fc827bf3b9/font-patcher#L248-L249).
What am I missing?
// Nerd Font (https://github.com/ryanoasis/nerd-fonts).
// Source: https://github.com/ryanoasis/nerd-fonts/blob/master/font-patcher
{0xe000, 0xe00a}, // symbolsPomiconsRangeStart
{0xe0a0, 0xe0a2}, // symbolsPowerlineRange1Start
{0xe0b0, 0xe0b3}, // symbolsPowerlineRange2Start
{0xe0a3, 0xe0a3}, // symbolsPowerlineExtraRange1Start
{0xe0b4, 0xe0c8}, // symbolsPowerlineExtraRange2Start
{0xe0cc, 0xe0d4}, // symbolsPowerlineExtraRange3Start
{0xe4fa, 0xe52a}, // symbolsOriginalRangeStart
{0xe600, 0xe6c5}, // symbolsDeviconsRangeStart
{0xf000, 0xf295}, // symbolsFontAwesomeRangeStart
{0xf000, 0xf0db}, // symbolsOcticonsRangeStart
{0xf100, 0xf115}, // symbolsFontLinuxRangeStart
The tables in the README add to the confusion, since they do not take into account that some sets get shifted etc: https://github.com/ryanoasis/nerd-fonts/blob/master/readme.md
After all I could imagine to create some pre-processor that would scan the Nerd Font, look at the expected width of the glyphs and use the output with wcwidth then.
I am using 'Ubuntu Mono derivative Powerline Nerd Font Complete.ttf' with rxvt-unicode on Arch Linux.
Some more info at https://github.com/ryanoasis/nerd-fonts/issues/40.
I believe we can close this now:
./bin/scripts/test-fonts.shI think it would be good to have table in the README still.
Seti-UI + Custom: U+e4fa-U+e52e
Devicons: U+e600-U+e6c5
Powerline Symbols: U+e0a0-U+e0a2
Powerline Symbols: U+e0b0-U+e0b3
Powerline Extra Symbols: U+e0a3-U+e0a3
Powerline Extra Symbols: U+e0b4-U+e0c8
Powerline Extra Symbols: U+e0ca-U+e0ca
Powerline Extra Symbols: U+e0cc-U+e0d4
Pomicons: U+e000-U+e00a
Font Awesome: U+f000-U+f2e0
Font Awesome Extension: U+e000-U+e0a9
Font Logos (Font Linux): U+f100-U+f11c
Power Symbols: U+23fb-U+23fe
Power Symbols: U+2b58-U+2b58
Octicons: U+f000-U+f105
Octicons: U+2665-U+2665
Octicons: U+26a1-U+26a1
Octicons: U+f27c-U+f27c
Material: U+f001-U+f847
Weather Icons: U+f000-U+f0eb
Via:
for p in PATCH_SET:
print('%s: U+%x-U+%x' % (p['Name'], p['SymStart'], p['SymEnd']))
in font-patcher.
This is helpful when configuring e.g. symbol_map in kitty terminal, where you need those ranges.
@blueyed there's some things missing in there unfortunately. The ranges from SrcStart and SrcEnd are needed too, for example the Dockerfile icon from Devicons is in there. Here's some __really lazy__ shit to get everything you need for Kitty for those ending up here from Google.
curl -s https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/font-patcher | grep "'SymStart':" | grep -oE '0x[A-Z00-9]+' | sed '$!N;s/\n/-/' | awk '{print tolower($0)}' | awk 'gsub("0x", "U+")' | grep -v '0000' | tr '\n' ','
U+e4fa-U+e52e,U+e5fa-U+e62e,U+e600-U+e6c5,U+e700-U+e7c5,U+e0a0-U+e0a2,U+e0b0-U+e0b3,U+e0a3-U+e0a3,U+e0b4-U+e0c8,U+e0ca-U+e0ca,U+e0cc-U+e0d4,U+e000-U+e00a,U+f000-U+f2e0,U+e000-U+e0a9,U+e200-U+e2a9,U+f100-U+f11c,U+f300-U+f31c,U+23fb-U+23fe,U+2b58-U+2b58,U+f000-U+f105,U+f400-U+f505,U+2665-U+2665,U+f27c-U+f27c,U+f4a9-U+f4a9,U+f001-U+f847,U+f500-U+fd46,U+f000-U+f0eb,U+e300-U+e3eb,
I've copied the complete list down from the web site and parsed it.
It has changed in a few places (weather, custom+seti, devicons, font linux & material):
```F#
let NerdFont = [|
(0x23fb, 0x23fe) // Power Symbols
(0x2665, 0x2665) // Octicons
(0x26a1, 0x26a1) // Octicons
(0x2b58, 0x2b58) // Power Symbols
(0xe000, 0xe00a) // Pomicons
(0xe0a0, 0xe0a2) // Powerline Symbols
(0xe0a3, 0xe0a3) // Powerline Extra Symbols
(0xe0b0, 0xe0b3) // Powerline Symbols
(0xe0b4, 0xe0c8) // Powerline Extra Symbols
(0xe0ca, 0xe0ca) // Powerline Extra Symbols
(0xe0cc, 0xe0d4) // Powerline Extra Symbols
(0xe200, 0xe2a9) // Font Awesome Extension
(0xe300, 0xe3e3) // Weather
(0xe5fa, 0xe62e) // Custom + Seti
(0xe700, 0xe7c5) // Devicons
(0xf000, 0xf2e0) // Font Awesome
(0xf300, 0xf31c) // Font Logos (Font Linux)
(0xf400, 0xf4a8) // Octicons
(0xf500, 0xfd46) // Material
|]
```
Thanks everyone, closing this for now because of:
Feel free to edit the Wiki as you see fit or submit a PR if you'd like something more.
Most helpful comment
I think it would be good to have table in the README still.
Via:
in font-patcher.
This is helpful when configuring e.g.
symbol_mapin kitty terminal, where you need those ranges.