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="id">
5 <link type="guide" xref="index#advanced"/>
6 <revision pkgversion="3.0" version="0.1" date="2010-05-04" status="incomplete"/>
7 <revision pkgversion="3.0.1" version="0.1" date="2011-06-20" status="incomplete"/>
9 Create your templates manually.
11 <credit type="author">
12 <name>Jim Evins</name>
13 <email>evins@snaught.com</email>
15 <credit type="author">
16 <name>Mario Blättermann</name>
17 <email>mariobl@gnome.org</email>
20 <p>Creative Commons Share Alike 3.0</p>
24 <title>Manually creating new templates</title>
28 <!-- ****************** -->
29 <!-- BEGIN Introduction -->
30 <!-- ****************** -->
31 <p>This page is a reference guide to manually creating <app>gLabels</app> templates.
32 <app>gLabels</app> templates are defined in simple XML files as described in the DTD:
33 <link href="http://glabels.org/xmlns/2.3/glabels-2.3.dtd.txt">glabels-2.3.dtd</link>
34 (this DTD also describes other XML files used by <app>gLabels</app>).</p>
36 <p>Manually created template files should be placed in the <file>${HOME}/.glabels</file>
37 and be named with a <file>.template</file> extension.</p>
39 <note style="advanced">
40 <p><app>gLabels</app> searches for templates in several other locations as defined here:</p>
41 <table frame="all" rules="rows">
43 <td><p>Lokasi</p></td>
44 <td><p>Deskripsi</p></td>
51 <td><p><file>${prefix}/share/libglabels-3.0/templates</file></p></td>
52 <td><p>Predefined templates distributed with <app>gLabels</app>.</p>
53 <p><file>${prefix}</file> is usually <file>/usr</file> or <file>/usr/local</file>,
54 depending on where <app>gLabels</app> was installed.</p></td>
57 <td><p><file>${XDG_CONFIG_HOME}/libglabels/templates</file></p></td>
58 <td><p>User defined templates created with the <app>gLabels</app> <gui>Template Designer</gui>.
59 <em>Do not put manually created templates in this directory.</em></p>
60 <p>If <file>${XDG_CONFIG_HOME}</file> is not defined, it defaults to
61 <file>${HOME}/.config</file>.</p></td>
64 <td><p><file>${HOME}/.glabels</file></p></td>
65 <td><p>User defined templates that have been created manually should be placed in this
67 Older versions of the <app>gLabels</app> <gui>Template Designer</gui> (prior to 3.0)
68 would also put templates in this directory.</p></td>
73 <note><p>Completed template files can be sent to the
74 <app>gLabels</app> template
75 <link href="mailto:glabels-templates@lists.sourceforge.net">mailing list</link>
76 for possible inclusion in future versions of <app>gLabels</app>.</p>
78 <!-- ****************** -->
79 <!-- END Introduction -->
80 <!-- ****************** -->
83 <!-- ***************** -->
84 <!-- BEGIN Assumptions -->
85 <!-- ***************** -->
86 <section id="template-assumptions">
87 <title>Assumptions/caveats</title>
90 <p>A sheet contains only one size of label or card (if a sheet
91 contains more than one size of item, it can be split into
92 multiple templates for multiple pass printing)</p>
95 <p>Distances can be expressed in units of <code translate="no">pt</code>,
96 <code translate="no">in</code>, <code translate="no">mm</code>,
97 <code translate="no">cm</code>, or <code translate="no">pc</code>. For example:
98 "<code translate="no">1.0in</code>" or "<code translate="no">2.54cm</code>". If no
99 units are specified, computer points (<code translate="no">pt</code>) will
100 be assumed (1 <em>pt</em> =
101 1/72 <em>in</em> = 0.352778 <em>mm</em>).
106 <!-- ***************** -->
107 <!-- END Assumptions -->
108 <!-- ***************** -->
112 <!-- ******************** -->
113 <!-- BEGIN Template Files -->
114 <!-- ******************** -->
115 <section id="template-file">
116 <title>Template Files</title>
118 <p>A template file contains a single <code translate="no">Glabels-templates</code> top-level
121 <code mime="text/xml" translate="no">
122 <?xml version="1.0"?>
123 <Glabels-templates>
125 <var translate="yes">...templates...</var>
127 </Glabels-templates></code>
130 <title>Example Template</title>
131 <desc>Example <app>gLabels</app> template file containing a single
132 <code translate="no">Template</code> node.</desc>
133 <code mime="text/xml" translate="no">
134 <?xml version="1.0"?>
135 <Glabels-templates>
137 <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels">
138 <Meta category="label"/>
139 <Meta category="mail"/>
140 <Meta product_url="http://www.avery.com/avery/en_us/"/>
141 <Label-rectangle id="0" width="189pt" height="72pt" round="5pt">
142 <Markup-margin size="5pt"/>
143 <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/>
144 </Label-rectangle>
147 </Glabels-templates></code>
151 <!-- ******************** -->
152 <!-- END Template Files -->
153 <!-- ******************** -->
157 <!-- ******************** -->
158 <!-- BEGIN Template Node -->
159 <!-- ******************** -->
160 <section id="template-template-node">
161 <title><span translate="no">Template</span> Node</title>
163 <p>A <code translate="no">Template</code> node describes a single
164 stationery product. It must contain one instance of any type of Label node
165 (<code translate="no">Label-rectangle</code>,
166 <code translate="no">Label-round</code>, or
167 <code translate="no">Label-cd</code>).</p>
169 <table frame="all" rules="rows">
171 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
174 <td><p/></td> <td><p/></td>
177 <td><p><code translate="no">merk</code></p></td>
178 <td><p>Brand or manufacturer of stationery product. E.g. "Avery"</p></td>
181 <td><p><code translate="no">part</code></p></td>
182 <td><p>Part number or name of stationery product. E.g. "8160"</p></td>
185 <td><p><code translate="no">ukuran</code></p></td>
186 <td><p>Size of sheet.
187 E.g., "<code translate="no">US-Letter</code>", "<code translate="no">A4</code>", ...
191 <td><p><code translate="no">deskripsi</code></p></td>
192 <td><p>Description of stationery product. E.g, "Mailing Labels."</p></td>
195 <td><p><code translate="no">_deskripsi</code></p></td>
196 <td><p>Translatable description of stationery product. E.g, "Mailing Labels."
197 (Only useful for predefined templates)</p></td>
200 <td><p><code translate="no">lebar</code></p></td>
201 <td><p>Page width. Only valid if size="Other"</p></td>
204 <td><p><code translate="no">tinggi</code></p></td>
205 <td><p>Page height. Only valid if size="Other"</p></td>
208 <td><p><code translate="no">equiv</code></p></td>
209 <td><p>Equivalent part number. If this property is present, the template
210 is a clone of another template of the same brand. The template will
211 inherit all properties, except brand and name from the other template.
212 This equiv property must refer to a previously defined template -
213 <app>gLabels</app> does not currently support forward references.</p></td>
218 <!-- ******************** -->
219 <!-- END Template Node -->
220 <!-- ******************** -->
223 <!-- ******************** -->
224 <!-- BEGIN Meta Node -->
225 <!-- ******************** -->
226 <section id="meta-template-node">
227 <title><span translate="no">Meta</span> Node</title>
229 <p>A <code translate="no">Meta</code> node contains some additional
230 information about the template. A <code translate="no">Template</code>
231 node may contain zero or more <code translate="no">Meta</code> nodes.</p>
233 <table frame="all" rules="rows">
235 <td><p>Subnode</p></td> <td><p>Deskripsi</p></td>
238 <td><p/></td> <td><p/></td>
241 <td><p><code translate="no">category</code></p></td>
242 <td><p>A category for the template.
243 A template can belong to multiple categories by simply adding multiple
244 <code translate="no">Meta</code> nodes to the parent
245 <code translate="no">Template</code> node.
246 Template categories are used by the <app>gLabels</app> <gui>New Label
247 Dialog</gui> to filter the results of template searches.</p>
249 <p>The value of this category must match a predefined category ID defined in
250 the file <file>${prefix}/libglabels-3.0/templates/categories.xml</file>.
251 Currently defined category IDs include:</p>
253 <item><p><code translate="no">label</code></p></item>
254 <item><p><code translate="no">round-label</code></p></item>
255 <item><p><code translate="no">elliptical-label</code></p></item>
256 <item><p><code translate="no">square-label</code></p></item>
257 <item><p><code translate="no">rectangle-label</code></p></item>
258 <item><p><code translate="no">card</code></p></item>
259 <item><p><code translate="no">business-card</code></p></item>
260 <item><p><code translate="no">media</code></p></item>
261 <item><p><code translate="no">mail</code></p></item>
262 <item><p><code translate="no">foldable</code></p></item>
263 <item><p><code translate="no">foto</code></p></item>
270 <td><p><code translate="no">product_url</code></p></td>
271 <td><p>A URL pointing to the vendor's webpage for the specific product, if available.</p></td>
275 <note><p>Suggestions for additional categories can be sent to the
276 <app>gLabels</app> developer's
277 <link href="mailto:glabels-devel@lists.sourceforge.net">mailing list</link>.</p>
278 <p>Product URLs may be of limited use, because they may not be permanent.</p>
282 <!-- ******************** -->
283 <!-- END Meta Node -->
284 <!-- ******************** -->
287 <!-- ************************** -->
288 <!-- BEGIN Label-rectangle Node -->
289 <!-- ************************** -->
290 <section id="template-label-rectangle-node">
291 <title><span translate="no">Label-rectangle</span> Node</title>
293 <p>A <code translate="no">Label-rectangle</code> node describes the
294 dimensions of a single label or business card that is rectangular
295 in shape (may have rounded edges).</p>
297 <table frame="all" rules="rows">
299 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
302 <td><p/></td> <td><p/></td>
305 <td><p><code translate="no">id</code></p></td>
306 <td><p>Reserved for future use. Should always be 0.</p></td>
309 <td><p><code translate="no">lebar</code></p></td>
310 <td><p>Width of label/card</p></td>
313 <td><p><code translate="no">tinggi</code></p></td>
314 <td><p>Heigth of label/card</p></td>
317 <td><p><code translate="no">round</code></p></td>
318 <td><p>Radius of corners. For items with square edges (business cards),
319 the radius should be 0.</p></td>
322 <td><p><code translate="no">x_waste</code></p></td>
323 <td><p>Amount of horizontal waste (over-print) to allow. This is useful
324 for minimizing alignment problems when using non-white
325 backgrounds (e.g. images).</p></td>
328 <td><p><code translate="no">y_waste</code></p></td>
329 <td><p>Amount of vertical waste (over-print) to allow. This is useful
330 for minimizing alignment problems when using non-white
331 backgrounds (e.g. images).</p></td>
335 <!-- ==== Figure ==== -->
337 <desc><span translate="no">Label-rectangle</span> parameters</desc>
338 <media type="image" src="figures/glabels-template-rect-label.png" mime="image/png" style="right">
339 <p><span translate="no">Label-rectangle</span> parameters</p>
342 <!-- ==== End of Figure ==== -->
345 <!-- ************************** -->
346 <!-- END Label-rectangle Node -->
347 <!-- ************************** -->
350 <!-- ************************ -->
351 <!-- BEGIN Label-ellipse Node -->
352 <!-- ************************ -->
353 <section id="template-label-ellipse-node">
354 <title><span translate="no">Label-ellipse</span> Node</title>
356 <p>A <code translate="no">Label-ellipse</code> node describes the
357 dimensions of a single label or business card that is elliptic
360 <table frame="all" rules="rows">
362 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
365 <td><p/></td> <td><p/></td>
368 <td><p><code translate="no">id</code></p></td>
369 <td><p>Reserved for future use. Should always be 0.</p></td>
372 <td><p><code translate="no">lebar</code></p></td>
373 <td><p>Width of the ellipse</p></td>
376 <td><p><code translate="no">tinggi</code></p></td>
377 <td><p>Heigth of the ellipse</p></td>
380 <td><p><code translate="no">waste</code></p></td>
381 <td><p>Amount of waste (over-print) to allow. This is useful
382 for minimizing alignment problems when using non-white
383 backgrounds (e.g. images).</p></td>
387 <!-- ==== Figure ==== -->
389 <desc><span translate="no">Label-ellipse</span> parameters</desc>
390 <media type="image" src="figures/glabels-template-ellipse-label.png" mime="image/png" style="right">
391 <p><span translate="no">Label-ellipse</span> parameters</p>
394 <!-- ==== End of Figure ==== -->
397 <!-- ************************ -->
398 <!-- END Label-ellipse Node -->
399 <!-- ************************ -->
402 <!-- ********************** -->
403 <!-- BEGIN Label-round Node -->
404 <!-- ********************** -->
405 <section id="template-label-round-node">
406 <title><span translate="no">Label-round</span> Node</title>
408 <p>A <code translate="no">Label-round</code> node describes the dimensions
409 of a simple round label (not a CD).</p>
411 <table frame="all" rules="rows">
413 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
416 <td><p/></td> <td><p/></td>
419 <td><p><code translate="no">id</code></p></td>
420 <td><p>Reserved for future use. Should always be 0.</p></td>
423 <td><p><code translate="no">radius</code></p></td>
424 <td><p>Radius (1/2 diameter) of label</p></td>
427 <td><p><code translate="no">waste</code></p></td>
428 <td><p>Amount of waste (over-print) to allow. This is useful
429 for minimizing alignment problems when using non-white
430 backgrounds (e.g. images).</p></td>
434 <!-- ==== Figure ==== -->
436 <desc><span translate="no">Label-ellipse</span> parameters</desc>
437 <media type="image" src="figures/glabels-template-circle-label.png" mime="image/png" style="right">
438 <p><span translate="no">Label-ellipse</span> parameters</p>
441 <!-- ==== End of Figure ==== -->
444 <!-- ********************** -->
445 <!-- END Label-round Node -->
446 <!-- ********************** -->
449 <!-- ******************* -->
450 <!-- BEGIN Label-cd Node -->
451 <!-- ******************* -->
452 <section id="template-label-cd-node">
453 <title><span translate="no">Label-cd</span> Node</title>
455 <p>A <code translate="no">Label-cd</code> node describes the dimensions
456 of a CD, DVD, or business card CD.</p>
458 <table frame="all" rules="rows">
460 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
463 <td><p/></td> <td><p/></td>
466 <td><p><code translate="no">id</code></p></td>
467 <td><p>Reserved for future use. Should always be 0.</p></td>
470 <td><p><code translate="no">radius</code></p></td>
471 <td><p>Outer radius of label</p></td>
474 <td><p><code translate="no">hole</code></p></td>
475 <td><p>Radius of concentric hole</p></td>
478 <td><p><code translate="no">lebar</code></p></td>
479 <td><p>If present, the label is clipped to the given width.
480 (Useful for "business card CDs").</p></td>
483 <td><p><code translate="no">tinggi</code></p></td>
484 <td><p>If present, the label is clipped to the given height.
485 (Useful for "business card CDs").</p></td>
488 <td><p><code translate="no">waste</code></p></td>
489 <td><p>Amount of waste (over-print) to allow. This is useful
490 for minimizing alignment problems when using non-white
491 backgrounds (e.g. images).</p></td>
495 <!-- ==== Figure ==== -->
497 <desc><span translate="no">Label-cd</span> parameters</desc>
498 <media type="image" src="figures/glabels-template-cd-label.png" mime="image/png" style="right">
499 <p>CD label parameters</p>
502 <!-- ==== End of Figure ==== -->
505 <!-- ******************* -->
506 <!-- END Label-cd Node -->
507 <!-- ******************* -->
510 <!-- ***************** -->
511 <!-- BEGIN Markup Node -->
512 <!-- ***************** -->
513 <section id="template-markup">
514 <title><span translate="no">Markup</span> Nodes</title>
516 <p>Templates may contain optional markup nodes. These nodes are used to describe
517 a simple set of markup lines that are visible in the <app>glabels</app> drawing canvas, but
518 not visible when printed. These lines can represent margins, fold lines, center lines,
519 special areas, or other helpful hints to the user of a template.</p>
522 <!-- ======================== -->
523 <!-- BEGIN Markup-margin Node -->
524 <!-- ======================== -->
525 <section id="template-markup-margin-node">
526 <title><span translate="no">Markup-margin</span> Node</title>
528 <p>A <code translate="no">Markup-margin</code> describes a margin along
529 all edges of a label.</p>
531 <table frame="all" rules="rows">
533 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
536 <td><p/></td> <td><p/></td>
539 <td><p><code translate="no">ukuran</code></p></td>
540 <td><p>Size of the margin. I.e. the distance of the margin
541 line from the edge of the card/label.</p></td>
545 <!-- ======================== -->
546 <!-- END Markup-margin Node -->
547 <!-- ======================== -->
550 <!-- ====================== -->
551 <!-- BEGIN Markup-line Node -->
552 <!-- ====================== -->
553 <section id="template-markup-line-node">
554 <title><span translate="no">Markup-line</span> Node</title>
556 <p>A <code translate="no">Markup-line</code> node describes a markup line.</p>
558 <table frame="all" rules="rows">
560 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
563 <td><p/></td> <td><p/></td>
566 <td><p><code translate="no">x1</code></p></td>
567 <td><p>x coordinate of 1st endpoint of the line segment.</p></td>
570 <td><p><code translate="no">y1</code></p></td>
571 <td><p>y coordinate of 1st endpoint of the line segment.</p></td>
574 <td><p><code translate="no">x2</code></p></td>
575 <td><p>x coordinate of 2st endpoint of the line segment.</p></td>
578 <td><p><code translate="no">y2</code></p></td>
579 <td><p>y coordinate of 2st endpoint of the line segment.</p></td>
583 <!-- ====================== -->
584 <!-- END Markup-line Node -->
585 <!-- ====================== -->
588 <!-- ======================== -->
589 <!-- BEGIN Markup-circle Node -->
590 <!-- ======================== -->
591 <section id="template-markup-circle-node">
592 <title><span translate="no">Markup-circle</span> Node</title>
594 <p>A <code translate="no">Markup-circle</code> describes a markup circle.</p>
596 <table frame="all" rules="rows">
598 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
601 <td><p/></td> <td><p/></td>
604 <td><p><code translate="no">x0</code></p></td>
605 <td><p>x coordinate of circle origin (center).</p></td>
608 <td><p><code translate="no">y0</code></p></td>
609 <td><p>y coordinate of circle origin (center).</p></td>
612 <td><p><code translate="no">radius</code></p></td>
613 <td><p>Radius of circle.</p></td>
617 <!-- ======================== -->
618 <!-- END Markup-circle Node -->
619 <!-- ======================== -->
622 <!-- ====================== -->
623 <!-- BEGIN Markup-rect Node -->
624 <!-- ====================== -->
625 <section id="template-markup-rect-node">
626 <title><span translate="no">Markup-rect</span> Node</title>
628 <p>A <code translate="no">Markup-rect</code> describes a markup rectangle.</p>
630 <table frame="all" rules="rows">
632 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
635 <td><p/></td> <td><p/></td>
638 <td><p><code translate="no">x1</code></p></td>
639 <td><p>x coordinate of upper left corner of rectangle.</p></td>
642 <td><p><code translate="no">y1</code></p></td>
643 <td><p>y coordinate of upper left corner of rectangle.</p></td>
646 <td><p><code translate="no">w</code></p></td>
647 <td><p>Lebar persegi panjang.</p></td>
650 <td><p><code translate="no">h</code></p></td>
651 <td><p>Tinggi persegi panjang.</p></td>
654 <td><p><code translate="no">r</code></p></td>
655 <td><p>Jari-jari lengkungan pojok dari persegi panjang.</p></td>
659 <!-- ====================== -->
660 <!-- END Markup-rect Node -->
661 <!-- ====================== -->
664 <!-- ========================= -->
665 <!-- BEGIN Markup-ellipse Node -->
666 <!-- ========================= -->
667 <section id="template-markup-ellipse-node">
668 <title><span translate="no">Markup-ellipse</span> Node</title>
670 <p>A <code translate="no">Markup-ellipse</code> describes a markup ellipse.</p>
672 <table frame="all" rules="rows">
674 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
677 <td><p/></td> <td><p/></td>
680 <td><p><code translate="no">x1</code></p></td>
681 <td><p>x coordinate of upper left corner of ellipse.</p></td>
684 <td><p><code translate="no">y1</code></p></td>
685 <td><p>y coordinate of upper left corner of ellipse.</p></td>
688 <td><p><code translate="no">w</code></p></td>
689 <td><p>Lebar elips.</p></td>
692 <td><p><code translate="no">h</code></p></td>
693 <td><p>Tinggi elips.</p></td>
697 <!-- ========================= -->
698 <!-- END Markup-ellipse Node -->
699 <!-- ========================= -->
702 <!-- ***************** -->
703 <!-- END Markup Node -->
704 <!-- ***************** -->
707 <!-- ***************** -->
708 <!-- BEGIN Layout Node -->
709 <!-- ***************** -->
710 <section id="template-layout-node">
711 <title><span translate="no">Layout</span> Node</title>
713 <p>A label node may contain multiple <code translate="no">Layout</code>
714 children. If labels are arranged in a simple grid pattern, only
715 one layout is needed. However, if labels are arranged in multiple
716 grids, such as a running bond pattern, multiple
717 <code translate="no">Layout</code> tags can be used. </p>
718 <p>A common example for multiple layouts is a sheet with three
721 <!-- ==== Figure ==== -->
723 <desc>CD label sheet</desc>
724 <media type="image" src="figures/layouts-cdlabel.png" mime="image/png" style="right">
725 <p>CD label sheet</p>
728 <!-- ==== End of Figure ==== -->
730 <p>The two labels on the left edge can be assigned to a grid, assuming we
731 can define the coordinates for the top left label and the distance to
732 the second label properly. The distance to the left edge is common to
733 these labels. The third one on the right edge has no common distance
734 values with the other ones, that's why we have to define a second layout,
735 with unique coordinates for the top left corner of that label.</p>
738 <p>You can define multiple layouts only if the labels on the sheet
739 have the same shape. If your sheet contains different shapes, you have
740 to define each shape in another template seperately. Future versions
741 of <app>gLabels</app> will probably be able to concatenate such sheets
742 with different shapes within a single template.</p>
746 <p>A single label can always be treated as a grid of one.</p>
749 <table frame="all" rules="rows">
751 <td><p>Properti</p></td> <td><p>Deskripsi</p></td>
754 <td><p/></td> <td><p/></td>
757 <td><p><code translate="no">nx</code></p></td>
758 <td><p>Number of labels/cards across in the grid (horizontal)</p></td>
761 <td><p><code translate="no">ny</code></p></td>
762 <td><p>Number of labels/cards across in the grid (vertical)</p></td>
765 <td><p><code translate="no">x0</code></p></td>
766 <td><p>Distance from left edge of sheet to the left edge of
767 the left column of cards/labels in the layout.</p></td>
770 <td><p><code translate="no">y0</code></p></td>
771 <td><p>Distance from the top edge of sheet to the top edge of
772 the top row of labels/cards in the layout.</p></td>
775 <td><p><code translate="no">dx</code></p></td>
776 <td><p>Horizontal pitch of grid.</p></td>
779 <td><p><code translate="no">dy</code></p></td>
780 <td><p>Vertical pitch of grid.</p></td>
784 <!-- ==== Figure ==== -->
786 <desc><span translate="no">Layout</span> parameters</desc>
787 <media type="image" src="figures/glabels-template-layout.png" mime="image/png" style="right">
788 <p><span translate="no">Layout</span> Parameters</p>
791 <!-- ==== End of Figure ==== -->
794 <!-- ***************** -->
795 <!-- END Layout Node -->
796 <!-- ***************** -->