diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2019-09-07 06:40:50 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2019-09-07 06:40:50 +0000 |
commit | 9665576959a38ebb213164e53a2e9c287ccf006d (patch) | |
tree | 8ef5a3c41eadcc702a5346346c30991798f898a5 /japanese/font-myricam | |
parent | 531e72dfadfe7fbfdf9bf176ea6ad2cb530d9f6d (diff) | |
download | freebsd-ports-9665576959a38ebb213164e53a2e9c287ccf006d.zip |
Add new ports -- Myrica free TrueType fonts for programming
Diffstat (limited to 'japanese/font-myricam')
-rw-r--r-- | japanese/font-myricam/Makefile | 45 | ||||
-rw-r--r-- | japanese/font-myricam/distinfo | 3 | ||||
-rw-r--r-- | japanese/font-myricam/files/20-unhint-myricam.conf | 19 | ||||
-rw-r--r-- | japanese/font-myricam/files/62-fonts-myricam.conf | 17 | ||||
-rw-r--r-- | japanese/font-myricam/files/pkg-install.in | 107 | ||||
-rw-r--r-- | japanese/font-myricam/pkg-descr | 3 | ||||
-rw-r--r-- | japanese/font-myricam/pkg-plist | 5 |
7 files changed, 199 insertions, 0 deletions
diff --git a/japanese/font-myricam/Makefile b/japanese/font-myricam/Makefile new file mode 100644 index 000000000000..806e2a4f4dcc --- /dev/null +++ b/japanese/font-myricam/Makefile @@ -0,0 +1,45 @@ +# $FreeBSD$ + +PORTNAME= myricam +PORTVERSION= 2.012.20180119 +#PORTREVISION= 0 +CATEGORIES= japanese x11-fonts +MASTER_SITES= https://github.com/tomokuni/Myrica/raw/master/product/ +PKGNAMEPREFIX= ja-font- +DISTNAME= MyricaM +DIST_SUBDIR= ${DISTNAME}-${PORTVERSION} + +MAINTAINER= ume@FreeBSD.org +COMMENT= Myrica free TrueType fonts for programming + +USES= fonts:fc 7z +FONTNAME= myricam +NO_WRKSUBDIR= yes +NO_ARCH= yes +NO_BUILD= yes +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-install +SUB_FILES= pkg-install +WRKSRC= ${WRKDIR}/${DISTNAME} +PORTDOCS= LICENSE_M+.txt LICENSE_OFL.txt README.md + +OPTIONS_DEFINE= DOCS + +do-install: + ${MKDIR} ${STAGEDIR}${FONTSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} *.TTC ${STAGEDIR}${FONTSDIR} + ${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-install-DOCS-on: + ${MKDIR} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} + +.include <bsd.port.mk> diff --git a/japanese/font-myricam/distinfo b/japanese/font-myricam/distinfo new file mode 100644 index 000000000000..807e2eee69f8 --- /dev/null +++ b/japanese/font-myricam/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1567834800 +SHA256 (MyricaM-2.012.20180119/MyricaM.7z) = 7b309919d0f5e51cb2d96dc13b94794efe39f2b2f4eae7a43d9404088ad2ddda +SIZE (MyricaM-2.012.20180119/MyricaM.7z) = 4394538 diff --git a/japanese/font-myricam/files/20-unhint-myricam.conf b/japanese/font-myricam/files/20-unhint-myricam.conf new file mode 100644 index 000000000000..0b8e46b7d95f --- /dev/null +++ b/japanese/font-myricam/files/20-unhint-myricam.conf @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- $FreeBSD$ --> +<fontconfig> + <match target="font"> + <test name="family"> + <string>MyricaM M</string> + </test> + <test name="family"> + <string>MyricaM N</string> + </test> + <test name="family"> + <string>MyricaM P</string> + </test> + <edit name="autohint"> + <bool>false</bool> + </edit> + </match> +</fontconfig> diff --git a/japanese/font-myricam/files/62-fonts-myricam.conf b/japanese/font-myricam/files/62-fonts-myricam.conf new file mode 100644 index 000000000000..9a995412f54e --- /dev/null +++ b/japanese/font-myricam/files/62-fonts-myricam.conf @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- $FreeBSD$ --> +<fontconfig> + <alias> + <family>sans-serif</family> + <prefer> + <family>MyricaM P</family> + </prefer> + </alias> + <alias> + <family>monospace</family> + <prefer> + <family>MyricaM M</family> + </prefer> + </alias> +</fontconfig> diff --git a/japanese/font-myricam/files/pkg-install.in b/japanese/font-myricam/files/pkg-install.in new file mode 100644 index 000000000000..964e1b27ee31 --- /dev/null +++ b/japanese/font-myricam/files/pkg-install.in @@ -0,0 +1,107 @@ +#!/bin/sh +# $FreeBSD$ + +catfontsdir() +{ + while read _IN + do + case "${_IN}" in + *-misc-myrica\ m-*|[0-9]*|"") ;; + *) echo ${_IN} ;; + esac + done +} + +ROMA="" +BOLD="ds=y" +RITA="ai=0.08" +ROBL="ai=0.08" + +make_xlfd() +{ + _enc=$1 + _file=$2 + _vendor=$3 + _fname=$4 + _poc=$5 + _weight=$6 + + case "${_poc}:${_enc}" in + p:jisx0201.1976-*) PFIX="bw=0.5" ;; + c:jisx0201.1976-*) PFIX="bw=0.5" ;; + p:*) PFIX="" ;; + c:*) PFIX="" ;; + esac + + set -- "" ${_weight}-r \ + ${RITA} ${_weight}-ri \ + ${ROBL} ${_weight}-ro + while [ $# != 0 ]; do + _prefix="${PFIX}:$1"; shift + _variant=$1; shift + [ ${index_type} = "scale" -a ${_prefix} != ":" ] && continue + 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,^:,,' + + _prefix="${PFIX}:" + [ ${index_type} = "scale" -a ${_prefix} != ":" ] && return + _file=$(echo $_file | sed -e 's,\.ttf$,Italic&,') + for _variant in ${_weight}-i ${_weight}-o; do + printf "%s:%s -%s-%s-%s-normal--0-0-0-0-%s-0-%s\n" \ + $_prefix $_file $_vendor "$_fname" $_variant $_poc $_enc + [ ${index_type} = "scale" ] && break + 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 MyricaM.TTC misc "myrica m" m medium + done +} + +nfonts() +{ + _L=0; while read _IN; do _L=$((${_L}+1)); done; echo ${_L} +} + +install_fontsdir() +{ + index_type=${1:-"dir"} + index="fonts.${index_type}" + tmpfile="${index}.tmp" + touch ${index} + (catfontsdir < ${index}; addentries ${index_type}) > ${tmpfile} + nfonts < ${tmpfile} > ${index} + cat ${tmpfile} >> ${index} + rm -f ${tmpfile} +} + +deinstall_fontsdir() +{ + index_type=${1:-"dir"} + index="fonts.${index_type}" + tmpfile="${index}.tmp" + catfontsdir < ${index} > ${tmpfile} + nfonts < ${tmpfile} > ${index} + cat ${tmpfile} >> ${index} + rm -f ${tmpfile} + if [ -r ${index} -a $(wc -l < ${index}) = 1 ]; then + rm -f ${index} + fi +} + +case "$2" in +POST-INSTALL) + cd %%FONTSDIR%% + install_fontsdir dir + install_fontsdir scale + ;; +POST-DEINSTALL) + cd %%FONTSDIR%% + deinstall_fontsdir dir + deinstall_fontsdir scale + ;; +esac diff --git a/japanese/font-myricam/pkg-descr b/japanese/font-myricam/pkg-descr new file mode 100644 index 000000000000..fa4eababc2e2 --- /dev/null +++ b/japanese/font-myricam/pkg-descr @@ -0,0 +1,3 @@ +Myrica is a free TrueType fonts for programming + +https://myrica.estable.jp/ diff --git a/japanese/font-myricam/pkg-plist b/japanese/font-myricam/pkg-plist new file mode 100644 index 000000000000..72873fee04da --- /dev/null +++ b/japanese/font-myricam/pkg-plist @@ -0,0 +1,5 @@ +etc/fonts/conf.avail/20-unhint-myricam.conf +etc/fonts/conf.avail/62-fonts-myricam.conf +etc/fonts/conf.d/20-unhint-myricam.conf +etc/fonts/conf.d/62-fonts-myricam.conf +%%FONTSDIR%%/MyricaM.TTC |