70 lines
2.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<xml>
<include src="settings/generic.xml"/>
<synopsis
name="RAnchor"
description="a connection point for Components"
keywords="objects, anchor, contour"/>
<title>RoboFab Objects: Anchor</title>
<div id="titlepic">
<img src="img/offdrawmodel_20.gif" alt="" border="0"/>
</div>
<div class="content">
<h1>RoboFab Anchor</h1>
<h3>Usage</h3>
<pythonsource src="examples/usageAnchor.py"/>
<python type="output"><![CDATA[
< RGlyph for RoboFab Demo Font.A >
[< RAnchor for RoboFab Demo Font.A.anchors[0] >]
]]></python>
<h3>Description</h3>
<p>
Anchors are single points in a glyph which are not part of a contour. Anchors have a name and a position, and they're used as connection points for <a href="objects/component.html">Components</a>. In FontLab the anchors have a special appearance and can be edited. Anchors are stored in GLIF as single, named, moveto's. i.e. any single, named moveto in GLIF will become an anchor in FontLab. RoboFab's own font.generateGlyph() also uses the anchors to assemble the components.
</p>
<h3>Attributes</h3>
<ul>
<li><strong>index</strong>: the index of the anchor. (read only)</li>
<li><strong>position</strong>: the position of the anchor (x, y)</li>
<li><strong>x</strong>: the x position of the anchor.</li>
<li><strong>y</strong>: the y position of the anchor.</li>
<li><strong>name</strong>: the name of the anchor.</li>
</ul>
<h3>Attribute examples</h3>
<pythonsource src="examples/anchorAttributes.py"/>
<h3>Methods</h3>
<p>
<ul>
<li><strong>copy()</strong>: return a deepcopy of the object.</li>
<li><strong>move((x, y))</strong>: move the anchor of the bPoint to (x,y). The relative coordinates of the bcpIn and bcpOut will remain the same, which means that in fact, they move the same distance.</li>
<li><strong>scale((x, y), center=(0, 0))</strong>: scale<6C>the<68>anchor.</li> <li><strong>round()</strong>: round the coordinates to whole integers.</li>
<li><strong>draw(aPen)</strong>: draw the object with a RoboFab segment pen.</li>
<li><strong>drawPoints(aPen)</strong>: draw the object with a point pen. See <a href="howto/usepens.html">how to use pens.</a></li>
<li><strong>transform(matrix)</strong>: Transform this point. Use a
Transform matrix
object to mess with the point. <a href="howto/usetransformations.html">See how to use transformations</a>.</li>
</ul>
</p>
<h3>Method examples</h3>
<pythonsource src="examples/anchorMethods.py"/>
</div>
</xml>