Import SRPM
This commit is contained in:
parent
2f39ac5420
commit
953466755b
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/01_NotoSansCJK-OTF-VF.zip
|
112
65-google-noto-sans-cjk-mono-vf-fonts.conf
Normal file
112
65-google-noto-sans-cjk-mono-vf-fonts.conf
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
||||||
|
<fontconfig>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans Mono CJK SC</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans Mono CJK TC</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans Mono CJK HK</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans Mono CJK JP</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans Mono CJK KR</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
</fontconfig>
|
112
65-google-noto-sans-cjk-vf-fonts.conf
Normal file
112
65-google-noto-sans-cjk-vf-fonts.conf
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
||||||
|
<fontconfig>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans CJK SC</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans CJK TC</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans CJK HK</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans CJK JP</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
<match target="scan">
|
||||||
|
<test name="family">
|
||||||
|
<string>Noto Sans CJK KR</string>
|
||||||
|
</test>
|
||||||
|
<edit name="lang" mode="assign">
|
||||||
|
<minus>
|
||||||
|
<name>lang</name>
|
||||||
|
<langset>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>zh-cn</string>
|
||||||
|
<string>zh-hk</string>
|
||||||
|
<string>zh-mo</string>
|
||||||
|
<string>zh-sg</string>
|
||||||
|
<string>zh-tw</string>
|
||||||
|
<string>cmn</string>
|
||||||
|
<string>hak</string>
|
||||||
|
<string>lzh</string>
|
||||||
|
<string>nan</string>
|
||||||
|
<string>yue</string>
|
||||||
|
</langset>
|
||||||
|
</minus>
|
||||||
|
</edit>
|
||||||
|
</match>
|
||||||
|
</fontconfig>
|
161
genfontconf.py
Normal file
161
genfontconf.py
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
|
'''
|
||||||
|
Generate the font config file for Noto CJK fonts
|
||||||
|
|
||||||
|
genfontconf.py "lang list" "common font name" "font name" "fallback font name" "prepend latin font" ...
|
||||||
|
|
||||||
|
like
|
||||||
|
|
||||||
|
genfontconf.py --fallback-font --prepend-latin-font "zh-cn:zh-sg" "monospace" "Source Han Sans CN" "Source Han Sans TW" "DejaVu Sans Mono" "zh-cn:zh-sg" "serif" "Source Han Sans CN" "Source Han Sans TW" "" "zh-cn:zh-sg" "sans-serif" "Source Han Sans CN" "Source Han Sans TW" ""
|
||||||
|
|
||||||
|
genfontconf.py "zh-cn:zh-sg" "monospace" "Noto Sans Mono CJK SC" "zh-cn:zh-sg" "serif" "Noto Serif CJK SC" "zh-cn:zh-sg" "sans-serif" "Noto Sans CJK SC"
|
||||||
|
|
||||||
|
The above information is in variable length array.
|
||||||
|
'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
Some Noto CJK fonts may not need "fallback font name"
|
||||||
|
|
||||||
|
Skip the "fallback font name" argument if not needed.
|
||||||
|
'''
|
||||||
|
|
||||||
|
fallback_font_name = False
|
||||||
|
|
||||||
|
'''
|
||||||
|
Noto CJK may not need "prepend latin font".
|
||||||
|
|
||||||
|
Skip the "prepend latin font" argument if not needed.
|
||||||
|
'''
|
||||||
|
|
||||||
|
prepend_latin_font = False
|
||||||
|
|
||||||
|
|
||||||
|
class FontConfRecord:
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderRecord(langlist, common, font, fallback=None, latin=None):
|
||||||
|
for lang in langlist.split(":"):
|
||||||
|
FontConfRecord.renderMatch(lang, common, font, fallback, latin)
|
||||||
|
print()
|
||||||
|
|
||||||
|
FontConfRecord.renderAlias(font, common)
|
||||||
|
print()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderMatch(lang, common, font, fallback, latin):
|
||||||
|
print('<match>')
|
||||||
|
FontConfRecord.renderTestLang(lang)
|
||||||
|
FontConfRecord.renderTestFamily(common)
|
||||||
|
FontConfRecord.renderEditFamily(font, fallback)
|
||||||
|
FontConfRecord.renderEditLatinFamily(latin)
|
||||||
|
print('</match>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderTestLang(lang):
|
||||||
|
print('<test name="lang">')
|
||||||
|
print('<string>{0}</string>'.format(lang))
|
||||||
|
print('</test>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderTestFamily(common):
|
||||||
|
print('<test name="family">')
|
||||||
|
print('<string>{0}</string>'.format(common))
|
||||||
|
print('</test>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderEditFamily(font, fallback):
|
||||||
|
print('<edit name="family" mode="prepend">')
|
||||||
|
print('<string>{0}</string>'.format(font))
|
||||||
|
if fallback:
|
||||||
|
print('<string>{0}</string>'.format(fallback))
|
||||||
|
print('</edit>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderEditLatinFamily(latin):
|
||||||
|
if not latin:
|
||||||
|
return
|
||||||
|
print('<edit name="family" mode="prepend" binding="strong">')
|
||||||
|
print('<string>{0}</string>'.format(latin))
|
||||||
|
print('</edit>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderAlias(font, common):
|
||||||
|
print('<alias>')
|
||||||
|
print('<family>{0}</family>'.format(font))
|
||||||
|
print('<default>')
|
||||||
|
print('<family>{0}</family>'.format(common))
|
||||||
|
print('</default>')
|
||||||
|
print('</alias>')
|
||||||
|
|
||||||
|
|
||||||
|
class FontConfFile:
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderFile(strings):
|
||||||
|
FontConfFile.renderHeader()
|
||||||
|
FontConfFile.renderBody(strings)
|
||||||
|
FontConfFile.renderFooter()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderHeader():
|
||||||
|
print('<?xml version="1.0"?>')
|
||||||
|
print('<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">')
|
||||||
|
print('<fontconfig>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderBody(strings):
|
||||||
|
num = 3
|
||||||
|
if fallback_font_name:
|
||||||
|
num += 1
|
||||||
|
if prepend_latin_font:
|
||||||
|
num += 1
|
||||||
|
|
||||||
|
while len(strings):
|
||||||
|
items = strings[0:num]
|
||||||
|
strings = strings[num:]
|
||||||
|
|
||||||
|
if num == 3:
|
||||||
|
FontConfRecord.renderRecord(items[0], items[1], items[2])
|
||||||
|
|
||||||
|
if num == 4:
|
||||||
|
if fallback_font_name:
|
||||||
|
FontConfRecord.renderRecord \
|
||||||
|
(items[0], items[1], items[2], items[3])
|
||||||
|
if prepend_latin_font:
|
||||||
|
FontConfRecord.renderRecord \
|
||||||
|
(items[0], items[1], items[2], None, items[3])
|
||||||
|
|
||||||
|
if num == 5:
|
||||||
|
FontConfRecord.renderRecord \
|
||||||
|
(items[0], items[1], items[2], items[3], items[4])
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderFooter():
|
||||||
|
print('</fontconfig>')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description='Generate font config.')
|
||||||
|
parser.add_argument('strings', metavar='string', type=str, nargs='+',
|
||||||
|
help='strings')
|
||||||
|
|
||||||
|
parser.add_argument('--fallback-font', dest='fallback_font', action='store_true')
|
||||||
|
parser.add_argument('--disable-fallback-font', dest='fallback_font', action='store_false')
|
||||||
|
parser.set_defaults(fallback_font=False)
|
||||||
|
|
||||||
|
parser.add_argument('--prepend-latin-font', dest='prepend_latin_font', action='store_true')
|
||||||
|
parser.add_argument('--disable-prepend-latin-font', dest='prepend_latin_font', action='store_false')
|
||||||
|
parser.set_defaults(prepend_latin_font=False)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
#print(args)
|
||||||
|
|
||||||
|
fallback_font_name = args.fallback_font
|
||||||
|
prepend_latin_font = args.prepend_latin_font
|
||||||
|
|
||||||
|
FontConfFile.renderFile(args.strings)
|
102
google-noto-sans-cjk-vf-fonts.spec
Normal file
102
google-noto-sans-cjk-vf-fonts.spec
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
Epoch: 1
|
||||||
|
Version: 2.004
|
||||||
|
Release: 1%{?dist}
|
||||||
|
URL: https://github.com/googlefonts/noto-cjk
|
||||||
|
|
||||||
|
BuildRequires: python3
|
||||||
|
|
||||||
|
%global foundry Google
|
||||||
|
%global fontlicense OFL-1.1
|
||||||
|
%global fontlicenses LICENSE
|
||||||
|
|
||||||
|
%global fontfamily Noto Sans CJK VF
|
||||||
|
%global fontsummary Google Noto Sans CJK Variable Fonts
|
||||||
|
%global fonts *.ttc
|
||||||
|
%global fontconfs 65-0-%{fontpkgname}.conf %{SOURCE10} %{SOURCE11}
|
||||||
|
%global fontdescription %{expand:
|
||||||
|
Noto CJK fonts, supporting Simplified Chinese, Traditional Chinese, \
|
||||||
|
Japanese, and Korean. The supported scripts are Han, Hiragana, Katakana, \
|
||||||
|
Hangul, and Bopomofo. Latin, Greek, Cyrllic, and various symbols are also \
|
||||||
|
supported for compatibility with CJK standards.
|
||||||
|
|
||||||
|
The google-noto-cjk-sans-vf-fonts package contains Google Noto Sans CJK Variable fonts.
|
||||||
|
}
|
||||||
|
|
||||||
|
Source0: https://github.com/googlefonts/noto-cjk/releases/download/Sans%{version}/01_NotoSansCJK-OTF-VF.zip
|
||||||
|
Source1: genfontconf.py
|
||||||
|
Source10: 65-%{fontpkgname}.conf
|
||||||
|
Source11: 65-google-noto-sans-cjk-mono-vf-fonts.conf
|
||||||
|
|
||||||
|
%global obsoletes_epoch_version_release 0:20201206-8
|
||||||
|
|
||||||
|
%global obsoletes_pkg()\
|
||||||
|
%define subpkgname %1\
|
||||||
|
Obsoletes: %{subpkgname} < %{obsoletes_epoch_version_release}\
|
||||||
|
Provides: %{subpkgname} = %{epoch}:%{version}-%{release}\
|
||||||
|
|
||||||
|
%global obsoletes_sans()\
|
||||||
|
%define langname %1\
|
||||||
|
%obsoletes_pkg google-noto-sans-cjk-%{langname}-fonts\
|
||||||
|
%obsoletes_pkg google-noto-sans-%{langname}-fonts\
|
||||||
|
%obsoletes_pkg google-noto-sans-mono-cjk-%{langname}-fonts\
|
||||||
|
|
||||||
|
%global fontpkgheader %{expand:
|
||||||
|
|
||||||
|
# The Noto Sans CJK fonts have both Variable and non-Variable fonts.
|
||||||
|
# It will cause some issues if install both VF and non-VF fonts,
|
||||||
|
# add Conflicts here to only install either VF or non-VF fonts.
|
||||||
|
Conflicts: google-noto-sans-cjk-fonts
|
||||||
|
|
||||||
|
%obsoletes_pkg google-noto-cjk-fonts
|
||||||
|
%obsoletes_pkg google-noto-cjk-fonts-common
|
||||||
|
%obsoletes_pkg google-noto-sans-cjk-ttc-fonts
|
||||||
|
|
||||||
|
%obsoletes_sans sc
|
||||||
|
%obsoletes_sans tc
|
||||||
|
%obsoletes_sans hk
|
||||||
|
%obsoletes_sans jp
|
||||||
|
%obsoletes_sans kr
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%fontpkg
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -c
|
||||||
|
|
||||||
|
cp -p Variable/OTC/NotoSansCJK-VF.otf.ttc NotoSansCJK-VF.ttc
|
||||||
|
cp -p Variable/OTC/NotoSansMonoCJK-VF.otf.ttc NotoSansMonoCJK-VF.ttc
|
||||||
|
|
||||||
|
cp %{SOURCE1} .
|
||||||
|
|
||||||
|
python3 genfontconf.py "ja" "monospace" "Noto Sans Mono CJK JP" \
|
||||||
|
"ja" "sans-serif" "Noto Sans CJK JP" \
|
||||||
|
"ko" "monospace" "Noto Sans Mono CJK KR" \
|
||||||
|
"ko" "sans-serif" "Noto Sans CJK KR" \
|
||||||
|
"zh-cn:zh-sg" "monospace" "Noto Sans Mono CJK SC" \
|
||||||
|
"zh-cn:zh-sg" "sans-serif" "Noto Sans CJK SC" \
|
||||||
|
"zh-tw:cmn:hak:lzh:nan" "monospace" "Noto Sans Mono CJK TC" \
|
||||||
|
"zh-tw:cmn:hak:lzh:nan" "sans-serif" "Noto Sans CJK TC" \
|
||||||
|
"zh-hk:zh-mo:yue" "monospace" "Noto Sans Mono CJK HK" \
|
||||||
|
"zh-hk:zh-mo:yue" "sans-serif" "Noto Sans CJK HK" \
|
||||||
|
| xmllint --format - |tee 65-0-google-noto-sans-cjk-vf-fonts.conf
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
%fontbuild
|
||||||
|
|
||||||
|
%install
|
||||||
|
%fontinstall
|
||||||
|
|
||||||
|
%check
|
||||||
|
%fontcheck
|
||||||
|
|
||||||
|
%fontfiles
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Feb 3 2023 Peng Wu <pwu@redhat.com> - 1:2.004-1
|
||||||
|
- Initial Packaging
|
||||||
|
- Migrate to SPDX license
|
Loading…
Reference in New Issue
Block a user