Add japanese/font-ipaex, new font series based on IPA fonts which contain

fixed-width Japanese and proportional Latin alphabets for
Japanese traditional printing convention.

Feature safe:	yes
This commit is contained in:
Hiroki Sato 2010-03-02 04:58:08 +00:00
parent 40d3951c8e
commit 0797a18a22
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=250488
8 changed files with 226 additions and 0 deletions

View File

@ -76,6 +76,7 @@
SUBDIR += foldoc-fpw
SUBDIR += font-ipa
SUBDIR += font-ipa-uigothic
SUBDIR += font-ipaex
SUBDIR += font-kochi
SUBDIR += font-mona-ipa
SUBDIR += font-mplus

View File

@ -0,0 +1,62 @@
# New ports collection makefile for: font-ipaex
# Date created: 2 March 2010
# Whom: hrs
# $FreeBSD$
#
PORTNAME= font-ipaex
PORTVERSION= 00101
CATEGORIES= japanese x11-fonts
MASTER_SITES= http://info.openlab.ipa.go.jp/ipafont/fontdata/
DISTNAME= IPAexfont${PORTVERSION}
MAINTAINER= hrs@FreeBSD.org
COMMENT= IPAex Japanese fonts
RUN_DEPENDS= fc-cache:${PORTSDIR}/x11-fonts/fontconfig
USE_ZIP= 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}
PORTDOCS= IPA_Font_License_Agreement_v1.0.txt \
Readme_IPAexfont${PORTVERSION}.txt
LOCAL_FONTSDIR= share/fonts
X_FONTSDIR= lib/X11/fonts
post-extract:
cd ${WRKSRC} && for F in *.ttf; do ${MV} $${F} $${F%.ttf}.otf; done
do-install:
${MKDIR} ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/*.otf ${DATADIR}
${MKDIR} ${PREFIX}/${LOCAL_FONTSDIR}/OTF
${LN} -s -f \
${DATADIR}/ipaex*.otf \
${LOCALBASE}/${LOCAL_FONTSDIR}/OTF/
${MKDIR} ${LOCALBASE}/${X_FONTSDIR}/OTF
${LN} -s -f \
${DATADIR}/ipaex*.otf \
${LOCALBASE}/${X_FONTSDIR}/OTF/
${INSTALL_DATA} ${FILESDIR}/20-unhint-ipaex.conf \
${FILESDIR}/62-fonts-ipaex.conf \
${PREFIX}/etc/fonts/conf.avail
${LN} -s -f ../conf.avail/20-unhint-ipaex.conf \
${PREFIX}/etc/fonts/conf.d/20-unhint-ipaex.conf
${LN} -s -f ../conf.avail/62-fonts-ipaex.conf \
${PREFIX}/etc/fonts/conf.d/62-fonts-ipaex.conf
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
post-install:
${LOCALBASE}/bin/fc-cache -f -v ${LOCALBASE}/${X_FONTSDIR}/OTF
${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
MD5 (IPAexfont00101.zip) = 5a1ec489515c9ee99151fad15cfb796f
SHA256 (IPAexfont00101.zip) = 62847ae2d1a4510f8e2e8e2110e51822b087e5b2db2069440a5e2f57ef4dc2f9
SIZE (IPAexfont00101.zip) = 9655506

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- $FreeBSD$ -->
<fontconfig>
<match target="font">
<test name="family">
<string>IPAexMincho</string>
<string>IPAexGothic</string>
</test>
<edit name="autohint">
<bool>false</bool>
</edit>
</match>
</fontconfig>

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- $FreeBSD$ -->
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>IPAexMincho</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>IPAexGothic</family>
</prefer>
</alias>
</fontconfig>

View File

@ -0,0 +1,97 @@
#!/bin/sh
# $FreeBSD$
X_FONTSDIR=%%X_FONTSDIR%%/OTF
catfontsdir ()
{
while read _IN
do
case "${_IN}" in
*-ipa-IPAex*|*-ipa-ex*|[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 ipaexg.otf ipa IPAexGothic c
make_xlfd $ENC ipaexg.otf ipa IPAexGothic p
make_xlfd $ENC ipaexg.otf ipa exgothic c
make_xlfd $ENC ipaexg.otf ipa exgothic p
make_xlfd $ENC ipaexm.otf ipa IPAexMincho c
make_xlfd $ENC ipaexm.otf ipa IPAexMincho p
make_xlfd $ENC ipaexm.otf ipa exmincho c
make_xlfd $ENC ipaexm.otf ipa exmincho 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

View File

@ -0,0 +1,11 @@
Japanese TrueType fonts distributed by Infomation-technology Promotion
Agency (IPA) Japan.
IPAex Mincho, the integration of IPA Mincho and IPA P Mincho, and
IPAex Gothic, the integration of IPA Gothic and IPA P Gothic are newly
developed. This new font series is strictly following Japanese
printing font tradition, namely, Japanese characters (Kanji, Kana and
punctuation marks) are full width mono-space pitch, and Western
characters are proportional pitch.
WWW: http://ossipedia.ipa.go.jp/ipafont/index.html

View File

@ -0,0 +1,21 @@
@comment $FreeBSD$
%%DATADIR%%/ipaexg.otf
%%DATADIR%%/ipaexm.otf
@dirrm %%DATADIR%%
%%LOCAL_FONTSDIR%%/OTF/ipaexg.otf
%%LOCAL_FONTSDIR%%/OTF/ipaexm.otf
@dirrmtry %%LOCAL_FONTSDIR%%/OTF
@dirrmtry %%LOCAL_FONTSDIR%%
etc/fonts/conf.avail/20-unhint-ipaex.conf
etc/fonts/conf.avail/62-fonts-ipaex.conf
@exec ln -s -f ../conf.avail/20-unhint-ipaex.conf %D/etc/fonts/conf.d/20-unhint-ipaex.conf
@exec ln -s -f ../conf.avail/62-fonts-ipaex.conf %D/etc/fonts/conf.d/62-fonts-ipaex.conf
@unexec rm -f %D/etc/fonts/conf.d/20-unhint-ipaex.conf
@unexec rm -f %D/etc/fonts/conf.d/62-fonts-ipaex.conf
%%X_FONTSDIR%%/OTF/ipaexg.otf
%%X_FONTSDIR%%/OTF/ipaexm.otf
@exec %%LOCALBASE%%/bin/fc-cache -s -f -v %D/%%X_FONTSDIR%%/OTF || true
@unexec %%LOCALBASE%%/bin/fc-cache -s -f -v %D/%%X_FONTSDIR%%/OTF || true
@unexec rm -f %D/%%X_FONTSDIR%%/OTF/fonts.cache-1
@dirrmtry %%X_FONTSDIR%%/OTF
@unexec if [ -d %D/%%X_FONTSDIR%%/OTF ]; then %%LOCALBASE%%/bin/fc-cache -f -v %D/%%X_FONTSDIR%%/OTF || true; fi