Add font import for Now, Gotham and Open Sauce One overrides; package fonts for Void

Font import:
- Migration M6 adds user_fonts; files are stored content-addressed under
  the local data dir. New Rust commands inspect, import, list, read and
  remove fonts, refusing WOFF2, collections, variable fonts and
  restricted fsType, and unpacking WOFF1 to plain sfnt.
- Imported fonts register in the render worker as user:<Face> families
  with an italic alias, and are pinned in the frozen render prefs so
  issued invoices can still re-render. Fonts referenced by issued
  invoices are hidden, never deleted.
- Size and tracking compensations tuned for the substitutes apply only
  while the face is not overridden; default output and fingerprint
  goldens are unchanged.
- Settings gets a Fonts section with a licence acknowledgement.

Void packaging:
- Install fonts to /usr/share/fonts/voiced with per-family OFL licences,
  set font_dirs, and add INSTALL/REMOVE scripts that run fc-cache.
  xbps-create carries both scripts (verified in a void-glibc container).
- Fix xbps-create dependency specs in build-xbps.sh.
This commit is contained in:
2026-10-04 13:58:06 +05:30
parent d955130cf3
commit 43afdaf4bf
37 changed files with 2436 additions and 72 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
# xbps action script for 'voiced': $1 = action, $2 = pkgname, $3 = version.
#
# Rebuilds the fontconfig cache for the bundled fonts after install and upgrade.
# The stock x11-fonts trigger (enabled by font_dirs) only runs fc-cache when
# mkfontdir and mkfontscale are installed, so it is not relied on here.
# Never fails the transaction: a missing fc-cache or a cache error is ignored.
case "$1" in
post)
if command -v fc-cache >/dev/null 2>&1; then
fc-cache -f /usr/share/fonts/voiced >/dev/null 2>&1 || :
fi
;;
esac
exit 0
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
# xbps action script for 'voiced': $1 = action, $2 = pkgname, $3 = version.
#
# Refreshes the fontconfig cache after the bundled fonts are removed, so stale
# entries for /usr/share/fonts/voiced do not linger.
# Never fails the transaction: a missing fc-cache or a cache error is ignored.
case "$1" in
post)
if command -v fc-cache >/dev/null 2>&1; then
fc-cache -f /usr/share/fonts/voiced >/dev/null 2>&1 || :
fi
;;
esac
exit 0
+22 -1
View File
@@ -54,6 +54,27 @@ install_icon src-tauri/icons/icon.png 512x512
install -Dm644 README.md "$STAGE/usr/share/doc/voiced/README.md"
# Bundled fonts: one subdirectory per family under /usr/share/fonts/voiced, plus
# each family's OFL text. Only *.ttf files are installed (not manifest.json, and
# not the legacy woff/woff2 files that sit directly in public/fonts).
for dir in public/fonts/*/; do
family="$(basename "$dir")"
for ttf in "$dir"*.ttf; do
install -Dm644 "$ttf" "$STAGE/usr/share/fonts/voiced/$family/$(basename "$ttf")"
done
install -Dm644 "${dir}OFL.txt" "$STAGE/usr/share/licenses/voiced/${family}-OFL.txt"
done
# xbps action scripts. xbps-create packs INSTALL and REMOVE found at the root of
# the destdir into the archive (verified: they appear as ./INSTALL and ./REMOVE
# members and are excluded from files.plist), and xbps runs them with $1 set to
# the action. They refresh the fontconfig cache for /usr/share/fonts/voiced.
# Fallback if a future xbps-create stops carrying them: font cache refresh would
# then rely on fontconfig regenerating its cache on first use, or on the xbps-src
# template (which uses the same scripts).
install -Dm755 packaging/void/INSTALL "$STAGE/INSTALL"
install -Dm755 packaging/void/REMOVE "$STAGE/REMOVE"
echo "==> Creating $PKGVER.$ARCH.xbps"
# Kept outside Vite's `dist/` output directory, which is wiped on every build.
OUT="$ROOT/build/void"
@@ -71,7 +92,7 @@ mkdir -p "$REPO"
-l "proprietary" \
-H "https://git.bongbetic.com/xavierk/Voiced" \
-m "Xavier Karma <xavier@bongbetic.com>" \
-D "libwebkit2gtk41>=2.50_1 fontconfig xdg-utils hicolor-icon-theme desktop-file-utils" \
-D "libwebkit2gtk41>=2.50_1 fontconfig>=0 xdg-utils>=0 hicolor-icon-theme>=0 desktop-file-utils>=0" \
-t "office finance" \
--compression zstd \
"$STAGE"
+23 -1
View File
@@ -3,7 +3,9 @@
# Canonical Void Linux package definition, to be built with xbps-src from a
# void-packages checkout:
#
# cp -r packaging/void/template void-packages/srcpkgs/voiced/template
# mkdir -p void-packages/srcpkgs/voiced
# cp packaging/void/template packaging/void/INSTALL packaging/void/REMOVE \
# void-packages/srcpkgs/voiced/
# cd void-packages && ./xbps-src pkg voiced
#
# Notes:
@@ -12,6 +14,13 @@
# tarball, mirror it, or drop the sources into the xbps-src masterdir.
# * `checksum=SKIP` avoids pinning a hash that cannot be computed here; replace
# it with the real sha256 once the tarball is published.
# * INSTALL and REMOVE (next to this file) are xbps action scripts that run
# `fc-cache -f /usr/share/fonts/voiced` after install and removal. xbps-src
# picks them up automatically from srcpkgs/voiced/INSTALL and
# srcpkgs/voiced/REMOVE and packs them into the package; the template does
# not install them. Copy them next to the template (see the commands above).
# The stock x11-fonts trigger enabled by font_dirs does not run fc-cache
# unless mkfontdir and mkfontscale are installed, hence these scripts.
# * If the build machine is offline, pre-populate the npm cache and Cargo
# registry in the masterdir before building.
#
@@ -29,6 +38,9 @@ homepage="https://git.bongbetic.com/xavierk/Voiced"
distfiles="https://git.bongbetic.com/xavierk/Voiced/archive/v${version}.tar.gz"
checksum=SKIP
compression="zstd"
# Fonts install under a voiced/ subdirectory so they never conflict with the
# files of Void's own font-ibm-plex-ttf and noto-fonts-ttf packages.
font_dirs="/usr/share/fonts/voiced"
do_build() {
npm install --include=dev --no-audit --no-fund
@@ -51,4 +63,14 @@ do_install() {
vinstall "${wrksrc}/src-tauri/icons/icon.png" 644 \
usr/share/icons/hicolor/512x512/apps voiced.png
vdoc "${wrksrc}/README.md"
# Bundled fonts: one subdirectory per family, plus its OFL text.
# manifest.json and any other non-font file are deliberately skipped.
for dir in "${wrksrc}"/public/fonts/*/; do
family="$(basename "${dir}")"
for ttf in "${dir}"*.ttf; do
vinstall "${ttf}" 644 "usr/share/fonts/voiced/${family}"
done
vlicense "${dir}OFL.txt" "${family}-OFL.txt"
done
}