Name:           fonttools
Version:        4.61.1
Release:        1
Summary:        Tools to manipulate font files
License:        MIT
URL:            https://github.com/fonttools/fonttools/
Source0:        %{pypi_source fonttools}
Requires:       python3-fonttools
Requires:       python3-setuptools
Provides:       ttx = %{version}-%{release}

%description
FontTools is a library for manipulating fonts, written in Python. The project
includes the TTX tool, that can convert TrueType and OpenType fonts to and
from an XML text format, which is also called TTX. It supports TrueType,
OpenType, AFM and to an extent Type 1 and some Mac-specific formats. The
project has an MIT open-source licence.

%package -n python3-fonttools
Summary:        Python 3 fonttools library
BuildRequires:  python3-devel python3-numpy python3-setuptools_scm
BuildRequires:  python3-setuptools
BuildRequires:  python3-pip python3-wheel python3-Cython

%{?python_provide:%python_provide python3-fonttools}

%description -n python3-fonttools
FontTools is a library for manipulating fonts, written in Python. The project
includes the TTX tool, that can convert TrueType and OpenType fonts to and
from an XML text format, which is also called TTX. It supports TrueType,
OpenType, AFM and to an extent Type 1 and some Mac-specific formats. The
project has an MIT open-source licence.

%package_help

%prep
%autosetup -p1
sed -i 1d Lib/fontTools/mtiLib/__init__.py
rm -rf *.egg-info

%build
export FONTTOOLS_WITH_CYTHON=1
%pyproject_build

%install
%pyproject_install

%files
%{_bindir}/pyf*
%{_bindir}/ttx
%{_bindir}/fonttools

%files help
%doc NEWS.rst README.rst
%{_mandir}/man1/ttx.1.gz

%files -n python3-fonttools
%doc LICENSE
%{python3_sitearch}/fontTools
%{python3_sitearch}/fonttools-%{version}.dist-info

%changelog
* Mon Jan 05 2026 maqi <maqi@uniontech.com> - 4.61.1-1
- Upgrade to 4.61.1
  *buildCoverage: return empty Coverage instead of None
  *bug fix in avar2 full instancing
  *Preserve empty conditionsets when serializing to XML
  *Fix FontBuilder setupOS2() default params globally polluted
  *Add more typing annotations to ttFont, xmlWriter, sfnt, varLib.models and others
  *Explicitly test and declare support for Python 3.14, even though we were already shipping pre-built wheels for it

* Mon Oct 20 2025 maqi <maqi@uniontech.com> - 4.60.1-1
- Upgrade to 4.60.1
  *Reverted accidental method name change in UFOReader.getKerningGroupConversionRenameMaps
   that broke compatibility with downstream projects like defcon
  *Added test coverage for getKerningGroupConversionRenameMaps method
  *Don't try to subset BASE table;  pass it through by default instead
  *Remove empty BaseRecord entries in MarkBasePos lookups
  *Add pruning for MarkLigPos and MarkMarkPos lookups
  *Remove duplicate features when subsetting
  *Added documentation for the visitor module

* Fri Sep 19 2025 Yu Peng <yupeng@kylinos.cn> - 4.60.0-1
- Upgrade to 4.60.0
  * Fixed difference in cython vs pure-python complex division
  * Refactored and added some new sub-modules and scripts
  * Speed up build_psNameMapping
  * Added typing annotations to fontTools.ufoLib

* Wed Jun 25 2025 Ge Wang <wang__ge@126.com> - 4.58.4-1
- Update to 4.58.4

* Tue Nov 05 2024 Ge Wang <wang__ge@126.com> - 4.54.1-1
- Update to 4.54.1

* Tue Jun 4 2024 lilu <lilu@kylinos.cn> - 4.53.0-1
- Update to 4.53.0
- Support CFF table to aid in downconverting CFF2 fonts
- Fix crash when accessing not-yet-existing attribute

* Thu Jan 11 2024 wangkai <13474090681@163.com> - 4.39.4-2
- Fix CVE-2023-45139

* Thu May 18 2023 Ge Wang <wang__ge@126.com> - 4.39.4-1
- Update to 4.39.4

* Sun Apr 24 2022 caodongxia <caodongxia@h-partners.com> - 4.32.0-1
- update to 4.32.0 

* Wed Apr 06 2022 houyingchao <houyingchao@h-partners.com> - 3.29.0-6
- Replace totring with tobytes
- Replace fromtring with frombytes

* Wed Mar 30 2022 baizhonggui <baizhonggui@huawei.com> - 3.29.0-5
- support py3.10+ wildcard to fix build error

* Tue Oct 26 2021 chenchen <chen_aka_jan@163.com> - 3.29.0-4
- change the spec file name to be the same as the repo name

* Thu Oct 22 2020 huanghaitao <huannghaitao8@huawei.com> - 3.29.0-3
- Disable python2 module

* Thu Nov 28 2019 likexin<likexin4@huawei.com> - 3.29.0-2
- Package init