1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

japanese/font-bizud-gothic: New port: Morisawa BIZ UD Gothic fonts

BIZ UD Gothic is a universal design typeface designed to be easy
to read and ideal for education and business documentation.

PR:	278771
Reported by:	mew14930xvi <mew14930xvi@inbox.lv>
This commit is contained in:
MANTANI Nobutaka 2024-08-18 14:29:19 +09:00
parent ce5ef2ef4d
commit b4896d72f5
8 changed files with 182 additions and 0 deletions

View File

@ -63,6 +63,7 @@
SUBDIR += font-aozoramincho
SUBDIR += font-ayu18
SUBDIR += font-ayu20
SUBDIR += font-bizud-gothic
SUBDIR += font-bizud-mincho
SUBDIR += font-cica
SUBDIR += font-elisa10

View File

@ -0,0 +1,46 @@
PORTNAME= bizud-gothic
DISTVERSIONPREFIX= v
DISTVERSION= 1.051
CATEGORIES= japanese x11-fonts
PKGNAMEPREFIX= ja-font-
MAINTAINER= mew14930xvi@inbox.lv
COMMENT= Morisawa BIZ UD Gothic fonts
WWW= https://github.com/googlefonts/morisawa-biz-ud-gothic
LICENSE= OFL11
LICENSE_FILE= ${WRKSRC}/OFL.txt
USES= fonts:fc
FONTPATHSPEC= ${FONTNAME}:pri=60
NO_ARCH= yes
NO_BUILD= yes
PKGINSTALL= ${WRKDIR}/pkg-install
PKGDEINSTALL= ${WRKDIR}/pkg-install
SUB_FILES= pkg-install
PORTDOCS= AUTHORS.txt CONTRIBUTORS.txt README.md
USE_GITHUB= yes
GH_ACCOUNT= googlefonts
GH_PROJECT= morisawa-biz-ud-gothic
OPTIONS_DEFINE= DOCS
do-install:
@${MKDIR} ${STAGEDIR}${FONTSDIR}
${INSTALL_DATA} ${WRKSRC}/fonts/ttf/* ${STAGEDIR}${FONTSDIR}
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/fonts/conf.avail \
${STAGEDIR}${PREFIX}/etc/fonts/conf.d
${INSTALL_DATA} ${FILESDIR}/20-unhint-${FONTNAME}.conf \
${FILESDIR}/62-fonts-${FONTNAME}.conf \
${STAGEDIR}${PREFIX}/etc/fonts/conf.avail
${LN} -s -f ../conf.avail/20-unhint-${FONTNAME}.conf \
${STAGEDIR}${PREFIX}/etc/fonts/conf.d/20-unhint-${FONTNAME}.conf
${LN} -s -f ../conf.avail/62-fonts-${FONTNAME}.conf \
${STAGEDIR}${PREFIX}/etc/fonts/conf.d/62-fonts-${FONTNAME}.conf
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1715401796
SHA256 (googlefonts-morisawa-biz-ud-gothic-v1.051_GH0.tar.gz) = 4449ee0c9b757fd307fb59b36a296a6fa86db1a54adc29c90821680c6b4252ad
SIZE (googlefonts-morisawa-biz-ud-gothic-v1.051_GH0.tar.gz) = 36721169

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<or>
<test name="family">
<string>BIZ UDGothic</string>
</test>
<test name="family">
<string>BIZ UDPGothic</string>
</test>
</or>
<edit name="autohint">
<bool>false</bool>
</edit>
</match>
</fontconfig>

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>BIZ UDPGothic</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>BIZ UDGothic</family>
</prefer>
</alias>
</fontconfig>

View File

@ -0,0 +1,89 @@
#!/bin/sh
catfontsdir ()
{
while read _IN
do
case "${_IN}" in
*-morisawa-BIZUD*[Gg]othic-*|[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
do
make_xlfd $ENC BIZUDGothic-Bold.ttf morisawa BIZUDGothic c
make_xlfd $ENC BIZUDGothic-Regular.ttf morisawa BIZUDGothic c
make_xlfd $ENC BIZUDPGothic-Bold.ttf morisawa BIZUDPGothic p
make_xlfd $ENC BIZUDPGothic-Regular.ttf morisawa BIZUDPGothic p
done
}
nfonts ()
{
_L=0; while read _IN; do _L=$((${_L}+1)); done; echo ${_L}
}
case "$2" in
POST-INSTALL)
cd %%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 %%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
;;
esac

View File

@ -0,0 +1,2 @@
BIZ UD Gothic is a universal design typeface designed to be easy
to read and ideal for education and business documentation.

View File

@ -0,0 +1,8 @@
%%FONTSDIR%%/BIZUDGothic-Bold.ttf
%%FONTSDIR%%/BIZUDGothic-Regular.ttf
%%FONTSDIR%%/BIZUDPGothic-Bold.ttf
%%FONTSDIR%%/BIZUDPGothic-Regular.ttf
etc/fonts/conf.avail/20-unhint-bizud-gothic.conf
etc/fonts/conf.avail/62-fonts-bizud-gothic.conf
etc/fonts/conf.d/20-unhint-bizud-gothic.conf
etc/fonts/conf.d/62-fonts-bizud-gothic.conf