1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-02-12 12:45:44 +02:00

generate-css: Add codepoint to glyphnames.json

[why]
Just having the characters themselves as data for the name is convenient
in some cases; but sometimes the codepoint is also nice. And it
certainly improves the human interaction / check of the file.

[how]
Include the character and the codepoint in the glyph-name data. This is
a breaking change. But given that the json file is rather new I believe
we can get away with it.

Sorry for the inconvenience for all the early adaptors that already use
the old/previous format. But now we are more future proof and can add
even more data without breaking old json code.

Related:
https://github.com/ryanoasis/nerd-fonts/issues/1140
https://github.com/kovidgoyal/kitty/issues/2972
https://github.com/chrisbra/unicode.vim/issues/39
https://github.com/ryanoasis/nerd-fonts/issues/448
https://github.com/nvim-tree/nvim-web-devicons/issues/192

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-03-12 20:55:10 +01:00 committed by Fini
parent 7e2d38b55a
commit 83b3d02d41

View File

@ -108,7 +108,7 @@ for var in "${!i@}"; do
# generate json entry
{
printf ",\"%s\":\"%s\"" "$glyph_name" "$glyph_char"
printf ",\"%s\":{\"char\":\"%s\",\"code\":\"%s\"}" "$glyph_name" "$glyph_char" "$glyph_code"
} >> "$output_json_file"
done