Add Chinese fonts

This commit is contained in:
Peng Wu 2014-11-12 17:23:25 +08:00
parent 25c9af6dc3
commit 3207ee5d5a
5 changed files with 274 additions and 2 deletions

View File

@ -0,0 +1,105 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<test name="lang">
<string>zh-cn</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans SC</string>
<string>Noto Sans TC</string>
</edit>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
</edit>
</match>
<match>
<test name="lang">
<string>zh-sg</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans SC</string>
<string>Noto Sans TC</string>
</edit>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
</edit>
</match>
<alias>
<family>Noto Sans SC</family>
<default>
<family>monospace</family>
</default>
</alias>
<match>
<test name="lang">
<string>zh-cn</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans SC</string>
<string>Noto Sans TC</string>
</edit>
</match>
<match>
<test name="lang">
<string>zh-sg</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans SC</string>
<string>Noto Sans TC</string>
</edit>
</match>
<alias>
<family>Noto Sans SC</family>
<default>
<family>serif</family>
</default>
</alias>
<match>
<test name="lang">
<string>zh-cn</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans SC</string>
<string>Noto Sans TC</string>
</edit>
</match>
<match>
<test name="lang">
<string>zh-sg</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans SC</string>
<string>Noto Sans TC</string>
</edit>
</match>
<alias>
<family>Noto Sans SC</family>
<default>
<family>sans-serif</family>
</default>
</alias>
</fontconfig>

View File

@ -0,0 +1,105 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans TC</string>
<string>Noto Sans SC</string>
</edit>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
</edit>
</match>
<match>
<test name="lang">
<string>zh-hk</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans TC</string>
<string>Noto Sans SC</string>
</edit>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
</edit>
</match>
<alias>
<family>Noto Sans TC</family>
<default>
<family>monospace</family>
</default>
</alias>
<match>
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans TC</string>
<string>Noto Sans SC</string>
</edit>
</match>
<match>
<test name="lang">
<string>zh-hk</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans TC</string>
<string>Noto Sans SC</string>
</edit>
</match>
<alias>
<family>Noto Sans TC</family>
<default>
<family>serif</family>
</default>
</alias>
<match>
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans TC</string>
<string>Noto Sans SC</string>
</edit>
</match>
<match>
<test name="lang">
<string>zh-hk</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans TC</string>
<string>Noto Sans SC</string>
</edit>
</match>
<alias>
<family>Noto Sans TC</family>
<default>
<family>sans-serif</family>
</default>
</alias>
</fontconfig>

View File

