forked from coldtype/coldtype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_reportlabpen.py
35 lines (27 loc) · 957 Bytes
/
test_reportlabpen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import unittest
import coldtype.pens.misc
from coldtype.pens.reportlabpen import ReportLabPen
from coldtype.test import StSt, co, Rect, P, hsl
class TestReportLabPen(unittest.TestCase):
def test_basic_drawing(self):
coldtype.pens.misc.USE_SKIA_PATHOPS = False
r = Rect("letter")
pens = P([
(P(r.inset(20))
.align(r)
.f(0.9)),
(P(r.inset(40))
.align(r)
.fssw(-1, 0, 5)),
(StSt("COLD", co, 150, wdth=1)
.align(r)
.fssw(hsl(0.65, 1, 0.8), hsl(0.9), 2)
.pen()
.q2c()
.removeOverlap())])
self.assertEqual(len(pens[-1].v.value), 117)
ReportLabPen.PDF(pens, r,
"test/ignorables/reportlab_test.pdf")
coldtype.pens.misc.USE_SKIA_PATHOPS = True
if __name__ == "__main__":
unittest.main()