The setting of current point to (0,0) is actually harmless, but it
definitely looks like a bug, (since after close_path the current point
is really the last move point).
We don't keep track of last move point here, nor do we even need to.
So we can be consistent with _cairo_path_fixed_close_path by not
adjusting current point at all, (the subsequent move_to coming right
behind the close_path will fix up the current point).
Besides the bug fix, this is a user-visible change since the new
move_to element after the close_path element can be seen in the
results of cairo_copy_path, so we document that here.
We are also careful to fix up _cairo_path_fixed_line_to to defer to
_cairo_path_fixed_move_to to avoid letting the last_move_point state
get stale. This avoids introducing the second bug that is also tested
by the close-path test case.
The bug shows up when doing cairo_copy_path_flat for a path that has
a curve_to immediately after a close_path. When the curve is flattened
the flattener is using (0,0) as the initial point rather than the proper
close_to point.
This test also serves to ensure a similar bug doesn't crop up when
closing a path that begins with an implicit move_to, (as from cairo_arc).
In that bug the path state may have no last-move-point and the path
is closed to (0,0). This bug is not present currently, but did appear
during the development of a fix for the bug above.
There are still some problems in the resulting output:
PDF: Rotated font ends up being blurry in final PNG (not too important)
PS and SVG: There's an incorrect offset being applied somewhere.
The difference here is that the SVG backend uses a meta-surface for
its similar surface, so there are no rasterization/filtering
artefacts when scaling the source surface.
that combine vertical layout with font_matrix rotation and translation.
Currently Type3 and Type1 font paths both show broken behavior.
The type1 test uses "Nimbus Sans L" as the font.
which should be set to device_transform_inverse, not device_transform.
Moreover, no negation is needed anymore, as that has been working around
the inverse matrix :-).