Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ertekinno committed Jun 6, 2021
0 parents commit 6397ad7
Show file tree
Hide file tree
Showing 62 changed files with 97,954 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store

8 changes: 8 additions & 0 deletions AUTHOR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is the official list of project authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS.txt file.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>

Ertekin Erdin <[email protected]>
93 changes: 93 additions & 0 deletions OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2021 The Haskoy Project Authors (https://github.com/ertekinno/haskoy)

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:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

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.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Hasköy

[![Cover](cover.png)]

Hasköy is an open-source variable sans-serif typeface family. Designed with powerful opentype features and each weight includes latin-extended language support, stylistic alternates, fractions, tabular figures, arrows and more. Currently, the family includes Latin Vietnamese, Pinyin, and all Western, Central, and South-Eastern European language support.


## Building the Fonts

Family is built using fontmake and gftools post processing script. Tools are all python based.

To install all the Python tools into a virtualenv, do the following:

```
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

Then run the build script in the terminal:

```
cd source
sh build.sh
```

## License

Hasköy is licensed under the SIL Open Font License v1.1, see [OFL.txt](OFL.txt) for details.
Binary file added cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fonts/otf/Haskoy-Bold.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-BoldItalic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-ExtraBold.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-ExtraBoldItalic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-ExtraLight.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-ExtraLightItalic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-Italic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-Light.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-LightItalic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-Medium.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-MediumItalic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-Regular.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-SemiBold.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-SemiBoldItalic.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-Thin.otf
Binary file not shown.
Binary file added fonts/otf/Haskoy-ThinItalic.otf
Binary file not shown.
Binary file added fonts/ttf/Haskoy-Italic[wght].ttf
Binary file not shown.
Binary file added fonts/ttf/Haskoy[wght].ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-Bold.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-BoldItalic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-ExtraBold.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-ExtraBoldItalic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-ExtraLight.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-ExtraLightItalic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-Italic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-Light.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-LightItalic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-Medium.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-MediumItalic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-Regular.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-SemiBold.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-SemiBoldItalic.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-Thin.ttf
Binary file not shown.
Binary file added fonts/ttf/static/Haskoy-ThinItalic.ttf
Binary file not shown.
Binary file added fonts/woff2/Haskoy-Italic[wght].woff2
Binary file not shown.
Binary file added fonts/woff2/Haskoy[wght].woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-Bold.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-BoldItalic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-ExtraBold.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-ExtraBoldItalic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-ExtraLight.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-ExtraLightItalic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-Italic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-Light.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-LightItalic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-Medium.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-MediumItalic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-Regular.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-SemiBold.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-SemiBoldItalic.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-Thin.woff2
Binary file not shown.
Binary file added fonts/woff2/static/Haskoy-ThinItalic.woff2
Binary file not shown.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fontmake
git+https://github.com/googlefonts/gftools
70 changes: 70 additions & 0 deletions source/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh

set -e


echo "Generating fonts"

mkdir -p ./fonts/otf ./fonts/ttf ./fonts/ttf/static ./fonts/woff2 ./fonts/woff2/static
echo "Made font directories"

echo "Generating static TTFs"
fontmake -g source/haskoy.glyphs -i -o ttf --output-dir ./fonts/ttf/static/
echo "Made static TTFs"

echo "Post processing static TTFs"
ttfs=$(ls ./fonts/ttf/static/*.ttf)
for ttf in $ttfs
do
gftools fix-dsig -f $ttf;
ttfautohint $ttf $ttf.fix;
mv "$ttf.fix" $ttf;
gftools fix-hinting $ttf;
mv "$ttf.fix" $ttf;
fonttools ttLib.woff2 compress $ttf;
done

echo "Generating VFs"
fontmake -g source/haskoy.glyphs -o variable --output-path ./fonts/ttf/Haskoy\[ital,wght\].ttf

python source/gen_stat.py ./fonts/ttf/Haskoy\[ital,wght\].ttf

fonttools varLib.instancer ./fonts/ttf/Haskoy\[ital,wght\].ttf ital=0 wght=100:800 --update-name-table -o ./fonts/ttf/Haskoy\[wght\].ttf
fonttools varLib.instancer ./fonts/ttf/Haskoy\[ital,wght\].ttf ital=1 wght=100:800 --update-name-table -o ./fonts/ttf/Haskoy-Italic\[wght\].ttf
python source/set_italic.py ./fonts/ttf/Haskoy-Italic\[wght\].ttf

rm ./fonts/ttf/Haskoy\[ital,wght\].ttf

echo "Made VFs"

echo "Post processing VFs"

vfs=$(ls ./fonts/ttf/*.ttf)
for vf in $vfs
do
gftools fix-dsig -f $vf;
gftools fix-unwanted-tables --tables MVAR $vf;
gftools fix-nonhinting $vf "$vf.fix";
mv "$vf.fix" $vf;
fonttools ttLib.woff2 compress $vf;
done

echo "Generating static OTFs"
fontmake -g source/haskoy.glyphs -i -o otf --output-dir ./fonts/otf/

echo "Post processing static OTFs"
otf=$(ls ./fonts/otf/*.otf)
for otf in $otf
do
gftools fix-dsig -f $otf;
done

echo "Woff2 static and VFs"

mv ./fonts/ttf/*.woff2 ./fonts/woff2
mv ./fonts/ttf/static/*.woff2 ./fonts/woff2/static

rm ./fonts/ttf/*backup*.ttf
rm -rf master_ufo/ instance_ufo/

echo "Build completed!"
53 changes: 53 additions & 0 deletions source/gen_stat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from fontTools.otlLib.builder import buildStatTable, _addName
from fontTools.ttLib import TTFont
import sys


AXES = [
dict(
tag="wght",
name="Weight",
values=[
dict(nominalValue=100, rangeMinValue=50, rangeMaxValue=150, name="Thin"),
dict(nominalValue=200, rangeMinValue=150, rangeMaxValue=250, name="ExtraLight"),
dict(nominalValue=300, rangeMinValue=250, rangeMaxValue=350, name="Light"),
dict(nominalValue=400, rangeMinValue=350, rangeMaxValue=500, name="Regular", flags=0x2),
dict(nominalValue=600, rangeMinValue=500, rangeMaxValue=650, name="SemiBold"),
dict(nominalValue=700, rangeMinValue=650, rangeMaxValue=700, name="Bold"),
dict(nominalValue=800, rangeMinValue=750, rangeMaxValue=850, name="ExtraBold"),
dict(nominalValue=900, rangeMinValue=850, rangeMaxValue=900, name="Black"),
],
),
dict(
tag="ital",
name="Italic",
values=[
dict(nominalValue=0, rangeMinValue=0, rangeMaxValue=0, name="Roman", flags=0x2),
dict(nominalValue=1, rangeMinValue=0.1, rangeMaxValue=1, name="Italic"),
],
),
]

def update_fvar(ttfont):
fvar = ttfont['fvar']
nametable = ttfont['name']
family_name = nametable.getName(16, 3, 1, 1033) or nametable.getName(1, 3, 1, 1033)
family_name = family_name.toUnicode().replace(" ", "")
nametable.setName(family_name, 25, 3, 1, 1033)
for instance in fvar.instances:
instance_style = nametable.getName(instance.subfamilyNameID, 3, 1, 1033).toUnicode()
ps_name = f"{family_name}-{instance_style.replace(' ', '')}"
instance.postscriptNameID = _addName(nametable, ps_name, 256)


def main():
filepath = sys.argv[1]
tt = TTFont(filepath)
buildStatTable(tt, AXES)
update_fvar(tt)
tt.save(filepath)
print(f"Added STAT table to {filepath}")


if __name__ == "__main__":
main()
Loading

0 comments on commit 6397ad7

Please sign in to comment.