diff --git a/bin/scripts/lib/fonts.json b/bin/scripts/lib/fonts.json index 10572a08c9..6b313abe7e 100644 --- a/bin/scripts/lib/fonts.json +++ b/bin/scripts/lib/fonts.json @@ -844,6 +844,19 @@ "caskName": "victor-mono", "repoRelease": true, "description": "Clean, crisp and narrow, with a large x-height and clear punctuation" + }, + { + "unpatchedName": "Zed Mono", + "RFN": false, + "version": "1.2.0", + "patchedName": "ZedMono", + "folderName": "ZedMono", + "imagePreviewFont": "ZedMono Nerd Font", + "imagePreviewFontSource": "ZedMono/Normal/zed-mono-regular.ttf", + "linkPreviewFont": false, + "caskName": "zed-mono", + "repoRelease": false, + "description": "Zed Mono is a more rounded version of Iosevka" } ] } diff --git a/bin/scripts/name_parser/FontnameTools.py b/bin/scripts/name_parser/FontnameTools.py index 39eb4c48df..0f5e12e4b3 100644 --- a/bin/scripts/name_parser/FontnameTools.py +++ b/bin/scripts/name_parser/FontnameTools.py @@ -251,7 +251,7 @@ def postscript_char_filter(name): 'Heavy': ('Hv', 'Heavy'), 'Thin': ('Th', 'Thin'), 'Light': ('Lt', 'Light'), - ' ': (), # Just for CodeClimate :-/ + '': (), # Just for CodeClimate :-/ } known_styles = [ # Keywords that end up as style (i.e. a RIBBI set) 'Bold', 'Italic', 'Regular', 'Normal' @@ -393,8 +393,12 @@ def parse_font_name(name): # Weights end up as Typographic Family parts ('after the dash') # Styles end up as Family parts (for classic grouping of four) # Others also end up in Typographic Family ('before the dash') + widths = [ m + s + for s in list(FontnameTools.known_widths) + for m in list(FontnameTools.known_modifiers) + [''] + ] weights = [ m + s - for s in list(FontnameTools.known_weights2) + list(FontnameTools.known_widths) + for s in list(FontnameTools.known_weights2) for m in list(FontnameTools.known_modifiers) + [''] if m != s ] + list(FontnameTools.known_weights1) + list(FontnameTools.known_slopes) weights = [ w for w in weights if w not in FontnameTools.known_styles ] @@ -408,9 +412,11 @@ def parse_font_name(name): r'(?:uni-)?1[14]', # GohuFont uni ] + ( style, width_token ) = FontnameTools.get_name_token(style, widths) ( style, weight_token ) = FontnameTools.get_name_token(style, weights) ( style, style_token ) = FontnameTools.get_name_token(style, FontnameTools.known_styles) ( style, other_token ) = FontnameTools.get_name_token(style, other) + weight_token = width_token + weight_token while 'Regular' in style_token and len(style_token) > 1: # Correct situation where "Regular" and something else is given style_token.remove('Regular') diff --git a/readme.md b/readme.md index 0be4ccdfc6..a2ce47e1fa 100644 --- a/readme.md +++ b/readme.md @@ -176,6 +176,7 @@ A preview of all fonts can be found [here](https://www.nerdfonts.com/font-downlo | [Ubuntu Nerd Font][p-ubuntu] | [Ubuntu Font][f-ubuntu] | 0.83 | NO | | [UbuntuMono Nerd Font][p-ubuntu-mono] | [Ubuntu Font][f-ubuntu] | 0.80 | NO | | [VictorMono Nerd Font][p-victor] | [Victor Mono][f-victor] | 1.5.6 | NO | +| [ZedMono Nerd Font][p-zed-mono] | [Zed Mono][f-zed-mono] | 1.2.0 | NO | _\*RFN = Reserved Font Name_ @@ -311,7 +312,7 @@ or, in Powershell (Windows only): _Note_: Will not work to get newer fonts as they are not inside the repo anymore. -A full clone of this repository is **not** required nor efficient (mostly due to Repository size) if you are simply only interested in a limited set of fonts. +A full clone of this repository is **not** required nor efficient (mostly due to Repository size) if you are simply only interested in a limited set of fonts. If you do want to clone the entire repo be sure to _shallow_ clone: ```sh @@ -698,6 +699,7 @@ Font repos [f-tinos]:https://fonts.google.com/specimen/Tinos [f-ubuntu]:http://font.ubuntu.com [f-victor]:https://github.com/rubjo/victor-mono +[f-zed-mono]:https://github.com/zed-industries/zed-fonts