aboutsummaryrefslogtreecommitdiff
path: root/japanese/font-ipamjm
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2014-11-23 10:40:37 +0000
committerHiroki Sato <hrs@FreeBSD.org>2014-11-23 10:40:37 +0000
commit46891d102c8d4397063376e162106c13eb683364 (patch)
treeb5faefa1deb58dea5c2b8fe12baa632f33a200a5 /japanese/font-ipamjm
parentf72299bfdd2fd8617bd212e0681a72b3bf4393e8 (diff)
downloadports-46891d102c8d4397063376e162106c13eb683364.tar.gz
ports-46891d102c8d4397063376e162106c13eb683364.zip
Notes
Diffstat (limited to 'japanese/font-ipamjm')
-rw-r--r--japanese/font-ipamjm/Makefile64
-rw-r--r--japanese/font-ipamjm/distinfo2
-rw-r--r--japanese/font-ipamjm/files/20-unhint-ipamjm.conf15
-rw-r--r--japanese/font-ipamjm/files/62-fonts-ipamjm.conf11
-rw-r--r--japanese/font-ipamjm/files/pkg-install.in94
-rw-r--r--japanese/font-ipamjm/pkg-descr7
-rw-r--r--japanese/font-ipamjm/pkg-plist8
7 files changed, 201 insertions, 0 deletions
diff --git a/japanese/font-ipamjm/Makefile b/japanese/font-ipamjm/Makefile
new file mode 100644
index 000000000000..b0f00c9b7231
--- /dev/null
+++ b/japanese/font-ipamjm/Makefile
@@ -0,0 +1,64 @@
+# $FreeBSD$
+
+PORTNAME= ipamjm
+PORTVERSION= 00301
+CATEGORIES= japanese x11-fonts
+MASTER_SITES= http://dl.mojikiban.ipa.go.jp/IPAmjMincho/
+PKGNAMEPREFIX= ja-font-
+DISTNAME= ${PORTNAME}${PORTVERSION}
+
+MAINTAINER= hrs@FreeBSD.org
+COMMENT= IPAmj Mincho Japanese fonts
+
+LICENSE= IPAFLAv1
+LICENSE_NAME= IPA Font License Agreement v1.0
+LICENSE_FILE= ${WRKSRC}/IPA_Font_License_Agreement_v1.0.txt
+LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+RUN_DEPENDS= fc-cache:${PORTSDIR}/x11-fonts/fontconfig
+
+USES= zip
+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_${PORTNAME}003.01.txt
+
+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}/ipamjm.ttf ${STAGEDIR}${DATADIR}
+ ${MKDIR} ${STAGEDIR}${PREFIX}/${LOCAL_FONTSDIR}/OTF
+ cd ${STAGEDIR}${PREFIX}/${LOCAL_FONTSDIR}/OTF/ && ${LN} -s -f \
+ ../${LOCAL_FONTSDIR:C,[^/]+,..,g}/${DATADIR_REL}/ipamjm.ttf .
+ ${MKDIR} ${STAGEDIR}${PREFIX}/${X_FONTSDIR}/OTF
+ cd ${STAGEDIR}${PREFIX}/${X_FONTSDIR}/OTF/ && ${LN} -s -f \
+ ../${X_FONTSDIR:C,[^/]+,..,g}/${DATADIR_REL}/ipamjm.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
+.if ${PORT_OPTIONS:MDOCS}
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
+.endif
+
+post-su-install:
+ ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.mk>
diff --git a/japanese/font-ipamjm/distinfo b/japanese/font-ipamjm/distinfo
new file mode 100644
index 000000000000..8802353138a5
--- /dev/null
+++ b/japanese/font-ipamjm/distinfo
@@ -0,0 +1,2 @@
+SHA256 (ipamjm00301.zip) = 036929d12ea36dce50915b36a1a9c3f8983a87c585305eaac1888aaceba18d64
+SIZE (ipamjm00301.zip) = 31097786
diff --git a/japanese/font-ipamjm/files/20-unhint-ipamjm.conf b/japanese/font-ipamjm/files/20-unhint-ipamjm.conf
new file mode 100644
index 000000000000..947e845fa40b
--- /dev/null
+++ b/japanese/font-ipamjm/files/20-unhint-ipamjm.conf
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- $FreeBSD$ -->
+<fontconfig>
+ <match target="font">
+ <or>
+ <test name="family">
+ <string>IPAmjMincho</string>
+ </test>
+ </or>
+ <edit name="autohint">
+ <bool>false</bool>
+ </edit>
+ </match>
+</fontconfig>
diff --git a/japanese/font-ipamjm/files/62-fonts-ipamjm.conf b/japanese/font-ipamjm/files/62-fonts-ipamjm.conf
new file mode 100644
index 000000000000..c4b7c82c8501
--- /dev/null
+++ b/japanese/font-ipamjm/files/62-fonts-ipamjm.conf
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- $FreeBSD$ -->
+<fontconfig>
+ <alias>
+ <family>serif</family>
+ <prefer>
+ <family>IPAmjMincho</family>
+ </prefer>
+ </alias>
+</fontconfig>
diff --git a/japanese/font-ipamjm/files/pkg-install.in b/japanese/font-ipamjm/files/pkg-install.in
new file mode 100644
index 000000000000..57ce1a13d971
--- /dev/null
+++ b/japanese/font-ipamjm/files/pkg-install.in
@@ -0,0 +1,94 @@
+#!/bin/sh
+# $FreeBSD$
+
+X_FONTSDIR=%%X_FONTSDIR%%/OTF
+
+catfontsdir ()
+{
+ while read _IN
+ do
+ case "${_IN}" in
+ *-ipa-IPAmj*|[0-9]*|"") ;;
+ *-ipa-mjm*|[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 jisx0208.1997-0 jisx0213.2004-1
+ do
+ make_xlfd $ENC ipamjm.ttf ipa IPAmjMincho c
+ make_xlfd $ENC ipamjm.ttf ipa IPAmjMincho p
+ make_xlfd $ENC ipamjm.ttf ipa mjmincho c
+ make_xlfd $ENC ipamjm.ttf ipa mjmincho 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
+ ;;
+POST-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
+ rmdir ${X_FONTSDIR} > /dev/null 2>&1 || true
+ ;;
+esac
diff --git a/japanese/font-ipamjm/pkg-descr b/japanese/font-ipamjm/pkg-descr
new file mode 100644
index 000000000000..cd621a4b1872
--- /dev/null
+++ b/japanese/font-ipamjm/pkg-descr
@@ -0,0 +1,7 @@
+Japanese TrueType fonts distributed by Infomation-technology Promotion
+Agency (IPA) Japan.
+
+IPAmj Mincho is a font set which covers the entire range of Kanji characters
+used in names of Japanese people.
+
+WWW: http://mojikiban.ipa.go.jp/1300.html
diff --git a/japanese/font-ipamjm/pkg-plist b/japanese/font-ipamjm/pkg-plist
new file mode 100644
index 000000000000..65c39809e0eb
--- /dev/null
+++ b/japanese/font-ipamjm/pkg-plist
@@ -0,0 +1,8 @@
+%%DATADIR%%/ipamjm.ttf
+%%LOCAL_FONTSDIR%%/OTF/ipamjm.ttf
+etc/fonts/conf.avail/20-unhint-ipamjm.conf
+etc/fonts/conf.avail/62-fonts-ipamjm.conf
+etc/fonts/conf.d/20-unhint-ipamjm.conf
+etc/fonts/conf.d/62-fonts-ipamjm.conf
+%%X_FONTSDIR%%/OTF/ipamjm.ttf
+@fc %%X_FONTSDIR%%/OTF