Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

157a9e58-01f9-46b6-a756-7898254ab7f3 592 B
Raw

You have to be logged in to leave a comment. Sign In
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
  1. """Pen to draw to a Cairo graphics library context."""
  2. from fontTools.pens.basePen import BasePen
  3. __all__ = ["CairoPen"]
  4. class CairoPen(BasePen):
  5. """Pen to draw to a Cairo graphics library context."""
  6. def __init__(self, glyphSet, context):
  7. BasePen.__init__(self, glyphSet)
  8. self.context = context
  9. def _moveTo(self, p):
  10. self.context.move_to(*p)
  11. def _lineTo(self, p):
  12. self.context.line_to(*p)
  13. def _curveToOne(self, p1, p2, p3):
  14. self.context.curve_to(*p1, *p2, *p3)
  15. def _closePath(self):
  16. self.context.close_path()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...