org.apache.fop.complexscripts.fonts

## Class GlyphPositioningTable.Anchor

- java.lang.Object
- - org.apache.fop.complexscripts.fonts.GlyphPositioningTable.Anchor

- Direct Known Subclasses:
    GlyphPositioningTable.MarkAnchor
  Enclosing class:
    GlyphPositioningTable

      public static class GlyphPositioningTable.Anchor
      extends Object

  The `Anchor` class implements a anchor record, comprising an X,Y coordinate pair, an optional anchor point index (or -1), and optional X or Y device tables (or null if absent).

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Anchor(GlyphPositioningTable.Anchor a)` Instantiate an Anchor based on an existing anchor.
    `` | `Anchor(int x, int y)` Instantiate an Anchor (format 1).
    `` | `Anchor(int x, int y, GlyphPositioningTable.DeviceTable xDevice, GlyphPositioningTable.DeviceTable yDevice)` Instantiate an Anchor (format 3).
    `` | `Anchor(int x, int y, int anchorPoint)` Instantiate an Anchor (format 2).

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GlyphPositioningTable.Value` | `getAlignmentAdjustment(GlyphPositioningTable.Anchor a)` Obtain adjustment value required to align the specified anchor with this anchor.
    `int` | `getAnchorPoint()`
    `int` | `getX()`
    `GlyphPositioningTable.DeviceTable` | `getXDevice()`
    `int` | `getY()`
    `GlyphPositioningTable.DeviceTable` | `getYDevice()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Anchor

          public Anchor(int x,
                        int y)

      Instantiate an Anchor (format 1).
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate

    - #### Anchor

          public Anchor(int x,
                        int y,
                        int anchorPoint)

      Instantiate an Anchor (format 2).
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate
        `anchorPoint` - anchor index (or -1)

    - #### Anchor

          public Anchor(int x,
                        int y,
                        GlyphPositioningTable.DeviceTable xDevice,
                        GlyphPositioningTable.DeviceTable yDevice)

      Instantiate an Anchor (format 3).
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate
        `xDevice` - the x device table (or null if not present)
        `yDevice` - the y device table (or null if not present)

    - #### Anchor

          protected Anchor(GlyphPositioningTable.Anchor a)

      Instantiate an Anchor based on an existing anchor.
      Parameters:
        `a` - the existing anchor

  - ### Method Detail

    - #### getX

          public int getX()

      Returns:
        the x coordinate

    - #### getY

          public int getY()

      Returns:
        the y coordinate

    - #### getAnchorPoint

          public int getAnchorPoint()

      Returns:
        the anchor point index (or -1 if not specified)

    - #### getXDevice

          public GlyphPositioningTable.DeviceTable getXDevice()

      Returns:
        the x device table (or null if not specified)

    - #### getYDevice

          public GlyphPositioningTable.DeviceTable getYDevice()

      Returns:
        the y device table (or null if not specified)

    - #### getAlignmentAdjustment

          public GlyphPositioningTable.Value getAlignmentAdjustment(GlyphPositioningTable.Anchor a)

      Obtain adjustment value required to align the specified anchor with this anchor.
      Parameters:
        `a` - the anchor to align
      Returns:
        the adjustment value needed to effect alignment

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2025 Apache Software Foundation. All rights reserved.