#!/usr/bin/env python3
# Copyright (c) 2026 iispig.com
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This program is free software; you can redistribute it and/or modify it under the terms of
# the GNU General Public License as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. It is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License (GPL-2.0.txt next to
# the published copy of this script) for more details.
"""Subset WenQuanYi Bitmap Song 12/14/16px to the characters the zh pages use.
Run from anywhere with the project venv (fontTools + brotli, pinned in
tools/requirements.txt):
.venv/bin/python tools/subset-wqy.py OUT_DIR [options]
Input characters
* every *.html under dist/bbs/ and dist/index.html (default; override with --html GLOB, repeatable):
text nodes; the attributes alt, placeholder and label (title and aria-label
are left out: the system draws tooltips in its own font, and nothing draws
aria-label);
every ; / og:* content; and the
non-ASCII characters (CSS and JS escapes decoded) of inline