Skip to content

Commit

Permalink
Merge pull request #43 from aaronbell/main
Browse files Browse the repository at this point in the history
Updating for GF onboarding
  • Loading branch information
ButTaiwan authored Nov 16, 2024
2 parents 116d684 + 9fb4847 commit 41190e8
Show file tree
Hide file tree
Showing 15,951 changed files with 5,527 additions and 189,467 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
116 changes: 116 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Build font and specimen

on: push

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install sys tools/deps
run: |
sudo apt-get update
sudo apt-get install ttfautohint
sudo snap install yq
- uses: actions/cache@v4
with:
path: ./venv/
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-venv-
- name: gen zip file name
id: zip-name
shell: bash
# Set the archive name to repo name + "-assets" e.g "MavenPro-assets"
run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV

# If a new release is cut, use the release tag to auto-bump the source files
# - name: Bump release
# if: github.event_name == 'release'
# run: |
# . venv/bin/activate
# SRCS=$(yq e ".sources[]" sources/config.yaml)
# TAG_NAME=${GITHUB_REF/refs\/tags\//}
# echo "Bumping $SRCS to $TAG_NAME"
# for src in $SRCS
# do
# bumpfontversion sources/$src --new-version $TAG_NAME;
# done

- name: Build font
run: make build
- name: Check with fontbakery
run: make test
continue-on-error: true
- name: proof
run: make proof
- name: setup site
run: cp scripts/index.html out/index.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_NAME }}
path: |
fonts
out
outputs:
zip_name: ${{ env.ZIP_NAME }}

# There are two ways a release can be created: either by pushing a tag, or by
# creating a release from the GitHub UI. Pushing a tag does not automatically
# create a release, so we have to do that ourselves. However, creating a
# release from the GitHub UI *does* push a tag, and we don't want to create
# a new release in that case because one already exists!

