diff options
author | hrs <hrs@FreeBSD.org> | 2008-05-13 01:18:47 +0800 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2008-05-13 01:18:47 +0800 |
commit | d931d865919268a1bfccc1265cc99cff27b41c8e (patch) | |
tree | 325c0410024a56b90e474240b22725c1b00e9d9a /japanese/font-kochi/files/pkg-install.in | |
parent | ae4e095141e5f070809c31970b52ce39969136bb (diff) | |
download | freebsd-ports-gnome-d931d865919268a1bfccc1265cc99cff27b41c8e.tar.gz freebsd-ports-gnome-d931d865919268a1bfccc1265cc99cff27b41c8e.tar.zst freebsd-ports-gnome-d931d865919268a1bfccc1265cc99cff27b41c8e.zip |
- Add fontconfig support.
- Clean up fonts.dir handling.
- Use $PORTDOCS.
- Take maintainership.
Diffstat (limited to 'japanese/font-kochi/files/pkg-install.in')
-rw-r--r-- | japanese/font-kochi/files/pkg-install.in | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/japanese/font-kochi/files/pkg-install.in b/japanese/font-kochi/files/pkg-install.in new file mode 100644 index 000000000000..fd308536c8bd --- /dev/null +++ b/japanese/font-kochi/files/pkg-install.in @@ -0,0 +1,94 @@ +#!/bin/sh +# $FreeBSD$ + +X_FONTSDIR=%%X_FONTSDIR%%/TrueType + +catfontsdir () +{ + while read _IN + do + case "${_IN}" in + *-kochi-*|[0-9]*|"") ;; + *-aliastt-*|[0-9]*|"") ;; + *) echo ${_IN} ;; + esac + done +} + +ROMA="" +BOLD="ds=y" +ITAL="ai=0.15" +OBLI="ai=0.15" +RITA="ai=0.08" +ROBL="ai=0.08" + +make_xlfd() +{ + _enc=$1 + _file=$2 + _vendor=$3 + _fname=$4 + _poc=$5 + + case "${_poc}:${_enc}" in + p:jisx0201.1976-*) PFIX="fp=y:bw=0.5" ;; + c:jisx0201.1976-*) PFIX="fp=n:bw=0.5" ;; + p:*) PFIX="fp=y" ;; + c:*) PFIX="fp=n" ;; + esac + + set -- "${ROMA}" medium-r \ + ${BOLD} bold-r \ + ${ITAL} medium-i \ + ${ITAL}:${BOLD} bold-i \ + ${OBLI} medium-o \ + ${OBLI}:${BOLD} bold-o \ + ${RITA} medium-ri \ + ${RITA}:${BOLD} bold-ri \ + ${ROBL} medium-ro \ + ${ROBL}:${BOLD} bold-ro + while [ $# != 0 ]; do + _prefix="${PFIX}:$1"; shift + _variant=$1; shift + printf "%s:%s -%s-%s-%s-normal--0-0-0-0-%s-0-%s\n" \ + $_prefix $_file $_vendor $_fname $_variant $_poc $_enc + done | sed -e 's,::,:,g' -e 's,^:,,' +} + +addentries () +{ + for ENC in iso8859-1 iso10646-1 jisx0201.1976-0 jisx0208.1983-0 jisx0208.1990-0 + do + make_xlfd $ENC kochi-mincho-subst.ttf kochi mincho c + make_xlfd $ENC kochi-mincho-subst.ttf kochi mincho p + make_xlfd $ENC kochi-mincho-subst.ttf aliastt mincho c + make_xlfd $ENC kochi-mincho-subst.ttf aliastt mincho p + make_xlfd $ENC kochi-gothic-subst.ttf kochi gothic c + make_xlfd $ENC kochi-gothic-subst.ttf kochi gothic p + make_xlfd $ENC kochi-gothic-subst.ttf aliastt gothic c + make_xlfd $ENC kochi-gothic-subst.ttf aliastt gothic p + done +} + +nfonts () +{ + _L=0; while read _IN; do _L=$((${_L}+1)); done; echo ${_L} +} + +case "$2" in +POST-INSTALL) + cd ${X_FONTSDIR} + touch fonts.dir + (catfontsdir < fonts.dir; addentries) > fonts.dir.tmp + nfonts < fonts.dir.tmp > fonts.dir + cat fonts.dir.tmp >> fonts.dir + rm -f fonts.dir.tmp + ;; +DEINSTALL) + cd ${X_FONTSDIR} + catfontsdir < fonts.dir > fonts.dir.tmp + nfonts < fonts.dir.tmp > fonts.dir + cat fonts.dir.tmp >> fonts.dir + rm -f fonts.dir.tmp + ;; +esac |