aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorltlnx <ltlnx@gmx.com>2023-05-11 21:20:40 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-05-13 19:27:10 +0700
commitaa1311c516eb0decbbc281d7661e355d811a3b5a (patch)
treefe39032d591514599d0dea40dbcb7feca24eab18 /system
parentda0cfe3f8f7c6627345cb602c7c679e9520e8a53 (diff)
system/CNS11643-font: Updated for version 20230323. New Maintainer.
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/CNS11643-font/35-CNS11643-font.conf113
-rw-r--r--system/CNS11643-font/98-CNS11643-font-patches.conf21
-rw-r--r--system/CNS11643-font/99-CNS11643-font.conf85
-rw-r--r--system/CNS11643-font/CNS11643-font.SlackBuild30
-rw-r--r--system/CNS11643-font/CNS11643-font.info8
-rw-r--r--system/CNS11643-font/README22
6 files changed, 151 insertions, 128 deletions
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 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
-<!-- TW-Kai and TW-Sung Configure File -->
-<fontconfig>
- <match target="font">
- <test qual="any" name="family">
- <string>TW-Sung</string>
- </test>
- <test qual="any" name="family">
- <string>全字庫正宋體</string>
- </test>
- <test qual="any" name="family">
- <string>TW-Sung-Plus</string>
- </test>
- <test qual="any" name="family">
- <string>全字庫正宋體 Plus</string>
- </test>
- <test qual="any" name="family">
- <string>TW-Sung-Ext-B</string>
- </test>
- <test qual="any" name="family">
- <string>全字庫正宋體 Ext-B</string>
- </test>
- <test qual="any" name="family">
- <string>TW-Kai</string>
- </test>
- <test qual="any" name="family">
- <string>全字庫正楷體</string>
- </test>
- <test qual="any" name="family">
- <string>TW-Kai-Plus</string>
- </test>
- <test qual="any" name="family">
- <string>全字庫正楷體 Plus</string>
- </test>
- <test qual="any" name="family">
- <string>TW-Kai-Ext-B</string>
- </test>
- <test qual="any" name="family">
- <string>全字庫正楷體 Ext-B</string>
- </test>
- </match>
- <match target="pattern">
- <test name="family" compare="eq">
- <string>TW-Sung</string>
- </test>
- <edit name="family" mode="prepend" binding="strong">
- <string>DejaVu Serif</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family" compare="eq">
- <string>TW-Kai</string>
- </test>
- <edit name="family" mode="prepend" binding="strong">
- <string>DejaVu Sans Light</string>
- </edit>
- </match>
- <alias binding="strong">
- <family>TW-Sung</family>
- <prefer>
- <family>DejaVu Serif:book</family>
- <family>Liberation Sans</family>
- <family>Bitstream Vera Serif</family>
- <family>TW-Sung</family>
- <family>TW-Sung-Plus</family>
- <family>TW-Sung-Ext-B</family>
- </prefer>
- </alias>
- <alias binding="strong">
- <family>TW-Kai</family>
- <prefer>
- <family>DejaVu Sans:book</family>
- <family>Bitstream Vera Sans</family>
- <family>TW-Kai</family>
- <family>TW-Kai-Plus</family>
- <family>TW-Kai-Ext-B</family>
- </prefer>
- </alias>
- <alias binding="strong">
- <family>serif</family>
- <prefer>
- <family>DejaVu Serif:book</family>
- <family>Liberation Serif</family>
- <family>Bitstream Vera Serif</family>
- <family>TW-Sung</family>
- <family>TW-Sung-Plus</family>
- <family>TW-Sung-Ext-B</family>
- </prefer>
- </alias>
- <alias binding="strong">
- <family>sans</family>
- <prefer>
- <family>DejaVu Sans Light:book</family>
- <family>Liberation Sans</family>
- <family>Bitstream Vera Sans</family>
- <family>TW-Kai</family>
- <family>TW-Kai-Plus</family>
- <family>TW-Kai-Ext-B</family>
- </prefer>
- </alias>
- <alias>
- <family>monospace</family>
- <prefer>
- <family>DejaVu Sans Mono</family>
- <family>Liberation Sans Mono</family>
- <family>Bitstream Vera Sans Mono</family>
- <family>TW-Sung</family>
- <family>TW-Sung-Plus</family>
- <family>TW-Sung-Ext-B</family>
- </prefer>
- </alias>
-</fontconfig>
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 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- Patch file to make sure default fonts don't get replaced-->
+<fontconfig>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans-serif</string>
+ </test>
+ <edit name="family" mode="prepend" binding="strong">
+ <string>{{DEFAULT_FONT}}</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans-serif</string>
+ </test>
+ <edit name="family" mode="prepend" binding="strong">
+ <string>Noto Sans CJK {{FONTLANG}}</string>
+ </edit>
+ </match>
+</fontconfig>
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 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- TW-Kai and TW-Sung Configure File -->
+<fontconfig>
+ <alias>
+ <family>TW-Sung</family>
+ <prefer>
+ <family>TW-Sung</family>
+ <family>TW-Sung-Plus</family>
+ <family>TW-Sung-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>TW-Kai</family>
+ <prefer>
+ <family>TW-Kai</family>
+ <family>TW-Kai-Plus</family>
+ <family>TW-Kai-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>細明體</family>
+ <prefer>
+ <family>TW-Sung</family>
+ <family>TW-Sung-Plus</family>
+ <family>TW-Sung-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>新細明體</family>
+ <prefer>
+ <family>TW-Sung</family>
+ <family>TW-Sung-Plus</family>
+ <family>TW-Sung-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>MingLiU</family>
+ <prefer>
+ <family>TW-Sung</family>
+ <family>TW-Sung-Plus</family>
+ <family>TW-Sung-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>PMingLiU</family>
+ <prefer>
+ <family>TW-Sung</family>
+ <family>TW-Sung-Plus</family>
+ <family>TW-Sung-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>標楷體</family>
+ <prefer>
+ <family>TW-Kai</family>
+ <family>TW-Kai-Plus</family>
+ <family>TW-Kai-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>BiauKai</family>
+ <prefer>
+ <family>TW-Kai</family>
+ <family>TW-Kai-Plus</family>
+ <family>TW-Kai-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>DFKai-SB</family>
+ <prefer>
+ <family>TW-Kai</family>
+ <family>TW-Kai-Plus</family>
+ <family>TW-Kai-Ext-B</family>
+ </prefer>
+ </alias>
+ <alias>
+ <family>KaiU</family>
+ <prefer>
+ <family>TW-Kai</family>
+ <family>TW-Kai-Plus</family>
+ <family>TW-Kai-Ext-B</family>
+ </prefer>
+ </alias>
+</fontconfig>
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".