Skip to content

Commit

Permalink
Merge pull request #1504 from cabrinha/zed-fonts
Browse files Browse the repository at this point in the history
Add font Zed Mono
  • Loading branch information
Finii authored Apr 2, 2024
2 parents ef76127 + 3d7aa92 commit 8bf4989
Show file tree
Hide file tree
Showing 38 changed files with 176 additions and 3 deletions.
13 changes: 13 additions & 0 deletions bin/scripts/lib/fonts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
10 changes: 8 additions & 2 deletions bin/scripts/name_parser/FontnameTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 ]
Expand All @@ -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')
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<sub>_\*RFN = Reserved Font Name_</sub>

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -701,6 +702,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

<!--
Patched Font internal links
Expand Down Expand Up @@ -770,6 +772,7 @@ Patched Font internal links
[p-ubuntu-mono]:patched-fonts/UbuntuMono
[p-ubuntu]:patched-fonts/Ubuntu
[p-victor]:patched-fonts/VictorMono
[p-zed-mono]:patched-fonts/ZedMono


<!--
Expand Down
1 change: 1 addition & 0 deletions src/unpatched-fonts/ZedMono/Extended/config.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config_patch_flags="--makegroups 5"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
110 changes: 110 additions & 0 deletions src/unpatched-fonts/ZedMono/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
Copyright 2015-2021, Renzhi Li (aka. Belleve Invis, belleve@typeof.net)

This Font Software is licensed under the SIL Open Font License, Version 1.1.

This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

--------------------------


SIL Open Font License v1.1
====================================================


Preamble
----------

The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.


Definitions
-------------

`"Font Software"` refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

`"Reserved Font Name"` refers to any names specified as such after the
copyright statement(s).

`"Original Version"` refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

`"Modified Version"` refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

`"Author"` refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.


Permission & Conditions
------------------------

Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1. Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2. Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3. No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4. The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5. The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.



Termination
-----------

This license becomes null and void if any of the above conditions are
not met.


DISCLAIMER

THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
1 change: 1 addition & 0 deletions src/unpatched-fonts/ZedMono/Normal/config.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config_patch_flags="--makegroups 4"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions src/unpatched-fonts/ZedMono/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Zed Mono

**Zed Mono** is a custom builds of Iosevka.

For more information have a look at the upstream website: https://github.com/zed-industries/zed-fonts

Version: 1.2.0
31 changes: 31 additions & 0 deletions src/unpatched-fonts/ZedMono/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

FONT_VERSION=1.2.0
TMP_DIR=$(mktemp -d)

set -ex

curl -LOf "https://github.com/zed-industries/zed-fonts/releases/download/${FONT_VERSION}/zed-mono-${FONT_VERSION}.zip" --output-dir "${TMP_DIR}"
unzip -d "${TMP_DIR}" "${TMP_DIR}/*.zip"

ls -alh "${TMP_DIR}"

typefaces=( "" "Extended" )

# weights=( regular italic oblique \
# thin* extralight* light* medium* semibold* bold* extrabold* heavy* )

weights=( Regular italic oblique \
light* medium* bold* extrabold* )

for face in "${typefaces[@]}"; do
echo "Processing ${face} ..."
dest=${face}
if [ -z "${face}" ]; then
dest=Normal
fi
mkdir -p "${dest}"
for weight in "${weights[@]}"; do
find "${TMP_DIR}" -iname "zed-mono-${face}${weight}.ttf" -exec mv "{}" "${dest}" \;
done
done
1 change: 1 addition & 0 deletions src/unpatched-fonts/fontfilenames
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ Tinos/Regular/Tinos-Regular.ttf
Ubuntu/Regular/Ubuntu-R.ttf
UbuntuMono/Regular/UbuntuMono-R.ttf
VictorMono/Regular/VictorMono-Regular.ttf
ZedMono/Normal/zed-mono-regular.ttf

0 comments on commit 8bf4989

Please sign in to comment.