From aa1311c516eb0decbbc281d7661e355d811a3b5a Mon Sep 17 00:00:00 2001 From: ltlnx Date: Thu, 11 May 2023 21:20:40 +0100 Subject: system/CNS11643-font: Updated for version 20230323. New Maintainer. Signed-off-by: bedlam Signed-off-by: Willy Sudiarto Raharjo --- system/CNS11643-font/35-CNS11643-font.conf | 113 --------------------- system/CNS11643-font/98-CNS11643-font-patches.conf | 21 ++++ system/CNS11643-font/99-CNS11643-font.conf | 85 ++++++++++++++++ system/CNS11643-font/CNS11643-font.SlackBuild | 30 ++++-- system/CNS11643-font/CNS11643-font.info | 8 +- system/CNS11643-font/README | 22 +++- 6 files changed, 151 insertions(+), 128 deletions(-) delete mode 100644 system/CNS11643-font/35-CNS11643-font.conf create mode 100644 system/CNS11643-font/98-CNS11643-font-patches.conf create mode 100644 system/CNS11643-font/99-CNS11643-font.conf (limited to 'system/CNS11643-font') diff --git a/system/CNS11643-font/35-CNS11643-font.conf b/system/CNS11643-font/35-CNS11643-font.conf deleted file mode 100644 index 6122b22e109c3..0000000000000 --- a/system/CNS11643-font/35-CNS11643-font.conf +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - TW-Sung - - - 全字庫正宋體 - - - TW-Sung-Plus - - - 全字庫正宋體 Plus - - - TW-Sung-Ext-B - - - 全字庫正宋體 Ext-B - - - TW-Kai - - - 全字庫正楷體 - - - TW-Kai-Plus - - - 全字庫正楷體 Plus - - - TW-Kai-Ext-B - - - 全字庫正楷體 Ext-B - - - - - TW-Sung - - - DejaVu Serif - - - - - TW-Kai - - - DejaVu Sans Light - - - - TW-Sung - - DejaVu Serif:book - Liberation Sans - Bitstream Vera Serif - TW-Sung - TW-Sung-Plus - TW-Sung-Ext-B - - - - TW-Kai - - DejaVu Sans:book - Bitstream Vera Sans - TW-Kai - TW-Kai-Plus - TW-Kai-Ext-B - - - - serif - - DejaVu Serif:book - Liberation Serif - Bitstream Vera Serif - TW-Sung - TW-Sung-Plus - TW-Sung-Ext-B - - - - sans - - DejaVu Sans Light:book - Liberation Sans - Bitstream Vera Sans - TW-Kai - TW-Kai-Plus - TW-Kai-Ext-B - - - - monospace - - DejaVu Sans Mono - Liberation Sans Mono - Bitstream Vera Sans Mono - TW-Sung - TW-Sung-Plus - TW-Sung-Ext-B - - - diff --git a/system/CNS11643-font/98-CNS11643-font-patches.conf b/system/CNS11643-font/98-CNS11643-font-patches.conf new file mode 100644 index 0000000000000..c123a241e5e3d --- /dev/null +++ b/system/CNS11643-font/98-CNS11643-font-patches.conf @@ -0,0 +1,21 @@ + + + + + + + sans-serif + + + {{DEFAULT_FONT}} + + + + + sans-serif + + + Noto Sans CJK {{FONTLANG}} + + + diff --git a/system/CNS11643-font/99-CNS11643-font.conf b/system/CNS11643-font/99-CNS11643-font.conf new file mode 100644 index 0000000000000..b23d2b29e7aac --- /dev/null +++ b/system/CNS11643-font/99-CNS11643-font.conf @@ -0,0 +1,85 @@ + + + + + + TW-Sung + + TW-Sung + TW-Sung-Plus + TW-Sung-Ext-B + + + + TW-Kai + + TW-Kai + TW-Kai-Plus + TW-Kai-Ext-B + + + + 細明體 + + TW-Sung + TW-Sung-Plus + TW-Sung-Ext-B + + + + 新細明體 + + TW-Sung + TW-Sung-Plus + TW-Sung-Ext-B + + + + MingLiU + + TW-Sung + TW-Sung-Plus + TW-Sung-Ext-B + + + + PMingLiU + + TW-Sung + TW-Sung-Plus + TW-Sung-Ext-B + + + + 標楷體 + + TW-Kai + TW-Kai-Plus + TW-Kai-Ext-B + + + + BiauKai + + TW-Kai + TW-Kai-Plus + TW-Kai-Ext-B + + + + DFKai-SB + + TW-Kai + TW-Kai-Plus + TW-Kai-Ext-B + + + + KaiU + + TW-Kai + TW-Kai-Plus + TW-Kai-Ext-B + + + diff --git a/system/CNS11643-font/CNS11643-font.SlackBuild b/system/CNS11643-font/CNS11643-font.SlackBuild index eb993a8eae16f..ea0109919a344 100644 --- a/system/CNS11643-font/CNS11643-font.SlackBuild +++ b/system/CNS11643-font/CNS11643-font.SlackBuild @@ -3,6 +3,7 @@ # Slackware build script for CNS11643-font # Copyright 2022 CCHsu, Taiwan +# Copyright 2023 ltlnx, Taiwan # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=CNS11643-font -VERSION=${VERSION:-20221004} +VERSION=${VERSION:-20230323} SRCNAM=Open_Data BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -33,9 +34,6 @@ PKGTYPE=${PKGTYPE:-tgz} ARCH=noarch -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -64,12 +62,30 @@ find -L . \ mkdir -p $PKG/usr/share/fonts/TTF cp -a Open_Data/Fonts/*.ttf $PKG/usr/share/fonts/TTF -# Create a font config file and symlink it into /etc/fonts/conf.d. +# Patch the fontconfig file to include accurate info from the system. +if FONTLANG="$(echo $LANG | grep -Po '{JP|KR|TW|HK|CN}')"; then + FONTLANG="$(echo $FONTLANG | sed 's|TW|TC|;s|CN|SC|')" +else + FONTLANG="TC" +fi mkdir -p $PKG/etc/fonts/conf.{d,avail} -cat $CWD/35-CNS11643-font.conf > $PKG/etc/fonts/conf.avail/35-CNS11643-font.conf +cat $CWD/98-CNS11643-font-patches.conf | sed "s|{{DEFAULT_FONT}}|$(fc-match -f "%{family[0]}")|; s|{{FONTLANG}}|$FONTLANG|" > $PKG/etc/fonts/conf.avail/98-CNS11643-font-patches.conf ( cd $PKG/etc/fonts/conf.d && \ - ln -sf ../conf.avail/35-CNS11643-font.conf + ln -sf ../conf.avail/98-CNS11643-font-patches.conf ) + +# Create a font config file and symlink it into /etc/fonts/conf.d. +# Do this only if the user explicitly asks for it. +ADDCONF=${ADDCONF:-no} + +if [ "$ADDCONF" = "yes" ]; then + cat $CWD/99-CNS11643-font.conf > $PKG/etc/fonts/conf.avail/99-CNS11643-font.conf + ( cd $PKG/etc/fonts/conf.d && \ + ln -sf ../conf.avail/99-CNS11643-font.conf + ) +fi + + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild diff --git a/system/CNS11643-font/CNS11643-font.info b/system/CNS11643-font/CNS11643-font.info index 7654103ffdbeb..48fcfe39e9483 100644 --- a/system/CNS11643-font/CNS11643-font.info +++ b/system/CNS11643-font/CNS11643-font.info @@ -1,10 +1,10 @@ PRGNAM="CNS11643-font" -VERSION="20221004" +VERSION="20230323" HOMEPAGE="http://www.cns11643.gov.tw/" DOWNLOAD="http://www.cns11643.gov.tw/AIDB/Open_Data.zip" -MD5SUM="6190c516b5613487c9142a515a7db797" +MD5SUM="3e4539c6cdbbc542b1418c8474d411f7" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="CCHsu" -EMAIL="a12321aabb@gmail.com" +MAINTAINER="ltlnx" +EMAIL="ltlnx@gmx.com" diff --git a/system/CNS11643-font/README b/system/CNS11643-font/README index 71352aaf8b226..8ecdb2b235848 100644 --- a/system/CNS11643-font/README +++ b/system/CNS11643-font/README @@ -2,10 +2,24 @@ This package contains two type of fonts: TW-Kai and TW-Sung, which are provided by CNS11643 Chinese Standard Interchange Code Master Ideographs from Taiwan. -This SlackBuild puts 35-CNS11643-font.conf into /etc/fonts/conf.avail. -It sets the "serif" and "monospace"aliases to TW-Sung fonts, the "sans" -aliases to TW-Kai fonts. You canuncomment the symlink in the slackbuild -if you like. +Included is a config file that adds the Noto Sans CJK family to a higher +spot in the default "sans-serif" substitutes. If you're using a +graphical desktop environment, this would make sure that your default +Chinese font substitute, Noto Sans CJK, wouldn't be superseded by the +fonts installed by this package. If your default fonts are changed after +installing this package, please email me at ltlnx (at) gmx (dot) com. + +Another config file is included, 35-CNS11643-font.conf, that +binds the Windows counterparts "MingLiU" (細明體) and "PMingLiU" +(新細明體) to TW-Sung, and "DFKai-SB", "UKai" (標楷體) to TW-Kai. +If you want it copied into /etc/fonts/conf.avail, add the +environment variable "ADDCONF=yes" at the front of the SlackBuild, +and run it as such: + + ADDCONF=yes ./CNS11643-font.SlackBuild + +If you're using a SlackBuild manager, the way of adding variables may +differ; please consult the manual of your program for instructions. The source file can be found at "http://data.gov.tw/node/5961", and the license can be found at "http://www.cns11643.gov.tw/AIDB/copyright.do". -- cgit v1.2.3