# Path: weasyprint/svg/utils.py
# def normalize(string):
#     """Give a canonical version of a given value string."""
#     string = (string or '').replace('E', 'e')
#     string = re.sub('(?<!e)-', ' -', string)
#     string = re.sub('[ \n\r\t,]+', ' ', string)
#     string = re.sub(r'(\.[0-9-]+)(?=\.)', r'\1 ', string)
#     return string.strip()
# 
# def point(svg, string, font_size):
#     """Pop first two size values from a string."""
#     match = re.match('(.*?) (.*?)(?: |$)', string)
#     if match:
#         x, y = match.group(1, 2)
#         string = string[match.end():]
#         return (*svg.point(x, y, font_size), string)
#     else:
#         raise PointError


from math import atan2, cos, isclose, pi, radians, sin, tan
from .utils import normalize, point
    from ..document import Matrix
            svg.stream.line_to(x, old_y)
            current_point = x, old_y

        elif letter in 'lL':
            # Straight line
            x, y, string = point(svg, string, font_size)
            old_x, old_y = current_point
            if letter == 'l':
                x += old_x
                y += old_y
            angle = atan2(y - old_y, x - old_x)
            node.vertices.append((pi - angle, angle))
            svg.stream.line_to(x, y)
            current_point = x, y

        elif letter in 'mM':
            # Current point move
            x, y, string = point(svg, string, font_size)
            if last_letter and last_letter not in 'zZ':
                node.vertices.append(None)
            if letter == 'm':
                x += current_point[0]
                y += current_point[1]
            svg.stream.move_to(x, y)
            current_point = x, y

        elif letter in 'qQtT':
            # Quadratic curve
            x1, y1 = current_point
            if letter in 'qQ':

# Path: weasyprint/svg/utils.py
# def normalize(string):
#     """Give a canonical version of a given value string."""
#     string = (string or '').replace('E', 'e')
#     string = re.sub('(?<!e)-', ' -', string)
#     string = re.sub('[ \n\r\t,]+', ' ', string)
#     string = re.sub(r'(\.[0-9-]+)(?=\.)', r'\1 ', string)
#     return string.strip()
# 
# def point(svg, string, font_size):
#     """Pop first two size values from a string."""
#     match = re.match('(.*?) (.*?)(?: |$)', string)
#     if match:
#         x, y = match.group(1, 2)
#         string = string[match.end():]
#         return (*svg.point(x, y, font_size), string)
#     else:
#         raise PointError


# Path: weasyprint/svg/path.py
from math import atan2, cos, isclose, pi, radians, sin, tan
from .utils import normalize, point
    from ..document import Matrix

            svg.stream.line_to(x, old_y)
            current_point = x, old_y

        elif letter in 'lL':
            # Straight line
            x, y, string = point(svg, string, font_size)
            old_x, old_y = current_point
            if letter == 'l':
                x += old_x
                y += old_y
            angle = atan2(y - old_y, x - old_x)
            node.vertices.append((pi - angle, angle))
            svg.stream.line_to(x, y)
            current_point = x, y

        elif letter in 'mM':
            # Current point move
            x, y, string = point(svg, string, font_size)
            if last_letter and last_letter not in 'zZ':
                node.vertices.append(None)
            if letter == 'm':
                x += current_point[0]
                y += current_point[1]
            svg.stream.move_to(x, y)
            current_point = x, y

        elif letter in 'qQtT':
            # Quadratic curve
            x1, y1 = current_point
            if letter in 'qQ':

                x2, y2, string = point(svg, string, font_size)