From 2497569155e63e39d9c9a2220406c8e15c688458 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Sun, 17 Nov 2019 08:05:03 +0000 Subject: [PATCH] New port japanese/font-hackgen HackGen is a composite font of Hack and GenJyuu-Gothic --- japanese/Makefile | 1 + japanese/font-hackgen/Makefile | 75 +++++++++++++ japanese/font-hackgen/distinfo | 3 + .../font-hackgen/files/20-unhint-hackgen.conf | 48 ++++++++ .../font-hackgen/files/62-fonts-hackgen.conf | 22 ++++ japanese/font-hackgen/files/pkg-install.in | 105 ++++++++++++++++++ japanese/font-hackgen/pkg-descr | 3 + japanese/font-hackgen/pkg-plist | 16 +++ 8 files changed, 273 insertions(+) create mode 100644 japanese/font-hackgen/Makefile create mode 100644 japanese/font-hackgen/distinfo create mode 100644 japanese/font-hackgen/files/20-unhint-hackgen.conf create mode 100644 japanese/font-hackgen/files/62-fonts-hackgen.conf create mode 100644 japanese/font-hackgen/files/pkg-install.in create mode 100644 japanese/font-hackgen/pkg-descr create mode 100644 japanese/font-hackgen/pkg-plist diff --git a/japanese/Makefile b/japanese/Makefile index 5f054b9ad4dd..82dba55021b3 100644 --- a/japanese/Makefile +++ b/japanese/Makefile @@ -65,6 +65,7 @@ SUBDIR += font-elisa8 SUBDIR += font-genjyuugothic SUBDIR += font-genshingothic + SUBDIR += font-hackgen SUBDIR += font-ipa SUBDIR += font-ipa-uigothic SUBDIR += font-ipaex diff --git a/japanese/font-hackgen/Makefile b/japanese/font-hackgen/Makefile new file mode 100644 index 000000000000..af7f7cfe95e9 --- /dev/null +++ b/japanese/font-hackgen/Makefile @@ -0,0 +1,75 @@ +# $FreeBSD$ + +PORTNAME= hackgen +PORTVERSION= 1.3.1 +#PORTREVISION= 0 +CATEGORIES= japanese x11-fonts +MASTER_SITES= https://github.com/yuru7/HackGen/releases/download/v${PORTVERSION}/ +PKGNAMEPREFIX= ja-font- +DISTNAME= HackGen_v${DISTVERSION} + +MAINTAINER= ume@FreeBSD.org +COMMENT= HackGen is a composite font of Hack and GenJyuu-Gothic + +LICENSE= OFL11 + +USES= fonts:fc zip +NO_ARCH= yes +NO_BUILD= yes +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-install +SUB_FILES= pkg-install +WRKSRC= ${WRKDIR}/${DISTNAME} + +OPTIONS_MULTI= FONT_FAMILY +OPTIONS_MULTI_FONT_FAMILY= HACKGEN HACKGEN_CONS HACKGEN_CONS_PL \ + HACKGEN35 HACKGEN35_CONS HACKGEN35_CONS_PL +OPTIONS_DEFAULT= HACKGEN HACKGEN_CONS HACKGEN_CONS_PL \ + HACKGEN35 HACKGEN35_CONS HACKGEN35_CONS_PL +OPTIONS_SUB= yes +HACKGEN_DESC= HackGen +HACKGEN_CONS_DESC= HackGen Console +HACKGEN_CONS_PL_DESC= HackGen Console for Powerline +HACKGEN35_DESC= HackGen35 +HACKGEN35_CONS_DESC= HackGen35 Console +HACKGEN35_CONS_PL_DESC= HackGen35 Console for Powerline + +.include + +.if ${PORT_OPTIONS:MHACKGEN} +HACKGEN_FONTS+= HackGen-Regular HackGen-Bold +.endif +.if ${PORT_OPTIONS:MHACKGEN_CONS} +HACKGEN_FONTS+= HackGenConsole-Regular HackGenConsole-Bold +.endif +.if ${PORT_OPTIONS:MHACKGEN_CONS_PL} +HACKGEN_FONTS+= HackGenConsole-Regular-forPowerline \ + HackGenConsole-Bold-forPowerline +.endif +.if ${PORT_OPTIONS:MHACKGEN35} +HACKGEN_FONTS+= HackGen35-Regular HackGen35-Bold +.endif +.if ${PORT_OPTIONS:MHACKGEN35_CONS} +HACKGEN_FONTS+= HackGen35Console-Regular HackGen35Console-Bold +.endif +.if ${PORT_OPTIONS:MHACKGEN35_CONS_PL} +HACKGEN_FONTS+= HackGen35Console-Regular-forPowerline \ + HackGen35Console-Bold-forPowerline +.endif + +do-install: + ${MKDIR} ${STAGEDIR}${FONTSDIR} +.for FONT in ${HACKGEN_FONTS} + ${INSTALL_DATA} ${WRKSRC}/${FONT}.ttf ${STAGEDIR}${FONTSDIR} +.endfor + ${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 + +.include diff --git a/japanese/font-hackgen/distinfo b/japanese/font-hackgen/distinfo new file mode 100644 index 000000000000..2d1616767c85 --- /dev/null +++ b/japanese/font-hackgen/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1573968933 +SHA256 (HackGen_v1.3.1.zip) = bc38c06ba7717deb3b986b47d072bcff74b7c127f276fd7d4fd733f3000ae8b5 +SIZE (HackGen_v1.3.1.zip) = 60823745 diff --git a/japanese/font-hackgen/files/20-unhint-hackgen.conf b/japanese/font-hackgen/files/20-unhint-hackgen.conf new file mode 100644 index 000000000000..68ad6255330c --- /dev/null +++ b/japanese/font-hackgen/files/20-unhint-hackgen.conf @@ -0,0 +1,48 @@ + + + + + + + + HackGen-Regular + + + HackGen-Bold + + + HackGenConsole-Regular + + + HackGenConsole-Bold + + + HackGenConsole-Regular-forPowerline + + + HackGenConsole-Bold-forPowerline + + + HackGen35-Regular + + + HackGen35-Bold + + + HackGen35Console-Regular + + + HackGen35Console-Bold + + + HackGen35Console-Regular-forPowerline + + + HackGen35Console-Bold-forPowerline + + + + false + + + diff --git a/japanese/font-hackgen/files/62-fonts-hackgen.conf b/japanese/font-hackgen/files/62-fonts-hackgen.conf new file mode 100644 index 000000000000..47f5deffbcfd --- /dev/null +++ b/japanese/font-hackgen/files/62-fonts-hackgen.conf @@ -0,0 +1,22 @@ + + + + + + monospace + + HackGen-Regular + HackGen-Bold + HackGenConsole-Regular + HackGenConsole-Bold + HackGenConsole-Regular-forPowerline + HackGenConsole-Bold-forPowerline + HackGen35-Regular + HackGen35-Bold + HackGen35Console-Regular + HackGen35Console-Bold + HackGen35Console-Regular-forPowerline + HackGen35Console-Bold-forPowerline + + + diff --git a/japanese/font-hackgen/files/pkg-install.in b/japanese/font-hackgen/files/pkg-install.in new file mode 100644 index 000000000000..ecc37fb4d192 --- /dev/null +++ b/japanese/font-hackgen/files/pkg-install.in @@ -0,0 +1,105 @@ +#!/bin/sh +# $FreeBSD$ + +catfontsdir() +{ + while read _IN + do + case "${_IN}" in + *-misc-hackgen*-*|[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,^:,,' +} + +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 HackGen-Regular.ttf misc "hackgen" m medium + make_xlfd $ENC HackGen-Bold.ttf misc "hackgen" m bold + make_xlfd $ENC HackGenConsole-Regular.ttf misc "hackgenconsole" m medium + make_xlfd $ENC HackGenConsole-Bold.ttf misc "hackgenconsole" m bold + make_xlfd $ENC HackGen35-Regular.ttf misc "hackgen35" m medium + make_xlfd $ENC HackGen35-Bold.ttf misc "hackgen35" m bold + make_xlfd $ENC HackGen35Console-Regular.ttf misc "hackgen35console" m medium + make_xlfd $ENC HackgEn35Console-Bold.ttf misc "hackgen35console" m bold + 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-hackgen/pkg-descr b/japanese/font-hackgen/pkg-descr new file mode 100644 index 000000000000..410ed6f27d2e --- /dev/null +++ b/japanese/font-hackgen/pkg-descr @@ -0,0 +1,3 @@ +HackGen is a composite font of Hack and GenJyuu-Gothic. + +WWW: https://github.com/yuru7/HackGen diff --git a/japanese/font-hackgen/pkg-plist b/japanese/font-hackgen/pkg-plist new file mode 100644 index 000000000000..76b8fb4e47a7 --- /dev/null +++ b/japanese/font-hackgen/pkg-plist @@ -0,0 +1,16 @@ +etc/fonts/conf.avail/20-unhint-hackgen.conf +etc/fonts/conf.avail/62-fonts-hackgen.conf +etc/fonts/conf.d/20-unhint-hackgen.conf +etc/fonts/conf.d/62-fonts-hackgen.conf +%%HACKGEN%%%%FONTSDIR%%/HackGen-Regular.ttf +%%HACKGEN%%%%FONTSDIR%%/HackGen-Bold.ttf +%%HACKGEN_CONS%%%%FONTSDIR%%/HackGenConsole-Regular.ttf +%%HACKGEN_CONS%%%%FONTSDIR%%/HackGenConsole-Bold.ttf +%%HACKGEN_CONS_PL%%%%FONTSDIR%%/HackGenConsole-Regular-forPowerline.ttf +%%HACKGEN_CONS_PL%%%%FONTSDIR%%/HackGenConsole-Bold-forPowerline.ttf +%%HACKGEN35%%%%FONTSDIR%%/HackGen35-Regular.ttf +%%HACKGEN35%%%%FONTSDIR%%/HackGen35-Bold.ttf +%%HACKGEN35_CONS%%%%FONTSDIR%%/HackGen35Console-Regular.ttf +%%HACKGEN35_CONS%%%%FONTSDIR%%/HackGen35Console-Bold.ttf +%%HACKGEN35_CONS_PL%%%%FONTSDIR%%/HackGen35Console-Regular-forPowerline.ttf +%%HACKGEN35_CONS_PL%%%%FONTSDIR%%/HackGen35Console-Bold-forPowerline.ttf