{
gdouble w, h, r;
gdouble r1;
+ gdouble waste;
glTemplate *template;
gl_debug (DEBUG_PRINT, "START");
case GL_TEMPLATE_STYLE_RECT:
gl_label_get_size (label, &w, &h);
r = template->label.rect.r;
+ waste = template->label.rect.waste;
if (r == 0.0) {
/* simple rectangle */
- create_rectangle_path (pi->pc, 0.0, 0.0, w, h);
+ create_rectangle_path (pi->pc, -waste, -waste, w+waste, h+waste);
} else {
/* rectangle with rounded corners */
- create_rounded_rectangle_path (pi->pc, 0.0, 0.0,
- w, h, r);
+ create_rounded_rectangle_path (pi->pc, -waste, -waste,
+ w+waste, h+waste, r);
}
gnome_print_clip (pi->pc);
break;
case GL_TEMPLATE_STYLE_ROUND:
r1 = template->label.round.r;
- create_ellipse_path (pi->pc, r1, r1, r1, r1);
+ waste = template->label.round.waste;
+ create_ellipse_path (pi->pc, r1, r1, r1+waste, r1+waste);
gnome_print_clip (pi->pc);
break;
case GL_TEMPLATE_STYLE_CD:
+ waste = template->label.cd.waste;
if ((template->label.cd.h == 0) && (template->label.cd.w == 0)) {
/* CD style, round label w/ concentric round hole */
r1 = template->label.cd.r1;
- create_ellipse_path (pi->pc, r1, r1, r1, r1);
- gnome_print_clip (pi->pc);
+ create_ellipse_path (pi->pc, r1, r1, r1+waste, r1+waste);
} else {
/* Business Card CD style, clipped round label w/ hole */
gl_label_get_size (label, &w, &h);
r1 = template->label.cd.r1;
- create_clipped_circle_path (pi->pc, w/2, h/2, w, h, r1);
- gnome_print_clip (pi->pc);
+ create_clipped_circle_path (pi->pc,
+ w/2, h/2,
+ w+2*waste, h+2*waste,
+ r1+waste);
}
+ gnome_print_clip (pi->pc);
break;
default:
gl_debug (DEBUG_TEMPLATE, "START");
+ template->label.style = GL_TEMPLATE_STYLE_RECT;
template->label.rect.w = gl_xml_get_prop_length (label_node, "width", 0);
template->label.rect.h = gl_xml_get_prop_length (label_node, "height", 0);
template->label.rect.r = gl_xml_get_prop_length (label_node, "round", 0);
+ template->label.rect.waste = gl_xml_get_prop_length (label_node, "waste", 0);
+
for (node = label_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (xmlStrEqual (node->name, "Layout")) {
gl_debug (DEBUG_TEMPLATE, "START");
+ template->label.style = GL_TEMPLATE_STYLE_ROUND;
+
template->label.round.r = gl_xml_get_prop_length (label_node, "radius", 0);
+ template->label.round.waste = gl_xml_get_prop_length (label_node, "waste", 0);
+
for (node = label_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (xmlStrEqual (node->name, "Layout")) {
gl_debug (DEBUG_TEMPLATE, "START");
+ template->label.style = GL_TEMPLATE_STYLE_CD;
+
template->label.cd.r1 = gl_xml_get_prop_length (label_node, "radius", 0);
template->label.cd.r2 = gl_xml_get_prop_length (label_node, "hole", 0);
template->label.cd.w = gl_xml_get_prop_length (label_node, "width", 0);
template->label.cd.h = gl_xml_get_prop_length (label_node, "height", 0);
+ template->label.cd.waste = gl_xml_get_prop_length (label_node, "waste", 0);
+
for (node = label_node->xmlChildrenNode; node != NULL;
node = node->next) {
if (xmlStrEqual (node->name, "Layout")) {
gl_xml_set_prop_length (node, "width", template->label.rect.w);
gl_xml_set_prop_length (node, "height", template->label.rect.h);
gl_xml_set_prop_length (node, "round", template->label.rect.r);
+ gl_xml_set_prop_length (node, "waste", template->label.rect.waste);
break;
case GL_TEMPLATE_STYLE_ROUND:
node = xmlNewChild(root, ns, "Label-round", NULL);
xmlSetProp (node, "id", "0");
gl_xml_set_prop_length (node, "radius", template->label.round.r);
+ gl_xml_set_prop_length (node, "waste", template->label.round.waste);
break;
case GL_TEMPLATE_STYLE_CD:
if (template->label.cd.h != 0.0) {
gl_xml_set_prop_length (node, "height", template->label.cd.h);
}
+ gl_xml_set_prop_length (node, "waste", template->label.cd.waste);
break;
default: