Fix autofix_for_release.py noto_lint.py scripts error

(cherry picked from commit 5889e95930eb2413f52002a46244da517a3fea53)
This commit is contained in:
wk333 2024-11-28 15:30:22 +08:00 committed by openeuler-sync-bot
parent 693862883d
commit 4237648ce2
2 changed files with 41 additions and 3 deletions

View File

@ -3,11 +3,12 @@
Name: nototools
Version: 0.2.17
Release: 1
Release: 2
Summary: Noto fonts support tools and scripts plus web site generation
License: ASL 2.0
License: Apache-2.0
URL: https://github.com/googlei18n/nototools
Source0: https://github.com/googlei18n/nototools/archive/%{commit0}/nototools-%{shortcommit0}.tar.gz
Patch0: remove-requireReal-arg-for-fonttools-4.27.0.patch
BuildArch: noarch
BuildRequires: python3-devel python-setuptools python3-wheel python3-setuptools_scm
Requires: python3-nototools = %{version}-%{release}
@ -30,7 +31,10 @@ BuildRequires: python3dist(fonttools)
The tools package contains python3 scripts.
%prep
%autosetup -c -p0
%autosetup -c -p1
# fix module 'nototools.notoconfig' has no attribute 'values'
sed -i 's/notoconfig.values/notoconfig._values/g' */nototools/autofix_for_release.py
rm -rf nototools-%{commit0}/third_party/{cldr,dspl,fontcrunch,ohchr,spiro,udhr,unicode}
mv %{name}-%{commit0} python3
@ -69,6 +73,9 @@ cd ..
%changelog
* Thu Nov 28 2024 wangkai <13474090681@163.com> - 0.2.17-2
- Fix autofix_for_release.py noto_lint.py scripts error
* Thu Sep 15 2022 lutcunpeng <lutkunpeng@163.com> - 0.2.17-1
- DESC: update to 0.2.17

View File

@ -0,0 +1,31 @@
diff --git a/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/compare_fonts.py b/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/compare_fonts.py
index b0b9379..48a1746 100755
--- a/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/compare_fonts.py
+++ b/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/compare_fonts.py
@@ -182,10 +182,10 @@ class FontCompare(object):
return result
def _test_gid(self, cp):
- return self.test.getGlyphID(self.test_cmap[cp], requireReal=True)
+ return self.test.getGlyphID(self.test_cmap[cp])
def _target_gid(self, cp):
- return self.target.getGlyphID(self.target_cmap[cp], requireReal=True)
+ return self.target.getGlyphID(self.target_cmap[cp])
def _cp_error_msg(self, cp, test_msg, target_msg):
test_gid = self._test_gid(cp)
diff --git a/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/noto_lint.py b/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/noto_lint.py
index 4951832..4c902f1 100755
--- a/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/noto_lint.py
+++ b/nototools-cd79db632c9a506ad61ae72bfad5875341ca56b8/nototools/noto_lint.py
@@ -1380,7 +1380,7 @@ def check_font(
cmap = font_data.get_cmap(font)
for cp in lint_config.parse_int_ranges(WIN_ANSI_CODEPOINTS, True):
if cp in cmap:
- tmp_gids.add(font.getGlyphID(cmap[cp], requireReal=True))
+ tmp_gids.add(font.getGlyphID(cmap[cp]))
win_ansi_gids = frozenset(tmp_gids)
font_ymin = None