#!/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
