|
Unified Typesetting API M1-20040817 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An anchor is a hint provided by a Box
which
describes a point where other boxes should be placed. This is needed
for combined characters, math typesetting etc. E.g. the letter 'a' would
have an anchor to specify where to place the combining diaerisis ̈. Such
information may be provided by a font, but not all do. In this case
you could implement an anchor which simply is centered above the 'a'.
Anchors are also known as attachment points.
Anchors may also prove useful for the placement of descriptive text around a graphic.
An anchor is owned by exactly one Box
and belongs to one AnchorClass
. An anchor
can be allocated by one box.
Many fonts provide precomposed glyphs which have no anchors. These glyphs do normally not have anchors, just if you're asking yourself how those fonts manage that. FontForge has a fine handbook dealing with fontformats with additional information about anchors.
Method Summary | |
void |
allocate(Anchor anAnchor,
Box aBox)
Allocates this anchor with anAnchor which
itself is an anchor of aBox . |
void |
allocate(Box aBox)
Allocates this anchor with the given box. |
AnchorClass |
getAnchorClass()
Returns the class this anchor belongs to. |
Point2D |
getLocation()
Returns the location relative to its owning box. |
boolean |
isAllocated()
A anchor is either allocated by a box or not. |
Method Detail |
public Point2D getLocation()
public AnchorClass getAnchorClass()
public boolean isAllocated()
true
if the anchor as a box assigned to it,
false
otherwise.public void allocate(Box aBox)
this.getLocation().equals(aBox.getOrigin())
.
aBox
- The box to be placed at this anchor.public void allocate(Anchor anAnchor, Box aBox)
anAnchor
which
itself is an anchor of aBox
. aBox
will be placed relative to anAnchor
.
anAnchor
will be translated to match the location
of this anchor.
So this.getLocation.equals(anAnchor.getLocation())
anAnchor
- The anchor of the box to use.aBox
- The box to place.
|
Unified Typesetting API M1-20040817 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() An inghuimische.de project. | Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details. |