1 <page xmlns="http://projectmallard.org/1.0/"
2 xmlns:e="http://projectmallard.org/experimental/"
3 xmlns:its="http://www.w3.org/2005/11/its"
8 <link type="guide" xref="index#advanced"/>
9 <revision pkgversion="3.0" version="0.1" date="2010-05-04" status="incomplete"/>
11 Create your templates manually.
13 <credit type="author">
14 <name>Jim Evins</name>
15 <email>evins@snaught.com</email>
17 <credit type="author">
18 <name>Mario Blättermann</name>
19 <email>mariobl@gnome.org</email>
22 <p>Creative Commons Share Alike 3.0</p>
26 <title>Manually creating new templates</title>
30 <!-- ****************** -->
31 <!-- BEGIN Introduction -->
32 <!-- ****************** -->
33 <p>This page is a reference guide to manually creating <app>gLabels</app> templates.
34 <app>gLabels</app> templates are defined in simple XML files as described in the DTD:
35 <link href="http://glabels.org/xmlns/2.3/glabels-2.3.dtd.txt">glabels-2.3.dtd</link>
36 (this DTD also describes other XML files used by <app>gLabels</app>).</p>
38 <p>Manually created template files should be placed in the <file>${HOME}/.glabels</file>
39 and be named with a <file>.template</file> extension.</p>
41 <note style="advanced">
42 <p><app>gLabels</app> searches for templates in several other locations as defined here:</p>
43 <table frame="all" rules="rows">
45 <td><p>Location</p></td>
46 <td><p>Description</p></td>
53 <td><p><file>${prefix}/share/libglabels-3.0/templates</file></p></td>
54 <td><p>Predefined templates distributed with <app>gLabels</app>.</p>
55 <p><file>${prefix}</file> is usually <file>/usr</file> or <file>/usr/local</file>,
56 depending on where <app>gLabels</app> was installed.</p></td>
59 <td><p><file>${XDG_CONFIG_HOME}/libglabels/templates</file></p></td>
60 <td><p>User defined templates created with the <app>gLabels</app> <gui>Template Designer</gui>.
61 <em>Do not put manually created templates in this directory.</em></p>
62 <p>If <file>${XDG_CONFIG_HOME}</file> is not defined, it defaults to
63 <file>${HOME}/.config</file>.</p></td>
66 <td><p><file>${HOME}/.glabels</file></p></td>
67 <td><p>User defined templates that have been created manually should be placed in this
69 Older versions of the <app>gLabels</app> <gui>Template Designer</gui> (prior to 3.0)
70 would also put templates in this directory.</p></td>
75 <note><p>Completed template files can be sent to the
76 <app>gLabels</app> template
77 <link href="mailto:glabels-templates@lists.sourceforge.net">mailing list</link>
78 for possible inclusion in future versions of <app>gLabels</app>.</p>
80 <!-- ****************** -->
81 <!-- END Introduction -->
82 <!-- ****************** -->
85 <!-- ***************** -->
86 <!-- BEGIN Assumptions -->
87 <!-- ***************** -->
88 <section id="template-assumptions">
89 <title>Assumptions/caveats</title>
92 <p>A sheet contains only one size of label or card (if a sheet
93 contains more than one size of item, it can be split into
94 multiple templates for multiple pass printing)</p>
97 <p>Distances can be expressed in units of <code its:translate="no">pt</code>,
98 <code its:translate="no">in</code>, <code its:translate="no">mm</code>,
99 <code its:translate="no">cm</code>, or <code its:translate="no">pc</code>. For example:
100 "<code its:translate="no">1.0in</code>" or "<code its:translate="no">2.54cm</code>". If no
101 units are specified, computer points (<code its:translate="no">pt</code>) will
102 be assumed (1 <em>pt</em> =
103 1/72 <em>in</em> = 0.352778 <em>mm</em>).
108 <!-- ***************** -->
109 <!-- END Assumptions -->
110 <!-- ***************** -->
114 <!-- ******************** -->
115 <!-- BEGIN Template Files -->
116 <!-- ******************** -->
117 <section id="template-file">
118 <title>Template Files</title>
120 <p>A template file contains a single <code its:translate="no">Glabels-templates</code> top-level
123 <code mime="text/xml" its:translate="no">
124 <?xml version="1.0"?>
125 <Glabels-templates>
127 <var its:translate="yes">...templates...</var>
129 </Glabels-templates></code>
132 <title>Example Template</title>
133 <desc>Example <app>gLabels</app> template file containing a single
134 <code its:translate="no">Template</code> node.</desc>
135 <code mime="text/xml" its:translate="no">
136 <?xml version="1.0"?>
137 <Glabels-templates>
139 <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels">
140 <Meta category="label"/>
141 <Meta category="mail"/>
142 <Meta product_url="http://www.avery.com/avery/en_us/"/>
143 <Label-rectangle id="0" width="189pt" height="72pt" round="5pt">
144 <Markup-margin size="5pt"/>
145 <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/>
146 </Label-rectangle>
149 </Glabels-templates></code>
153 <!-- ******************** -->
154 <!-- END Template Files -->
155 <!-- ******************** -->
159 <!-- ******************** -->
160 <!-- BEGIN Template Node -->
161 <!-- ******************** -->
162 <section id="template-template-node">
163 <title><span its:translate="no">Template</span> Node</title>
165 <p>A <code its:translate="no">Template</code> node describes a single
166 stationery product. It must contain one instance of any type of Label node
167 (<code its:translate="no">Label-rectangle</code>,
168 <code its:translate="no">Label-round</code>, or
169 <code its:translate="no">Label-cd</code>).</p>
171 <table frame="all" rules="rows">
173 <td><p>Property</p></td> <td><p>Description</p></td>
176 <td><p></p></td> <td><p></p></td>
179 <td><p><code its:translate="no">brand</code></p></td>
180 <td><p>Brand or manufacturer of stationery product. E.g. "Avery"</p></td>
183 <td><p><code its:translate="no">part</code></p></td>
184 <td><p>Part number or name of stationery product. E.g. "8160"</p></td>
187 <td><p><code its:translate="no">size</code></p></td>
188 <td><p>Size of sheet.
189 E.g., "<code its:translate="no">US-Letter</code>", "<code its:translate="no">A4</code>", ...
193 <td><p><code its:translate="no">description</code></p></td>
194 <td><p>Description of stationery product. E.g, "Mailing Labels."</p></td>
197 <td><p><code its:translate="no">_description</code></p></td>
198 <td><p>Translatable description of stationery product. E.g, "Mailing Labels."
199 (Only useful for predefined templates)</p></td>
202 <td><p><code its:translate="no">width</code></p></td>
203 <td><p>Page width. Only valid if size="Other"</p></td>
206 <td><p><code its:translate="no">height</code></p></td>
207 <td><p>Page height. Only valid if size="Other"</p></td>
210 <td><p><code its:translate="no">equiv</code></p></td>
211 <td><p>Equivalent part number. If this property is present, the template
212 is a clone of another template of the same brand. The template will
213 inherit all properties, except brand and name from the other template.
214 This equiv property must refer to a previously defined template -
215 <app>gLabels</app> does not currently support forward references.</p></td>
220 <!-- ******************** -->
221 <!-- END Template Node -->
222 <!-- ******************** -->
225 <!-- ******************** -->
226 <!-- BEGIN Meta Node -->
227 <!-- ******************** -->
228 <section id="meta-template-node">
229 <title><span its:translate="no">Meta</span> Node</title>
231 <p>A <code its:translate="no">Meta</code> node contains some additional
232 information about the template. A <code its:translate="no">Template</code>
233 node may contain zero or more <code its:translate="no">Meta</code> nodes.</p>
235 <table frame="all" rules="rows">
237 <td><p>Subnode</p></td> <td><p>Description</p></td>
240 <td><p></p></td> <td><p></p></td>
243 <td><p><code its:translate="no">category</code></p></td>
244 <td><p>A category for the template.
245 A template can belong to multiple categories by simply adding multiple
246 <code its:translate="no">Meta</code> nodes to the parent
247 <code its:translate="no">Template</code> node.
248 Template categories are used by the <app>gLabels</app> <gui>New Label
249 Dialog</gui> to filter the results of template searches.</p>
251 <p>The value of this category must match a predefined category ID defined in
252 the file <file>${prefix}/libglabels-3.0/templates/categories.xml</file>.
253 Currently defined category IDs include:</p>
255 <item><p><code its:translate="no">label</code></p></item>
256 <item><p><code its:translate="no">round-label</code></p></item>
257 <item><p><code its:translate="no">elliptical-label</code></p></item>
258 <item><p><code its:translate="no">square-label</code></p></item>
259 <item><p><code its:translate="no">rectangle-label</code></p></item>
260 <item><p><code its:translate="no">card</code></p></item>
261 <item><p><code its:translate="no">business-card</code></p></item>
262 <item><p><code its:translate="no">media</code></p></item>
263 <item><p><code its:translate="no">mail</code></p></item>
264 <item><p><code its:translate="no">foldable</code></p></item>
265 <item><p><code its:translate="no">photo</code></p></item>
272 <td><p><code its:translate="no">product_url</code></p></td>
273 <td><p>A URL pointing to the vendor's webpage for the specific product, if available.</p></td>
277 <note><p>Suggestions for additional categories can be sent to the
278 <app>gLabels</app> developer's
279 <link href="mailto:glabels-devel@lists.sourceforge.net">mailing list</link>.</p>
280 <p>Product URLs may be of limited use, because they may not be permanent.</p>
284 <!-- ******************** -->
285 <!-- END Meta Node -->
286 <!-- ******************** -->
289 <!-- ************************** -->
290 <!-- BEGIN Label-rectangle Node -->
291 <!-- ************************** -->
292 <section id="template-label-rectangle-node">
293 <title><span its:translate="no">Label-rectangle</span> Node</title>
295 <p>A <code its:translate="no">Label-rectangle</code> node describes the
296 dimensions of a single label or business card that is rectangular
297 in shape (may have rounded edges).</p>
299 <table frame="all" rules="rows">
301 <td><p>Property</p></td> <td><p>Description</p></td>
304 <td><p></p></td> <td><p></p></td>
307 <td><p><code its:translate="no">id</code></p></td>
308 <td><p>Reserved for future use. Should always be 0.</p></td>
311 <td><p><code its:translate="no">width</code></p></td>
312 <td><p>Width of label/card</p></td>
315 <td><p><code its:translate="no">height</code></p></td>
316 <td><p>Heigth of label/card</p></td>
319 <td><p><code its:translate="no">round</code></p></td>
320 <td><p>Radius of corners. For items with square edges (business cards),
321 the radius should be 0.</p></td>
324 <td><p><code its:translate="no">x_waste</code></p></td>
325 <td><p>Amount of horizontal waste (over-print) to allow. This is useful
326 for minimizing alignment problems when using non-white
327 backgrounds (e.g. images).</p></td>
330 <td><p><code its:translate="no">y_waste</code></p></td>
331 <td><p>Amount of vertical waste (over-print) to allow. This is useful
332 for minimizing alignment problems when using non-white
333 backgrounds (e.g. images).</p></td>
337 <!-- ==== Figure ==== -->
339 <desc><span its:translate="no">Label-rectangle</span> parameters</desc>
340 <media type="image" src="figures/glabels-template-rect-label.png" mime="image/png" style="right">
341 <p><span its:translate="no">Label-rectangle</span> parameters</p>
344 <!-- ==== End of Figure ==== -->
347 <!-- ************************** -->
348 <!-- END Label-rectangle Node -->
349 <!-- ************************** -->
352 <!-- ************************ -->
353 <!-- BEGIN Label-ellipse Node -->
354 <!-- ************************ -->
355 <section id="template-label-ellipse-node">
356 <title><span its:translate="no">Label-ellipse</span> Node</title>
358 <p>A <code its:translate="no">Label-ellipse</code> node describes the
359 dimensions of a single label or business card that is elliptic
362 <table frame="all" rules="rows">
364 <td><p>Property</p></td> <td><p>Description</p></td>
367 <td><p></p></td> <td><p></p></td>
370 <td><p><code its:translate="no">id</code></p></td>
371 <td><p>Reserved for future use. Should always be 0.</p></td>
374 <td><p><code its:translate="no">width</code></p></td>
375 <td><p>Width of the ellipse</p></td>
378 <td><p><code its:translate="no">height</code></p></td>
379 <td><p>Heigth of the ellipse</p></td>
382 <td><p><code its:translate="no">waste</code></p></td>
383 <td><p>Amount of waste (over-print) to allow. This is useful
384 for minimizing alignment problems when using non-white
385 backgrounds (e.g. images).</p></td>
389 <!-- ==== Figure ==== -->
391 <desc><span its:translate="no">Label-ellipse</span> parameters</desc>
392 <media type="image" src="figures/glabels-template-ellipse-label.png" mime="image/png" style="right">
393 <p><span its:translate="no">Label-ellipse</span> parameters</p>
396 <!-- ==== End of Figure ==== -->
399 <!-- ************************ -->
400 <!-- END Label-ellipse Node -->
401 <!-- ************************ -->
404 <!-- ********************** -->
405 <!-- BEGIN Label-round Node -->
406 <!-- ********************** -->
407 <section id="template-label-round-node">
408 <title><span its:translate="no">Label-round</span> Node</title>
410 <p>A <code its:translate="no">Label-round</code> node describes the dimensions
411 of a simple round label (not a CD).</p>
413 <table frame="all" rules="rows">
415 <td><p>Property</p></td> <td><p>Description</p></td>
418 <td><p></p></td> <td><p></p></td>
421 <td><p><code its:translate="no">id</code></p></td>
422 <td><p>Reserved for future use. Should always be 0.</p></td>
425 <td><p><code its:translate="no">radius</code></p></td>
426 <td><p>Radius (1/2 diameter) of label</p></td>
429 <td><p><code its:translate="no">waste</code></p></td>
430 <td><p>Amount of waste (over-print) to allow. This is useful
431 for minimizing alignment problems when using non-white
432 backgrounds (e.g. images).</p></td>
436 <!-- ==== Figure ==== -->
438 <desc><span its:translate="no">Label-ellipse</span> parameters</desc>
439 <media type="image" src="figures/glabels-template-circle-label.png" mime="image/png" style="right">
440 <p><span its:translate="no">Label-ellipse</span> parameters</p>
443 <!-- ==== End of Figure ==== -->
446 <!-- ********************** -->
447 <!-- END Label-round Node -->
448 <!-- ********************** -->
451 <!-- ******************* -->
452 <!-- BEGIN Label-cd Node -->
453 <!-- ******************* -->
454 <section id="template-label-cd-node">
455 <title><span its:translate="no">Label-cd</span> Node</title>
457 <p>A <code its:translate="no">Label-cd</code> node describes the dimensions
458 of a CD, DVD, or business card CD.</p>
460 <table frame="all" rules="rows">
462 <td><p>Property</p></td> <td><p>Description</p></td>
465 <td><p></p></td> <td><p></p></td>
468 <td><p><code its:translate="no">id</code></p></td>
469 <td><p>Reserved for future use. Should always be 0.</p></td>
472 <td><p><code its:translate="no">radius</code></p></td>
473 <td><p>Outer radius of label</p></td>
476 <td><p><code its:translate="no">hole</code></p></td>
477 <td><p>Radius of concentric hole</p></td>
480 <td><p><code its:translate="no">width</code></p></td>
481 <td><p>If present, the label is clipped to the given width.
482 (Useful for "business card CDs").</p></td>
485 <td><p><code its:translate="no">height</code></p></td>
486 <td><p>If present, the label is clipped to the given height.
487 (Useful for "business card CDs").</p></td>
490 <td><p><code its:translate="no">waste</code></p></td>
491 <td><p>Amount of waste (over-print) to allow. This is useful
492 for minimizing alignment problems when using non-white
493 backgrounds (e.g. images).</p></td>
497 <!-- ==== Figure ==== -->
499 <desc><span its:translate="no">Label-cd</span> parameters</desc>
500 <media type="image" src="figures/glabels-template-cd-label.png" mime="image/png" style="right">
501 <p>CD label parameters</p>
504 <!-- ==== End of Figure ==== -->
507 <!-- ******************* -->
508 <!-- END Label-cd Node -->
509 <!-- ******************* -->
512 <!-- ***************** -->
513 <!-- BEGIN Markup Node -->
514 <!-- ***************** -->
515 <section id="template-markup">
516 <title><span its:translate="no">Markup</span> Nodes</title>
518 <p>Templates may contain optional markup nodes. These nodes are used to describe
519 a simple set of markup lines that are visible in the <app>glabels</app> drawing canvas, but
520 not visible when printed. These lines can represent margins, fold lines, center lines,
521 special areas, or other helpful hints to the user of a template.</p>
524 <!-- ======================== -->
525 <!-- BEGIN Markup-margin Node -->
526 <!-- ======================== -->
527 <section id="template-markup-margin-node">
528 <title><span its:translate="no">Markup-margin</span> Node</title>
530 <p>A <code its:translate="no">Markup-margin</code> describes a margin along
531 all edges of a label.</p>
533 <table frame="all" rules="rows">
535 <td><p>Property</p></td> <td><p>Description</p></td>
538 <td><p></p></td> <td><p></p></td>
541 <td><p><code its:translate="no">size</code></p></td>
542 <td><p>Size of the margin. I.e. the distance of the margin
543 line from the edge of the card/label.</p></td>
547 <!-- ======================== -->
548 <!-- END Markup-margin Node -->
549 <!-- ======================== -->
552 <!-- ====================== -->
553 <!-- BEGIN Markup-line Node -->
554 <!-- ====================== -->
555 <section id="template-markup-line-node">
556 <title><span its:translate="no">Markup-line</span> Node</title>
558 <p>A <code its:translate="no">Markup-line</code> node describes a markup line.</p>
560 <table frame="all" rules="rows">
562 <td><p>Property</p></td> <td><p>Description</p></td>
565 <td><p></p></td> <td><p></p></td>
568 <td><p><code its:translate="no">x1</code></p></td>
569 <td><p>x coordinate of 1st endpoint of the line segment.</p></td>
572 <td><p><code its:translate="no">y1</code></p></td>
573 <td><p>y coordinate of 1st endpoint of the line segment.</p></td>
576 <td><p><code its:translate="no">x2</code></p></td>
577 <td><p>x coordinate of 2st endpoint of the line segment.</p></td>
580 <td><p><code its:translate="no">y2</code></p></td>
581 <td><p>y coordinate of 2st endpoint of the line segment.</p></td>
585 <!-- ====================== -->
586 <!-- END Markup-line Node -->
587 <!-- ====================== -->
590 <!-- ======================== -->
591 <!-- BEGIN Markup-circle Node -->
592 <!-- ======================== -->
593 <section id="template-markup-circle-node">
594 <title><span its:translate="no">Markup-circle</span> Node</title>
596 <p>A <code its:translate="no">Markup-circle</code> describes a markup circle.</p>
598 <table frame="all" rules="rows">
600 <td><p>Property</p></td> <td><p>Description</p></td>
603 <td><p></p></td> <td><p></p></td>
606 <td><p><code its:translate="no">x0</code></p></td>
607 <td><p>x coordinate of circle origin (center).</p></td>
610 <td><p><code its:translate="no">y0</code></p></td>
611 <td><p>y coordinate of circle origin (center).</p></td>
614 <td><p><code its:translate="no">radius</code></p></td>
615 <td><p>Radius of circle.</p></td>
619 <!-- ======================== -->
620 <!-- END Markup-circle Node -->
621 <!-- ======================== -->
624 <!-- ====================== -->
625 <!-- BEGIN Markup-rect Node -->
626 <!-- ====================== -->
627 <section id="template-markup-rect-node">
628 <title><span its:translate="no">Markup-rect</span> Node</title>
630 <p>A <code its:translate="no">Markup-rect</code> describes a markup rectangle.</p>
632 <table frame="all" rules="rows">
634 <td><p>Property</p></td> <td><p>Description</p></td>
637 <td><p></p></td> <td><p></p></td>
640 <td><p><code its:translate="no">x1</code></p></td>
641 <td><p>x coordinate of upper left corner of rectangle.</p></td>
644 <td><p><code its:translate="no">y1</code></p></td>
645 <td><p>y coordinate of upper left corner of rectangle.</p></td>
648 <td><p><code its:translate="no">w</code></p></td>
649 <td><p>Width of rectangle.</p></td>
652 <td><p><code its:translate="no">h</code></p></td>
653 <td><p>Height of rectangle.</p></td>
656 <td><p><code its:translate="no">r</code></p></td>
657 <td><p>Radius of rounded corners of rectangle.</p></td>
661 <!-- ====================== -->
662 <!-- END Markup-rect Node -->
663 <!-- ====================== -->
666 <!-- ========================= -->
667 <!-- BEGIN Markup-ellipse Node -->
668 <!-- ========================= -->
669 <section id="template-markup-ellipse-node">
670 <title><span its:translate="no">Markup-ellipse</span> Node</title>
672 <p>A <code its:translate="no">Markup-ellipse</code> describes a markup ellipse.</p>
674 <table frame="all" rules="rows">
676 <td><p>Property</p></td> <td><p>Description</p></td>
679 <td><p></p></td> <td><p></p></td>
682 <td><p><code its:translate="no">x1</code></p></td>
683 <td><p>x coordinate of upper left corner of ellipse.</p></td>
686 <td><p><code its:translate="no">y1</code></p></td>
687 <td><p>y coordinate of upper left corner of ellipse.</p></td>
690 <td><p><code its:translate="no">w</code></p></td>
691 <td><p>Width of ellipse.</p></td>
694 <td><p><code its:translate="no">h</code></p></td>
695 <td><p>Height of ellipse.</p></td>
699 <!-- ========================= -->
700 <!-- END Markup-ellipse Node -->
701 <!-- ========================= -->
704 <!-- ***************** -->
705 <!-- END Markup Node -->
706 <!-- ***************** -->
709 <!-- ***************** -->
710 <!-- BEGIN Layout Node -->
711 <!-- ***************** -->
712 <section id="template-layout-node">
713 <title><span its:translate="no">Layout</span> Node</title>
715 <p>A label node may contain multiple <code its:translate="no">Layout</code>
716 children. If labels are arranged in a simple grid pattern, only
717 one layout is needed. However, if labels are arranged in multiple
718 grids, such as a running bond pattern, multiple
719 <code its:translate="no">Layout</code> tags can be used. </p>
721 <p>A single label can always be treated as a grid of one.</p>
724 <table frame="all" rules="rows">
726 <td><p>Property</p></td> <td><p>Description</p></td>
729 <td><p></p></td> <td><p></p></td>
732 <td><p><code its:translate="no">nx</code></p></td>
733 <td><p>Number of labels/cards across in the grid (horizontal)</p></td>
736 <td><p><code its:translate="no">ny</code></p></td>
737 <td><p>Number of labels/cards across in the grid (vertical)</p></td>
740 <td><p><code its:translate="no">x0</code></p></td>
741 <td><p>Distance from left edge of sheet to the left edge of
742 the left column of cards/labels in the layout.</p></td>
745 <td><p><code its:translate="no">y0</code></p></td>
746 <td><p>Distance from the top edge of sheet to the top edge of
747 the top row of labels/cards in the layout.</p></td>
750 <td><p><code its:translate="no">dx</code></p></td>
751 <td><p>Horizontal pitch of grid.</p></td>
754 <td><p><code its:translate="no">dy</code></p></td>
755 <td><p>Vertical pitch of grid.</p></td>
759 <!-- ==== Figure ==== -->
761 <desc><span its:translate="no">Layout</span> parameters</desc>
762 <media type="image" src="figures/glabels-template-layout.png" mime="image/png" style="right">
763 <p><span its:translate="no">Layout</span> Parameters</p>
766 <!-- ==== End of Figure ==== -->
769 <!-- ***************** -->
770 <!-- END Layout Node -->
771 <!-- ***************** -->