Skip to content

Commit

Permalink
Merge pull request #1544 from ryanoasis/feature/update-codicons
Browse files Browse the repository at this point in the history
Update codicons to 0.0.35
  • Loading branch information
Finii authored Mar 17, 2024
2 parents d85756f + da502d2 commit 59133b8
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 13 deletions.
23 changes: 18 additions & 5 deletions bin/scripts/generate-glyph-info-from-set.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# coding=utf8
# Nerd Fonts Version: 3.1.1
# Script Version: 1.1.1
# Script Version: 1.2.0

# Example Usage:
# ./generate-glyph-info-from-set.py --font ../../src/glyphs/materialdesignicons-webfont.ttf --start f001 --end f847 --offset 4ff --prefix mdi
Expand Down Expand Up @@ -66,9 +66,13 @@
signedOffset = int(sign+'0x'+format(offset, 'X'), 16)
hexPosition = args.symbolFontStart + signedOffset

symbolFont.selection.select((str("ranges"),str("unicode")),args.symbolFontStart,args.symbolFontEnd)

for index, sym_glyph in enumerate(symbolFont.selection.byGlyphs):
allNames = {}
suppressedEntries = []
symbolFont.encoding = 'UnicodeFull'
for index in range(args.symbolFontStart, args.symbolFontEnd + 1):
if not index in symbolFont:
continue
sym_glyph = symbolFont[index]
slot = format(sym_glyph.unicode, 'X')
name = sym_glyph.glyphname
sh_name = "i_" + args.prefix + "_" + name.replace("-", "_")
Expand All @@ -78,9 +82,18 @@
else:
char = chr(int('0x'+slot, 16) + signedOffset)

print("i='" + char + "' " + sh_name + "=$i")
entryString = "i='" + char + "' " + sh_name + "=$i SLOT " + slot + ' ' + str(index)
if name not in allNames:
print(entryString)
else:
suppressedEntries.append(entryString)

ctr += 1
hexPosition += 1
allNames[name] = 1

print("Done, generated " + str(ctr) + " glyphs")

if len(suppressedEntries) > 0:
print('FOLLOGING ENTRIES SUPPRESSED to prevent double names with different codepoints:')
print('\n'.join(suppressedEntries))
8 changes: 7 additions & 1 deletion bin/scripts/lib/i_all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Nerd Fonts Version: 3.1.1
# Script Version 1.2.0
# Script Version 1.3.0

# Usually this is called without argument. If the first argument
# is 'include-old-material' the old material design icons will be
Expand All @@ -15,6 +15,12 @@ fi

for set in "${sets[@]}"; do
i="${base}/i_${set}.sh"
dups=$(grep ' i_' "$i" | sed 's/.* i_//;s/=.*//' | sort | uniq -D | wc -l)
if [ "$dups" -gt 0 ]; then
echo "Found duplicate glyph names in ${i}"
grep ' i_' "$i" | sed 's/.* i_//;s/=.*//' | sort | uniq -D
exit 1
fi
# shellcheck disable=SC1090 # We check the sources individually
test -f "$i" -a -r "$i" && source "$i"
done
Expand Down
55 changes: 53 additions & 2 deletions bin/scripts/lib/i_cod.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Codicons (387 icons)
# Codepoints: EA60-EBEB with holes
# Codicons (439 icons)
# Codepoints: EA60-EC1E with holes
test -n "$__i_cod_loaded" && return || __i_cod_loaded=1
i='' i_cod_add=$i
i='' i_cod_lightbulb=$i
Expand Down Expand Up @@ -389,4 +389,55 @@ i='' i_cod_azure_devops=$i
i='' i_cod_verified_filled=$i
i='' i_cod_newline=$i
i='' i_cod_layout=$i
i='' i_cod_layout_activitybar_left=$i
i='' i_cod_layout_activitybar_right=$i
i='' i_cod_layout_panel_left=$i
i='' i_cod_layout_panel_center=$i
i='' i_cod_layout_panel_justify=$i
i='' i_cod_layout_panel_right=$i
i='' i_cod_layout_panel=$i
i='' i_cod_layout_sidebar_left=$i
i='' i_cod_layout_sidebar_right=$i
i='' i_cod_layout_statusbar=$i
i='' i_cod_layout_menubar=$i
i='' i_cod_layout_centered=$i
i='' i_cod_target=$i
i='' i_cod_indent=$i
i='' i_cod_record_small=$i
i='' i_cod_error_small=$i
i='' i_cod_arrow_circle_down=$i
i='' i_cod_arrow_circle_left=$i
i='' i_cod_arrow_circle_right=$i
i='' i_cod_arrow_circle_up=$i
i='' i_cod_layout_sidebar_right_off=$i
i='' i_cod_layout_panel_off=$i
i='' i_cod_layout_sidebar_left_off=$i
i='' i_cod_blank=$i
i='' i_cod_heart_filled=$i
i='' i_cod_map=$i
i='' i_cod_map_filled=$i
i='' i_cod_circle_small=$i
i='' i_cod_bell_slash=$i
i='' i_cod_bell_slash_dot=$i
i='' i_cod_comment_unresolved=$i
i='' i_cod_git_pull_request_go_to_changes=$i
i='' i_cod_git_pull_request_new_changes=$i
i='' i_cod_search_fuzzy=$i
i='' i_cod_comment_draft=$i
i='' i_cod_send=$i
i='' i_cod_sparkle=$i
i='' i_cod_insert=$i
i='' i_cod_mic=$i
i='' i_cod_thumbsdown_filled=$i
i='' i_cod_thumbsup_filled=$i
i='' i_cod_coffee=$i
i='' i_cod_snake=$i
i='' i_cod_game=$i
i='' i_cod_vr=$i
i='' i_cod_chip=$i
i='' i_cod_piano=$i
i='' i_cod_music=$i
i='' i_cod_mic_filled=$i
i='' i_cod_git_fetch=$i
i='' i_cod_copilot=$i
unset i
13 changes: 10 additions & 3 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import absolute_import, print_function, unicode_literals

