diff options
author | Rasmus Andersson <rasmus@notion.se> | 2017-09-23 20:14:17 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2017-09-23 20:14:17 +0300 |
commit | 84dfab8f06ac72089d129cb10d47e5ac262c63f8 (patch) | |
tree | a02cbbb34556c37e073d370cd7e9629330dccf82 | |
parent | c5efb03ca8e1948f8931920fbe8c6ba314ce516e (diff) | |
download | inter-84dfab8f06ac72089d129cb10d47e5ac262c63f8.tar.xz |
Move away from using hinted fonts by default
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | CONTRIBUTING.md | 6 | ||||
-rw-r--r-- | Makefile | 67 | ||||
-rwxr-xr-x | init.sh | 26 | ||||
-rw-r--r-- | misc/doc/hinted vs unhinted.txt | 17 | ||||
-rw-r--r-- | misc/doc/install-win.txt | 19 |
6 files changed, 89 insertions, 47 deletions
diff --git a/.gitattributes b/.gitattributes index f1917bd5e..591ca02e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ # Use CRLF for line endings in the Windows install "readme" file misc/doc/install-win.txt text eol=crlf +misc/doc/hinted[[:space:]]vs[[:space:]]unhinted.txt text eol=crlf diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7877ab116..8e4f9da27 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -158,8 +158,8 @@ You can also specify specific style + file format to `make` through `build/Inter E.g. - `make build/dist-unhinted/InterUI-MediumItalic.otf` -- `make build/dist/InterUI-Bold.woff2` -- `make build/dist/InterUI-Regular.ttf` +- `make build/dist-unhinted/InterUI-Bold.woff2` +- `make build/dist-hinted/InterUI-Regular.ttf` - `...` All resulting font files are written to the `build` directory with `InterUI-` as the filename prefix. @@ -298,4 +298,4 @@ Run `./init.sh` to update the generated makefile. Use the fontinfo.py tool which outputs JSON describing all properties of one or more font files. See `misc/fontinfo.py -h` for details. -Example use: `misc/fontinfo.py build/dist/InterUI-BoldItalic.ttf` +Example use: `misc/fontinfo.py -pretty build/dist-unhinted/Inter-UI-BoldItalic.ttf` @@ -1,11 +1,17 @@ # Targets: -# all Build all styles in all formats (default) -# all_ttf Build all styles as TrueType -# STYLE Build STYLE in all formats (e.g. MediumItalic) -# STYLE_ttf Build STYLE as TrueType (e.g. MediumItalic_ttf) -# zip Build all styles as TrueType and package into a zip archive +# all Build all styles in all formats (default) +# all_ttf Build all styles as TrueType +# all_otf Build all styles as OpenType +# all_hinted Build all styles as autohinted TrueType +# STYLE Build STYLE in all formats (e.g. MediumItalic) +# STYLE_hinted Build STYLE in TTF and web formats with autohints +# STYLE_ttf Build STYLE as TrueType (e.g. MediumItalic_ttf) +# zip Build all styles as TrueType and package into a zip archive +# install Build all (web, ttf and otf) and install. Mac-only for now. +# dist Create a new release distribution. Does everything. # all: all_web all_otf +all_hinted: all_web_hinted VERSION := $(shell misc/version.py) @@ -24,20 +30,13 @@ build/tmp/InterUIOTF/InterUI-%.otf: build/tmp/InterUITTF/InterUI-%.ttf $(res_fil @true # build/tmp/ttf -> build (generated.make handles build/tmp/InterUITTF/InterUI-%.ttf) -build/dist-unhinted/Inter-UI-%.ttf: build/tmp/InterUITTF/InterUI-%.ttf +build/dist-unhinted/Inter-UI-%: build/tmp/InterUITTF/InterUI-% build/dist-unhinted @mkdir -p build/dist-unhinted cp -a "$<" "$@" -# OTF -build/dist-unhinted/Inter-UI-%.otf: build/tmp/InterUIOTF/InterUI-%.otf - @mkdir -p build/dist-unhinted - cp -a "$<" "$@" - -build/dist: - @mkdir -p build/dist - # autohint -build/dist/Inter-UI-%.ttf: build/dist-unhinted/Inter-UI-%.ttf build/dist +build/dist-hinted/Inter-UI-%.ttf: build/dist-unhinted/Inter-UI-%.ttf + @mkdir -p build/dist-hinted ttfautohint \ --hinting-limit=256 \ --hinting-range-min=8 \ @@ -64,20 +63,24 @@ ZIP_FILE_DIST := build/release/Inter-UI-${VERSION}.zip ZIP_FILE_DEV := build/release/Inter-UI-${VERSION}-$(shell git rev-parse --short=10 HEAD).zip # zip intermediate -build/.zip.zip: all +build/.zip.zip: all_otf all_web all_web_hinted @rm -rf build/.zip @rm -f build/.zip.zip @mkdir -p \ "build/.zip/Inter UI (web)" \ - "build/.zip/Inter UI (hinted TTF)" \ + "build/.zip/Inter UI (web hinted)" \ "build/.zip/Inter UI (TTF)" \ + "build/.zip/Inter UI (TTF hinted)" \ "build/.zip/Inter UI (OTF)" - @cp -a build/dist/*.woff build/dist/*.woff2 "build/.zip/Inter UI (web)/" - @cp -a build/dist/*.ttf "build/.zip/Inter UI (hinted TTF)/" - @cp -a build/dist-unhinted/*.ttf "build/.zip/Inter UI (TTF)/" - @cp -a build/dist-unhinted/*.otf "build/.zip/Inter UI (OTF)/" - @cp -a misc/doc/install-*.txt "build/.zip/" - @cp -a LICENSE.txt "build/.zip/" + @cp -a build/dist-unhinted/*.woff build/dist-unhinted/*.woff2 \ + "build/.zip/Inter UI (web)/" + @cp -a build/dist-hinted/*.woff build/dist-hinted/*.woff2 \ + "build/.zip/Inter UI (web hinted)/" + @cp -a build/dist-unhinted/*.ttf "build/.zip/Inter UI (TTF)/" + @cp -a build/dist-hinted/*.ttf "build/.zip/Inter UI (TTF hinted)/" + @cp -a build/dist-unhinted/*.otf "build/.zip/Inter UI (OTF)/" + @cp -a misc/doc/*.txt "build/.zip/" + @cp -a LICENSE.txt "build/.zip/" cd build/.zip && zip -v -X -r "../../build/.zip.zip" * >/dev/null && cd ../.. @rm -rf build/.zip @@ -114,13 +117,19 @@ dist: pre_dist zip_dist glyphinfo copy_docs_fonts copy_docs_fonts: rm -rf docs/font-files mkdir docs/font-files - cp -a build/dist/*.woff build/dist/*.woff2 build/dist-unhinted/*.otf docs/font-files/ + cp -a build/dist-unhinted/*.woff build/dist-unhinted/*.woff2 build/dist-unhinted/*.otf docs/font-files/ -install_ttf: all_ttf +install_ttf: all_ttf_unhinted @echo "Installing TTF files locally at ~/Library/Fonts/Inter UI" rm -rf ~/'Library/Fonts/Inter UI' mkdir -p ~/'Library/Fonts/Inter UI' - cp -va build/dist/*.ttf ~/'Library/Fonts/Inter UI' + cp -va build/dist-unhinted/*.ttf ~/'Library/Fonts/Inter UI' + +install_ttf_hinted: all_ttf + @echo "Installing autohinted TTF files locally at ~/Library/Fonts/Inter UI" + rm -rf ~/'Library/Fonts/Inter UI' + mkdir -p ~/'Library/Fonts/Inter UI' + cp -va build/dist-hinted/*.ttf ~/'Library/Fonts/Inter UI' install_otf: all_otf @echo "Installing OTF files locally at ~/Library/Fonts/Inter UI" @@ -128,7 +137,7 @@ install_otf: all_otf mkdir -p ~/'Library/Fonts/Inter UI' cp -va build/dist-unhinted/*.otf ~/'Library/Fonts/Inter UI' -install: all install_otf +install: all_web install_otf glyphinfo: docs/lab/glyphinfo.json docs/glyphs/metrics.json @@ -151,6 +160,6 @@ _local/UnicodeData.txt: http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt clean: - rm -vrf build/tmp/* build/dist/Inter-UI-*.* + rm -vrf build/tmp/* build/dist-hinted build/dist-unhinted -.PHONY: all web clean install install_otf install_ttf deploy zip zip_dist pre_dist dist glyphinfo copy_docs_fonts +.PHONY: all web clean install install_otf install_ttf deploy zip zip_dist pre_dist dist glyphinfo copy_docs_fonts all_hinted @@ -7,7 +7,7 @@ if [[ "${BUILD_DIR:0:2}" == "./" ]]; then BUILD_DIR=${BUILD_DIR:2} fi -DIST_DIR=$BUILD_DIR/dist +DIST_DIR=$BUILD_DIR/dist #-hinted|-unhinted BUILD_TMP_DIR=$BUILD_DIR/tmp VENV_DIR=$BUILD_DIR/venv @@ -255,19 +255,19 @@ else # STYLE and STYLE_ttf targets for style in "${all_styles[@]}"; do - echo "${style}_ttf: $DIST_DIR/Inter-UI-${style}.ttf" >> "$GEN_MAKE_FILE" + echo "${style}_ttf_hinted: $DIST_DIR-hinted/Inter-UI-${style}.ttf" >> "$GEN_MAKE_FILE" + echo "${style}_ttf: $DIST_DIR-unhinted/Inter-UI-${style}.ttf" >> "$GEN_MAKE_FILE" echo "${style}_otf: $DIST_DIR-unhinted/Inter-UI-${style}.otf" >> "$GEN_MAKE_FILE" - echo "${style}_ttf_unhinted: $DIST_DIR-unhinted/Inter-UI-${style}.ttf" >> "$GEN_MAKE_FILE" echo -n "${style}: ${style}_otf" >> "$GEN_MAKE_FILE" for format in "${web_formats[@]}"; do - echo -n " $DIST_DIR/Inter-UI-${style}.${format}" >> "$GEN_MAKE_FILE" + echo -n " $DIST_DIR-unhinted/Inter-UI-${style}.${format}" >> "$GEN_MAKE_FILE" done echo "" >> "$GEN_MAKE_FILE" - echo -n "${style}_unhinted: ${style}_otf" >> "$GEN_MAKE_FILE" + echo -n "${style}_hinted: ${style}_ttf_hinted" >> "$GEN_MAKE_FILE" for format in "${web_formats[@]}"; do - echo -n " $DIST_DIR-unhinted/Inter-UI-${style}.${format}" >> "$GEN_MAKE_FILE" + echo -n " $DIST_DIR-hinted/Inter-UI-${style}.${format}" >> "$GEN_MAKE_FILE" done echo "" >> "$GEN_MAKE_FILE" done @@ -286,9 +286,10 @@ else done echo "" >> "$GEN_MAKE_FILE" - echo -n "all_ttf_unhinted:" >> "$GEN_MAKE_FILE" + # all_ttf_hinted target + echo -n "all_ttf_hinted:" >> "$GEN_MAKE_FILE" for style in "${all_styles[@]}"; do - echo -n " ${style}_ttf_unhinted" >> "$GEN_MAKE_FILE" + echo -n " ${style}_ttf_hinted" >> "$GEN_MAKE_FILE" done echo "" >> "$GEN_MAKE_FILE" @@ -299,16 +300,17 @@ else done echo "" >> "$GEN_MAKE_FILE" - echo -n "all_web_unhinted:" >> "$GEN_MAKE_FILE" + # all_web_hinted target + echo -n "all_web_hinted:" >> "$GEN_MAKE_FILE" for style in "${all_styles[@]}"; do - echo -n " ${style}_unhinted" >> "$GEN_MAKE_FILE" + echo -n " ${style}_hinted" >> "$GEN_MAKE_FILE" done echo "" >> "$GEN_MAKE_FILE" - echo -n ".PHONY: all_ttf all_ttf_unhinted all_web all_web_unhinted all_otf all_ufo" >> "$GEN_MAKE_FILE" + echo -n ".PHONY: all_otf all_ttf_hinted all_ttf all_web all_web_hinted all_ufo" >> "$GEN_MAKE_FILE" for style in "${all_styles[@]}"; do - echo -n " ${style} ${style}_ttf ${style}_ttf_unhinted ${style}_otf" >> "$GEN_MAKE_FILE" + echo -n " ${style} ${style}_ttf ${style}_ttf_hinted ${style}_otf" >> "$GEN_MAKE_FILE" done echo "" >> "$GEN_MAKE_FILE" fi diff --git a/misc/doc/hinted vs unhinted.txt b/misc/doc/hinted vs unhinted.txt new file mode 100644 index 000000000..564e360cc --- /dev/null +++ b/misc/doc/hinted vs unhinted.txt @@ -0,0 +1,17 @@ + +Inter UI font files comes in two versions: + +1. Without TrueType hints (the default) + +2. With TrueType hints (folder with "hinted" in their name) + + +The TrueType hints are used by ClearType on Windows machines where ClearType +is enabled. This usually changes the appearance of the fonts and can in some +cases increase the legibility of text. + +However, the hints for Inter UI are automatically generated and are not always +a good thing. Additionally, hints are little computer programs that takes up +considerable disk space, meaning that font files with hints are larger than +those without hints. This might be a consideration when using web fonts. + diff --git a/misc/doc/install-win.txt b/misc/doc/install-win.txt index ea86be137..9bff45889 100644 --- a/misc/doc/install-win.txt +++ b/misc/doc/install-win.txt @@ -1,7 +1,7 @@ Installing on Windows 10: -1. Open the "Inter UI (hinted TTF)" folder +1. Open the "Inter UI (OTF)" folder 2. Select all font files 3. Right-click the selected files and choose "Install" @@ -9,11 +9,24 @@ Installing on Windows 10: Installing on Windows 10, manually: 1. Double-click the downloaded zip file -2. Copy the "Inter UI (hinted TTF)" folder +2. Copy the "Inter UI (OTF)" folder 3. Press Win-Q on your keyboard, then type "fonts" and hit ENTER -4. Paste the "Inter UI (hinted TTF)" folder. +4. Paste the "Inter UI (OTF)" folder. If you have a previous installation of Inter UI, you should make sure to remove those fonts files before installing new ones. + +ClearType-hinted fonts + + Inter UI also comes with a version that has TrueType hints used by ClearType + on Windows. This changes the appearance of the fonts when rendered on a + system with ClearType enabled and can in some cases increase the legibility + of text. However, the hints for Inter UI are automatically generated and are + not always a good thing. + + If you do prefer to use the version with hints, use the font files in the + folders with "hinted" in their name, like "Inter UI (TTF hinted)" + + See https://github.com/rsms/inter for more information |