New port japanese/font-hackgen

HackGen is a composite font of Hack and GenJyuu-Gothic
This commit is contained in:
Hajimu UMEMOTO 2019-11-17 08:05:03 +00:00
parent 26571a2a3b
commit 2497569155
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=517807
8 changed files with 273 additions and 0 deletions

View File

@ -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

View File

@ -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 <bsd.port.options.mk>
.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 <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1573968933
SHA256 (HackGen_v1.3.1.zip) = bc38c06ba7717deb3b986b47d072bcff74b7c127f276fd7d4fd733f3000ae8b5
SIZE (HackGen_v1.3.1.zip) = 60823745

View File

@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- $FreeBSD$ -->
<fontconfig>
<match target="font">
<or>
<test name="family">
<string>HackGen-Regular</string>
</test>
<test name="family">
<string>HackGen-Bold</string>
</test>
<test name="family">
<string>HackGenConsole-Regular</string>
</test>
<test name="family">
<string>HackGenConsole-Bold</string>
</test>
<test name="family">
<string>HackGenConsole-Regular-forPowerline</string>
</test>
<test name="family">
<string>HackGenConsole-Bold-forPowerline</string>
</test>
<test name="family">
<string>HackGen35-Regular</string>
</test>
<test name="family">
<string>HackGen35-Bold</string>
</test>
<test name="family">
<string>HackGen35Console-Regular</string>
</test>
<test name="family">
<string>HackGen35Console-Bold</string>
</test>
<test name="family">
<string>HackGen35Console-Regular-forPowerline</string>
</test>
<test name="family">
<string>HackGen35Console-Bold-forPowerline</string>
</test>
</or>
<edit name="autohint">
<bool>false</bool>
</edit>
</match>
</fontconfig>

View File

@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- $FreeBSD$ -->
<fontconfig>
<alias>
<family>monospace</family>
<prefer>
<family>HackGen-Regular</family>
<family>HackGen-Bold</family>
<family>HackGenConsole-Regular</family>
<family>HackGenConsole-Bold</family>
<family>HackGenConsole-Regular-forPowerline</family>
<family>HackGenConsole-Bold-forPowerline</family>
<family>HackGen35-Regular</family>
<family>HackGen35-Bold</family>
<family>HackGen35Console-Regular</family>
<family>HackGen35Console-Bold</family>
<family>HackGen35Console-Regular-forPowerline</family>
<family>HackGen35Console-Bold-forPowerline</family>
</prefer>
</alias>
</fontconfig>

View File

@ -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

View File

@ -0,0 +1,3 @@
HackGen is a composite font of Hack and GenJyuu-Gothic.
WWW: https://github.com/yuru7/HackGen

View File

@ -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