# Change the script version when you edit this script:
script_version = "4.8.5"
script_version = "4.9.0"

version = "3.1.1"
projectName = "Nerd Fonts"
Expand Down Expand Up @@ -985,8 +985,15 @@ class font_patcher:
range(0x2594, 0x259f + 1), # quards (Note: quard 2597 in Hack is wrong, scales like block!)
]}
CODI_SCALE_LIST = {'ScaleGroups': [
range(0xeb6e, 0xeb71 + 1), # triangles
[0xea61, 0xeb13], # lightbulb
range(0xeab4, 0xeab7 + 1), # chevrons
[0xea7d, *range(0xea99, 0xeaa1 + 1), 0xebcb], # arrows
[0xeaa2, 0xeb9a, 0xec08, 0xec09], # bells
range(0xead4, 0xead6 + 1), # dot and arrow
[0xeb43, 0xec0b, 0xec0c], # (pull) request changes
range(0xeb6e, 0xeb71 + 1), # triangles
[*range(0xeb89, 0xeb8b + 1), 0xec07], # smallish dots
range(0xebd5, 0xebd7 + 1), # compasses
]}
DEVI_SCALE_LIST = {'ScaleGlyph': 0xE60E, # Android logo
'GlyphsToScale': [
Expand Down Expand Up @@ -1077,7 +1084,7 @@ class font_patcher:
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': True, 'SymStart': 0x2665, 'SymEnd': 0x2665, 'SrcStart': None, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Heart
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': True, 'SymStart': 0X26A1, 'SymEnd': 0X26A1, 'SrcStart': None, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT}, # Zap
{'Enabled': self.args.octicons, 'Name': "Octicons", 'Filename': "octicons/octicons.ttf", 'Exact': False, 'SymStart': 0xF27C, 'SymEnd': 0xF306, 'SrcStart': 0xF4A9, 'ScaleRules': OCTI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
{'Enabled': self.args.codicons, 'Name': "Codicons", 'Filename': "codicons/codicon.ttf", 'Exact': True, 'SymStart': 0xEA60, 'SymEnd': 0xEBEB, 'SrcStart': None, 'ScaleRules': CODI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
{'Enabled': self.args.codicons, 'Name': "Codicons", 'Filename': "codicons/codicon.ttf", 'Exact': True, 'SymStart': 0xEA60, 'SymEnd': 0xEC1E, 'SrcStart': None, 'ScaleRules': CODI_SCALE_LIST, 'Attributes': SYM_ATTR_DEFAULT},
{'Enabled': self.args.custom, 'Name': "Custom", 'Filename': self.args.custom, 'Exact': True, 'SymStart': 0x0000, 'SymEnd': 0x0000, 'SrcStart': None, 'ScaleRules': None, 'Attributes': CUSTOM_ATTR}
]

Expand Down
9 changes: 9 additions & 0 deletions src/glyphs/codicons/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Codicons

For more information have a look at the upstream website: https://github.com/microsoft/vscode-codicons

## Source bugs fixed

Glyph 0xEB40 and 0xEB41 are defective in the original font. We fixed that manually.

Version: 0.0.35
Binary file modified src/glyphs/codicons/codicon.ttf
Binary file not shown.
Binary file added src/glyphs/codicons/codicon_orig.ttf
Binary file not shown.
3 changes: 1 addition & 2 deletions src/svgs/icons.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
022 i_seti_gulp gulp.svg
023 i_seti_grunt grunt.svg
024 i_custom_default file_nf.svg
024 i_seti_default
024 i_seti_text
025 i_seti_folder folder.svg
026 i_seti_css css.svg
027 i_seti_config config.svg
Expand Down Expand Up @@ -114,6 +112,7 @@
082 i_seti_dart dart.svg
083 i_seti_db db.svg
084 i_seti_default default.svg
084 i_seti_text
085 i_seti_deprecation_cop deprecation-cop.svg
086 i_seti_docker docker.svg
087 i_seti_d d.svg
Expand Down

0 comments on commit 59133b8

Please sign in to comment.