diff --git a/.gitignore b/.gitignore index fc2f44b..57a25cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /venv /build *.swp +/docs/_site +/fonts/*.woff2 diff --git a/Makefile b/Makefile index 751c40f..8c8b7b5 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ NAME = Qahiri MAKEFLAGS := -sr SHELL = bash -CONFIG = _config.yml +CONFIG = docs/_config.yml VERSION = $(shell grep "version:" $(CONFIG) | sed -e 's/.*.: "\(.*.\)".*/\1/') DIST = $(NAME)-$(VERSION) @@ -29,17 +29,27 @@ TESTDIR = tests BUILDDIR = build FONTS = $(FONTDIR)/$(NAME)-Regular.ttf +WOFF2 = $(FONTDIR)/$(NAME)-Regular.woff2 .SECONDARY: .ONESHELL: .PHONY: all dist -all: $(FONTS) +all: ttf web +ttf: $(FONTS) + +web: $(WOFF2) + cp $(WOFF2) docs/assets/fonts/ + cp $(FONTS) docs/app/assets/fonts/ %.ttf: $(SOURCEDIR)/$(NAME).glyphs $(CONFIG) $(info   BUILD $(@F)) python $(SCRIPTDIR)/build.py $< $(VERSION) $@ +%.woff2: %.ttf + $(info   WOFF2 $(@F)) + python $(SCRIPTDIR)/buildwoff2.py $< $@ + dist: all $(info   DIST $(DIST).zip) install -Dm644 -t $(DIST) $(FONTS) diff --git a/_config.yml b/_config.yml deleted file mode 100644 index b5795e5..0000000 --- a/_config.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: "3.00" # Increment only when tagging release, download link uses it. -title: Qahiri -title_ar: قاهري -description: A manuscript Kufic typeface -description_ar: خط كوفي مصحفي -logo: assets/images/favicon.svg -theme: jekyll-theme-minimal diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index 0cbcc7f..0000000 --- a/_layouts/default.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - {% if site.google_analytics %} - - - - {% endif %} - - - - -{% seo %} - - - - -

عربي

-
-
-

{{ site.title | default: site.github.repository_name }}

- - {% if site.logo %} - Logo - {% endif %} - -

{{ site.description | default: site.github.project_tagline }}

- -

Download font

- -

Go to app

- -

View the Project on GitHub {{ site.github.repository_nwo }}

