Skip to content

Commit

Permalink
media-fonts/Shanggu: new package, add 1.021
Browse files Browse the repository at this point in the history
  • Loading branch information
Linerre authored and liangyongxiang committed Nov 19, 2024
1 parent df4d2c1 commit a2fc958
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/overlay.toml
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,13 @@ use_latest_release = true
prefix = "v"
github_account = "Linerre"

["media-fonts/Shanggu"]
source = "github"
github = "GuiWonder/Shanggu"
use_latest_release = true
prefix = "v"
github_account = "Linerre"

# TODO: version not found: https://sites.google.com/view/jtfoundry/zh-tw/downloads
#["media-fonts/taipei-sans-tc"]

Expand Down
4 changes: 4 additions & 0 deletions media-fonts/Shanggu/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DIST ShangguMono-1.021.7z 48145274 BLAKE2B 610a52e00b991dd23569347d2fc44c522384647c2af46e8319fb922541f27a96b101eedf48406c4be8b47f85fdf94ed0ae704c9f9f8c8f522936c0311f996eee SHA512 04cc5efbd7034fcdb8acdd5d6363d2fbd9f589daca23a87afa0789f2537d972463e2c1f12fe2f82925ce59b5090f82e46e054a1b114d6c879e8bffd1c40c4f15
DIST ShangguRound-1.021.7z 50298854 BLAKE2B efc8e4189e9185d06c0ba576a08dae1e52b1b85649734f8b8e93edd810c34bf53a9d6ce905c9648c05850667380fbd74c18b1399dc14d91960572b961a421b23 SHA512 9770d957d010986551953f9247671f84570adc737e7af44f0ee3ece814cf60826500b302fc8d8d5f8572d6ed57cf13064044afb281d614b7cca213579d1d49ff
DIST ShangguSans-1.021.7z 46665936 BLAKE2B 83a32f14b13c7aa390518e3303cf96efca9d8b6eb02809e39c0e4509109d4bff43f4692e59872e3ebc344964256a0716c68838273794d894fb40e2520adc130d SHA512 3ce3794537dd5855d564d01977b4f066f517962afdf557fbf7c8b4265afbcf9019d5c836155f72394cf2409bae004333c44e8fe737e80890e6cab70ac6c0eb9f
DIST ShangguSerif-1.021.7z 67705930 BLAKE2B 4a44c66b32ccdcda07a9fe518bb6096ae83de977225ca4564406a01fb5bc95274c1d6131571e8e2846c2dcbaf9dc9822062c6acd617b7b885f6a6ae10741e354 SHA512 555f7611e892c737e9780d4520c7b754181c4c434e1d418d0fcf8f044f7805f2c5f54cee0b93b0e4f5f91840b68c9e75a4dd9badb14e0d7486af73671395e711
80 changes: 80 additions & 0 deletions media-fonts/Shanggu/Shanggu-1.021.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit font unpacker

DESCRIPTION="A Noto-based font for traditional Chinese characters"
HOMEPAGE="https://github.com/GuiWonder/Shanggu"

SRC_URI="
mono? ( https://github.com/GuiWonder/${PN}/releases/download/${PV}/${PN}MonoTTFs.7z -> ${PN}Mono-${PV}.7z )
round? ( https://github.com/GuiWonder/${PN}/releases/download/${PV}/${PN}RoundTTFs.7z -> ${PN}Round-${PV}.7z )
sans? ( https://github.com/GuiWonder/${PN}/releases/download/${PV}/${PN}SansTTFs.7z -> ${PN}Sans-${PV}.7z )
serif? ( https://github.com/GuiWonder/${PN}/releases/download/${PV}/${PN}SerifTTFs.7z -> ${PN}Serif-${PV}.7z )
"

S="${WORKDIR}"
LICENSE="OFL-1.1"
SLOT="0"
KEYWORDS="~amd64"
IUSE="round sans +serif mono"
REQUIRED_USE="|| ( round sans serif mono )"
BDEPEND="
app-arch/p7zip
"

FONT_SUFFIX="ttf"

src_unpack() {
use mono && unpack_7z "${PN}Mono-${PV}.7z"
use round && unpack_7z "${PN}Round-${PV}.7z"
use sans && unpack_7z "${PN}Sans-${PV}.7z"
use serif && unpack_7z "${PN}Serif-${PV}.7z"
}

src_install() {
if use serif; then
FONT_S=(
"${S}/${PN}Serif"
"${S}/${PN}SerifFANTI"
"${S}/${PN}SerifJP"
"${S}/${PN}SerifSC"
"${S}/${PN}SerifTC"
)
font_src_install
fi

if use sans; then
FONT_S=(
"${S}/${PN}Sans"
"${S}/${PN}SansFANTI"
"${S}/${PN}SansJP"
"${S}/${PN}SansSC"
"${S}/${PN}SansTC"
)
font_src_install
fi

if use mono; then
FONT_S=(
"${S}/${PN}Mono"
"${S}/${PN}MonoJP"
"${S}/${PN}MonoSC"
"${S}/${PN}MonoTC"
)
font_src_install
fi

if use round; then
FONT_S=(
"${S}/${PN}Round"
"${S}/${PN}RoundFANTI"
"${S}/${PN}RoundJP"
"${S}/${PN}RoundSC"
"${S}/${PN}RoundTC"
)
font_src_install
fi
}
17 changes: 17 additions & 0 deletions media-fonts/Shanggu/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>leon.errelin@outlook.com</email>
<name>Linerre</name>
</maintainer>
<use>
<flag name="mono">Install ShangguMono font family</flag>
<flag name="round">Install ShangguRound font family</flag>
<flag name="sans">Install ShangguSans font family</flag>
<flag name="serif">Install ShangguSerif font family (default)</flag>
</use>
<upstream>
<remote-id type="github">GuiWonder/Shanggu</remote-id>
</upstream>
</pkgmetadata>

0 comments on commit a2fc958

Please sign in to comment.