1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- XML file produced from file: manual.tex
using Hyperlatex v 2.6 (c) Otfried Cheong
on Emacs 21.3.1, Tue Sep 26 20:03:47 2006 -->
<head>
<title>Ipe Manual -- 14.3 Ipe object elements</title>
<style type="text/css">
.maketitle { align : center }
div.abstract { margin-left: 20%; margin-right: 10%; }
h3.abstract { align : center }
div.verse, div.quote, div.quotation {
margin-left : 10%;
margin-right : 10%;
}
</style>
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffe6">
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_39.html"><img border="0" alt="14.4 The Ipe style sheet format" src="next.png"></a></td><td bgcolor="#99ccff"><a href="manual_35.html"><img border="0" alt="14 The Ipe file format" src="up.png"></a></td><td bgcolor="#99ccff"><a href="manual_37.html"><img border="0" alt="14.2 The page element" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>14.3 Ipe object elements</b></td></tr></table>
<h2>14.3 Ipe object elements</h2>
<p>In the following, we explain the Ipe object elements currently
understood by Ipe.
<p>A "top-level" Ipe object, that is an object directly inside a
<code><page></code> element, can take the optional <code>layer</code> attribute.
This attribute indicates into which layer the object goes. If it is
missing, the object goes into the same layer as the preceding object.
If the first object has no layer attribute, it goes into the layer
defined first in the page, or the default "alpha" layer.
<p>Any Ipe object can take the optional attributes <code>stroke</code> and
<code>matrix</code>. The value of <code>stroke</code> is a color--either a
symbolic name defined in one of the style sheets of the document, one
of the predefined names "black" or "white", a single
real number between <i>0</i> (black) and <i>1</i> (white) indicating a gray
level, or three real numbers in the range <i>[0,1]</i> indicating the red,
green, and blue component (in this order), separated by white space.
(Note that the stroke color is not allowed to be "void".)
<p>The value of <code>matrix</code> is a sequence of six real numbers,
separated by white space, indicating a transformation matrix for all
coordinates inside the element (including embedded elements if this is
a <code><group></code> element). A missing <code>matrix</code> attribute is
interpreted as the identity matrix.
<h3><a name="id1">14.3.1 The <code><mark></code> element</a></h3>
<p>The <code><mark></code> element defines a mark object. It takes the required
attributes <code>size</code> (a real number or symbolic name), <code>type</code>
(an integer, see <code>IpeMark</code>), and <code><pos></code> (two real numbers,
separated by white space), and the optional attribute <code>fill</code> for
the fill color.
<h3><a name="id2">14.3.2 The <code><ref></code> element</a></h3>
<p>The <code><ref></code> element refers to an Ipe object defined in the style
sheet. It has one required attribute <code>name</code>, which must be a name
of a <code><template></code> defined in the style sheet. The object will be
reused at the position defined in the template, unless the
<code>matrix</code> is set.
<h3><a name="id3">14.3.3 The <code><image></code> element</a></h3>
<p>The <code><image></code> element defines a bitmap object. The tag takes the
required attributes <code>bitmap</code> (the value is an integer referring
to a bitmap defined in a <code><bitmap></code> element in the document), and
<code>rect</code> (four real coordinates separated by white space, in the
order <i>x<sub>1</sub></i>, <i>y<sub>1</sub></i>, <i>x<sub>2</sub></i>, <i>y<sub>2</sub></i>, indicating two opposite
corners of the image in Ipe coordinates). The optional <code>matrix</code>
attribute can be used to transform the image into a non-rectangular
shape.
<p>It is also possible to embed a bitmap <em>directly</em>, without first
creating a <code><bitmap></code> element. In that case, the <code>bitmap</code>
attribute must be omitted, and instead the <code><image></code> element must
carry all the attributes of the <code><bitmap></code> element, with the
exception of <code>id</code>. The element contents is then the bitmap data,
as described for <code><bitmap></code>.
<h3><a name="id4">14.3.4 The <code><text></code> element</a></h3>
<p>The <code><text></code> element takes the required attributes <code>size</code>
(the font size--either a symbolic name defined in a style sheet, or a
real number) and <code>pos</code> (two real numbers separated by white
space, defining the position of the text on the paper).
<p>The required attribute <code>type</code>, with the possible values
<em>label</em>, <em>minipage</em>, <em>textbox</em>, and <em>title</em>
determines the type of object, and the attributes <code>width</code>,
<code>height</code>, and <code>depth</code> give its dimensions. Note that these
dimensions are recomputed by Ipe when running LaTeX, with the
exception of <code>width</code> for minipage objects whose width is fixed.
If the dimensions are missing, Ipe uses some default values until
LaTeX has been run. (Obviously, <code>width</code> must not be missing
for a minipage object.) If <code>type</code> is missing, the object is a
minipage if <code>width</code> is present, otherwise a label.
<p>The optional attributes <code>valign</code> (with values <em>top</em> (default
for a minipage object), <em>bottom</em> (default for a label object),
<em>center</em>, and <em>baseline</em>) and <code>halign</code> (with values
<em>left</em>, <em>right</em>, and <em>center</em>, with <em>left</em> the
default) determine the position of the reference point with respect to
the text box.
<p>The optional attribute <code>transformable</code> (possible values
are <em>yes</em> and <em>no</em>, the latter is the default) determines
whether the text object can be transformed, that is, stretched and
rotated. Moving, of course, is always allowed.
<p>The optional attribute <code>style</code> selects a LaTeX "style" to be
used for formatting the text. It is only used for minipage objects,
and must be a symbolic name defined in a style sheet. The standard
style sheet defines the styles "default", "center", "itemize",
and "item". If the attribute is not present, the "default" style
is applied.
<p>The contents of the element must be a legal LaTeX fragment that can
be interpreted by LaTeX inside <code>\hbox</code>, possibly using the
macros or packages defined in the preamble.
<h3><a name="id5">14.3.5 The <code><path></code> element</a></h3>
<p>The <code><path></code> element is the most complex element, and represents
any filled and/or stroked PDF path, that is, any sequence of
Postscript moveto/lineto/curveto/closepath operations, followed by a
single fill/stroke operation. In particular, paths consisting of more
than one closed loop are allowed, and so is any mix of straight
segments and Bezier curves in the paths.
<p>The <code><path></code> element takes the following optional attributes:
<code>stroke</code>, <code>fill</code>, <code>dash</code>, <code>pen</code>, <code>cap</code>,
<code>join</code>, <code>fillrule</code>, <code>matrix</code>, <code>arrow</code>,
<code>backarrow</code>.
<p>The value of <code>dash</code> is either one of the predefined names
"void" or "solid", a symbolic name defined in a style sheet, or a
dash pattern in PDF format, such as "[3 1] 0" for "three pixels on,
one off, starting with the first pixel".
<p>The value of <code>pen</code> is the line width, either symbolic (defined in
a style sheet), or as a single real number.
<p>The values of <code>cap</code>, <code>join</code> are the <em>line cap</em> and
<em>line join</em> settings of PDF, as integers.
<p>The value of the <code>fillrule</code> attribute selects one of two
algorithms for determining whether a point lies inside a filled
object. Possible values are <code>wind</code> and <code>eofill</code>.
<p>The value of the <code><arrow></code> and <code><backarrow></code> attributes is
the size of an arrow, either a symbolic name defined in a style sheet,
or a real number. If the attribute is missing, no arrow is drawn.
<p>The contents of the <code><path></code> element describes a path using a
series of "path construction operators" with arguments. This
generalizes the PDF path construction syntax.
<p>Each operator follows its arguments. The operators are
[<ul class="menu"><li><code>m</code> (moveto) (1 point argument): begin new subpath,
<li><code>l</code> (lineto) (1 point argument): add straight segment to
subpath,
<li><code>c</code> (curveto) (3 point arguments): add a cubic Bézier
curve,
<li><code>q</code> (quadratic curveto) (2 point arguments): add a
quadratic Bézier curve,
<li><code>e</code> (ellipse) (1 matrix argument): add a closed subpath
consisting of an ellipse, the ellipse is the image of the unit
circle under the transformation described by the matrix,
<li><code>a</code> (arcto) (1 matrix argument, 1 point argument): add an
elliptic arc, on the ellipse describe by the matrix, from current
position to given point,
<li><code>s</code> (spline) (<i>n</i> point arguments): add a uniform cubic
B-spline with <i>n + 5</i> control points (current position and nth
point have multiplicity 3),
<li><code>u</code> (closed spline) (<i>n</i> point arguments): add a closed
subpath consisting of a closed uniform B-spline with <i>n</i> control
points.
<li><code>h</code> (closepath) (no arguments): close the current subpath.
No more segments can be added to this subpath, so the next operator
(if there is one) must start a new subpath.
</ul>
<h3><a name="id6">14.3.6 The <code><group></code> element</a></h3>
<p>The <code><group></code> element allows to group objects together, so that
they appear as one in the user interface. The contents of the element
consists of a series of Ipe object elements.
<p>The <code><group></code> element takes all the possible attributes of the
<code><path></code> element (with the exception of the two arrow
attributes), as well as <code>textsize</code>, <code>marksize</code>, and
<code>markshape</code>.
<p>If one of these attributes has been set, its value overrides the
corresponding attribute of the elements inside the group. In other
words, the attribute of an object is meaningful only if none of its
parents in the tree structure formed by the grouped objects has this
attribute set.
<hr />
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_39.html"><img border="0" alt="14.4 The Ipe style sheet format" src="next.png"></a></td><td bgcolor="#99ccff"><a href="manual_35.html"><img border="0" alt="14 The Ipe file format" src="up.png"></a></td><td bgcolor="#99ccff"><a href="manual_37.html"><img border="0" alt="14.2 The page element" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>14.3 Ipe object elements</b></td></tr></table></body></html>
|