dev-python/cu2qu: new package

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2020-04-20 22:27:33 +02:00
parent ec392ceb98
commit 72a8ae9076
3 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST cu2qu-1.6.7.zip 215819 BLAKE2B 328df385c459f82805eaa9483ccf49ab1faae2f4a878381d2a7fd1e2be01d15f55eb5f2afabc1a0487d3bed4ae407cc2042989bc820620bd1ac0b33f95d441bc SHA512 929d353cf8ef6f989cd373c49ba77082cfdd35edce6aafa1c13d983782562a16245d75d086d3a7e28dd217bda6c19d50966a4fb1ce50d5a0397eb1304816a28f

View File

@@ -0,0 +1,28 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
PYTHON_COMPAT=( python3_{6,7} )
inherit distutils-r1
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.zip"
KEYWORDS="~amd64"
DESCRIPTION="Cubic-to-quadratic bezier curve conversion"
HOMEPAGE="https://github.com/googlefonts/cu2qu"
LICENSE="Apache-2.0"
SLOT="0"
RDEPEND="
>=dev-python/fonttools-3.32[${PYTHON_USEDEP}]
>=dev-python/defcon-0.6.0[${PYTHON_USEDEP}]
"
DEPEND="
${RDEPEND}
"
BDEPEND="
dev-python/cython[${PYTHON_USEDEP}]
"
distutils_enable_tests pytest

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<remote-id type="github">googlefonts/cu2qu</remote-id>
<remote-id type="pypi">cu2qu</remote-id>
</upstream>
<longdescription lang="en">
This library provides functions which take in UFO objects (Defcon Fonts or Robofab RFonts) and converts any cubic curves to quadratic. The most useful function is probably fonts_to_quadratic:
from defcon import Font
from cu2qu.ufo import fonts_to_quadratic
thin_font = Font('MyFont-Thin.ufo')
bold_font = Font('MyFont-Bold.ufo')
fonts_to_quadratic([thin_font, bold_font])
Interpolation compatibility is guaranteed during conversion. If it's not needed, converting one font at a time may yield more optimized results:
for font in [thin_font, bold_font]:
fonts_to_quadratic([font])
Some fonts may need a different error threshold than the default (0.001 em). This can also be provided by the caller:
fonts_to_quadratic([thin_font, bold_font], max_err_em=0.005)
for font in [thin_font, bold_font]:
fonts_to_quadratic([font], max_err_em=0.001)
fonts_to_quadratic can print a string reporting the number of curves of each length. For example fonts_to_quadratic([font], dump_stats=True) may print something like:
3: 1000
4: 2000
5: 100
meaning that the font now contains 1000 curves with three points, 2000 with four points, and 100 with five. Given multiple fonts, the function will report the total counts across all fonts. You can also accumulate statistics between calls by providing your own report dictionary:
stats = {}
for font in [thin_font, bold_font]:
fonts_to_quadratic([font], stats=stats)
# "stats" will report combined statistics for both fonts
The library also provides a command-line script also named cu2qu. Check its --help to see all the options. </longdescription>
</pkgmetadata>