File: index.rst

package info (click to toggle)
fonttools 4.61.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,588 kB
  • sloc: python: 145,091; xml: 103; makefile: 24
file content (38 lines) | stat: -rw-r--r-- 1,448 bytes parent folder | download | duplicates (4)
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
36
37
38
########################################
cu2qu: Convert cubic curves to quadratic
########################################

Routines for converting cubic curves to quadratic splines, suitable for use
in OpenType to TrueType outline conversion.

Conversion is carried out to a degree of tolerance provided by the user. While
it is relatively easy to find the best *single* quadratic curve to represent a
given cubic (see for example `this method from CAGD <https://www.sirver.net/blog/2011/08/23/degree-reduction-of-bezier-curves/>`_),
the best-fit method may not be sufficiently accurate for type design.

Instead, this method chops the cubic curve into multiple segments before
converting each cubic segment to a quadratic, in order to ensure that the
resulting spline fits within the given tolerance.

The basic curve conversion routines are implemented in the
:mod:`fontTools.cu2qu.cu2qu` module; the :mod:`fontTools.cu2qu.ufo` module
applies these routines to all of the curves in a UFO file or files; while the
:mod:`fontTools.cu2qu.cli` module implements the ``fonttools cu2qu`` command
for converting a UFO format font with cubic curves into one with quadratic
curves.

fontTools.cu2qu.cu2qu
---------------------

.. automodule:: fontTools.cu2qu.cu2qu
   :inherited-members:
   :members:
   :undoc-members:

fontTools.cu2qu.ufo
-------------------

.. automodule:: fontTools.cu2qu.ufo
   :inherited-members:
   :members:
   :undoc-members: