Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

70 lines
2.5 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 the 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>