mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-04 02:17:14 +08:00
add source han sans
This commit is contained in:
parent
dcdd01efb8
commit
a9aac42809
15
otf-source-han-sans/44-source-han-sans-cn.conf
Normal file
15
otf-source-han-sans/44-source-han-sans-cn.conf
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
|
||||
<fontconfig>
|
||||
<match>
|
||||
<test name="lang" compare="contains">
|
||||
<string>zh-cn</string>
|
||||
</test>
|
||||
<test name="family">
|
||||
<string>sans-serif</string>
|
||||
</test>
|
||||
<edit name="family" mode="prepend">
|
||||
<string>Source Hans Sans CN</string>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
15
otf-source-han-sans/44-source-han-sans-jp.conf
Normal file
15
otf-source-han-sans/44-source-han-sans-jp.conf
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
|
||||
<fontconfig>
|
||||
<match>
|
||||
<test name="lang" compare="contains">
|
||||
<string>jp</string>
|
||||
</test>
|
||||
<test name="family">
|
||||
<string>sans-serif</string>
|
||||
</test>
|
||||
<edit name="family" mode="prepend">
|
||||
<string>Source Hans Sans JP</string>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
15
otf-source-han-sans/44-source-han-sans-kr.conf
Normal file
15
otf-source-han-sans/44-source-han-sans-kr.conf
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
|
||||
<fontconfig>
|
||||
<match>
|
||||
<test name="lang" compare="contains">
|
||||
<string>kr</string>
|
||||
</test>
|
||||
<test name="family">
|
||||
<string>sans-serif</string>
|
||||
</test>
|
||||
<edit name="family" mode="prepend">
|
||||
<string>Source Hans Sans KR</string>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
26
otf-source-han-sans/44-source-han-sans-twhk.conf
Normal file
26
otf-source-han-sans/44-source-han-sans-twhk.conf
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
|
||||
<fontconfig>
|
||||
<match>
|
||||
<test name="lang" compare="contains">
|
||||
<string>zh-tw</string>
|
||||
</test>
|
||||
<test name="family">
|
||||
<string>sans-serif</string>
|
||||
</test>
|
||||
<edit name="family" mode="prepend">
|
||||
<string>Source Hans Sans TWHK</string>
|
||||
</edit>
|
||||
</match>
|
||||
<match>
|
||||
<test name="lang" compare="contains">
|
||||
<string>zh-hk</string>
|
||||
</test>
|
||||
<test name="family">
|
||||
<string>sans-serif</string>
|
||||
</test>
|
||||
<edit name="family" mode="prepend">
|
||||
<string>Source Hans Sans TWHK</string>
|
||||
</edit>
|
||||
</match>
|
||||
</fontconfig>
|
58
otf-source-han-sans/PKGBUILD
Normal file
58
otf-source-han-sans/PKGBUILD
Normal file
@ -0,0 +1,58 @@
|
||||
# Maintainer: Weng Xuetian <wengxt@gmail.com>
|
||||
|
||||
pkgbase=otf-source-han-sans
|
||||
pkgver=1.000
|
||||
pkgrel=1
|
||||
pkgdesc='Adobe Source Han Sans - Religion-specific subsets'
|
||||
arch=('any')
|
||||
url='https://github.com/adobe-fonts/source-han-sans'
|
||||
license=('apache')
|
||||
depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-font-utils')
|
||||
install="otf-source-han-sans.install"
|
||||
|
||||
_languages=(
|
||||
'cn "Simplified Chinese"'
|
||||
'jp "Japanese"'
|
||||
'kr "Korean"'
|
||||
'twhk "Traditional Chinese"'
|
||||
)
|
||||
|
||||
pkgname=()
|
||||
source=()
|
||||
|
||||
for _lang in "${_languages[@]}"; do
|
||||
_locale=${_lang%% *}
|
||||
_pkgname=${pkgbase}-${_locale,,}
|
||||
_upper_locale=`echo $_locale | tr '[:lower:]' '[:upper:]'`
|
||||
pkgname+=(${_pkgname})
|
||||
source+=("http://sourceforge.net/projects/source-han-sans.adobe/files/SourceHanSans${_upper_locale}-${pkgver}.zip"
|
||||
"44-source-han-sans-${_locale}.conf")
|
||||
eval "function package_${_pkgname}() { _package $_lang; }"
|
||||
done
|
||||
|
||||
|
||||
function _package {
|
||||
pkgdesc="Adobe Source Han Sans - $2 OpenType fonts"
|
||||
_upper_locale=`echo $1 | tr '[:lower:]' '[:upper:]'`
|
||||
|
||||
# Prepare destination directory
|
||||
install -dm755 "$pkgdir/usr/share/fonts/OTF"
|
||||
|
||||
# Install fonts
|
||||
for font in "SourceHanSans${_upper_locale}-${pkgver}"/*.otf; do
|
||||
install -m644 "$font" "$pkgdir/usr/share/fonts/OTF"
|
||||
done
|
||||
|
||||
install -dm755 "$pkgdir/etc/fonts/conf.d/"
|
||||
install -Dm644 "44-source-han-sans-${1}.conf" "$pkgdir/etc/fonts/conf.avail/44-source-han-sans-${1}.conf"
|
||||
cd "$pkgdir/etc/fonts/conf.d/"
|
||||
ln -s ../conf.avail/44-source-han-sans-${1}.conf .
|
||||
}
|
||||
md5sums=('146465b5e0efa1709433bed888622b06'
|
||||
'71e97aa9698fd241aede6d6f7dda6dc8'
|
||||
'10fbb83ab3e77cbf292bb20d50b1f7c9'
|
||||
'3281df1f09624f680988cbee60406609'
|
||||
'745ffdb9dad770472623a9430f3cabab'
|
||||
'efb45e8595fb8ff9264203346b2e9485'
|
||||
'39d5915f35f7a46aae293eaf91fd9a17'
|
||||
'98141e67f7405249da9ec7800211be01')
|
15
otf-source-han-sans/otf-source-han-sans.install
Normal file
15
otf-source-han-sans/otf-source-han-sans.install
Normal file
@ -0,0 +1,15 @@
|
||||
post_install() {
|
||||
echo -n "Updating font cache... "
|
||||
fc-cache -fs >/dev/null
|
||||
mkfontscale usr/share/fonts/OTF
|
||||
mkfontdir usr/share/fonts/OTF
|
||||
echo "Done."
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install $1
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
post_install $1
|
||||
}
|
Loading…
Reference in New Issue
Block a user