diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2008-05-25 07:10:33 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2008-05-25 07:10:33 +0000 |
commit | a64fc33a1916315f2dd54c87f5450020c7f30600 (patch) | |
tree | 0806769ff74f45ec7d103290a5bbfad82108ec33 /japanese/font-vlgothic | |
parent | b9966eafd775fe8fae7d4821b7054843f62f0d97 (diff) | |
download | ports-a64fc33a1916315f2dd54c87f5450020c7f30600.tar.gz ports-a64fc33a1916315f2dd54c87f5450020c7f30600.zip |
Notes
Diffstat (limited to 'japanese/font-vlgothic')
-rw-r--r-- | japanese/font-vlgothic/Makefile | 55 | ||||
-rw-r--r-- | japanese/font-vlgothic/files/20-unhint-vlgothic.conf | 14 | ||||
-rw-r--r-- | japanese/font-vlgothic/files/62-fonts-vlgothic.conf | 17 | ||||
-rw-r--r-- | japanese/font-vlgothic/files/63-vlgothic.conf | 17 | ||||
-rw-r--r-- | japanese/font-vlgothic/files/pkg-install.in | 87 | ||||
-rw-r--r-- | japanese/font-vlgothic/pkg-plist | 36 |
6 files changed, 170 insertions, 56 deletions
diff --git a/japanese/font-vlgothic/Makefile b/japanese/font-vlgothic/Makefile index cb3d0e2ef119..5179ec4938a3 100644 --- a/japanese/font-vlgothic/Makefile +++ b/japanese/font-vlgothic/Makefile @@ -7,46 +7,55 @@ PORTNAME= vlgothic PORTVERSION= 20080429 +PORTREVISION= 1 CATEGORIES= japanese x11-fonts MASTER_SITES= http://vinelinux.org/~daisuke/vlgothic/ DISTNAME= VLGothic-${PORTVERSION} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= hrs@FreeBSD.org COMMENT= Free Japanese TrueType fonts named 'VLGothic' -BUILD_DEPENDS= fc-cache:${PORTSDIR}/x11-fonts/fontconfig RUN_DEPENDS= fc-cache:${PORTSDIR}/x11-fonts/fontconfig -WRKSRC= ${WRKDIR}/VLGothic - USE_BZIP2= yes NO_BUILD= yes - -PLIST_SUB= FONTSDIR="${FONTSDIR_REL}" - -FONTSDIR= ${PREFIX}/lib/X11/fonts/vlgothic -FONTSDIR_REL= ${FONTSDIR:S,${PREFIX}/,,} - -TTF_FILES= VL-PGothic-Regular.ttf VL-Gothic-Regular.ttf -DOC_FILES= Changelog LICENSE LICENSE.en LICENSE_E.mplus LICENSE_J.mplus \ +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-install +SUB_FILES= pkg-install +SUB_LIST= X_FONTSDIR=${PREFIX}/${X_FONTSDIR} +PLIST_SUB= X_FONTSDIR=${X_FONTSDIR} \ + LOCAL_FONTSDIR=${LOCAL_FONTSDIR} +PORTDOCS= Changelog LICENSE LICENSE.en LICENSE_E.mplus LICENSE_J.mplus \ README README.sazanami README_J.mplus +WRKSRC= ${WRKDIR}/VLGothic + +LOCAL_FONTSDIR= share/fonts +X_FONTSDIR= lib/X11/fonts do-install: - @${MKDIR} ${FONTSDIR} -.for file in ${TTF_FILES} - ${INSTALL_DATA} ${WRKSRC}/${file} ${FONTSDIR} -.endfor - @${MKDIR} ${PREFIX}/etc/fonts/conf.d - ${INSTALL_DATA} ${FILESDIR}/63-vlgothic.conf \ - ${PREFIX}/etc/fonts/conf.d + ${MKDIR} ${DATADIR} + ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${WRKSRC} + ${INSTALL_DATA} ${WRKSRC}/*.ttf ${DATADIR} + ${MKDIR} ${PREFIX}/${LOCAL_FONTSDIR}/TrueType/ + ${LN} -s -f ${DATADIR}/*.ttf \ + ${LOCALBASE}/${LOCAL_FONTSDIR}/TrueType/ + ${MKDIR} ${LOCALBASE}/${X_FONTSDIR}/TrueType + ${LN} -s -f ${DATADIR}/*.ttf \ + ${LOCALBASE}/${X_FONTSDIR}/TrueType/ + ${INSTALL_DATA} ${FILESDIR}/20-unhint-vlgothic.conf \ + ${FILESDIR}/62-fonts-vlgothic.conf \ + ${PREFIX}/etc/fonts/conf.avail + ${LN} -s -f ../conf.avail/20-unhint-vlgothic.conf \ + ${PREFIX}/etc/fonts/conf.d/20-unhint-vlgothic.conf + ${LN} -s -f ../conf.avail/62-fonts-vlgothic.conf \ + ${PREFIX}/etc/fonts/conf.d/62-fonts-vlgothic.conf .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} -.for file in ${DOC_FILES} - ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} -.endfor + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} .endif post-install: - ${LOCALBASE}/bin/fc-cache -f -v ${FONTSDIR} + ${LOCALBASE}/bin/fc-cache -f -v ${LOCALBASE}/${X_FONTSDIR}/TrueType + ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include <bsd.port.mk> diff --git a/japanese/font-vlgothic/files/20-unhint-vlgothic.conf b/japanese/font-vlgothic/files/20-unhint-vlgothic.conf new file mode 100644 index 000000000000..30b3395591c7 --- /dev/null +++ b/japanese/font-vlgothic/files/20-unhint-vlgothic.conf @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- $FreeBSD$ --> +<fontconfig> + <match target="font"> + <test name="family"> + <string>VL Gothic</string> + <string>VL PGothic</string> + </test> + <edit name="autohint"> + <bool>false</bool> + </edit> + </match> +</fontconfig> diff --git a/japanese/font-vlgothic/files/62-fonts-vlgothic.conf b/japanese/font-vlgothic/files/62-fonts-vlgothic.conf new file mode 100644 index 000000000000..8ca1fbfeb94d --- /dev/null +++ b/japanese/font-vlgothic/files/62-fonts-vlgothic.conf @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- $FreeBSD$ --> +<fontconfig> + <alias> + <family>sans-serif</family> + <prefer> + <family>VL PGothic</family> + </prefer> + </alias> + <alias> + <family>monospace</family> + <prefer> + <family>VL Gothic</family> + </prefer> + </alias> +</fontconfig> diff --git a/japanese/font-vlgothic/files/63-vlgothic.conf b/japanese/font-vlgothic/files/63-vlgothic.conf deleted file mode 100644 index 114290b01f62..000000000000 --- a/japanese/font-vlgothic/files/63-vlgothic.conf +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> -<!-- $FreeBSD$ --> -<fontconfig> -<alias> -<family>sans-serif</family> -<prefer> -<family>VL PGothic</family> -</prefer> -</alias> -<alias> -<family>monospace</family> -<prefer> -<family>VL Gothic</family> -</prefer> -</alias> -</fontconfig> diff --git a/japanese/font-vlgothic/files/pkg-install.in b/japanese/font-vlgothic/files/pkg-install.in new file mode 100644 index 000000000000..d3a3e12482d1 --- /dev/null +++ b/japanese/font-vlgothic/files/pkg-install.in @@ -0,0 +1,87 @@ +#!/bin/sh +# $FreeBSD$ + +X_FONTSDIR=%%X_FONTSDIR%%/TrueType + +catfontsdir () +{ + while read _IN + do + case "${_IN}" in + *-vlgothic-*|[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 VL-PGothic-Regular.ttf vlgothic "VL_PGothic" p + make_xlfd $ENC VL-Gothic-Regular.ttf vlgothic "VL_Gothic" c + 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 diff --git a/japanese/font-vlgothic/pkg-plist b/japanese/font-vlgothic/pkg-plist index ad0db4bbea43..0274e6aa12cf 100644 --- a/japanese/font-vlgothic/pkg-plist +++ b/japanese/font-vlgothic/pkg-plist @@ -1,17 +1,21 @@ @comment $FreeBSD$ -etc/fonts/conf.d/63-vlgothic.conf -%%FONTSDIR%%/VL-PGothic-Regular.ttf -%%FONTSDIR%%/VL-Gothic-Regular.ttf -%%PORTDOCS%%%%DOCSDIR%%/Changelog -%%PORTDOCS%%%%DOCSDIR%%/LICENSE -%%PORTDOCS%%%%DOCSDIR%%/LICENSE.en -%%PORTDOCS%%%%DOCSDIR%%/LICENSE_E.mplus -%%PORTDOCS%%%%DOCSDIR%%/LICENSE_J.mplus -%%PORTDOCS%%%%DOCSDIR%%/README -%%PORTDOCS%%%%DOCSDIR%%/README.sazanami -%%PORTDOCS%%%%DOCSDIR%%/README_J.mplus -%%PORTDOCS%%@dirrm %%DOCSDIR%% -@exec %%LOCALBASE%%/bin/fc-cache -f -v %D/%%FONTSDIR%% || true -@unexec %%LOCALBASE%%/bin/fc-cache -f -v %D/%%FONTSDIR%% || true -@unexec [ -s %D/%%FONTSDIR%%/fonts.cache-1 ] || rm -f %D/%%FONTSDIR%%/fonts.cache-1 -@dirrmtry %%FONTSDIR%% +%%DATADIR%%/VL-PGothic-Regular.ttf +%%DATADIR%%/VL-Gothic-Regular.ttf +@dirrm %%DATADIR%% +%%LOCAL_FONTSDIR%%/TrueType/VL-PGothic-Regular.ttf +%%LOCAL_FONTSDIR%%/TrueType/VL-Gothic-Regular.ttf +@dirrmtry %%LOCAL_FONTSDIR%%/TrueType +@dirrmtry %%LOCAL_FONTSDIR%% +etc/fonts/conf.avail/20-unhint-vlgothic.conf +etc/fonts/conf.avail/62-fonts-vlgothic.conf +@exec ln -s -f ../conf.avail/20-unhint-vlgothic.conf %D/etc/fonts/conf.d/20-unhint-vlgothic.conf +@exec ln -s -f ../conf.avail/62-fonts-vlgothic.conf %D/etc/fonts/conf.d/62-fonts-vlgothic.conf +@unexec rm -f %D/etc/fonts/conf.d/20-unhint-vlgothic.conf +@unexec rm -f %D/etc/fonts/conf.d/62-fonts-vlgothic.conf +%%X_FONTSDIR%%/TrueType/VL-PGothic-Regular.ttf +%%X_FONTSDIR%%/TrueType/VL-Gothic-Regular.ttf +@exec %%LOCALBASE%%/bin/fc-cache -f -v %D/%%X_FONTSDIR%%/TrueType || true +@unexec %%LOCALBASE%%/bin/fc-cache -f -v %D/%%X_FONTSDIR%%/TrueType || true +@unexec rm -f %D/%%X_FONTSDIR%%/TrueType/fonts.cache-1 +@dirrmtry %%X_FONTSDIR%%/TrueType +@unexec if [ -d %D/%%X_FONTSDIR%%/TrueType ]; then %%LOCALBASE%%/bin/fc-cache -f -v %D/%%X_FONTSDIR%%/TrueType || true; fi |