diff options
-rw-r--r-- | japanese/Makefile | 1 | ||||
-rw-r--r-- | japanese/font-koruri/Makefile | 64 | ||||
-rw-r--r-- | japanese/font-koruri/distinfo | 2 | ||||
-rw-r--r-- | japanese/font-koruri/files/20-unhint-koruri.conf | 15 | ||||
-rw-r--r-- | japanese/font-koruri/files/62-fonts-koruri.conf | 17 | ||||
-rw-r--r-- | japanese/font-koruri/files/pkg-install.in | 98 | ||||
-rw-r--r-- | japanese/font-koruri/pkg-descr | 3 | ||||
-rw-r--r-- | japanese/font-koruri/pkg-plist | 27 |
8 files changed, 227 insertions, 0 deletions
diff --git a/japanese/Makefile b/japanese/Makefile index 519351e7b9d1..adf6e3707bb5 100644 --- a/japanese/Makefile +++ b/japanese/Makefile @@ -78,6 +78,7 @@ SUBDIR += font-ipaex SUBDIR += font-jisx0213 SUBDIR += font-kochi + SUBDIR += font-koruri SUBDIR += font-migmix SUBDIR += font-migu SUBDIR += font-mona-ipa diff --git a/japanese/font-koruri/Makefile b/japanese/font-koruri/Makefile new file mode 100644 index 000000000000..e52b69d0c4d7 --- /dev/null +++ b/japanese/font-koruri/Makefile @@ -0,0 +1,64 @@ +# Created by: Koichiro IWAO <meta+ports@vmeta.jp> +# $FreeBSD$ + +PORTNAME= koruri +PORTVERSION= 20131228 +CATEGORIES= japanese x11-fonts +MASTER_SITES= SFJP/koruri/60169 +PKGNAMEPREFIX= ja-font- +DISTNAME= Koruri-${PORTVERSION} + +MAINTAINER= meta+ports@vmeta.jp +COMMENT= Koruri Japanese TrueType fonts + +LICENSE= APACHE20 + +RUN_DEPENDS= fc-cache:${PORTSDIR}/x11-fonts/fontconfig + +USE_XZ= yes +NO_BUILD= yes +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} +DATADIR= ${PREFIX}/share/font-${PORTNAME} +PORTDOCS= README + +LOCAL_FONTSDIR= share/fonts +X_FONTSDIR= lib/X11/fonts + +OPTIONS_DEFINE= DOCS + +.include <bsd.port.options.mk> + +do-install: + ${MKDIR} ${STAGEDIR}${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/*.ttf ${STAGEDIR}${DATADIR} + ${MKDIR} ${STAGEDIR}${PREFIX}/${LOCAL_FONTSDIR}/TTF + cd ${STAGEDIR}${PREFIX}/${LOCAL_FONTSDIR}/TTF && ${LN} -s -f \ + ../${LOCAL_FONTSDIR:C,[^/]+,..,g}/${DATADIR_REL}/*.ttf . + ${MKDIR} ${STAGEDIR}${PREFIX}/${X_FONTSDIR}/TTF + cd ${STAGEDIR}${PREFIX}/${X_FONTSDIR}/TTF && ${LN} -s -f \ + ../${X_FONTSDIR:C,[^/]+,..,g}/${DATADIR_REL}/*.ttf . + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/fonts/conf.avail \ + ${STAGEDIR}${PREFIX}/etc/fonts/conf.d + ${INSTALL_DATA} ${FILESDIR}/20-unhint-${PORTNAME}.conf \ + ${FILESDIR}/62-fonts-${PORTNAME}.conf \ + ${STAGEDIR}${PREFIX}/etc/fonts/conf.avail + ${LN} -s -f ../conf.avail/20-unhint-${PORTNAME}.conf \ + ${STAGEDIR}${PREFIX}/etc/fonts/conf.d/20-unhint-${PORTNAME}.conf + ${LN} -s -f ../conf.avail/62-fonts-${PORTNAME}.conf \ + ${STAGEDIR}${PREFIX}/etc/fonts/conf.d/62-fonts-${PORTNAME}.conf + +post-su-install: + ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + +.if ${PORT_OPTIONS:MDOCS} +post-install: + ${MKDIR} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} +.endif + +.include <bsd.port.mk> diff --git a/japanese/font-koruri/distinfo b/japanese/font-koruri/distinfo new file mode 100644 index 000000000000..271939c785ae --- /dev/null +++ b/japanese/font-koruri/distinfo @@ -0,0 +1,2 @@ +SHA256 (Koruri-20131228.tar.xz) = 815c4f53ee63fda58c03b73fe6ed7101fe563477a8ff2e8a48ff8c11a20c8ecb +SIZE (Koruri-20131228.tar.xz) = 23724396 diff --git a/japanese/font-koruri/files/20-unhint-koruri.conf b/japanese/font-koruri/files/20-unhint-koruri.conf new file mode 100644 index 000000000000..c77098c9480f --- /dev/null +++ b/japanese/font-koruri/files/20-unhint-koruri.conf @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- $FreeBSD$ --> +<fontconfig> + <match target="font"> + <or> + <test name="family"> + <string>Koruri</string> + </test> + </or> + <edit name="autohint"> + <bool>false</bool> + </edit> + </match> +</fontconfig> diff --git a/japanese/font-koruri/files/62-fonts-koruri.conf b/japanese/font-koruri/files/62-fonts-koruri.conf new file mode 100644 index 000000000000..acb954f53094 --- /dev/null +++ b/japanese/font-koruri/files/62-fonts-koruri.conf @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- $FreeBSD$ --> +<fontconfig> + <alias> + <family>sans-serif</family> + <prefer> + <family>Koruri</family> + </prefer> + </alias> + <alias> + <family>monospace</family> + <prefer> + <family>Koruri</family> + </prefer> + </alias> +</fontconfig> diff --git a/japanese/font-koruri/files/pkg-install.in b/japanese/font-koruri/files/pkg-install.in new file mode 100644 index 000000000000..db0e7d1d2888 --- /dev/null +++ b/japanese/font-koruri/files/pkg-install.in @@ -0,0 +1,98 @@ +#!/bin/sh +# $FreeBSD$ + +X_FONTSDIR=%%X_FONTSDIR%%/TTF + +catfontsdir () +{ + while read _IN + do + case "${_IN}" in + *-koruri-*|[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="bw=0.5" ;; + c:jisx0201.1976-*) PFIX="bw=0.5" ;; + p:*) PFIX="" ;; + c:*) PFIX="" ;; + 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 Koruri-Bold.ttf koruri gothic p + make_xlfd $ENC Koruri-Bold.ttf koruri gothic c + make_xlfd $ENC Koruri-Extrabold.ttf koruri gothic p + make_xlfd $ENC Koruri-Extrabold.ttf koruri gothic c + make_xlfd $ENC Koruri-Light.ttf koruri gothic p + make_xlfd $ENC Koruri-Light.ttf koruri gothic c + make_xlfd $ENC Koruri-Semibold.ttf koruri gothic p + make_xlfd $ENC Koruri-Semibold.ttf koruri gothic c + make_xlfd $ENC Koruri.ttf koruri gothic p + make_xlfd $ENC Koruri.ttf koruri 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 + if [ -r fonts.dir -a `wc -l < fonts.dir` = 1 ]; then + rm -f fonts.dir + fi + ;; +esac diff --git a/japanese/font-koruri/pkg-descr b/japanese/font-koruri/pkg-descr new file mode 100644 index 000000000000..4d3444425514 --- /dev/null +++ b/japanese/font-koruri/pkg-descr @@ -0,0 +1,3 @@ +Koruri Japanese TrueType fonts. + +WWW: http://koruri.lindwurm.biz/ diff --git a/japanese/font-koruri/pkg-plist b/japanese/font-koruri/pkg-plist new file mode 100644 index 000000000000..19420c82a10d --- /dev/null +++ b/japanese/font-koruri/pkg-plist @@ -0,0 +1,27 @@ +%%DATADIR%%/Koruri-Bold.ttf +%%DATADIR%%/Koruri-Extrabold.ttf +%%DATADIR%%/Koruri-Light.ttf +%%DATADIR%%/Koruri-Semibold.ttf +%%DATADIR%%/Koruri.ttf +@dirrmtry %%DATADIR%% +%%LOCAL_FONTSDIR%%/TTF/Koruri-Bold.ttf +%%LOCAL_FONTSDIR%%/TTF/Koruri-Extrabold.ttf +%%LOCAL_FONTSDIR%%/TTF/Koruri-Light.ttf +%%LOCAL_FONTSDIR%%/TTF/Koruri-Semibold.ttf +%%LOCAL_FONTSDIR%%/TTF/Koruri.ttf +@dirrmtry %%LOCAL_FONTSDIR%%/TTF +@dirrmtry %%LOCAL_FONTSDIR%% +etc/fonts/conf.avail/20-unhint-koruri.conf +etc/fonts/conf.avail/62-fonts-koruri.conf +etc/fonts/conf.d/20-unhint-koruri.conf +etc/fonts/conf.d/62-fonts-koruri.conf +%%X_FONTSDIR%%/TTF/Koruri-Bold.ttf +%%X_FONTSDIR%%/TTF/Koruri-Extrabold.ttf +%%X_FONTSDIR%%/TTF/Koruri-Light.ttf +%%X_FONTSDIR%%/TTF/Koruri-Semibold.ttf +%%X_FONTSDIR%%/TTF/Koruri.ttf +@exec %%LOCALBASE%%/bin/fc-cache -s -f -v %D/%%X_FONTSDIR%%/TTF || true +@unexec %%LOCALBASE%%/bin/fc-cache -s -f -v %D/%%X_FONTSDIR%%/TTF || true +@unexec rm -f %D/%%X_FONTSDIR%%/TTF/fonts.cache-1 +@dirrmtry %%X_FONTSDIR%%/TTF +@unexec if [ -d %D/%%X_FONTSDIR%%/TTF ]; then %%LOCALBASE%%/bin/fc-cache -s -f -v %D/%%X_FONTSDIR%%/TTF || true; fi |