Package icyllis.arc3d.core

# Class Strike

java.lang.Object
icyllis.arc3d.core.Strike

@Experimental public final class Strike extends Object
The font strike holds the results from `ScalerContext`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Strike(StrikeCache strikeCache, StrikeDesc strikeDesc, ScalerContext scalerContext)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Glyph`
  `digestFor(int actionType, int glyphID)`
  Find or create a glyph for the given glyph ID, return the pointer to it.
  `Glyph`
  `getGlyph(int glyphID)`
  Find or create a glyph for the given glyph ID, return the pointer to it.
  `Glyph[]`
  `getMetrics(int[] glyphs, int glyphOffset, int glyphCount, Glyph[] results)`
  Compute metrics for a list of glyphs in bulk.
  `StrikeDesc`
  `getStrikeDesc()`
  `void`
  `lock()`
  `boolean`
  `prepareForImage(Glyph glyph)`
  Prepare the glyph to draw an image, and return if the image exists.
  `boolean`
  `prepareForPath(Glyph glyph)`
  Prepare the glyph to draw a path, and return if the path exists.
  `void`
  `unlock()`

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

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

- ## Constructor Details

  - ### Strike

    @Internal public Strike(@Nonnull StrikeCache strikeCache, @Nonnull StrikeDesc strikeDesc, @Nonnull ScalerContext scalerContext)

- ## Method Details

  - ### lock

    public void lock()

  - ### unlock

    public void unlock()

  - ### getGlyph

    @Nonnull public Glyph getGlyph(int glyphID)
    Find or create a glyph for the given glyph ID, return the pointer to it.

    Requires lock.

    Parameters:
      `glyphID` - typeface-specified glyph ID

  - ### digestFor

    @Nonnull public Glyph digestFor(int actionType, int glyphID)
    Find or create a glyph for the given glyph ID, return the pointer to it. Get or compute the digest for the given action type, ensure that `Glyph.actionFor(int)` is set.

    Requires lock.

    Parameters:
      `actionType` - e.g. `Glyph.kDirectMask`
      `glyphID` - typeface-specified glyph ID

  - ### prepareForImage

    public boolean prepareForImage(@Nonnull Glyph glyph)
    Prepare the glyph to draw an image, and return if the image exists.

    Requires lock.

  - ### prepareForPath

    public boolean prepareForPath(Glyph glyph)
    Prepare the glyph to draw a path, and return if the path exists.

    Requires lock.

  - ### getMetrics

    @Nonnull public Glyph[] getMetrics(@Nonnull int[] glyphs, int glyphOffset, int glyphCount, @Nonnull Glyph[] results)
    Compute metrics for a list of glyphs in bulk. The glyph metrics within the given range will be computed, and the glyph pointers will be stored in the results array and returned.

    Excludes lock.

  - ### getStrikeDesc

    public StrikeDesc getStrikeDesc()