Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/cu2qu/
Date: Sat, 25 Apr 2020 00:37:30
Message-Id: 1587775035.72a8ae907625d23ef354f6e4f4165d467a035ab1.Alessandro-Barbieri@gentoo
1 commit: 72a8ae907625d23ef354f6e4f4165d467a035ab1
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Mon Apr 20 20:27:33 2020 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Sat Apr 25 00:37:15 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=72a8ae90
7
8 dev-python/cu2qu: new package
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
12
13 dev-python/cu2qu/Manifest | 1 +
14 dev-python/cu2qu/cu2qu-1.6.7.ebuild | 28 +++++++++++++++++++++++
15 dev-python/cu2qu/metadata.xml | 44 +++++++++++++++++++++++++++++++++++++
16 3 files changed, 73 insertions(+)
17
18 diff --git a/dev-python/cu2qu/Manifest b/dev-python/cu2qu/Manifest
19 new file mode 100644
20 index 0000000..4996475
21 --- /dev/null
22 +++ b/dev-python/cu2qu/Manifest
23 @@ -0,0 +1 @@
24 +DIST cu2qu-1.6.7.zip 215819 BLAKE2B 328df385c459f82805eaa9483ccf49ab1faae2f4a878381d2a7fd1e2be01d15f55eb5f2afabc1a0487d3bed4ae407cc2042989bc820620bd1ac0b33f95d441bc SHA512 929d353cf8ef6f989cd373c49ba77082cfdd35edce6aafa1c13d983782562a16245d75d086d3a7e28dd217bda6c19d50966a4fb1ce50d5a0397eb1304816a28f
25
26 diff --git a/dev-python/cu2qu/cu2qu-1.6.7.ebuild b/dev-python/cu2qu/cu2qu-1.6.7.ebuild
27 new file mode 100644
28 index 0000000..b3520e6
29 --- /dev/null
30 +++ b/dev-python/cu2qu/cu2qu-1.6.7.ebuild
31 @@ -0,0 +1,28 @@
32 +# Copyright 1999-2020 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI="7"
36 +
37 +PYTHON_COMPAT=( python3_{6,7} )
38 +
39 +inherit distutils-r1
40 +
41 +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.zip"
42 +KEYWORDS="~amd64"
43 +DESCRIPTION="Cubic-to-quadratic bezier curve conversion"
44 +HOMEPAGE="https://github.com/googlefonts/cu2qu"
45 +LICENSE="Apache-2.0"
46 +SLOT="0"
47 +
48 +RDEPEND="
49 + >=dev-python/fonttools-3.32[${PYTHON_USEDEP}]
50 + >=dev-python/defcon-0.6.0[${PYTHON_USEDEP}]
51 +"
52 +DEPEND="
53 + ${RDEPEND}
54 +"
55 +BDEPEND="
56 + dev-python/cython[${PYTHON_USEDEP}]
57 +"
58 +
59 +distutils_enable_tests pytest
60
61 diff --git a/dev-python/cu2qu/metadata.xml b/dev-python/cu2qu/metadata.xml
62 new file mode 100644
63 index 0000000..831cc74
64 --- /dev/null
65 +++ b/dev-python/cu2qu/metadata.xml
66 @@ -0,0 +1,44 @@
67 +<?xml version="1.0" encoding="UTF-8"?>
68 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
69 +
70 +<pkgmetadata>
71 + <upstream>
72 + <remote-id type="github">googlefonts/cu2qu</remote-id>
73 + <remote-id type="pypi">cu2qu</remote-id>
74 + </upstream>
75 + <longdescription lang="en">
76 +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:
77 +
78 +from defcon import Font
79 +from cu2qu.ufo import fonts_to_quadratic
80 +thin_font = Font('MyFont-Thin.ufo')
81 +bold_font = Font('MyFont-Bold.ufo')
82 +fonts_to_quadratic([thin_font, bold_font])
83 +
84 +Interpolation compatibility is guaranteed during conversion. If it's not needed, converting one font at a time may yield more optimized results:
85 +
86 +for font in [thin_font, bold_font]:
87 + fonts_to_quadratic([font])
88 +
89 +Some fonts may need a different error threshold than the default (0.001 em). This can also be provided by the caller:
90 +
91 +fonts_to_quadratic([thin_font, bold_font], max_err_em=0.005)
92 +
93 +for font in [thin_font, bold_font]:
94 + fonts_to_quadratic([font], max_err_em=0.001)
95 +
96 +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:
97 +
98 +3: 1000
99 +4: 2000
100 +5: 100
101 +
102 +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:
103 +
104 +stats = {}
105 +for font in [thin_font, bold_font]:
106 + fonts_to_quadratic([font], stats=stats)
107 +# "stats" will report combined statistics for both fonts
108 +
109 +The library also provides a command-line script also named cu2qu. Check its --help to see all the options. </longdescription>
110 +</pkgmetadata>