diff options
author | ltlnx <ltlnx@disroot.org> | 2024-08-12 08:28:55 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-08-12 08:55:04 +0700 |
commit | f532080a949d65af7795f5082ea1af17985278fa (patch) | |
tree | a82ffdaf78113cb92ab548dd1fcbddfbba2d1e64 /system/CNS11643-sung-font | |
parent | ce6ade73245a5dabf238a3f3ad632ba8626f4a4b (diff) |
system/CNS11643-sung-font: Added (System font).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/CNS11643-sung-font')
-rw-r--r-- | system/CNS11643-sung-font/35-CNS11643-sung-font.conf | 45 | ||||
-rw-r--r-- | system/CNS11643-sung-font/CNS11643-sung-font.SlackBuild | 84 | ||||
-rw-r--r-- | system/CNS11643-sung-font/CNS11643-sung-font.info | 10 | ||||
-rw-r--r-- | system/CNS11643-sung-font/README | 70 | ||||
-rw-r--r-- | system/CNS11643-sung-font/doinst.sh | 10 | ||||
-rw-r--r-- | system/CNS11643-sung-font/slack-desc | 19 |
6 files changed, 238 insertions, 0 deletions
diff --git a/system/CNS11643-sung-font/35-CNS11643-sung-font.conf b/system/CNS11643-sung-font/35-CNS11643-sung-font.conf new file mode 100644 index 000000000000..0928d4bda92a --- /dev/null +++ b/system/CNS11643-sung-font/35-CNS11643-sung-font.conf @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<!-- TW-Sung Configuration 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>細明體</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> +</fontconfig> diff --git a/system/CNS11643-sung-font/CNS11643-sung-font.SlackBuild b/system/CNS11643-sung-font/CNS11643-sung-font.SlackBuild new file mode 100644 index 000000000000..4a35266466a3 --- /dev/null +++ b/system/CNS11643-sung-font/CNS11643-sung-font.SlackBuild @@ -0,0 +1,84 @@ +#!/bin/bash + +# Slackware build script for CNS11643-kai-font + +# Copyright 2022 CCHsu, Taiwan +# Copyright 2023-2024 ltlnx, Taiwan +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=CNS11643-sung-font +VERSION=${VERSION:-20240626} +SRCNAM=Fonts_Sung +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +ARCH=noarch + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -eu + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +mkdir $PRGNAM-$VERSION +cd $PRGNAM-$VERSION +unzip $CWD/$SRCNAM.zip "$SRCNAM/*.ttf" +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir -p $PKG/usr/share/fonts/TTF +cp -a $SRCNAM/*.ttf $PKG/usr/share/fonts/TTF + +# 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 + mkdir -p $PKG/etc/fonts/conf.{d,avail} + cat $CWD/35-CNS11643-sung-font.conf > $PKG/etc/fonts/conf.avail/35-CNS11643-sung-font.conf + ( cd $PKG/etc/fonts/conf.d && \ + ln -sf ../conf.avail/35-CNS11643-sung-font.conf + ) +fi + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/CNS11643-sung-font/CNS11643-sung-font.info b/system/CNS11643-sung-font/CNS11643-sung-font.info new file mode 100644 index 000000000000..597186d7dd76 --- /dev/null +++ b/system/CNS11643-sung-font/CNS11643-sung-font.info @@ -0,0 +1,10 @@ +PRGNAM="CNS11643-sung-font" +VERSION="20240626" +HOMEPAGE="http://www.cns11643.gov.tw/" +DOWNLOAD="https://www.cns11643.gov.tw/opendata/Fonts_Sung.zip" +MD5SUM="d71e2ffdeca8de0b6096ec030f4ee7f2" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="ltlnx" +EMAIL="ltlnx@disroot.org" diff --git a/system/CNS11643-sung-font/README b/system/CNS11643-sung-font/README new file mode 100644 index 000000000000..8b173ac14dd4 --- /dev/null +++ b/system/CNS11643-sung-font/README @@ -0,0 +1,70 @@ +This package contains the TW-Sung font, provided by CNS11643 Chinese +Standard Interchange Code Master Ideographs from Taiwan. + +A config file is included, 35-CNS11643-sung-font.conf, which binds the +Windows counterparts "MingLiU" (細明體) and "PMingLiU" (新細明體) +to TW-Sung. If you want it copied into /etc/fonts/conf.avail, add the +environment variable "ADDCONF=yes" in front of the SlackBuild. +I recommend running the SlackBuild like this: + + ADDCONF=yes ./CNS11643-sung-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. + +If you don't want your default fonts replaced, you can add this to +/etc/fonts/conf.avail/50-user.conf between the <fontconfig> tags: +(please replace the font names according to the comments) + +<!-- Custom font preference --> +<alias> + <family>serif</family> + <prefer> + <!-- preferred serif latin font --> + <family>Noto Serif</family> + <!-- preferred serif fallback font --> + <family>Noto Serif CJK TC</family> + </prefer> +</alias> +<alias> + <family>sans-serif</family> + <prefer> + <!-- preferred sans-serif latin font --> + <family>Noto Sans</family> + <!-- preferred sans-serif fallback font --> + <family>Noto Sans CJK TC</family> + </prefer> +</alias> +<match target="pattern"> + <test qual="any" name="family" compare="eq"> + <string>monospace</string> + </test> + <!-- replace "Liberation Mono" with preferred monospace font --> + <edit name="family" mode="assign" binding="strong"> + <string>Liberation Mono</string> + </edit> +</match> +<alias> + <!-- replace "Liberation Mono" with preferred monospace font --> + <family>Liberation Mono</family> + <prefer> + <!-- preferred monospace font --> + <family>Liberation Mono</family> + <!-- preferred monospace fallback font + (does not necessarily need to be monospace --> + <family>Sarasa Fixed TC</family> + </prefer> +</alias> +<alias> + <family>system-ui</family> + <prefer> + <!-- preferred system-ui latin font (usually sans-serif) --> + <family>Noto Sans</family> + <!-- preferred system-ui fallback font --> + <family>Noto Sans CJK TC</family> + </prefer> +</alias> + +The source file can be found at "https://data.gov.tw/dataset/5961". You +can choose to apply one of two licenses to the files: OFL 1.1 or the +Open Government Data License version 1.0 (https://data.gov.tw/license). diff --git a/system/CNS11643-sung-font/doinst.sh b/system/CNS11643-sung-font/doinst.sh new file mode 100644 index 000000000000..b3ec374e4a45 --- /dev/null +++ b/system/CNS11643-sung-font/doinst.sh @@ -0,0 +1,10 @@ +# Update the X font indexes: +if [ -x /usr/bin/mkfontdir ]; then + ( cd usr/share/fonts/TTF + mkfontscale . + mkfontdir . + ) +fi +if [ -x /usr/bin/fc-cache ]; then + /usr/bin/fc-cache -f +fi diff --git a/system/CNS11643-sung-font/slack-desc b/system/CNS11643-sung-font/slack-desc new file mode 100644 index 000000000000..21d5d59da7fe --- /dev/null +++ b/system/CNS11643-sung-font/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +CNS11643-sung-font: CNS11643-sung-font (Governmental Chinese Sung font) +CNS11643-sung-font: +CNS11643-sung-font: These fonts are provided by CNS11643 Chinese Standard Interchange +CNS11643-sung-font: Code Master Ideographs from Taiwan, aimed at providing all required +CNS11643-sung-font: characters to type out names in Chinese. +CNS11643-sung-font: +CNS11643-sung-font: This package contains the Sung font, one of the two supported font +CNS11643-sung-font: styles in the project. +CNS11643-sung-font: +CNS11643-sung-font: Homepage: http://www.cns11643.gov.tw/ +CNS11643-sung-font: |