diff options
| author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2011-06-04 14:16:57 +0000 |
|---|---|---|
| committer | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2011-06-04 14:16:57 +0000 |
| commit | 0be32d46f7e5ca3b4f4fc6c5f7f19b110b948551 (patch) | |
| tree | 82fc18e5bd687f5f86d133638163d86d041d5aaf /src/libnrtype | |
| parent | Idem. (diff) | |
| download | inkscape-0be32d46f7e5ca3b4f4fc6c5f7f19b110b948551.tar.gz inkscape-0be32d46f7e5ca3b4f4fc6c5f7f19b110b948551.zip | |
Fixed font problem on win32.
(bzr r9508.1.87)
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/FontInstance.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 7dc8bb859..1b65dd88c 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -557,13 +557,19 @@ void font_instance::LoadGlyph(int glyph_id) break; case TT_PRIM_QSPLINE: - //g_assert(polyCurve->cpfx % 2 == 0); - if (polyCurve->cpfx % 2 != 0) return; - - while ( p != endp ) { - path_builder.quadTo(pointfx_to_nrpoint(p[0], scale), - pointfx_to_nrpoint(p[1], scale)); - p += 2; + { + g_assert(polyCurve->cpfx >= 2); + + // The list of points specifies one or more control points and ends with the end point. + // The intermediate points (on the curve) are the points between the control points. + Geom::Point this_control = pointfx_to_nrpoint(*p++, scale); + while ( p+1 != endp ) { // Process all "midpoints" (all points except the last) + Geom::Point new_control = pointfx_to_nrpoint(*p++, scale); + path_builder.quadTo(this_control, (new_control+this_control)/2); + this_control = new_control; + } + Geom::Point end = pointfx_to_nrpoint(*p++, scale); + path_builder.quadTo(this_control, end); } break; |
