1 <?xml version="1.0" encoding="utf-8"?>
2 <page xmlns="http://projectmallard.org/1.0/" xmlns:e="http://projectmallard.org/experimental/" xmlns:its="http://www.w3.org/2005/11/its" type="guide" id="mancreate" xml:lang="sl">
5 <link type="guide" xref="index#advanced"/>
6 <revision pkgversion="3.0" version="0.1" date="2010-05-04" status="incomplete"/>
8 Create your templates manually.
10 <credit type="author">
11 <name>Jim Evins</name>
12 <email>evins@snaught.com</email>
14 <credit type="author">
15 <name>Mario Blättermann</name>
16 <email>mariobl@gnome.org</email>
19 <p>Creative Commons Share Alike 3.0</p>
23 <title>Manually creating new templates</title>
27 <!-- ****************** -->
28 <!-- BEGIN Introduction -->
29 <!-- ****************** -->
30 <p>This page is a reference guide to manually creating <app>gLabels</app> templates.
31 <app>gLabels</app> templates are defined in simple XML files as described in the DTD:
32 <link href="http://glabels.org/xmlns/2.3/glabels-2.3.dtd.txt">glabels-2.3.dtd</link>
33 (this DTD also describes other XML files used by <app>gLabels</app>).</p>
35 <p>Manually created template files should be placed in the <file>${HOME}/.glabels</file>
36 and be named with a <file>.template</file> extension.</p>
38 <note style="advanced">
39 <p><app>gLabels</app> searches for templates in several other locations as defined here:</p>
40 <table frame="all" rules="rows">
42 <td><p>Location</p></td>
43 <td><p>Description</p></td>
50 <td><p><file>${prefix}/share/libglabels-3.0/templates</file></p></td>
51 <td><p>Predefined templates distributed with <app>gLabels</app>.</p>
52 <p><file>${prefix}</file> is usually <file>/usr</file> or <file>/usr/local</file>,
53 depending on where <app>gLabels</app> was installed.</p></td>
56 <td><p><file>${XDG_CONFIG_HOME}/libglabels/templates</file></p></td>
57 <td><p>User defined templates created with the <app>gLabels</app> <gui>Template Designer</gui>.
58 <em>Do not put manually created templates in this directory.</em></p>
59 <p>If <file>${XDG_CONFIG_HOME}</file> is not defined, it defaults to
60 <file>${HOME}/.config</file>.</p></td>
63 <td><p><file>${HOME}/.glabels</file></p></td>
64 <td><p>User defined templates that have been created manually should be placed in this
66 Older versions of the <app>gLabels</app> <gui>Template Designer</gui> (prior to 3.0)
67 would also put templates in this directory.</p></td>
72 <note><p>Completed template files can be sent to the
73 <app>gLabels</app> template
74 <link href="mailto:glabels-templates@lists.sourceforge.net">mailing list</link>
75 for possible inclusion in future versions of <app>gLabels</app>.</p>
77 <!-- ****************** -->
78 <!-- END Introduction -->
79 <!-- ****************** -->
82 <!-- ***************** -->
83 <!-- BEGIN Assumptions -->
84 <!-- ***************** -->
85 <section id="template-assumptions">
86 <title>Assumptions/caveats</title>
89 <p>A sheet contains only one size of label or card (if a sheet
90 contains more than one size of item, it can be split into
91 multiple templates for multiple pass printing)</p>
94 <p>Distances can be expressed in units of <code translate="no">pt</code>,
95 <code translate="no">in</code>, <code translate="no">mm</code>,
96 <code translate="no">cm</code>, or <code translate="no">pc</code>. For example:
97 "<code translate="no">1.0in</code>" or "<code translate="no">2.54cm</code>". If no
98 units are specified, computer points (<code translate="no">pt</code>) will
99 be assumed (1 <em>pt</em> =
100 1/72 <em>in</em> = 0.352778 <em>mm</em>).
105 <!-- ***************** -->
106 <!-- END Assumptions -->
107 <!-- ***************** -->
111 <!-- ******************** -->
112 <!-- BEGIN Template Files -->
113 <!-- ******************** -->
114 <section id="template-file">
115 <title>Template Files</title>
117 <p>A template file contains a single <code translate="no">Glabels-templates</code> top-level
120 <code mime="text/xml" translate="no">
121 <?xml version="1.0"?>
122 <Glabels-templates>
124 <var translate="yes">...templates...</var>
126 </Glabels-templates></code>
129 <title>Example Template</title>
130 <desc>Example <app>gLabels</app> template file containing a single
131 <code translate="no">Template</code> node.</desc>
132 <code mime="text/xml" translate="no">
133 <?xml version="1.0"?>
134 <Glabels-templates>
136 <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels">
137 <Meta category="label"/>
138 <Meta category="mail"/>
139 <Meta product_url="http://www.avery.com/avery/en_us/"/>
140 <Label-rectangle id="0" width="189pt" height="72pt" round="5pt">
141 <Markup-margin size="5pt"/>
142 <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/>
143 </Label-rectangle>
146 </Glabels-templates></code>
150 <!-- ******************** -->
151 <!-- END Template Files -->
152 <!-- ******************** -->
156 <!-- ******************** -->
157 <!-- BEGIN Template Node -->
158 <!-- ******************** -->
159 <section id="template-template-node">
160 <title><span translate="no">Template</span> Node</title>
162 <p>A <code translate="no">Template</code> node describes a single
163 stationery product. It must contain one instance of any type of Label node
164 (<code translate="no">Label-rectangle</code>,
165 <code translate="no">Label-round</code>, or
166 <code translate="no">Label-cd</code>).</p>
168 <table frame="all" rules="rows">
170 <td><p>Property</p></td> <td><p>Description</p></td>
173 <td><p/></td> <td><p/></td>
176 <td><p><code translate="no">brand</code></p></td>
177 <td><p>Brand or manufacturer of stationery product. E.g. "Avery"</p></td>
180 <td><p><code translate="no">part</code></p></td>
181 <td><p>Part number or name of stationery product. E.g. "8160"</p></td>
184 <td><p><code translate="no">size</code></p></td>
185 <td><p>Size of sheet.
186 E.g., "<code translate="no">US-Letter</code>", "<code translate="no">A4</code>", ...
190 <td><p><code translate="no">description</code></p></td>
191 <td><p>Description of stationery product. E.g, "Mailing Labels."</p></td>
194 <td><p><code translate="no">_description</code></p></td>
195 <td><p>Translatable description of stationery product. E.g, "Mailing Labels."
196 (Only useful for predefined templates)</p></td>
199 <td><p><code translate="no">width</code></p></td>
200 <td><p>Page width. Only valid if size="Other"</p></td>
203 <td><p><code translate="no">height</code></p></td>
204 <td><p>Page height. Only valid if size="Other"</p></td>
207 <td><p><code translate="no">equiv</code></p></td>
208 <td><p>Equivalent part number. If this property is present, the template
209 is a clone of another template of the same brand. The template will
210 inherit all properties, except brand and name from the other template.
211 This equiv property must refer to a previously defined template -
212 <app>gLabels</app> does not currently support forward references.</p></td>
217 <!-- ******************** -->
218 <!-- END Template Node -->
219 <!-- ******************** -->
222 <!-- ******************** -->
223 <!-- BEGIN Meta Node -->
224 <!-- ******************** -->
225 <section id="meta-template-node">
226 <title><span translate="no">Meta</span> Node</title>
228 <p>A <code translate="no">Meta</code> node contains some additional
229 information about the template. A <code translate="no">Template</code>
230 node may contain zero or more <code translate="no">Meta</code> nodes.</p>
232 <table frame="all" rules="rows">
234 <td><p>Subnode</p></td> <td><p>Description</p></td>
237 <td><p/></td> <td><p/></td>
240 <td><p><code translate="no">category</code></p></td>
241 <td><p>A category for the template.
242 A template can belong to multiple categories by simply adding multiple
243 <code translate="no">Meta</code> nodes to the parent
244 <code translate="no">Template</code> node.
245 Template categories are used by the <app>gLabels</app> <gui>New Label
246 Dialog</gui> to filter the results of template searches.</p>
248 <p>The value of this category must match a predefined category ID defined in
249 the file <file>${prefix}/libglabels-3.0/templates/categories.xml</file>.
250 Currently defined category IDs include:</p>
252 <item><p><code translate="no">label</code></p></item>
253 <item><p><code translate="no">round-label</code></p></item>
254 <item><p><code translate="no">elliptical-label</code></p></item>
255 <item><p><code translate="no">square-label</code></p></item>
256 <item><p><code translate="no">rectangle-label</code></p></item>
257 <item><p><code translate="no">card</code></p></item>
258 <item><p><code translate="no">business-card</code></p></item>
259 <item><p><code translate="no">media</code></p></item>
260 <item><p><code translate="no">mail</code></p></item>
261 <item><p><code translate="no">foldable</code></p></item>
262 <item><p><code translate="no">photo</code></p></item>
269 <td><p><code translate="no">product_url</code></p></td>
270 <td><p>A URL pointing to the vendor's webpage for the specific product, if available.</p></td>
274 <note><p>Suggestions for additional categories can be sent to the
275 <app>gLabels</app> developer's
276 <link href="mailto:glabels-devel@lists.sourceforge.net">mailing list</link>.</p>
277 <p>Product URLs may be of limited use, because they may not be permanent.</p>
281 <!-- ******************** -->
282 <!-- END Meta Node -->
283 <!-- ******************** -->
286 <!-- ************************** -->
287 <!-- BEGIN Label-rectangle Node -->
288 <!-- ************************** -->
289 <section id="template-label-rectangle-node">
290 <title><span translate="no">Label-rectangle</span> Node</title>
292 <p>A <code translate="no">Label-rectangle</code> node describes the
293 dimensions of a single label or business card that is rectangular
294 in shape (may have rounded edges).</p>
296 <table frame="all" rules="rows">
298 <td><p>Property</p></td> <td><p>Description</p></td>
301 <td><p/></td> <td><p/></td>
304 <td><p><code translate="no">id</code></p></td>
305 <td><p>Reserved for future use. Should always be 0.</p></td>
308 <td><p><code translate="no">width</code></p></td>
309 <td><p>Width of label/card</p></td>
312 <td><p><code translate="no">height</code></p></td>
313 <td><p>Heigth of label/card</p></td>
316 <td><p><code translate="no">round</code></p></td>
317 <td><p>Radius of corners. For items with square edges (business cards),
318 the radius should be 0.</p></td>
321 <td><p><code translate="no">x_waste</code></p></td>
322 <td><p>Amount of horizontal waste (over-print) to allow. This is useful
323 for minimizing alignment problems when using non-white
324 backgrounds (e.g. images).</p></td>
327 <td><p><code translate="no">y_waste</code></p></td>
328 <td><p>Amount of vertical waste (over-print) to allow. This is useful
329 for minimizing alignment problems when using non-white
330 backgrounds (e.g. images).</p></td>
334 <!-- ==== Figure ==== -->
336 <desc><span translate="no">Label-rectangle</span> parameters</desc>
337 <media type="image" src="figures/glabels-template-rect-label.png" mime="image/png" style="right">
338 <p><span translate="no">Label-rectangle</span> parameters</p>
341 <!-- ==== End of Figure ==== -->
344 <!-- ************************** -->
345 <!-- END Label-rectangle Node -->
346 <!-- ************************** -->
349 <!-- ************************ -->
350 <!-- BEGIN Label-ellipse Node -->
351 <!-- ************************ -->
352 <section id="template-label-ellipse-node">
353 <title><span translate="no">Label-ellipse</span> Node</title>
355 <p>A <code translate="no">Label-ellipse</code> node describes the
356 dimensions of a single label or business card that is elliptic
359 <table frame="all" rules="rows">
361 <td><p>Property</p></td> <td><p>Description</p></td>
364 <td><p/></td> <td><p/></td>
367 <td><p><code translate="no">id</code></p></td>
368 <td><p>Reserved for future use. Should always be 0.</p></td>
371 <td><p><code translate="no">width</code></p></td>
372 <td><p>Width of the ellipse</p></td>
375 <td><p><code translate="no">height</code></p></td>
376 <td><p>Heigth of the ellipse</p></td>
379 <td><p><code translate="no">waste</code></p></td>
380 <td><p>Amount of waste (over-print) to allow. This is useful
381 for minimizing alignment problems when using non-white
382 backgrounds (e.g. images).</p></td>
386 <!-- ==== Figure ==== -->
388 <desc><span translate="no">Label-ellipse</span> parameters</desc>
389 <media type="image" src="figures/glabels-template-ellipse-label.png" mime="image/png" style="right">
390 <p><span translate="no">Label-ellipse</span> parameters</p>
393 <!-- ==== End of Figure ==== -->
396 <!-- ************************ -->
397 <!-- END Label-ellipse Node -->
398 <!-- ************************ -->
401 <!-- ********************** -->
402 <!-- BEGIN Label-round Node -->
403 <!-- ********************** -->
404 <section id="template-label-round-node">
405 <title><span translate="no">Label-round</span> Node</title>
407 <p>A <code translate="no">Label-round</code> node describes the dimensions
408 of a simple round label (not a CD).</p>
410 <table frame="all" rules="rows">
412 <td><p>Property</p></td> <td><p>Description</p></td>
415 <td><p/></td> <td><p/></td>
418 <td><p><code translate="no">id</code></p></td>
419 <td><p>Reserved for future use. Should always be 0.</p></td>
422 <td><p><code translate="no">radius</code></p></td>
423 <td><p>Radius (1/2 diameter) of label</p></td>
426 <td><p><code translate="no">waste</code></p></td>
427 <td><p>Amount of waste (over-print) to allow. This is useful
428 for minimizing alignment problems when using non-white
429 backgrounds (e.g. images).</p></td>
433 <!-- ==== Figure ==== -->
435 <desc><span translate="no">Label-ellipse</span> parameters</desc>
436 <media type="image" src="figures/glabels-template-circle-label.png" mime="image/png" style="right">
437 <p><span translate="no">Label-ellipse</span> parameters</p>
440 <!-- ==== End of Figure ==== -->
443 <!-- ********************** -->
444 <!-- END Label-round Node -->
445 <!-- ********************** -->
448 <!-- ******************* -->
449 <!-- BEGIN Label-cd Node -->
450 <!-- ******************* -->
451 <section id="template-label-cd-node">
452 <title><span translate="no">Label-cd</span> Node</title>
454 <p>A <code translate="no">Label-cd</code> node describes the dimensions
455 of a CD, DVD, or business card CD.</p>
457 <table frame="all" rules="rows">
459 <td><p>Property</p></td> <td><p>Description</p></td>
462 <td><p/></td> <td><p/></td>
465 <td><p><code translate="no">id</code></p></td>
466 <td><p>Reserved for future use. Should always be 0.</p></td>
469 <td><p><code translate="no">radius</code></p></td>
470 <td><p>Outer radius of label</p></td>
473 <td><p><code translate="no">hole</code></p></td>
474 <td><p>Radius of concentric hole</p></td>
477 <td><p><code translate="no">width</code></p></td>
478 <td><p>If present, the label is clipped to the given width.
479 (Useful for "business card CDs").</p></td>
482 <td><p><code translate="no">height</code></p></td>
483 <td><p>If present, the label is clipped to the given height.
484 (Useful for "business card CDs").</p></td>
487 <td><p><code translate="no">waste</code></p></td>
488 <td><p>Amount of waste (over-print) to allow. This is useful
489 for minimizing alignment problems when using non-white
490 backgrounds (e.g. images).</p></td>
494 <!-- ==== Figure ==== -->
496 <desc><span translate="no">Label-cd</span> parameters</desc>
497 <media type="image" src="figures/glabels-template-cd-label.png" mime="image/png" style="right">
498 <p>CD label parameters</p>
501 <!-- ==== End of Figure ==== -->
504 <!-- ******************* -->
505 <!-- END Label-cd Node -->
506 <!-- ******************* -->
509 <!-- ***************** -->
510 <!-- BEGIN Markup Node -->
511 <!-- ***************** -->
512 <section id="template-markup">
513 <title><span translate="no">Markup</span> Nodes</title>
515 <p>Templates may contain optional markup nodes. These nodes are used to describe
516 a simple set of markup lines that are visible in the <app>glabels</app> drawing canvas, but
517 not visible when printed. These lines can represent margins, fold lines, center lines,
518 special areas, or other helpful hints to the user of a template.</p>
521 <!-- ======================== -->
522 <!-- BEGIN Markup-margin Node -->
523 <!-- ======================== -->
524 <section id="template-markup-margin-node">
525 <title><span translate="no">Markup-margin</span> Node</title>
527 <p>A <code translate="no">Markup-margin</code> describes a margin along
528 all edges of a label.</p>
530 <table frame="all" rules="rows">
532 <td><p>Property</p></td> <td><p>Description</p></td>
535 <td><p/></td> <td><p/></td>
538 <td><p><code translate="no">size</code></p></td>
539 <td><p>Size of the margin. I.e. the distance of the margin
540 line from the edge of the card/label.</p></td>
544 <!-- ======================== -->
545 <!-- END Markup-margin Node -->
546 <!-- ======================== -->
549 <!-- ====================== -->
550 <!-- BEGIN Markup-line Node -->
551 <!-- ====================== -->
552 <section id="template-markup-line-node">
553 <title><span translate="no">Markup-line</span> Node</title>
555 <p>A <code translate="no">Markup-line</code> node describes a markup line.</p>
557 <table frame="all" rules="rows">
559 <td><p>Property</p></td> <td><p>Description</p></td>
562 <td><p/></td> <td><p/></td>
565 <td><p><code translate="no">x1</code></p></td>
566 <td><p>x coordinate of 1st endpoint of the line segment.</p></td>
569 <td><p><code translate="no">y1</code></p></td>
570 <td><p>y coordinate of 1st endpoint of the line segment.</p></td>
573 <td><p><code translate="no">x2</code></p></td>
574 <td><p>x coordinate of 2st endpoint of the line segment.</p></td>
577 <td><p><code translate="no">y2</code></p></td>
578 <td><p>y coordinate of 2st endpoint of the line segment.</p></td>
582 <!-- ====================== -->
583 <!-- END Markup-line Node -->
584 <!-- ====================== -->
587 <!-- ======================== -->
588 <!-- BEGIN Markup-circle Node -->
589 <!-- ======================== -->
590 <section id="template-markup-circle-node">
591 <title><span translate="no">Markup-circle</span> Node</title>
593 <p>A <code translate="no">Markup-circle</code> describes a markup circle.</p>
595 <table frame="all" rules="rows">
597 <td><p>Property</p></td> <td><p>Description</p></td>
600 <td><p/></td> <td><p/></td>
603 <td><p><code translate="no">x0</code></p></td>
604 <td><p>x coordinate of circle origin (center).</p></td>
607 <td><p><code translate="no">y0</code></p></td>
608 <td><p>y coordinate of circle origin (center).</p></td>
611 <td><p><code translate="no">radius</code></p></td>
612 <td><p>Radius of circle.</p></td>
616 <!-- ======================== -->
617 <!-- END Markup-circle Node -->
618 <!-- ======================== -->
621 <!-- ====================== -->
622 <!-- BEGIN Markup-rect Node -->
623 <!-- ====================== -->
624 <section id="template-markup-rect-node">
625 <title><span translate="no">Markup-rect</span> Node</title>
627 <p>A <code translate="no">Markup-rect</code> describes a markup rectangle.</p>
629 <table frame="all" rules="rows">
631 <td><p>Property</p></td> <td><p>Description</p></td>
634 <td><p/></td> <td><p/></td>
637 <td><p><code translate="no">x1</code></p></td>
638 <td><p>x coordinate of upper left corner of rectangle.</p></td>
641 <td><p><code translate="no">y1</code></p></td>
642 <td><p>y coordinate of upper left corner of rectangle.</p></td>
645 <td><p><code translate="no">w</code></p></td>
646 <td><p>Width of rectangle.</p></td>
649 <td><p><code translate="no">h</code></p></td>
650 <td><p>Height of rectangle.</p></td>
653 <td><p><code translate="no">r</code></p></td>
654 <td><p>Radius of rounded corners of rectangle.</p></td>
658 <!-- ====================== -->
659 <!-- END Markup-rect Node -->
660 <!-- ====================== -->
663 <!-- ========================= -->
664 <!-- BEGIN Markup-ellipse Node -->
665 <!-- ========================= -->
666 <section id="template-markup-ellipse-node">
667 <title><span translate="no">Markup-ellipse</span> Node</title>
669 <p>A <code translate="no">Markup-ellipse</code> describes a markup ellipse.</p>
671 <table frame="all" rules="rows">
673 <td><p>Property</p></td> <td><p>Description</p></td>
676 <td><p/></td> <td><p/></td>
679 <td><p><code translate="no">x1</code></p></td>
680 <td><p>x coordinate of upper left corner of ellipse.</p></td>
683 <td><p><code translate="no">y1</code></p></td>
684 <td><p>y coordinate of upper left corner of ellipse.</p></td>
687 <td><p><code translate="no">w</code></p></td>
688 <td><p>Width of ellipse.</p></td>
691 <td><p><code translate="no">h</code></p></td>
692 <td><p>Height of ellipse.</p></td>
696 <!-- ========================= -->
697 <!-- END Markup-ellipse Node -->
698 <!-- ========================= -->
701 <!-- ***************** -->
702 <!-- END Markup Node -->
703 <!-- ***************** -->
706 <!-- ***************** -->
707 <!-- BEGIN Layout Node -->
708 <!-- ***************** -->
709 <section id="template-layout-node">
710 <title><span translate="no">Layout</span> Node</title>
712 <p>A label node may contain multiple <code translate="no">Layout</code>
713 children. If labels are arranged in a simple grid pattern, only
714 one layout is needed. However, if labels are arranged in multiple
715 grids, such as a running bond pattern, multiple
716 <code translate="no">Layout</code> tags can be used. </p>
718 <p>A single label can always be treated as a grid of one.</p>
721 <table frame="all" rules="rows">
723 <td><p>Property</p></td> <td><p>Description</p></td>
726 <td><p/></td> <td><p/></td>
729 <td><p><code translate="no">nx</code></p></td>
730 <td><p>Number of labels/cards across in the grid (horizontal)</p></td>
733 <td><p><code translate="no">ny</code></p></td>
734 <td><p>Number of labels/cards across in the grid (vertical)</p></td>
737 <td><p><code translate="no">x0</code></p></td>
738 <td><p>Distance from left edge of sheet to the left edge of
739 the left column of cards/labels in the layout.</p></td>
742 <td><p><code translate="no">y0</code></p></td>
743 <td><p>Distance from the top edge of sheet to the top edge of
744 the top row of labels/cards in the layout.</p></td>
747 <td><p><code translate="no">dx</code></p></td>
748 <td><p>Horizontal pitch of grid.</p></td>
751 <td><p><code translate="no">dy</code></p></td>
752 <td><p>Vertical pitch of grid.</p></td>
756 <!-- ==== Figure ==== -->
758 <desc><span translate="no">Layout</span> parameters</desc>
759 <media type="image" src="figures/glabels-template-layout.png" mime="image/png" style="right">
760 <p><span translate="no">Layout</span> Parameters</p>
763 <!-- ==== End of Figure ==== -->
766 <!-- ***************** -->
767 <!-- END Layout Node -->
768 <!-- ***************** -->