#!/bin/sh

#DEBHELPER#

FONTS="09t@rk Aqu@rk EunBandal EunBangwool EunJin EunGuseul EunGuseulMono Eunhasu Ongdalsam"

if [ "$1" = "configure" ]; then
    for FONT in $FONTS; do 
        defoma-font purge truetype \
            /usr/share/fonts/truetype/alee/$FONT.ttf > /dev/null || true
    done
    if [ -x "/usr/bin/fc-cache" ]; then
        echo -n "Regenerating fonts cache... "
        rm -f /usr/share/fonts/truetype/alee/fonts.cache*
        if (fc-cache -v 1>/var/log/fontconfig.log 2>&1); then
            cd /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType && mkfontdir
            echo "done."
        else
            echo "failed; see /var/log/fontconfig.log for more information."
            exit 1
        fi
    fi
fi
