示例#1
0
void NRStyle::applyTextDecorationStroke(Inkscape::DrawingContext &dc)
{
    dc.setSource(text_decoration_stroke_pattern);
    dc.setLineWidth(text_decoration_stroke_width);
    dc.setLineCap(CAIRO_LINE_CAP_BUTT);
    dc.setLineJoin(CAIRO_LINE_JOIN_MITER);
    dc.setMiterLimit(miter_limit);
    cairo_set_dash(dc.raw(), 0, 0, 0.0); // fixme (no dash)
}
示例#2
0
void NRStyle::applyStroke(Inkscape::DrawingContext &dc)
{
    dc.setSource(stroke_pattern);
    dc.setLineWidth(stroke_width);
    dc.setLineCap(line_cap);
    dc.setLineJoin(line_join);
    dc.setMiterLimit(miter_limit);
    cairo_set_dash(dc.raw(), dash, n_dash, dash_offset); // fixme
}
示例#3
0
bool NRStyle::prepareTextDecorationStroke(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox)
{
    if (!text_decoration_stroke_pattern) {
        switch (text_decoration_stroke.type) {
        case PAINT_SERVER: {
        	text_decoration_stroke_pattern = text_decoration_stroke.server->pattern_new(dc.raw(), paintbox, text_decoration_stroke.opacity);
		} break;
        case PAINT_COLOR: {
            SPColor const &c = text_decoration_stroke.color;
            text_decoration_stroke_pattern = cairo_pattern_create_rgba(
                c.v.c[0], c.v.c[1], c.v.c[2], text_decoration_stroke.opacity);
            } break;
        default: break;
        }
    }
    if (!text_decoration_stroke_pattern) return false;
    return true;
}
示例#4
0
bool NRStyle::prepareStroke(Inkscape::DrawingContext &ct, Geom::OptRect const &paintbox)
{
    if (!stroke_pattern) {
        switch (stroke.type) {
        case PAINT_SERVER: {
            stroke_pattern = sp_paint_server_create_pattern(stroke.server, ct.raw(), paintbox, stroke.opacity);
            } break;
        case PAINT_COLOR: {
            SPColor const &c = stroke.color;
            stroke_pattern = cairo_pattern_create_rgba(
                c.v.c[0], c.v.c[1], c.v.c[2], stroke.opacity);
            } break;
        default: break;
        }
    }
    if (!stroke_pattern) return false;
    return true;
}
示例#5
0
bool NRStyle::prepareFill(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox)
{
    // update fill pattern
    if (!fill_pattern) {
        switch (fill.type) {
        case PAINT_SERVER: {
            fill_pattern = fill.server->pattern_new(dc.raw(), paintbox, fill.opacity);
            } break;
        case PAINT_COLOR: {
            SPColor const &c = fill.color;
            fill_pattern = cairo_pattern_create_rgba(
                c.v.c[0], c.v.c[1], c.v.c[2], fill.opacity);
            } break;
        default: break;
        }
    }
    if (!fill_pattern) return false;
    return true;
}