Logo Search packages:      
Sourcecode: inkscape version File versions

SPCurve * Inkscape::Text::Layout::convertToCurves ( iterator const &  from_glyph,
iterator const &  to_glyph 
) const

Convert the specified range of characters into their bezier outlines.

Definition at line 541 of file Layout-TNG-Output.cpp.

References _getGlyphTransformMatrix(), Inkscape::Text::Layout::iterator::_glyph_index, sp_curve_concat(), sp_curve_new(), sp_curve_new_from_bpath(), and sp_curve_unref().

{
    GSList *cc = NULL;

    for (int glyph_index = from_glyph._glyph_index ; glyph_index < to_glyph._glyph_index ; glyph_index++) {
        NRMatrix glyph_matrix;
        Span const &span = _glyphs[glyph_index].span(this);
        _getGlyphTransformMatrix(glyph_index, &glyph_matrix);

        NRBPath bpath;
        bpath.path = (NArtBpath*)span.font->ArtBPath(_glyphs[glyph_index].glyph);
        if (bpath.path) {
            NArtBpath *abp = nr_artpath_affine(bpath.path, glyph_matrix);
            SPCurve *c = sp_curve_new_from_bpath(abp);
            if (c) cc = g_slist_prepend(cc, c);
        }
    }
    cc = g_slist_reverse(cc);

    SPCurve *curve;
    if ( cc ) {
        curve = sp_curve_concat(cc);
    } else {
        curve = sp_curve_new();
    }

    while (cc) {
        /* fixme: This is dangerous, as we are mixing art_alloc and g_new */
        sp_curve_unref((SPCurve *) cc->data);
        cc = g_slist_remove(cc, cc->data);
    }

    return curve;
}


Generated by  Doxygen 1.6.0   Back to index