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 <file>${prefix}/share/glabels/</file>,
29 where <file>${prefix}</file> is usually something like
30 <file>/usr/local</file> or <file>/usr</file> depending
31 on the configuration option <file>prefix</file>. gLabels will
32 use all files of the form <file>*-templates.xml</file>
33 or <file>*.template</file>, that it finds in
34 <file>${prefix}/share/glabels/</file> and
35 <file>${HOME}/.glabels/</file>.
36 Additional templates can be added by creating additional
37 <file>*.template</file> files in either of these directories.
40 <p>The format for these files is defined in the DTD:
41 <link href="http://glabels.sourceforge.net/doc/glabels-2.0.dtd.txt">glabels-2.2.dtd</link>.
42 (This DTD also describes other XML formats used by glabels.)</p>
44 <section id="template-assumptions">
45 <title>Assumptions/caveats</title>
48 <p>A sheet contains only one size of label or card (if a sheet
49 contains more than one size of item, it can be split into
50 multiple templates for multiple pass printing)</p>
53 <p>Distances can be expressed in units of <em>pt</em>,
54 <em>in</em>, <em>mm</em>,
55 <em>cm</em>, or <em>pc</em>. For example:
56 "<literal>1.0in</literal>" or "<literal>2.54cm</literal>". If no
57 units are specified, computer points (<em>pt</em>) will
58 be assumed (1 <em>pt</em> =
59 1/72 <em>in</em> = 0.352778 <em>mm</em>).
65 <section id="template-file">
66 <title>Template Files</title>
69 <?xml version="1.0"?>
70 <Glabels-templates>
72 <replaceable>...templates...</replaceable>
74 </Glabels-templates>
79 <section id="template-example">
80 <title>Example Template</title>
82 <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels">
83 <Meta category="label"/>
84 <Meta category="mail"/>
85 <Meta product_url="http://www.avery.com/avery/en_us/"/>
86 <Label-rectangle id="0" width="189pt" height="72pt" round="5pt">
87 <Markup-margin size="5pt"/>
88 <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/>
89 </Label-rectangle>
90 <Alias brand="Avery" part="5160"/>
91 <Alias brand="Avery" part="6233"/>
96 <section id="template-template-node">
97 <title>Template Node</title>
99 <p>A <em>Template</em> node describes a single stationary
100 product. It must contain one instance of any type of Label node
101 (<em>Label-rectangle</em>,
102 <em>Label-round</em>, or <em>Label-cd</em>).
103 This node can be followed by zero or more
104 <em>Alias</em> nodes.</p>
106 <table frame="all" rules="rows">
108 <td><p>Property</p></td> <td><p>Description</p></td>
111 <td><p></p></td> <td><p></p></td>
114 <td><p>brand</p></td> <td><p>Brand or manufacturer of stationary product. E.g. "Avery"</p></td>
117 <td><p>part</p></td> <td><p>Part number or name of stationary product. E.g. "8160"</p></td>
120 <td><p>size</p></td> <td><p>Size of sheet. E.g., "US-Letter," "A4", ...</p></td>
123 <td><p>description</p></td> <td><p>Description of stationary product. E.g, "Mailing Labels."</p></td>
126 <td><p>_description</p></td> <td><p>Translatable description of stationary product. E.g, "Mailing Labels." (Only useful for predefined templates)</p></td>
129 <td><p>width</p></td> <td><p>Page width. Only valid if size="Other"</p></td>
132 <td><p>height</p></td> <td><p>Page height. Only valid if size="Other"</p></td>
138 <section id="template-template-node">
139 <title>Meta Node</title>
141 <p>A <em>Meta</em> node contains some additional properties of that product.
142 This node may appear more than once, with a subnode each.</p>
144 <table frame="all" rules="rows">
146 <td><p>Subnode</p></td> <td><p>Description</p></td>
149 <td><p></p></td> <td><p></p></td>
152 <td><p>category</p></td> <td><p>The category which this product is assigned to. The value
153 of this category is used by the <app>gLabels'</app> template chooser to filter the
154 view to display only mailing labels, or labels in common and suppress any other products
155 which the user don't want to find. One product can be assigned to several categories.</p></td>
158 <td><p>product_url</p></td> <td><p>This address points to the vendor's website. Ideally,
159 the link shows the URL of that certain product, if available.</p></td>
165 <section id="template-label-rectangle-node">
166 <title>Label-rectangle Node</title>
168 <p>A <em>Label-rectangle</em> node describes the
169 dimensions of a single label or business card that is rectangular
170 in shape (may have rounded edges).</p>
172 <table frame="all" rules="rows">
174 <td><p>Property</p></td> <td><p>Description</p></td>
177 <td><p></p></td> <td><p></p></td>
180 <td><p>id</p></td> <td><p>Reserved for future use. Should always be 0.</p></td>
183 <td><p>width</p></td> <td><p>Width of label/card</p></td>
186 <td><p>height</p></td> <td><p>Heigth of label/card</p></td>
189 <td><p>round</p></td> <td><p>Radius of corners. For items with square edges (business cards), the radius should be 0.</p></td>
192 <td><p>x_waste</p></td> <td><p>Amount of horizontal waste (over-print) to allow. This is useful
193 for minimizing alignment problems when using non-white
194 backgrounds (e.g. images).</p></td>
197 <td><p>y_waste</p></td> <td><p>Amount of vertical waste (over-print) to allow. This is useful
198 for minimizing alignment problems when using non-white
199 backgrounds (e.g. images).</p></td>
203 <!-- ==== Figure ==== -->
204 <media type="image" src="figures/glabels-template-label.png" mime="image/png" style="right">
205 <p>Label-rectangle parameters</p>
207 <!-- ==== End of Figure ==== -->
210 <section id="template-label-rectangle-node">
211 <title>Label-ellipse Node</title>
213 <p>A <em>Label-ellipse</em> node describes the
214 dimensions of a single label or business card that is elliptic
217 <table frame="all" rules="rows">
219 <td><p>Property</p></td> <td><p>Description</p></td>
222 <td><p></p></td> <td><p></p></td>
225 <td><p>id</p></td> <td><p>Reserved for future use. Should always be 0.</p></td>
228 <td><p>width</p></td> <td><p>Width of the ellipse</p></td>
231 <td><p>height</p></td> <td><p>Heigth of the ellipse</p></td>
234 <td><p>waste</p></td> <td><p>Amount of waste (over-print) to allow. This is useful
235 for minimizing alignment problems when using non-white
236 backgrounds (e.g. images).</p></td>
240 <!-- ==== Figure ==== -->
241 <media type="image" src="figures/glabels-template-ellipse.png" mime="image/png" style="right">
242 <p>Label-ellipse parameters</p>
244 <!-- ==== End of Figure ==== -->
247 <section id="template-label-round-node">
248 <title>Label-round Node</title>
250 <p>A <em>Label-round</em> node describes the dimensions
251 of a simple round label (not a CD).</p>
253 <table frame="all" rules="rows">
255 <td><p>Property</p></td> <td><p>Description</p></td>
258 <td><p></p></td> <td><p></p></td>
261 <td><p>id</p></td> <td><p>Reserved for future use. Should always be 0.</p></td>
264 <td><p>radius</p></td> <td><p>Radius (1/2 diameter) of label</p></td>
267 <td><p>waste</p></td> <td><p>Amount of waste (over-print) to allow. This is useful
268 for minimizing alignment problems when using non-white
269 backgrounds (e.g. images).</p></td>
274 <section id="template-label-cd-node">
275 <title>Label-cd Node</title>
277 <p>A <em>Label-round</em> node describes the dimensions
278 of a CD, DVD, or business card CD.</p>
280 <table frame="all" rules="rows">
282 <td><p>Property</p></td> <td><p>Description</p></td>
285 <td><p></p></td> <td><p></p></td>
288 <td><p>id</p></td> <td><p>Reserved for future use. Should always be 0.</p></td>
291 <td><p>radius</p></td> <td><p>Outer radius of label</p></td>
294 <td><p>hole</p></td> <td><p>Radius of concentric hole</p></td>
297 <td><p>width</p></td> <td><p>If present, the label is clipped to the given width.
298 (Useful for "business card CDs").</p></td>
300 <td><p>heigth</p></td> <td><p>If present, the label is clipped to the given height.
301 (Useful for "business card CDs").</p></td>
303 <td><p>waste</p></td> <td><p>Amount of waste (over-print) to allow. This is useful
304 for minimizing alignment problems when using non-white
305 backgrounds (e.g. images).</p></td>
309 <!-- ==== Figure ==== -->
310 <media type="image" src="figures/glabels-template-cd.png" mime="image/png" style="right">
311 <p>CD label parameters</p>
313 <!-- ==== End of Figure ==== -->
316 <section id="template-markup-margin-node">
317 <title>Markup-margin Node</title>
319 <p>A <em>Markup-margin</em> describes a margin along
320 all edges of a label.</p>
322 <table frame="all" rules="rows">
324 <td><p>Property</p></td> <td><p>Description</p></td>
327 <td><p></p></td> <td><p></p></td>
330 <td><p>size</p></td> <td><p>Size of the margin. I.e. the distance of the margin
331 line from the edge of the card/label.</p></td>
336 <section id="template-markup-line-node">
337 <title>Markup-line Node</title>
339 <p>A <em>Markup-line</em> describes a markup line.</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>x1</p></td> <td><p>x coordinate of 1st endpoint of the line segment.</p></td>
352 <td><p>y1</p></td> <td><p>y coordinate of 1st endpoint of the line segment.</p></td>
355 <td><p>x2</p></td> <td><p>x coordinate of 2st endpoint of the line segment.</p></td>
358 <td><p>y2</p></td> <td><p>y coordinate of 2st endpoint of the line segment.</p></td>
363 <section id="template-markup-circle-node">
364 <title>Markup-circle Node</title>
366 <p>A <em>Markup-circle</em> describes a markup circle.</p>
368 <table frame="all" rules="rows">
370 <td><p>Property</p></td> <td><p>Description</p></td>
373 <td><p></p></td> <td><p></p></td>
376 <td><p>x0</p></td> <td><p>x coordinate of circle origin (center).</p></td>
379 <td><p>y0</p></td> <td><p>y coordinate of circle origin (center).</p></td>
382 <td><p>radius</p></td> <td><p>Radius of circle.</p></td>
387 <section id="template-markup-rect-node">
388 <title>Markup-rect Node</title>
390 <p>A <em>Markup-rect</em> describes a markup rectangle.</p>
392 <table frame="all" rules="rows">
394 <td><p>Property</p></td> <td><p>Description</p></td>
397 <td><p></p></td> <td><p></p></td>
400 <td><p>x1</p></td> <td><p>x coordinate of upper left corner of rectangle.</p></td>
403 <td><p>y1</p></td> <td><p>y coordinate of upper left corner of rectangle.</p></td>
406 <td><p>w</p></td> <td><p>Width of rectangle.</p></td>
409 <td><p>h</p></td> <td><p>Height of rectangle.</p></td>
412 <td><p>r</p></td> <td><p>Radius of rounded corners of rectangle.</p></td>
417 <section id="template-layout-node">
418 <title>Layout Node</title>
420 <p>A label node may contain multiple <em>Layout</em>
421 children. If labels are arranged in a simple grid pattern, only
422 one layout is needed. However, if labels are arranged in multiple
423 grids, such as a running bond pattern, multiple
424 <em>layout</em> tags can be used. Note: a single label
425 can always be treated as a grid of one.</p>
427 <table frame="all" rules="rows">
429 <td><p>Property</p></td> <td><p>Description</p></td>
432 <td><p></p></td> <td><p></p></td>
435 <td><p>nx</p></td> <td><p>Number of labels/cards across in the grid (horizontal)</p></td>
438 <td><p>ny</p></td> <td><p>Number of labels/cards across in the grid (vertical)</p></td>
441 <td><p>x0</p></td> <td><p>Distance from left edge of sheet to the left edge of
442 the left column of cards/labels in the layout.</p></td>
445 <td><p>y0</p></td> <td><p>Distance from the top edge of sheet to the top edge of
446 the top row of labels/cards in the layout.</p></td>
449 <td><p>dx</p></td> <td><p>Horizontal pitch of grid.</p></td>
452 <td><p>dy</p></td> <td><p>Vertical pitch of grid.</p></td>
456 <!-- ==== Figure ==== -->
457 <media type="image" src="figures/glabels-template-layout.png" mime="image/png" style="right">
458 <p>Layout Parameters</p>
460 <!-- ==== End of Figure ==== -->
463 <section id="template-alias-node">
464 <title>Alias Node</title>
466 <p>An <em>Alias</em> node provides the name of a
467 product with the same size and layout characteristics as the
470 <table frame="all" rules="rows">
472 <td><p>Property</p></td> <td><p>Description</p></td>
475 <td><p></p></td> <td><p></p></td>
478 <td><p>brand</p></td> <td><p>The brand or manufacturer of the equivalent product.</p></td>
481 <td><p>part</p></td> <td><p>The part number of the equivalent product.</p></td>