Enum Class BufferClusterLevel

java.lang.Object
java.lang.Enum<BufferClusterLevel>
org.freedesktop.harfbuzz.BufferClusterLevel
All Implemented Interfaces:
Serializable, Comparable<BufferClusterLevel>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum BufferClusterLevel extends Enum<BufferClusterLevel> implements Enumeration

Data type for holding HarfBuzz's clustering behavior options. The cluster level dictates one aspect of how HarfBuzz will treat non-base characters during shaping.

In HBBUFFERCLUSTERLEVELMONOTONEGRAPHEMES, non-base characters are merged into the cluster of the base character that precedes them. There is also cluster merging every time the clusters will otherwise become non-monotone.

In HBBUFFERCLUSTERLEVELMONOTONECHARACTERS, non-base characters are initially assigned their own cluster values, which are not merged into preceding base clusters. This allows HarfBuzz to perform additional operations like reorder sequences of adjacent marks. The output is still monotone, but the cluster values are more granular.

In HBBUFFERCLUSTERLEVELCHARACTERS, non-base characters are assigned their own cluster values, which are not merged into preceding base clusters. Moreover, the cluster values are not merged into monotone order. This is the most granular cluster level, and it is useful for clients that need to know the exact cluster values of each character, but is harder to use for clients, since clusters might appear in any order.

In HBBUFFERCLUSTERLEVELGRAPHEMES, non-base characters are merged into the cluster of the base character that precedes them. This is similar to the Unicode Grapheme Cluster algorithm, but it is not exactly the same. The output is not forced to be monotone. This is useful for clients that want to use HarfBuzz as a cheap implementation of the Unicode Grapheme Cluster algorithm.

HBBUFFERCLUSTERLEVELMONOTONEGRAPHEMES is the default, because it maintains backward compatibility with older versions of HarfBuzz. New client programs that do not need to maintain such backward compatibility are recommended to use HBBUFFERCLUSTERLEVELMONOTONECHARACTERS instead of the default.

Since:
0.9.42
  • Enum Constant Details

    • MONOTONE_GRAPHEMES

      public static final BufferClusterLevel MONOTONE_GRAPHEMES
      Return cluster values grouped by graphemes into monotone order.
    • MONOTONE_CHARACTERS

      public static final BufferClusterLevel MONOTONE_CHARACTERS
      Return cluster values grouped into monotone order.
    • CHARACTERS

      public static final BufferClusterLevel CHARACTERS
      Don't group cluster values.
    • GRAPHEMES

      public static final BufferClusterLevel GRAPHEMES
      Only group clusters, but don't enforce monotone order.
  • Field Details

    • DEFAULT

      public static final BufferClusterLevel DEFAULT
      Default cluster level, equal to HBBUFFERCLUSTERLEVELMONOTONEGRAPHEMES.
  • Method Details

    • values

      public static BufferClusterLevel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BufferClusterLevel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static BufferClusterLevel of(int value)
      Create a new BufferClusterLevel for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static BufferClusterLevel of(MemorySegment address)
      Create a new BufferClusterLevel for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the BufferClusterLevel class.
      Returns:
      the GType