-
-
- - {{ content }} - -
- -
- - - diff --git a/app/assets/fonts/Qahiri-Regular.ttf b/app/assets/fonts/Qahiri-Regular.ttf deleted file mode 120000 index fea43e3..0000000 --- a/app/assets/fonts/Qahiri-Regular.ttf +++ /dev/null @@ -1 +0,0 @@ -../../../fonts/Qahiri-Regular.ttf \ No newline at end of file diff --git a/assets/css/style.scss b/assets/css/style.scss deleted file mode 100644 index 8df6f71..0000000 --- a/assets/css/style.scss +++ /dev/null @@ -1,101 +0,0 @@ ---- ---- - -@import "{{ site.theme }}"; -@import url('https://fonts.googleapis.com/css2?family=Mada:wght@400;700&display=swap'); - -body { - font-family: "Noto Sans", "Mada", sans-serif; -} - -body:lang(ar) { - direction: rtl; - font-family: "Mada", sans-serif; -} - -header, footer { - float: left; -} - -section { - float: right; -} - -header:lang(ar), footer:lang(ar) { - float: right; -} - -section:lang(ar) { - float: left; -} - -.lang-switcher { - font-size: 14pt; - float: right; - transform: rotate(90deg); -} - -.lang-switcher:lang(ar) { - font-size: 16pt; - transform: rotate(-90deg); -} - -p { - text-align: justify; -} - -.downloads { - height: 40px; - padding: 0; - background: #f4f4f4; - border-radius: 5px; - border: 1px solid #e0e0e0; - width: 100%; -} - -.downloads a { - line-height: 1; - font-size: 120%; - color: #676767; - display: block; - text-align: center; - padding-top: 12px; - height: 34px; -} - -section img { - vertical-align: text-bottom; -} - -section img[src*="#install"] { - width: 220px; -} - -@media print, screen and (max-width: 960px) { - header { - padding-inline-end: 320px; - padding-inline-start: 0px; - } - .lang-switcher, .lang-switcher:lang(ar) { - transform: rotate(0deg); - margin-bottom: -1.5em; - } -} - -@media print, screen and (max-width: 720px) { - header { - padding: 0px; - } -} - -@media print, screen and (max-width: 700px) { - section img[src*="#install"] { - width: 45%; - } -} - -@media print, screen and (max-width: 480px) { - p { - text-align: start; - } -} diff --git a/assets/images/favicon.svg b/assets/images/favicon.svg deleted file mode 100644 index a6a6e90..0000000 --- a/assets/images/favicon.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..eeb20ae --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,4 @@ +version: "3.00" # Increment only when tagging release, download link uses it. +name: Qahiri +title: قاهري +description: خط كوفي مصحفي diff --git a/docs/_data/messages.yml b/docs/_data/messages.yml new file mode 100644 index 0000000..7c52755 --- /dev/null +++ b/docs/_data/messages.yml @@ -0,0 +1,27 @@ +en-US: + foundry: Alif Type + foundry-description: Alif Type is a virtual type foundry specialized in Arabic and mathematical libre fonts. + contact: Contact + contact-detail: Do you have questions or suggestions about our typefaces? Reach out! + facebook: Facebook + instagram: Instagram + google-fonts: Google Fonts + sitedesigner: Website design by Abdo Mohamed + github: Project page on GitHub + app: Go to app + download: Download font + description: Raqq (رَقّ) is a manuscript Kufic typeface, intends to revive (as faithfully as possible) the style of Kufic script used in writing the Qur’an in the third century AH. Raqq is Arabic for parchment, on which early Qur’ans were written. + +ar: + foundry: حروف ألف + foundry-description: «مسبك حروف ألف» هو مسبك حروف رقمی متخصص فی الخطوط العربیة والریاضیاتیة. + contact: تواصل معنا + contact-detail: هل لديك أي أسئلة أو اقتراحات عن خطوطنا؟ يمكن التواصل معنا عبر + facebook: فيسبوك + instagram: إنستاجرام + google-fonts: خطوط جوجل + sitedesigner: الموقع من تصميم عبد الرحمن محمد + download: نزِّل الخط + app: اذهب إلى التطبيق + github: صفحة المشروع على جت‌هب + description: «رَقّ» هو خط حاسوبي كوفي مصحفي، يهدف إلى إحياء الخط الكوفي الذي كتبت به المصاحف المبكرة، وتحديدا مصاحف القرن الثالث الهجري، عبر رقمنته رقمنة دقيقة قدر الإمكان. الرَقّ هو الجلد الذي كتبت عليه المصاحف المبكرة. diff --git a/_layouts/arabic.html b/docs/_layouts/arabic.html similarity index 100% rename from _layouts/arabic.html rename to docs/_layouts/arabic.html diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 0000000..44c4506 --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,63 @@ +{% assign messages = site.data.messages[page.language] %} + + + + + + + + {{ page.title | default: site.title }} | {{ page.description | default: site.description }} + + + + + + + + + + + +
+ +

{{ messages.foundry }}

+

+ {% if page.language == "ar" %} + عربي | English + {% else %} + English | عربي + {% endif %} +

+

{{ messages.foundry-description }}

+

{{ messages.contact }}

+

{{ messages.contact-detail }} info@aliftype.com

+

+ {{ messages.facebook }}
+ {{ messages.instagram }}
+ {{ messages.google-fonts }}
+

+

{{ messages.sitedesigner }}

+
+ +

+ {% if page.language == "ar" %} + عربي | English + {% else %} + English | عربي + {% endif %} +

+

{{ site.title }}—{{ site.description }}

+
+ {% if page.title and page.description %} +

{{ page.title }} — {{ page.description }}

+ {% endif %} + {{ content }} +
+ + + + diff --git a/app/Config.js b/docs/app/Config.js similarity index 100% rename from app/Config.js rename to docs/app/Config.js diff --git a/app/FontRemapper.js b/docs/app/FontRemapper.js similarity index 100% rename from app/FontRemapper.js rename to docs/app/FontRemapper.js diff --git a/app/HarfBuzz.js b/docs/app/HarfBuzz.js similarity index 100% rename from app/HarfBuzz.js rename to docs/app/HarfBuzz.js diff --git a/app/OpenType.js b/docs/app/OpenType.js similarity index 100% rename from app/OpenType.js rename to docs/app/OpenType.js diff --git a/app/ServiceWorker.js b/docs/app/ServiceWorker.js similarity index 100% rename from app/ServiceWorker.js rename to docs/app/ServiceWorker.js diff --git a/app/TextView.js b/docs/app/TextView.js similarity index 100% rename from app/TextView.js rename to docs/app/TextView.js diff --git a/app/app.webmanifest b/docs/app/app.webmanifest similarity index 100% rename from app/app.webmanifest rename to docs/app/app.webmanifest diff --git a/docs/app/assets/fonts/Qahiri-Regular.ttf b/docs/app/assets/fonts/Qahiri-Regular.ttf new file mode 100644 index 0000000..39f96d9 Binary files /dev/null and b/docs/app/assets/fonts/Qahiri-Regular.ttf differ diff --git a/app/assets/images/app-icon.png b/docs/app/assets/images/app-icon.png similarity index 100% rename from app/assets/images/app-icon.png rename to docs/app/assets/images/app-icon.png diff --git a/app/assets/images/app-icon.svg b/docs/app/assets/images/app-icon.svg similarity index 100% rename from app/assets/images/app-icon.svg rename to docs/app/assets/images/app-icon.svg diff --git a/app/assets/images/clear.svg b/docs/app/assets/images/clear.svg similarity index 100% rename from app/assets/images/clear.svg rename to docs/app/assets/images/clear.svg diff --git a/app/assets/images/export.svg b/docs/app/assets/images/export.svg similarity index 100% rename from app/assets/images/export.svg rename to docs/app/assets/images/export.svg diff --git a/app/assets/images/onum.svg b/docs/app/assets/images/onum.svg similarity index 100% rename from app/assets/images/onum.svg rename to docs/app/assets/images/onum.svg diff --git a/app/assets/images/open.svg b/docs/app/assets/images/open.svg similarity index 100% rename from app/assets/images/open.svg rename to docs/app/assets/images/open.svg diff --git a/app/assets/images/remove-dots.svg b/docs/app/assets/images/remove-dots.svg similarity index 100% rename from app/assets/images/remove-dots.svg rename to docs/app/assets/images/remove-dots.svg diff --git a/app/assets/images/round-dots.svg b/docs/app/assets/images/round-dots.svg similarity index 100% rename from app/assets/images/round-dots.svg rename to docs/app/assets/images/round-dots.svg diff --git a/app/assets/images/save.svg b/docs/app/assets/images/save.svg similarity index 100% rename from app/assets/images/save.svg rename to docs/app/assets/images/save.svg diff --git a/app/hb.js b/docs/app/hb.js similarity index 100% rename from app/hb.js rename to docs/app/hb.js diff --git a/app/hb.wasm b/docs/app/hb.wasm similarity index 100% rename from app/hb.wasm rename to docs/app/hb.wasm diff --git a/app/index.css b/docs/app/index.css similarity index 100% rename from app/index.css rename to docs/app/index.css diff --git a/app/index.html b/docs/app/index.html similarity index 100% rename from app/index.html rename to docs/app/index.html diff --git a/app/index.js b/docs/app/index.js similarity index 100% rename from app/index.js rename to docs/app/index.js diff --git a/app/override.css b/docs/app/override.css similarity index 100% rename from app/override.css rename to docs/app/override.css diff --git a/arabic.md b/docs/arabic.md similarity index 98% rename from arabic.md rename to docs/arabic.md index c1571da..697dd59 100644 --- a/arabic.md +++ b/docs/arabic.md @@ -1,6 +1,9 @@ --- -layout: arabic title: قاهري +description: خط كوفي مصحفي +layout: default +language: ar +direction: rtl --- «قاهري» هو خط حاسوبي [كوفي] مبني على القاعدة الحديثة لخط كوفي المصاحف التي diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss new file mode 100644 index 0000000..1d5006a --- /dev/null +++ b/docs/assets/css/style.scss @@ -0,0 +1,336 @@ +--- +--- + +@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,700;1,400;1,700&display=block'); +@import url('https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@700&display=block'); +@import url('https://fonts.googleapis.com/css2?family=Inconsolata&display=block'); + +@font-face { + font-family: "Raqq"; + src: url("{{ "/assets/fonts/Raqq.woff2" | relative_url }}"); + font-weight: 400; +} + +@font-feature-values "Raqq" { + @stylistic { alt-one: 1; alt-two: 2; } + @styleset { dotless: 1; } +} + +@font-face { + font-family: "Qahiri"; + src: url("{{ "/assets/fonts/Qahiri-Regular.woff2" | relative_url }}"); + font-weight: 400; +} + +@font-feature-values "Qahiri" { + @stylistic { alt-six: 6; } +} + +@font-face { + font-family: "Amiri"; + src: url("{{ "/assets/fonts/Amiri-Regular.woff2" | relative_url }}"); + font-weight: 400; +} + +:root { + --kufi-family: "Raqq", serif; + --kufi-color: #DFDFDF; + --title-family: "Qahiri", serif; + --main-family: "Amiri", serif; + --heading-family: "Reem Kufi", sans-serif; + --h1-font-size: 40px; + --latin-font: "DM Sans", "Amiri", sans-serif; +} + +:lang(en-US) { + --main-family: var(--latin-font); + --heading-family: var(--latin-font); + --h1-font-size: 1.5em; +} + +body * { + font-palette: dark; +} + +body { + font-family: var(--main-family); + font-size: 14pt; + font-weight: 400; + font-variant-numeric: proportional-nums; + background-color: black; + color: lightgray; + max-width: 1240px; + padding: 0 15px; + margin: 50px auto; + display: grid; + grid-template-columns: 1fr 700px 1fr; + grid-template-rows: auto auto auto; + justify-content: space-between; + grid-template-areas: + "header title title" + "header section footer"; + gap: 15px; +} + +.lang-switcher-top { grid-area: lang-switcher; } +header { grid-area: header; } +#title { grid-area: title; } +section { grid-area: section; } +footer { grid-area: footer; } + +h1, h2, h3, h4, h5, h6 { + font-family: var(--heading-family); + margin-block-start: 20px; + margin-block-end: 5px; + color: var(--kufi-color); +} + +h1, h2, h3 { + line-height: 1.4; +} + +h1 { + font-size: var(--h1-font-size); +} + +p { + text-align: justify; + line-height: normal; + hyphens: auto; + -webkit-hyphens: auto; +} + +a { + color: #267CB9; + text-decoration: none; +} + +blockquote { + margin: 0; + container-type: inline-size; +} + +blockquote p { + text-align: center; +} + +blockquote.kufi p, +blockquote.كوفي p { + font-size: 8cqw; + direction: rtl; + font-weight: normal; +} + +blockquote.big p, +blockquote.كبير p { + margin-block-start: 0px; + margin-block-end: .4em; +} + +code { + font-family: "Inconsolata", monospace; +} + +img { + max-width: 100%; +} + +#sitedesigner { + font-size: 60%; + color: grey; +} + +header p { + text-align: start; + margin-block-end: 20%; +} + +#logo { + font-family: var(--kufi-family); + color: var(--kufi-color); + font-size: 55pt; + margin-block-end: 5%; + margin-block-start: 0; +} + +#title { + font-size: 95pt; + font-weight: normal; + font-variant-alternates: stylistic(alt-six); + text-align-last: justify; + font-family: var(--title-family); + margin: 0; + color: var(--kufi-color); +} + +footer { + align-self: start; + position: sticky; + top: 0; +} + +footer p { + text-align: center; + margin-block-end: 20%; +} + +.downloads { + background: #f4f4f4; + border-radius: 35px; + border: 1px solid #e0e0e0; +} + +.downloads a { + line-height: 200%; + font-size: 120%; + color: #676767; + text-align: center; +} + +.lang-switcher-side { + font-size: 120%; +} + +.lang-switcher-top { + grid-area: lang-switcher; + text-align: center; + display: none; +} + +.lang-switcher-side, +.lang-switcher-top { + font-family: var(--latin-font); +} + +.kufi p, .كوفي p { + font-family: var(--kufi-family); + color: var(--kufi-color); +} + +@media print, screen and (max-width: 1280px) { + #title { + font-size: 10vw; + font-variation-settings: "SPAC" -100; + } +} + +@media print, screen and (max-width: 1100px) { + body { + grid-template-columns: auto; + max-width: 700px; + padding: 0 20px; + grid-template-areas: + "lang-switcher" + "title" + "section" + "footer" + "header" + ; + } + + .lang-switcher-top { + display: revert; + } + + .lang-switcher-side { + display: none; + } + + header { + border-block-start: 1px solid #e5e5e5; + border-width: 1px 0; + } + + header, header p { + text-align: center; + } + + header p, footer p { + margin-block-end: 10%; + margin-block-end: 10%; + } + + header, footer { + padding: revert; + margin: revert; + padding-block-start: 20px; + border-block-start: 1px solid #e5e5e5; + border-width: 1px 0; + } + + footer { + align-self: revert; + position: revert; + top: revert; + } + + #title { + text-align: center; + text-align-last: center; + font-size: 15vi; + } + + blockquote p { + margin-block-start: .2em; + margin-block-end: .6em; + } +} + +@media print, screen and (max-width: 700px) { + section > p:lang(en-US) { + text-align: start; + hyphens: revert; + -webkit-hyphens: revert; + } +} + +@media print { + body { + background-color: revert; + grid-template-columns: auto; + max-width: 100%; + padding: 0 8%; + grid-template-areas: + "title" + "section" + "footer" + "header" + ; + } + + body * { + font-palette: light; + } + + body, + .kufi p, .كوفي p, + h1, h2, h3, h4, h5, h6, + #title, + #logo { + color: revert; + } + + section { + break-after: page; + } + + h1, h2, h3, h4, h5, h6, + blockquote { + break-after: avoid-page; + } + + blockquote.kufi { + break-after: default; + } + + footer { + border: none; + } + + .lang-switcher-top, + .lang-switcher-side, + #sitedesigner { + display: none; + } + +} diff --git a/docs/assets/fonts/Amiri-Regular.woff2 b/docs/assets/fonts/Amiri-Regular.woff2 new file mode 100644 index 0000000..8a2e5cf Binary files /dev/null and b/docs/assets/fonts/Amiri-Regular.woff2 differ diff --git a/docs/assets/fonts/Qahiri-Regular.woff2 b/docs/assets/fonts/Qahiri-Regular.woff2 new file mode 100644 index 0000000..c8c5f89 Binary files /dev/null and b/docs/assets/fonts/Qahiri-Regular.woff2 differ diff --git a/docs/assets/fonts/Raqq.woff2 b/docs/assets/fonts/Raqq.woff2 new file mode 100644 index 0000000..804fa83 Binary files /dev/null and b/docs/assets/fonts/Raqq.woff2 differ diff --git a/docs/assets/images/favicon.svg b/docs/assets/images/favicon.svg new file mode 100644 index 0000000..c038145 --- /dev/null +++ b/docs/assets/images/favicon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/install-android-1-ar.png b/docs/assets/images/install-android-1-ar.png similarity index 100% rename from assets/images/install-android-1-ar.png rename to docs/assets/images/install-android-1-ar.png diff --git a/assets/images/install-android-1-en.png b/docs/assets/images/install-android-1-en.png similarity index 100% rename from assets/images/install-android-1-en.png rename to docs/assets/images/install-android-1-en.png diff --git a/assets/images/install-android-2-ar.png b/docs/assets/images/install-android-2-ar.png similarity index 100% rename from assets/images/install-android-2-ar.png rename to docs/assets/images/install-android-2-ar.png diff --git a/assets/images/install-android-2-en.png b/docs/assets/images/install-android-2-en.png similarity index 100% rename from assets/images/install-android-2-en.png rename to docs/assets/images/install-android-2-en.png diff --git a/assets/images/install-ios-1-ar.png b/docs/assets/images/install-ios-1-ar.png similarity index 100% rename from assets/images/install-ios-1-ar.png rename to docs/assets/images/install-ios-1-ar.png diff --git a/assets/images/install-ios-1-en.png b/docs/assets/images/install-ios-1-en.png similarity index 100% rename from assets/images/install-ios-1-en.png rename to docs/assets/images/install-ios-1-en.png diff --git a/assets/images/install-ios-2-ar.png b/docs/assets/images/install-ios-2-ar.png similarity index 100% rename from assets/images/install-ios-2-ar.png rename to docs/assets/images/install-ios-2-ar.png diff --git a/assets/images/install-ios-2-en.png b/docs/assets/images/install-ios-2-en.png similarity index 100% rename from assets/images/install-ios-2-en.png rename to docs/assets/images/install-ios-2-en.png diff --git a/assets/images/screenshot-clash.png b/docs/assets/images/screenshot-clash.png similarity index 100% rename from assets/images/screenshot-clash.png rename to docs/assets/images/screenshot-clash.png diff --git a/assets/images/screenshot-dotless.png b/docs/assets/images/screenshot-dotless.png similarity index 100% rename from assets/images/screenshot-dotless.png rename to docs/assets/images/screenshot-dotless.png diff --git a/assets/images/screenshot-rounded-dots.png b/docs/assets/images/screenshot-rounded-dots.png similarity index 100% rename from assets/images/screenshot-rounded-dots.png rename to docs/assets/images/screenshot-rounded-dots.png diff --git a/assets/images/screenshot-spacing.png b/docs/assets/images/screenshot-spacing.png similarity index 100% rename from assets/images/screenshot-spacing.png rename to docs/assets/images/screenshot-spacing.png diff --git a/assets/images/screenshot.png b/docs/assets/images/screenshot.png similarity index 100% rename from assets/images/screenshot.png rename to docs/assets/images/screenshot.png diff --git a/README.md b/docs/index.md similarity index 97% rename from README.md rename to docs/index.md index c5b2e6b..f05d7ea 100644 --- a/README.md +++ b/docs/index.md @@ -1,3 +1,10 @@ +--- +title: Qahiri +description: A manuscript Kufic typeface +layout: default +language: en-US +direction: ltr +--- _Qahiri_ is a [Kufic][1] typeface based on the modernized and regularized old manuscript Kufic calligraphy style of the late master of Arabic calligraphy [_Mohammad Abdul Qadir_][2]. diff --git a/requirements.in b/requirements.in index e340618..8110de4 100644 --- a/requirements.in +++ b/requirements.in @@ -1,3 +1,3 @@ -fonttools +fonttools[woff] glyphsLib skia-pathops diff --git a/requirements.txt b/requirements.txt index c7f1a3c..8e1d9ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,9 @@ appdirs==1.4.4 # via fs attrs==23.1.0 # via ufolib2 -fonttools[ufo,unicode]==4.40.0 +brotli==1.1.0 + # via fonttools +fonttools[ufo,unicode,woff]==4.40.0 # via # -r requirements.in # glyphslib @@ -27,6 +29,8 @@ ufolib2==0.14.0 # via glyphslib unicodedata2==15.0.0 # via fonttools +zopfli==0.2.2 + # via fonttools # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/scripts/buildwoff2.py b/scripts/buildwoff2.py new file mode 100644 index 0000000..6007ba0 --- /dev/null +++ b/scripts/buildwoff2.py @@ -0,0 +1,31 @@ +from fontTools.ttLib import TTFont +from fontTools.ttLib.woff2 import WOFF2FlavorData + + +def compress(args): + font = TTFont(args.input, recalcBBoxes=False, recalcTimestamp=False) + font.flavor = "woff2" + + if "SVG " in font: + del font["SVG "] + + font.flavorData = WOFF2FlavorData( + data=font.flavorData, transformedTables=["glyf", "loca"] + ) + + font.save(args.output, reorderTables=False) + + +def main(): + import argparse + from pathlib import Path + + parser = argparse.ArgumentParser(description="Build Raqq WOFF2 font.") + parser.add_argument("input", help="input TTF file", type=Path) + parser.add_argument("output", help="output WOFF2 file", type=Path) + args = parser.parse_args() + + compress(args) + + +main()