GlyphMapping (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.fonts

## Class GlyphMapping

- java.lang.Object
- - org.apache.fop.fonts.GlyphMapping

-     public class GlyphMapping
      extends Object

  Stores the mapping of a text fragment to glyphs, along with various information.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `MinOptMax` | `areaIPD`
    `List` | `associations`
    `boolean` | `breakOppAfter`
    `int` | `endIndex` Exclusive.
    `Font` | `font`
    `int[][]` | `gposAdjustments`
    `boolean` | `isHyphenated`
    `boolean` | `isSpace`
    `int` | `letterSpaceCount`
    `int` | `level`
    `String` | `mapping`
    `int` | `startIndex` Inclusive.
    `int` | `wordSpaceCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letterSpaceCount, MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean breakOppAfter, Font font, int level, int[][] gposAdjustments)`
    `GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letterSpaceCount, MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean breakOppAfter, Font font, int level, int[][] gposAdjustments, String mapping, List associations)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addToAreaIPD(MinOptMax idp)`
    `static GlyphMapping` | `doGlyphMapping(TextFragment text, int startIndex, int endIndex, Font font, MinOptMax letterSpaceIPD, MinOptMax[] letterSpaceAdjustArray, char precedingChar, char breakOpportunityChar, boolean endsWithHyphen, int level, boolean dontOptimizeForIdentityMapping, boolean retainAssociations, boolean retainControls)`
    `int` | `getWordLength()` Obtain number of 'characters' contained in word.
    `static boolean` | `isSpace(char ch)` Indicates whether a character is a space in terms of this layout manager.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### startIndex

          public final int startIndex

      Inclusive.

    - #### endIndex

          public final int endIndex

      Exclusive.

    - #### wordSpaceCount

          public final int wordSpaceCount

    - #### letterSpaceCount

          public int letterSpaceCount

    - #### areaIPD

          public MinOptMax areaIPD

    - #### isHyphenated

          public final boolean isHyphenated

    - #### isSpace

          public final boolean isSpace

    - #### breakOppAfter

          public boolean breakOppAfter

    - #### font

          public final Font font

    - #### level

          public final int level

    - #### gposAdjustments

          public final int[][] gposAdjustments

    - #### mapping

          public String mapping

    - #### associations

          public List associations

  - ### Constructor Detail

    - #### GlyphMapping

          public GlyphMapping(int startIndex,
                              int endIndex,
                              int wordSpaceCount,
                              int letterSpaceCount,
                              MinOptMax areaIPD,
                              boolean isHyphenated,
                              boolean isSpace,
                              boolean breakOppAfter,
                              Font font,
                              int level,
                              int[][] gposAdjustments)

    - #### GlyphMapping

          public GlyphMapping(int startIndex,
                              int endIndex,
                              int wordSpaceCount,
                              int letterSpaceCount,
                              MinOptMax areaIPD,
                              boolean isHyphenated,
                              boolean isSpace,
                              boolean breakOppAfter,
                              Font font,
                              int level,
                              int[][] gposAdjustments,
                              String mapping,
                              List associations)

  - ### Method Detail

    - #### doGlyphMapping

          public static GlyphMapping doGlyphMapping(TextFragment text,
                                                    int startIndex,
                                                    int endIndex,
                                                    Font font,
                                                    MinOptMax letterSpaceIPD,
                                                    MinOptMax[] letterSpaceAdjustArray,
                                                    char precedingChar,
                                                    char breakOpportunityChar,
                                                    boolean endsWithHyphen,
                                                    int level,
                                                    boolean dontOptimizeForIdentityMapping,
                                                    boolean retainAssociations,
                                                    boolean retainControls)

    - #### isSpace

          public static boolean isSpace(char ch)

      Indicates whether a character is a space in terms of this layout manager.
      Parameters:
        `ch` - the character
      Returns:
        true if it's a space

    - #### getWordLength

          public int getWordLength()

      Obtain number of 'characters' contained in word. If word is mapped, then this number may be less than or greater than the original length (breakIndex - startIndex). We compute and memoize thius length upon first invocation of this method.

    - #### addToAreaIPD

          public void addToAreaIPD(MinOptMax idp)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2025 Apache Software Foundation. All rights reserved.