Class ScalerContext

java.lang.Object
icyllis.arc3d.core.ScalerContext
Direct Known Subclasses:
ScalerContext_JDK

public abstract class ScalerContext extends Object
The ScalerContext controls the rasterization with a specified typeface and rasterization options.

This class is not thread safe, even it is stateless.

  • Field Details

  • Constructor Details

  • Method Details

    • getTypeface

      public final Typeface getTypeface()
    • getMaskFormat

      public final byte getMaskFormat()
    • isLinearMetrics

      public final boolean isLinearMetrics()
    • makeGlyph

      @Nonnull public final Glyph makeGlyph(int glyphID)
    • getImage

      public final void getImage(Glyph glyph)
    • getPath

      public final void getPath(@Nonnull Glyph glyph)
    • generateMetrics

      protected abstract ScalerContext.GlyphMetrics generateMetrics(Glyph glyph)
    • generateImage

      protected abstract void generateImage(Glyph glyph, Object imageBase, long imageAddress)
      Generates the contents of glyph.fImage. When called, glyph.fImage will be pointing to a pre-allocated, uninitialized region of memory of size glyph.imageSize(). This method may not change glyph.fMaskFormat.

      Because glyph.imageSize() will determine the size of fImage, generateMetrics will be called before generateImage.

    • generatePath

      protected abstract boolean generatePath(Glyph glyph, Path dst)
      Sets the passed path to the glyph outline. If this cannot be done the path is set to empty; Does not apply subpixel positioning to the path.
      Returns:
      false if this glyph does not have any path.