@ -1,5 +1,6 @@
%global fontname google-noto
%global fontconf 66-%{fontname}
%global cjkfontconf 65-0-%{fontname}
%global common_desc \
Noto fonts aims to remove tofu from web by providing fonts for all \
Unicode supported script. Its design goal is to achieve visual harmonization\
@ -8,7 +9,7 @@ in Unicode.
Name: %{fontname}-fonts
Version: 20141001
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Hinted and Non Hinted open type fonts for Unicode scripts
Group: User Interface/X
License: ASL 2.0
@ -121,6 +122,9 @@ Source104: %{fontconf}-sans-tai-le.conf
Source105: %{fontconf}-sans-tifinagh.conf
Source106: %{fontconf}-sans-yi.conf
Source107: %{fontconf}-sans-tagbanwa.conf
Source108: %{cjkfontconf}-sans-sc.conf
Source109: %{cjkfontconf}-sans-tc.conf
# Add appstream metadata files
Source200: %{fontname}.metainfo.xml
@ -230,6 +234,9 @@ Source303: %{fontname}-sans-tai-le.metainfo.xml
Source304: %{fontname}-sans-tifinagh.metainfo.xml
Source305: %{fontname}-sans-yi.metainfo.xml
Source306: %{fontname}-sans-tagbanwa.metainfo.xml
Source307: %{fontname}-sans-sc.metainfo.xml
Source308: %{fontname}-sans-tc.metainfo.xml
BuildArch: noarch
BuildRequires: fontforge >= 20080429
@ -1554,7 +1561,29 @@ Non Hinted fonts for Tagbanwa script.
%{_datadir}/appdata/%{fontname}-sans-tagbanwa.metainfo.xml
%doc LICENSE
%package -n %{fontname}-sans-sc-fonts
Summary: Free sans-serif fonts for Simplified Chinese
Requires: fontpackages-filesystem
%description -n %{fontname}-sans-sc-fonts
%common_desc
Non Hinted fonts for Simplified Chinese.
%_font_pkg -n sans-sc -f %{cjkfontconf}-sans-sc.conf NotoSansSC-*.otf
%{_datadir}/appdata/%{fontname}-sans-sc.metainfo.xml
%doc LICENSE
%package -n %{fontname}-sans-tc-fonts
Summary: Free sans-serif fonts for Traditional Chinese
Requires: fontpackages-filesystem
%description -n %{fontname}-sans-tc-fonts
%common_desc
Non Hinted fonts for Traditional Chinese.
%_font_pkg -n sans-tc -f %{cjkfontconf}-sans-tc.conf NotoSansTC-*.otf
%{_datadir}/appdata/%{fontname}-sans-tc.metainfo.xml
%doc LICENSE
%prep
%setup -q -c
@ -1562,6 +1591,8 @@ rm -rf noto-396bf23e32cf/color_emoji
cp noto-396bf23e32cf/AUTHORS noto-396bf23e32cf/CONTRIBUTORS noto-396bf23e32cf/LICENSE .
cp noto-396bf23e32cf/fonts/individual/unhinted/* .
cp -f noto-396bf23e32cf/fonts/individual/hinted/* .
cp noto-396bf23e32cf/third_party/noto_cjk/NotoSansSC-*.otf .
cp noto-396bf23e32cf/third_party/noto_cjk/NotoSansTC-*.otf .
rm -rf Arimo-* Cousine-* Tinos-*
@ -1572,6 +1603,9 @@ rm -rf Arimo-* Cousine-* Tinos-*
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p *.ttf %{buildroot}%{_fontdir}
# for cjk fonts
install -m 0644 -p *.otf %{buildroot}%{_fontdir}
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
%{buildroot}%{_fontconfig_confdir}
@ -1788,6 +1822,10 @@ install -m 0644 -p %{SOURCE106} \
%{buildroot}%{_fontconfig_templatedir}/%{fontconf}-sans-yi.conf
install -m 0644 -p %{SOURCE107} \
%{buildroot}%{_fontconfig_templatedir}/%{fontconf}-sans-tagbanwa.conf
install -m 0644 -p %{SOURCE108} \
%{buildroot}%{_fontconfig_templatedir}/%{cjkfontconf}-sans-sc.conf
install -m 0644 -p %{SOURCE109} \
%{buildroot}%{_fontconfig_templatedir}/%{cjkfontconf}-sans-tc.conf
for fconf in %{fontconf}-sans.conf \
%{fontconf}-sans-armenian.conf \
@ -1894,7 +1932,9 @@ for fconf in %{fontconf}-sans.conf \
%{fontconf}-sans-tai-le.conf \
%{fontconf}-sans-tifinagh.conf \
%{fontconf}-sans-yi.conf \
%{fontconf}-sans-tagbanwa.conf ; do
%{fontconf}-sans-tagbanwa.conf \
%{cjkfontconf}-sans-sc.conf \
%{cjkfontconf}-sans-tc.conf ; do
ln -s %{_fontconfig_templatedir}/$fconf \
%{buildroot}%{_fontconfig_confdir}/$fconf
done
@ -2114,8 +2154,16 @@ install -Dm 0644 -p %{SOURCE305} \
%{buildroot}%{_datadir}/appdata/%{fontname}-sans-yi.metainfo.xml
install -Dm 0644 -p %{SOURCE306} \
%{buildroot}%{_datadir}/appdata/%{fontname}-sans-tagbanwa.metainfo.xml
install -Dm 0644 -p %{SOURCE307} \
%{buildroot}%{_datadir}/appdata/%{fontname}-sans-sc.metainfo.xml
install -Dm 0644 -p %{SOURCE308} \
%{buildroot}%{_datadir}/appdata/%{fontname}-sans-tc.metainfo.xml
%changelog
* Wed Nov 12 2014 Peng Wu <pwu@redhat.com> - 20141001-4
- Add Chinese fonts
* Tue Nov 11 2014 Parag Nemade <pnemade AT redhat DOT com> - 20141001-3
- Add metainfo file to show this font in gnome-software

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->
<component type="font">
<id>google-noto-sans-sc</id>
<metadata_license>CC-BY-3.0</metadata_license>
<extends>google-noto</extends>
</component>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->
<component type="font">
<id>google-noto-sans-tc</id>
<metadata_license>CC-BY-3.0</metadata_license>
<extends>google-noto</extends>
</component>