]> git.sur5r.net Git - glabels/commitdiff
2008-03-15 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sun, 16 Mar 2008 03:37:48 +0000 (03:37 +0000)
committerJim Evins <evins@snaught.com>
Sun, 16 Mar 2008 03:37:48 +0000 (03:37 +0000)
* data/templates/Makefile.am:
* data/templates/brother-other-templates.xml:
Added brother templates.
* src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path),
(gl_cairo_markup_margin_cd_path):
* src/view.c: (draw_markup_layer):
Fixed markup drawing errors when label is rotated.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/branches/glabels-2_2@761 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/data/templates/Makefile.am
glabels2/data/templates/brother-other-templates.xml [new file with mode: 0644]
glabels2/src/cairo-markup-path.c
glabels2/src/view.c

index bac40cdf744e13b792df86f395910053a99599c0..e0e3403354d1fb4da985fec4822da92fb7fe2bad 100644 (file)
@@ -1,3 +1,13 @@
+2008-03-15  Jim Evins  <evins@snaught.com>
+
+       * data/templates/Makefile.am:
+       * data/templates/brother-other-templates.xml:
+               Added brother templates.
+       * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path),
+       (gl_cairo_markup_margin_cd_path):
+       * src/view.c: (draw_markup_layer):
+               Fixed markup drawing errors when label is rotated.
+
 2008-03-03  Jim Evins  <evins@snaught.com>
 
        * configure.in:
index 6339454039975f2c4793695a6cf8b47359b3186a..71b1f50b993c116d181d573cfec0f5fd3953331a 100644 (file)
@@ -9,6 +9,7 @@ templates_DATA = \
        avery-iso-templates.xml \
        avery-other-templates.xml \
        zweckform-iso-templates.xml \
+       brother-other-templates.xml \
        misc-us-templates.xml \
        misc-iso-templates.xml \
        misc-other-templates.xml
diff --git a/glabels2/data/templates/brother-other-templates.xml b/glabels2/data/templates/brother-other-templates.xml
new file mode 100644 (file)
index 0000000..2158f98
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<Glabels-templates xmlns="http://snaught.com/glabels/2.2/">
+
+  <!--
+   *********************************************************************
+   *********************************************************************
+   Labels for the Brother QL-500/550/650 PC Label Printers
+      
+   These templates work with the Brother Linux Printer CUPS Driver.  It
+   is unknown if these work correctly with the foomatic print driver for
+   these printers.
+      
+   One difference from typical templates is that the template size is
+   not the actual media size - it is the size of the printable area,
+   which is smaller than the media size.  This is because (at least with
+   the Brother driver) coordinates are relative the corner of this area.
+      
+   *********************************************************************
+   *********************************************************************
+  -->
+
+  <Template brand="Brother" part="DK-1201" size="Other" width="25.91mm" height="83.90mm" description="Standard Address Labels 29mm x 90mm">
+    <Label-rectangle id="0" width="25.91mm" height="83.90mm" round="0" x_waste="0" y_waste="0">
+      <Markup-rect x1="-1.5mm" y1="-3mm" w="29mm" h="90mm" r="1.5mm" />
+      <Layout nx="1" ny="1" x0="0" y0="0" dx="0" dy="0"/>
+    </Label-rectangle>
+  </Template>
+
+  <Template brand="Brother" part="DK-1202" size="Other" width="58.93mm" height="93.20mm" description="Shipping Labels 62mm x 100mm">
+    <Label-rectangle id="0" width="58.93mm" height="93.20mm" round="0" x_waste="0" y_waste="0">
+      <Markup-rect x1="-1.5mm" y1="-3mm" w="62mm" h="100mm" r="1.5mm" />
+      <Layout nx="1" ny="1" x0="0" y0="0" dx="0" dy="0"/>
+    </Label-rectangle>
+  </Template>
+
+  <Template brand="Brother" part="DK-1204" size="Other" width="13.97mm" height="47.92mm" description="Multi Purpose Labels 17mm x 54mm">
+    <Label-rectangle id="0" width="13.97mm" height="47.92mm" round="0" x_waste="0" y_waste="0">
+      <Markup-rect x1="-1.5mm" y1="-3mm" w="17mm" h="54mm" r="1.5mm" />
+      <Layout nx="1" ny="1" x0="0" y0="0" dx="0" dy="0"/>
+    </Label-rectangle>
+  </Template>
+
+
+</Glabels-templates>
index cb7ead7c4643b4d48cdfd457bacaeaba9911f445..04a2a68f0d5e6cc5ba597ae93c5998028ebab438 100644 (file)
@@ -153,7 +153,7 @@ gl_cairo_markup_margin_rect_path (cairo_t                 *cr,
 
         m = markup->margin.size;
 
-        gl_label_get_size (label, &w, &h);
+        lgl_template_frame_get_size (frame, &w, &h);
        w = w - 2*m;
        h = h - 2*m;
         r = MAX (frame->rect.r - m, 0.0);
@@ -217,7 +217,7 @@ gl_cairo_markup_margin_cd_path (cairo_t                 *cr,
 
         frame = (lglTemplateFrame *)label->template->frames->data;
 
-        gl_label_get_size (label, &w, &h);
+        lgl_template_frame_get_size (frame, &w, &h);
         xc = w/2.0;
         yc = h/2.0;
 
index c35db8d367d3940e6bba8fc950ecac034c6a154d..a9e7ceeb6cd26b5d9f9b8495e45e11b9df8af649 100644 (file)
@@ -905,6 +905,7 @@ draw_markup_layer (glView  *view,
        const lglTemplateFrame    *frame;
        GList                     *p;
        lglTemplateMarkup         *markup;
+        gdouble                    width, height;
 
        g_return_if_fail (view && GL_IS_VIEW (view));
        g_return_if_fail (view->label && GL_IS_LABEL (view->label));
@@ -917,6 +918,13 @@ draw_markup_layer (glView  *view,
 
                 cairo_save (cr);
 
+                if (label->rotate_flag)
+                {
+                        lgl_template_frame_get_size (frame, &width, &height);
+                        cairo_rotate (cr, -M_PI/2.0);
+                        cairo_translate (cr, -width, 0.0);
+                }
+
                 cairo_set_line_width (cr, MARKUP_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom));
                 cairo_set_source_rgb (cr, MARKUP_RGB_ARGS);