retrotxt-fonts is a tool to dynamically generate the HTML and CSS in use by RetroTxt for The Oldschool PC fonts.
The tool requires Go and the RetroTxt repository.
# clone the repositories if they don't exist
git clone [email protected]:bengarrett/retrotxt-fonts.git
git clone [email protected]:bengarrett/RetroTxt.git
cd retrotxt-fonts
go run .
Afterwards, font.css
and fonts.html
will be saved.
It is a drop in replacement for RetroTxt/ext/css/fonts_ibm.css
It needs to be pasted into RetroTxt/ext/html/options.html
between the HTML comments...
<!-- automatic generation begin (00 XXX 00 00:00 +0000)-->
<!-- (00 XXX 00 00:00 +0000) automatic generation end -->
The process relies on Python 3 scripts and libraries that need to be installed.
# change directory to the font sources
cd RetroTxt/fonts
# unzip webfonts
unzip -j oldschool_pc_font_pack_v2.2_web.zip "woff - Web (webfonts)/*.woff" -d ../ext/fonts
# change directory to the extension fonts
cd RetroTxt/ext/fonts
# if missing, install python libraries
pip3 install fontTools[woff]
pip3 install Brotli
# convert woff fonts into better compressed woff2 format
python3 woff-to-woff2.py
# cleanup and remove woff fonts
python3 woff-cleanup.py