From b4896d72f58ef4a181e68b79ff729d7cb897c1e7 Mon Sep 17 00:00:00 2001 From: MANTANI Nobutaka Date: Sun, 18 Aug 2024 14:29:19 +0900 Subject: [PATCH] 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 --- japanese/Makefile | 1 + japanese/font-bizud-gothic/Makefile | 46 ++++++++++ japanese/font-bizud-gothic/distinfo | 3 + .../files/20-unhint-bizud-gothic.conf | 17 ++++ .../files/62-fonts-bizud-gothic.conf | 16 ++++ .../font-bizud-gothic/files/pkg-install.in | 89 +++++++++++++++++++ japanese/font-bizud-gothic/pkg-descr | 2 + japanese/font-bizud-gothic/pkg-plist | 8 ++ 8 files changed, 182 insertions(+) create mode 100644 japanese/font-bizud-gothic/Makefile create mode 100644 japanese/font-bizud-gothic/distinfo create mode 100644 japanese/font-bizud-gothic/files/20-unhint-bizud-gothic.conf create mode 100644 japanese/font-bizud-gothic/files/62-fonts-bizud-gothic.conf create mode 100644 japanese/font-bizud-gothic/files/pkg-install.in create mode 100644 japanese/font-bizud-gothic/pkg-descr create mode 100644 japanese/font-bizud-gothic/pkg-plist diff --git a/japanese/Makefile b/japanese/Makefile index 641652962b2f..55b40ffbbdd4 100644 --- a/japanese/Makefile +++ b/japanese/Makefile @@ -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 diff --git a/japanese/font-bizud-gothic/Makefile b/japanese/font-bizud-gothic/Makefile new file mode 100644 index 000000000000..c1099bc50cf8 --- /dev/null +++ b/japanese/font-bizud-gothic/Makefile @@ -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 diff --git a/japanese/font-bizud-gothic/distinfo b/japanese/font-bizud-gothic/distinfo new file mode 100644 index 000000000000..036c402053e3 --- /dev/null +++ b/japanese/font-bizud-gothic/distinfo @@ -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 diff --git a/japanese/font-bizud-gothic/files/20-unhint-bizud-gothic.conf b/japanese/font-bizud-gothic/files/20-unhint-bizud-gothic.conf new file mode 100644 index 000000000000..88b159b48db3 --- /dev/null +++ b/japanese/font-bizud-gothic/files/20-unhint-bizud-gothic.conf @@ -0,0 +1,17 @@ + + + + + + + BIZ UDGothic + + + BIZ UDPGothic + + + + false + + + diff --git a/japanese/font-bizud-gothic/files/62-fonts-bizud-gothic.conf b/japanese/font-bizud-gothic/files/62-fonts-bizud-gothic.conf new file mode 100644 index 000000000000..34bc40f42b63 --- /dev/null +++ b/japanese/font-bizud-gothic/files/62-fonts-bizud-gothic.conf @@ -0,0 +1,16 @@ + + + + + sans-serif + + BIZ UDPGothic + + + + monospace + + BIZ UDGothic + + + diff --git a/japanese/font-bizud-gothic/files/pkg-install.in b/japanese/font-bizud-gothic/files/pkg-install.in new file mode 100644 index 000000000000..5d0fbf48f6c5 --- /dev/null +++ b/japanese/font-bizud-gothic/files/pkg-install.in @@ -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 diff --git a/japanese/font-bizud-gothic/pkg-descr b/japanese/font-bizud-gothic/pkg-descr new file mode 100644 index 000000000000..bd2e72708127 --- /dev/null +++ b/japanese/font-bizud-gothic/pkg-descr @@ -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. diff --git a/japanese/font-bizud-gothic/pkg-plist b/japanese/font-bizud-gothic/pkg-plist new file mode 100644 index 000000000000..667adc58e542 --- /dev/null +++ b/japanese/font-bizud-gothic/pkg-plist @@ -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