release:
name: Create and populate release
needs: build
runs-on: ubuntu-latest
if: contains(github.ref, 'refs/tags/')
env:
ZIP_NAME: ${{ needs.build.outputs.zip_name }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- name: Download font artefact files
uses: actions/download-artifact@v4
with:
name: ${{ env.ZIP_NAME }}
path: ${{ env.ZIP_NAME }}
- name: Copy DESCRIPTION.en_us.html to artefact directory
run: cp documentation/DESCRIPTION.en_us.html ${{ env.ZIP_NAME }}/DESCRIPTION.en_us.html
- name: Copy ARTICLE.en_us.html to artefact directory
run: cp documentation/ARTICLE.en_us.html ${{ env.ZIP_NAME }}/ARTICLE.en_us.html
continue-on-error: true
- name: Copy OFL.txt to artefact directory
run: cp OFL.txt ${{ env.ZIP_NAME }}/OFL.txt
- name: Remove proof/fontbakery stuff from release
run: rm -rf ${{ env.ZIP_NAME }}/out
- name: gen release file name
shell: bash
run: echo "RELEASE_ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-${{github.ref_name}}" >> $GITHUB_ENV
- name: Create release bundle
run: mv ${{ env.ZIP_NAME }} ${{ env.RELEASE_ZIP_NAME }}; zip -r ${{ env.RELEASE_ZIP_NAME }}.zip ${{ env.RELEASE_ZIP_NAME }}
- name: Check for release
id: create_release
run: |
if ! gh release view ${{ github.ref_name }}; then
git show -s --format=%B ${{ github.ref_name }} | tail -n +4 | gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -F -
fi
- name: Populate release
run: |
gh release upload ${{ github.ref_name }} ${{ env.RELEASE_ZIP_NAME }}.zip --clobber
- name: Set release live
run: |
gh release edit ${{ github.ref_name }} --draft=false
47 changes: 43 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
*~
venv
venv-test
build.stamp
proof
fonts
node_modules
package-lock.json
package.json
master_ufo
instance_ufos
.ninja_log
build.ninja

# OS generated files #
######################
.DS_Store
*.psd
*.html
*.zip
policyx.md
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Autosaved by application when editing
######################
*(تم الحفظ تلقائيًا).*
*(automaticky uloženo).*
*(Automatisch gesichert).*
*(Autosaved).*
*(guardado automáticamente).*
*(enregistré automatiquement).*
*(salvato automaticamente).*
*(自動保存).*
*(자동 저장됨).*
*(Salvo Automaticamente).*
*(Автосохранение).*
*(Otomatik Kaydedildi).*
*(自动存储).*
*(已自動儲存).*

# Build files
*.md
changelist.txt
11 changes: 11 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is the official list of project authors for copyright purposes. The first name in the list (if there are several authors), will appear as "Principal design" in the "about" section of the font specimen on Google Fonts.
# 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>
#
# (In alphabetical order)

But Ko
Fontworks
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 異動紀錄

## 2024/11/7 v1.003
- Changed metrics to follow GF guidelines
- Updated config.yaml and added makefile build system
- Added documentation folder with description files
- Removed unreachable glpyhs, and cleared out related OT features

## 2023/6/13 v1.002

- 新增雙線表格等符號
Expand Down
70 changes: 70 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
SOURCES=$(shell python3 scripts/read-config.py --sources )
FAMILY=$(shell python3 scripts/read-config.py --family )
DRAWBOT_SCRIPTS=$(shell ls documentation/*.py)
DRAWBOT_OUTPUT=$(shell ls documentation/*.py | sed 's/\.py/.png/g')

help:
@echo "###"
@echo "# Build targets for $(FAMILY)"
@echo "###"
@echo
@echo " make build: Builds the fonts and places them in the fonts/ directory"
@echo " make test: Tests the fonts with fontbakery"
@echo " make proof: Creates HTML proof documents in the proof/ directory"
@echo " make images: Creates PNG specimen images in the documentation/ directory"
@echo

build: build.stamp

venv: venv/touchfile

venv-test: venv-test/touchfile

customize: venv
. venv/bin/activate; python3 scripts/customize.py

build.stamp: venv sources/config.yaml $(SOURCES)
rm -rf fonts
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp

venv/touchfile: requirements.txt
test -d venv || python3 -m venv venv
. venv/bin/activate; pip install -Ur requirements.txt
touch venv/touchfile

venv-test/touchfile: requirements-test.txt
test -d venv-test || python3 -m venv venv-test
. venv-test/bin/activate; pip install -Ur requirements-test.txt
touch venv-test/touchfile

test: venv-test build.stamp
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv-test/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $$TOCHECK || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'

proof: venv build.stamp
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $$TOCHECK -o out/proof

images: venv $(DRAWBOT_OUTPUT)

%.png: %.py build.stamp
. venv/bin/activate; python3 $< --output $@

clean:
rm -rf venv
find . -name "*.pyc" -delete

update-project-template:
npx update-template https://github.com/googlefonts/googlefonts-project-template/

update: venv venv-test
venv/bin/pip install --upgrade pip-tools
# See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for
# the `--resolver` flag below.
venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in
venv/bin/pip-sync requirements.txt

venv-test/bin/pip install --upgrade pip-tools
venv-test/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements-test.in
venv-test/bin/pip-sync requirements-test.txt

git commit -m "Update requirements" requirements.txt requirements-test.txt
git push
3 changes: 1 addition & 2 deletions OFL.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2022, But Ko (https://github.com/ButTaiwan/iansui), with Reserved Font Name "芫荽".
Copyright (c) 2020, The Klee Project Authors (https://github.com/fontworks-fonts/Klee).
Copyright 2022 The Iansui Project Authors (https://github.com/ButTaiwan/iansui).

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:
Expand Down
7 changes: 7 additions & 0 deletions documentation/DESCRIPTION.en_us.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p>
Iansui is based on Fontworks' Klee Semibold font, which is a script font handwritten by pencil or pen. Its quiet design has an elegant and slightly feminine look that sets itself apart from traditional script and textbook fonts. Ideal for body text. Iansui further modifies the existing design to meet the Ministry of Education's requirements for Taiwanese use.
</p>

<p>
Learn more about Iansui from <a href="https://github.com/ButTaiwan/iansui">https://github.com/ButTaiwan/iansui</a>
</p>
Binary file added documentation/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 41190e8

Please sign in to comment.