Class Rect

java.lang.Object
com.adobe.fontengine.font.Rect

public final class Rect extends Object
A bounding box.

AFE's coordinates are in y-positive. Values are: xmin, ymin, xmax, ymax where xmin invalid input: '<'= xmax and ymin invalid input: '<'= ymax.

Synchronization

These objects are immutable.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Rect
    A rectangle with xmin = ymin = xmax = ymax = 0.
    final double
     
    final double
     
    final double
     
    final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Rect(double[] vals)
    Create a Rect from an array of doubles.
    Rect(double xmin, double ymin, double xmax, double ymax)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Convert this Rect through a matrix.
    boolean
     
    int
     
    toDesignSpace(double unitsPerEmX, double unitsPerEmY)
     
    toEmSpace(double unitsPerEmX, double unitsPerEmY)
     
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • xmin

      public final double xmin
    • ymin

      public final double ymin
    • xmax

      public final double xmax
    • ymax

      public final double ymax
    • emptyRect

      public static final Rect emptyRect
      A rectangle with xmin = ymin = xmax = ymax = 0.
  • Constructor Details

    • Rect

      public Rect(double xmin, double ymin, double xmax, double ymax)
    • Rect

      public Rect(double[] vals)
      Create a Rect from an array of doubles.
      Parameters:
      vals - An array of length 4 whose entries are in the order xmin, ymin, xmax, ymax.
  • Method Details

    • applyMatrix

      public Rect applyMatrix(Matrix m)
      Convert this Rect through a matrix.
      Parameters:
      m - the matrix
      Returns:
      the transformed bounding box
    • toEmSpace

      public Rect toEmSpace(double unitsPerEmX, double unitsPerEmY)
    • toDesignSpace

      public Rect toDesignSpace(double unitsPerEmX, double unitsPerEmY)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object