1 <page xmlns="http://projectmallard.org/1.0/"
2 xmlns:e="http://projectmallard.org/experimental/"
7 <link type="guide" xref="index#advanced"/>
8 <revision pkgversion="3.0" version="0.1" date="2010-05-04" status="incomplete"/>
10 Create your templates manually.
12 <credit type="author">
13 <name>Jim Evins</name>
14 <email>evins@snaught.com</email>
16 <credit type="author">
17 <name>Mario Blättermann</name>
18 <email>mariobl@gnome.org</email>
21 <p>Creative Commons Share Alike 3.0</p>
25 <title>Manually creating new templates</title>
27 <p>Predefined templates are defined by XML files located in
28 either <file>/usr/share/libglabels-3.0/templates/</file> or
29 <file>/usr/local/share/libglabels-3.0/templates/</file>,
30 depending on where <app>glabels</app> was installed. <app>Glabels</app> will
31 also search for user defined templates in the directory
32 <file>${HOME}/.config/libglabels/templates/</file>. User
33 defined template files should be named with a
34 <file>*.template</file> extension.
37 <p>The format for these files is defined in the DTD:
38 <link href="http://glabels.org/xmlns/2.3/glabels-2.3.dtd.txt">glabels-2.3.dtd</link>.
39 (This DTD also describes other XML formats used by <app>glabels</app>.)</p>
41 <section id="template-assumptions">
42 <title>Assumptions/caveats</title>
45 <p>A sheet contains only one size of label or card (if a sheet
46 contains more than one size of item, it can be split into
47 multiple templates for multiple pass printing)</p>
50 <p>Distances can be expressed in units of <em>pt</em>,
51 <em>in</em>, <em>mm</em>,
52 <em>cm</em>, or <em>pc</em>. For example:
53 "<code>1.0in</code>" or "<code>2.54cm</code>". If no
54 units are specified, computer points (<em>pt</em>) will
55 be assumed (1 <em>pt</em> =
56 1/72 <em>in</em> = 0.352778 <em>mm</em>).
62 <section id="template-file">
63 <title>Template Files</title>
66 <?xml version="1.0"?>
67 <Glabels-templates>
69 <var>...templates...</var>
71 </Glabels-templates>
76 <section id="template-example">
77 <title>Example Template</title>
79 <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels">
80 <Meta category="label"/>
81 <Meta category="mail"/>
82 <Meta product_url="http://www.avery.com/avery/en_us/"/>
83 <Label-rectangle id="0" width="189pt" height="72pt" round="5pt">
84 <Markup-margin size="5pt"/>
85 <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/>
86 </Label-rectangle>
91 <section id="template-template-node">
92 <title><span translate="no">Template</span> Node</title>
94 <p>A <em><span translate="no">Template</span></em> node describes a single
95 stationery product. It must contain one instance of any type of Label node
96 (<em><span translate="no">Label-rectangle</span></em>,
97 <em><span translate="no">Label-round</span></em>, or
98 <em><span translate="no">Label-cd</span></em>).</p>
100 <table frame="all" rules="rows">
102 <td><p>Property</p></td> <td><p>Description</p></td>
105 <td><p></p></td> <td><p></p></td>
108 <td><p><span translate="no">brand</span></p></td>
109 <td><p>Brand or manufacturer of stationery product. E.g. "Avery"</p></td>
112 <td><p><span translate="no">part</span></p></td>
113 <td><p>Part number or name of stationery product. E.g. "8160"</p></td>
116 <td><p><span translate="no">size</span></p></td>
117 <td><p>Size of sheet. E.g., "US-Letter," "A4", ...</p></td>
120 <td><p><span translate="no">description</span></p></td>
121 <td><p>Description of stationery product. E.g, "Mailing Labels."</p></td>
124 <td><p><span translate="no">_description</span></p></td>
125 <td><p>Translatable description of stationery product. E.g, "Mailing Labels."
126 (Only useful for predefined templates)</p></td>
129 <td><p><span translate="no">width</span></p></td>
130 <td><p>Page width. Only valid if size="Other"</p></td>
133 <td><p><span translate="no">height</span></p></td>
134 <td><p>Page height. Only valid if size="Other"</p></td>
137 <td><p><span translate="no">equiv</span></p></td>
138 <td><p>Equivalent part number. If this property is present, the template
139 is a clone of another template of the same brand. The template will
140 inherit all properties, except brand and name from the other template.
141 This equiv property must refer to a previously defined template --
142 libglabels does not currently support forward references.</p></td>
148 <section id="template-template-node">
149 <title><span translate="no">Meta</span> Node</title>
151 <p>A <em><span translate="no">Meta</span></em> node contains some additional
152 properties of that product. This node may appear more than once, with a
155 <table frame="all" rules="rows">
157 <td><p>Subnode</p></td> <td><p>Description</p></td>
160 <td><p></p></td> <td><p></p></td>
163 <td><p><span translate="no">category</span></p></td>
164 <td><p>The category which this product is assigned to. The value
165 of this category is used by the <app>gLabels'</app> template chooser to filter the
166 view to display only mailing labels, or labels in common and suppress any other products
167 which the user don't want to find.</p>
168 <p>One product can be assigned to several categories. You may choose from the
169 following categories:</p>
171 <item><p><span translate="no">label</span></p></item>
172 <item><p><span translate="no">round-label</span></p></item>
173 <item><p><span translate="no">elliptical-label</span></p></item>
174 <item><p><span translate="no">square-label</span></p></item>
175 <item><p><span translate="no">rectangle-label</span></p></item>
176 <item><p><span translate="no">card</span></p></item>
177 <item><p><span translate="no">business-card</span></p></item>
178 <item><p><span translate="no">media</span></p></item>
179 <item><p><span translate="no">mail</span></p></item>
180 <item><p><span translate="no">foldable</span></p></item>
182 <note><p>If you have any ideas for new categories, please send your suggestions to the
183 developer's <link href="mailto:glabels-devel@lists.sourceforge.net">mailing list</link>
184 of <app>gLabels</app>.
189 <td><p><span translate="no">product_url</span></p></td>
190 <td><p>This address points to the vendor's website. Ideally,
191 the link shows the URL of that certain product, if available.</p></td>
197 <section id="template-label-rectangle-node">
198 <title><span translate="no">Label-rectangle</span> Node</title>
200 <p>A <em><span translate="no">Label-rectangle</span></em> node describes the
201 dimensions of a single label or business card that is rectangular
202 in shape (may have rounded edges).</p>
204 <table frame="all" rules="rows">
206 <td><p>Property</p></td> <td><p>Description</p></td>
209 <td><p></p></td> <td><p></p></td>
212 <td><p><span translate="no">id</span></p></td>
213 <td><p>Reserved for future use. Should always be 0.</p></td>
216 <td><p><span translate="no">width</span></p></td>
217 <td><p>Width of label/card</p></td>
220 <td><p><span translate="no">height</span></p></td>
221 <td><p>Heigth of label/card</p></td>
224 <td><p><span translate="no">round</span></p></td>
225 <td><p>Radius of corners. For items with square edges (business cards),
226 the radius should be 0.</p></td>
229 <td><p><span translate="no">x_waste</span></p></td>
230 <td><p>Amount of horizontal waste (over-print) to allow. This is useful
231 for minimizing alignment problems when using non-white
232 backgrounds (e.g. images).</p></td>
235 <td><p><span translate="no">y_waste</span></p></td>
236 <td><p>Amount of vertical waste (over-print) to allow. This is useful
237 for minimizing alignment problems when using non-white
238 backgrounds (e.g. images).</p></td>
242 <!-- ==== Figure ==== -->
244 <desc><span translate="no">Label-rectangle</span> parameters</desc>
245 <media type="image" src="figures/glabels-template-rect-label.png" mime="image/png" style="right">
246 <p><span translate="no">Label-rectangle</span> parameters</p>
249 <!-- ==== End of Figure ==== -->
252 <section id="template-label-rectangle-node">
253 <title><span translate="no">Label-ellipse</span> Node</title>
255 <p>A <em><span translate="no">Label-ellipse</span></em> node describes the
256 dimensions of a single label or business card that is elliptic
259 <table frame="all" rules="rows">
261 <td><p>Property</p></td> <td><p>Description</p></td>
264 <td><p></p></td> <td><p></p></td>
267 <td><p><span translate="no">id</span></p></td>
268 <td><p>Reserved for future use. Should always be 0.</p></td>
271 <td><p><span translate="no">width</span></p></td>
272 <td><p>Width of the ellipse</p></td>
275 <td><p><span translate="no">height</span></p></td>
276 <td><p>Heigth of the ellipse</p></td>
279 <td><p><span translate="no">waste</span></p></td>
280 <td><p>Amount of waste (over-print) to allow. This is useful
281 for minimizing alignment problems when using non-white
282 backgrounds (e.g. images).</p></td>
286 <!-- ==== Figure ==== -->
288 <desc><span translate="no">Label-ellipse</span> parameters</desc>
289 <media type="image" src="figures/glabels-template-ellipse-label.png" mime="image/png" style="right">
290 <p><span translate="no">Label-ellipse</span> parameters</p>
293 <!-- ==== End of Figure ==== -->
296 <section id="template-label-round-node">
297 <title><span translate="no">Label-round</span> Node</title>
299 <p>A <em><span translate="no">Label-round</span></em> node describes the dimensions
300 of a simple round label (not a CD).</p>
302 <table frame="all" rules="rows">
304 <td><p>Property</p></td> <td><p>Description</p></td>
307 <td><p></p></td> <td><p></p></td>
310 <td><p><span translate="no">id</span></p></td>
311 <td><p>Reserved for future use. Should always be 0.</p></td>
314 <td><p><span translate="no">radius</span></p></td>
315 <td><p>Radius (1/2 diameter) of label</p></td>
318 <td><p><span translate="no">waste</span></p></td>
319 <td><p>Amount of waste (over-print) to allow. This is useful
320 for minimizing alignment problems when using non-white
321 backgrounds (e.g. images).</p></td>
325 <!-- ==== Figure ==== -->
327 <desc><span translate="no">Label-ellipse</span> parameters</desc>
328 <media type="image" src="figures/glabels-template-circle-label.png" mime="image/png" style="right">
329 <p><span translate="no">Label-ellipse</span> parameters</p>
332 <!-- ==== End of Figure ==== -->
335 <section id="template-label-cd-node">
336 <title><span translate="no">Label-cd</span> Node</title>
338 <p>A <em><span translate="no">Label-cd</span></em> node describes the dimensions
339 of a CD, DVD, or business card CD.</p>
341 <table frame="all" rules="rows">
343 <td><p>Property</p></td> <td><p>Description</p></td>
346 <td><p></p></td> <td><p></p></td>
349 <td><p><span translate="no">id</span></p></td>
350 <td><p>Reserved for future use. Should always be 0.</p></td>
353 <td><p><span translate="no">radius</span></p></td>
354 <td><p>Outer radius of label</p></td>
357 <td><p><span translate="no">hole</span></p></td>
358 <td><p>Radius of concentric hole</p></td>
361 <td><p><span translate="no">width</span></p></td>
362 <td><p>If present, the label is clipped to the given width.
363 (Useful for "business card CDs").</p></td>
366 <td><p><span translate="no">height</span></p></td>
367 <td><p>If present, the label is clipped to the given height.
368 (Useful for "business card CDs").</p></td>
371 <td><p><span translate="no">waste</span></p></td>
372 <td><p>Amount of waste (over-print) to allow. This is useful
373 for minimizing alignment problems when using non-white
374 backgrounds (e.g. images).</p></td>
378 <!-- ==== Figure ==== -->
380 <desc><span translate="no">Label-cd</span> parameters</desc>
381 <media type="image" src="figures/glabels-template-cd-label.png" mime="image/png" style="right">
382 <p>CD label parameters</p>
385 <!-- ==== End of Figure ==== -->
388 <section id="template-markup">
389 <title><span translate="no">Markup</span> Nodes</title>
391 <p>Templates may contain optional markup nodes. These nodes are used to describe
392 a simple set of markup lines that are visible in the <app>glabels</app> drawing canvas, but
393 not visible when printed. These lines can represent margins, fold lines, center lines,
394 special areas, or other helpful hints to the user of a template.</p>
396 <section id="template-markup-margin-node">
397 <title><span translate="no">Markup-margin</span> Node</title>
399 <p>A <em><span translate="no">Markup-margin</span></em> describes a margin along
400 all edges of a label.</p>
402 <table frame="all" rules="rows">
404 <td><p>Property</p></td> <td><p>Description</p></td>
407 <td><p></p></td> <td><p></p></td>
410 <td><p><span translate="no">size</span></p></td>
411 <td><p>Size of the margin. I.e. the distance of the margin
412 line from the edge of the card/label.</p></td>
417 <section id="template-markup-line-node">
418 <title><span translate="no">Markup-line</span> Node</title>
420 <p>A <em><span translate="no">Markup-line</span></em> node describes a markup line.</p>
422 <table frame="all" rules="rows">
424 <td><p>Property</p></td> <td><p>Description</p></td>
427 <td><p></p></td> <td><p></p></td>
430 <td><p><span translate="no">x1</span></p></td>
431 <td><p>x coordinate of 1st endpoint of the line segment.</p></td>
434 <td><p><span translate="no">y1</span></p></td>
435 <td><p>y coordinate of 1st endpoint of the line segment.</p></td>
438 <td><p><span translate="no">x2</span></p></td>
439 <td><p>x coordinate of 2st endpoint of the line segment.</p></td>
442 <td><p><span translate="no">y2</span></p></td>
443 <td><p>y coordinate of 2st endpoint of the line segment.</p></td>
448 <section id="template-markup-circle-node">
449 <title><span translate="no">Markup-circle</span> Node</title>
451 <p>A <em><span translate="no">Markup-circle</span></em> describes a markup circle.</p>
453 <table frame="all" rules="rows">
455 <td><p>Property</p></td> <td><p>Description</p></td>
458 <td><p></p></td> <td><p></p></td>
461 <td><p><span translate="no">x0</span></p></td>
462 <td><p>x coordinate of circle origin (center).</p></td>
465 <td><p><span translate="no">y0</span></p></td>
466 <td><p>y coordinate of circle origin (center).</p></td>
469 <td><p><span translate="no">radius</span></p></td>
470 <td><p>Radius of circle.</p></td>
475 <section id="template-markup-rect-node">
476 <title><span translate="no">Markup-rect</span> Node</title>
478 <p>A <em><span translate="no">Markup-rect</span></em> describes a markup rectangle.</p>
480 <table frame="all" rules="rows">
482 <td><p>Property</p></td> <td><p>Description</p></td>
485 <td><p></p></td> <td><p></p></td>
488 <td><p><span translate="no">x1</span></p></td>
489 <td><p>x coordinate of upper left corner of rectangle.</p></td>
492 <td><p><span translate="no">y1</span></p></td>
493 <td><p>y coordinate of upper left corner of rectangle.</p></td>
496 <td><p><span translate="no">w</span></p></td>
497 <td><p>Width of rectangle.</p></td>
500 <td><p><span translate="no">h</span></p></td>
501 <td><p>Height of rectangle.</p></td>
504 <td><p><span translate="no">r</span></p></td>
505 <td><p>Radius of rounded corners of rectangle.</p></td>
510 <section id="template-markup-ellipse-node">
511 <title><span translate="no">Markup-ellipse</span> Node</title>
513 <p>A <em><span translate="no">Markup-ellipse</span></em> describes a markup ellipse.</p>
515 <table frame="all" rules="rows">
517 <td><p>Property</p></td> <td><p>Description</p></td>
520 <td><p></p></td> <td><p></p></td>
523 <td><p><span translate="no">x1</span></p></td>
524 <td><p>x coordinate of upper left corner of ellipse.</p></td>
527 <td><p><span translate="no">y1</span></p></td>
528 <td><p>y coordinate of upper left corner of ellipse.</p></td>
531 <td><p><span translate="no">w</span></p></td>
532 <td><p>Width of ellipse.</p></td>
535 <td><p><span translate="no">h</span></p></td>
536 <td><p>Height of ellipse.</p></td>
543 <section id="template-layout-node">
544 <title><span translate="no">Layout</span> Node</title>
546 <p>A label node may contain multiple <em><span translate="no">Layout</span></em>
547 children. If labels are arranged in a simple grid pattern, only
548 one layout is needed. However, if labels are arranged in multiple
549 grids, such as a running bond pattern, multiple
550 <em><span translate="no">Layout</span></em> tags can be used.
551 Note: a single label can always be treated as a grid of one.</p>
553 <table frame="all" rules="rows">
555 <td><p>Property</p></td> <td><p>Description</p></td>
558 <td><p></p></td> <td><p></p></td>
561 <td><p><span translate="no">nx</span></p></td>
562 <td><p>Number of labels/cards across in the grid (horizontal)</p></td>
565 <td><p><span translate="no">ny</span></p></td>
566 <td><p>Number of labels/cards across in the grid (vertical)</p></td>
569 <td><p><span translate="no">x0</span></p></td>
570 <td><p>Distance from left edge of sheet to the left edge of
571 the left column of cards/labels in the layout.</p></td>
574 <td><p><span translate="no">y0</span></p></td>
575 <td><p>Distance from the top edge of sheet to the top edge of
576 the top row of labels/cards in the layout.</p></td>
579 <td><p><span translate="no">dx</span></p></td>
580 <td><p>Horizontal pitch of grid.</p></td>
583 <td><p><span translate="no">dy</span></p></td>
584 <td><p>Vertical pitch of grid.</p></td>
588 <!-- ==== Figure ==== -->
590 <desc><span translate="no">Layout</span> parameters</desc>
591 <media type="image" src="figures/glabels-template-layout.png" mime="image/png" style="right">
592 <p><span translate="no">Layout</span> Parameters</p>
595 <!-- ==== End of Figure ==== -->