#!/bin/sh # updmap-otf: v0.9 # 27 May 2006 by KOBAYASHI R. Taizo v0.9 # use noEmbed.map instead of noEmbeddedFont.map # 10 Jun 2005 by KOBAYASHI R. Taizo v0.8 # modified to use updmap-sys in teTeX3 # 07 Nov 2004 by KOBAYASHI R. Taizo v0.7 # do not echo back the message of updmap. # 17 Oct 2004 by KOBAYASHI R. Taizo v0.6 # set hiragino map file if nofont is installed and arg is auto. # 04 Oct 2004 by KOBAYASHI R. Taizo v0.5 # handl standby map files more strictly # 20 Sep 2004 by KOBAYASHI R. Taizo v0.4 # hand over current status to map file installer # 19 Sep 2004 by KOBAYASHI R. Taizo v0.3 # handl *-udvips.map in TEXMF/dvipdfm/config/otf/ # 02 Mar 2004 by KOBAYASHI R. Taizo v0.2 # added noFont-udvips.map # 28 Feb 2004 by KOBAYASHI R. Taizo v0.1 PREFIX=/usr/local TEXMF=${PREFIX}/share/texmf FONTDIR=${TEXMF}/fonts/opentype MAPDIR=${TEXMF}/fonts/map/dvipdfm STATEDIR=${TEXMF}-var/updmap-otf export TEXMFSYSVAR=${TEXMF}-var export PATH=${PREFIX}/bin:${PATH} ### ### Usage ### Usage() { cat < /dev/null fi done } ### ### Setup Map files ### SetupMapFile() { CleanUp MAPFILE=otf-$1.map if [ -f ${MAPDIR}/${MAPFILE} ]; then touch ${STATEDIR}/otf-$1.map echo "Setting up ... $MAPFILE" ${PREFIX}/bin/updmap-sys --nostop --enable KanjiMap ${MAPFILE} 2> /dev/null else echo "NOT EXIST $MAPFILE" return -1 fi } ### ### MAIN ### main() { ${PREFIX}/bin/texhash 2> /dev/null CheckInstallFont if [ $# != 1 ] ; then eval Usage ${0##*/} return -1 fi case "$1" in hiragino) if [ "$HIRAGINO" = "installed" ]; then SetupMapFile hiraginox else main auto fi ;; morisawa) if [ "$MORISAWA" = "installed" ]; then SetupMapFile morisawax else main auto fi ;; kozuka) if [ "$KOZUKA" = "installed" ]; then SetupMapFile kozukax else main auto fi ;; nofont) SetupMapFile noEmbed ;; auto) GetStatus MAPFILE=${MAPDIR}/otf-$STATUS.map if [ -f $MAPFILE ] && [ "$STATUS" != "noEmbeddedFont" ]; then SetupMapFile $STATUS elif [ "$STATUS" = "morisawa" ] && [ "$MORISAWA" = "installed" ]; then SetupMapFile morisawax elif [ "$STATUS" = "kozuka" ] && [ "$KOZUKA" = "installed" ]; then SetupMapFile kozukax elif [ "$STATUS" = "noEmbed" ] && [ "$HIRAGINO" = "installed" ]; then SetupMapFile hiraginox elif [ "$HIRAGINO" = "installed" ]; then SetupMapFile hiraginox elif [ "$MORISAWA" = "installed" ]; then SetupMapFile morisawax elif [ "$KOZUKA" = "installed" ]; then SetupMapFile kozukax else SetupMapFile noEmbed fi ;; status) GetStatus return 0 ;; *) if [ -f ${MAPDIR}/otf-$1.map ]; then SetupMapFile $1 else eval Usage ${0##*/} return -1 fi ;; esac } main $@