Class HarfBuzz

java.lang.Object
org.freedesktop.harfbuzz.HarfBuzz

@Generated("org.javagi.JavaGI") public final class HarfBuzz extends Object
Constants and functions that are declared in the global HarfBuzz namespace.
  • Field Details

    • AAT_LAYOUT_NO_SELECTOR_INDEX

      public static final int AAT_LAYOUT_NO_SELECTOR_INDEX
      Used when getting or setting AAT feature selectors. Indicates that there is no selector index corresponding to the selector of interest.
      See Also:
    • BUFFER_REPLACEMENT_CODEPOINT_DEFAULT

      public static final int BUFFER_REPLACEMENT_CODEPOINT_DEFAULT
      The default code point for replacing invalid characters in a given encoding. Set to U+FFFD REPLACEMENT CHARACTER.
      Since:
      0.9.31
      See Also:
    • CODEPOINT_INVALID

      public static final Codepoint CODEPOINT_INVALID
      Unused hb_codepoint_t value.
      Since:
      8.0.0
    • FEATURE_GLOBAL_START

      public static final int FEATURE_GLOBAL_START
      Special setting for hb_feature_t.start to apply the feature from the start of the buffer.
      Since:
      2.0.0
      See Also:
    • FONT_NO_VAR_NAMED_INSTANCE

      public static final int FONT_NO_VAR_NAMED_INSTANCE
      Constant signifying that a font does not have any named-instance index set. This is the default of a font.
      Since:
      7.0.0
      See Also:
    • OT_LAYOUT_DEFAULT_LANGUAGE_INDEX

      public static final int OT_LAYOUT_DEFAULT_LANGUAGE_INDEX
      Special value for language index indicating default or unsupported language.
      See Also:
    • OT_LAYOUT_NO_FEATURE_INDEX

      public static final int OT_LAYOUT_NO_FEATURE_INDEX
      Special value for feature index indicating unsupported feature.
      See Also:
    • OT_LAYOUT_NO_SCRIPT_INDEX

      public static final int OT_LAYOUT_NO_SCRIPT_INDEX
      Special value for script index indicating unsupported script.
      See Also:
    • OT_LAYOUT_NO_VARIATIONS_INDEX

      public static final int OT_LAYOUT_NO_VARIATIONS_INDEX
      Special value for variations index indicating unsupported variation.
      See Also:
    • OT_MAX_TAGS_PER_LANGUAGE

      public static final int OT_MAX_TAGS_PER_LANGUAGE
      Maximum number of OpenType tags that can correspond to a give hb_language_t.
      Since:
      2.0.0
      See Also:
    • OT_MAX_TAGS_PER_SCRIPT

      public static final int OT_MAX_TAGS_PER_SCRIPT
      Maximum number of OpenType tags that can correspond to a give hb_script_t.
      Since:
      2.0.0
      See Also:
    • OT_VAR_NO_AXIS_INDEX

      @Deprecated public static final int OT_VAR_NO_AXIS_INDEX
      Deprecated.
      Do not use.
      Since:
      1.4.2
      See Also:
    • UNICODE_COMBINING_CLASS_CCC133

      @Deprecated public static final int UNICODE_COMBINING_CLASS_CCC133
      Deprecated.
      invalid reference
      Tibetan
      See Also:
    • UNICODE_MAX

      public static final int UNICODE_MAX
      Maximum valid Unicode code point.
      Since:
      1.9.0
      See Also:
    • UNICODE_MAX_DECOMPOSITION_LEN

      @Deprecated public static final int UNICODE_MAX_DECOMPOSITION_LEN
      Deprecated.
      See Unicode 6.1 for details on the maximum decomposition length.
      See Also:
    • VERSION_MAJOR

      public static final int VERSION_MAJOR
      See Also:
    • VERSION_MICRO

      public static final int VERSION_MICRO
      See Also:
    • VERSION_MINOR

      public static final int VERSION_MINOR
      See Also:
    • VERSION_STRING

      public static final String VERSION_STRING
      See Also:
  • Constructor Details

    • HarfBuzz

      public HarfBuzz()
  • Method Details

    • javagi$ensureInitialized

      public static void javagi$ensureInitialized()
    • aatLayoutFeatureTypeGetNameId

      public static OtNameId aatLayoutFeatureTypeGetNameId(Face face, AatLayoutFeatureType featureType)
      Fetches the name identifier of the specified feature type in the face's name table.
      Parameters:
      face - hb_face_t to work upon
      featureType - The hb_aat_layout_feature_type_t of the requested feature type
      Returns:
      Name identifier of the requested feature type
      Since:
      2.2.0
    • aatLayoutFeatureTypeGetSelectorInfos

      public static int aatLayoutFeatureTypeGetSelectorInfos(Face face, AatLayoutFeatureType featureType, int startOffset, @Nullable Out<AatLayoutFeatureSelectorInfo[]> selectors, @Nullable Out<Integer> defaultIndex)

      Fetches a list of the selectors available for the specified feature in the given face.

      If upon return, defaultIndex is set to HB_AAT_LAYOUT_NO_SELECTOR_INDEX, then the feature type is non-exclusive. Otherwise, defaultIndex is the index of the selector that is selected by default.

      Parameters:
      face - hb_face_t to work upon
      featureType - The hb_aat_layout_feature_type_t of the requested feature type
      startOffset - offset of the first feature type to retrieve
      selectors - A buffer pointer. The selectors available for the feature type queries.
      defaultIndex - The index of the feature's default selector, if any
      Returns:
      Number of all available feature selectors
      Since:
      2.2.0
    • aatLayoutGetFeatureTypes

      public static int aatLayoutGetFeatureTypes(Face face, int startOffset, @Nullable Out<AatLayoutFeatureType[]> features)
      Fetches a list of the AAT feature types included in the specified face.
      Parameters:
      face - hb_face_t to work upon
      startOffset - offset of the first feature type to retrieve
      features - Array of feature types found
      Returns:
      Number of all available feature types.
      Since:
      2.2.0
    • aatLayoutHasPositioning

      public static Bool aatLayoutHasPositioning(Face face)

      Tests whether the specified face includes any positioning information in the kerx table.

      Note: does not examine the GPOS table.

      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      2.3.0
    • aatLayoutHasSubstitution

      public static Bool aatLayoutHasSubstitution(Face face)

      Tests whether the specified face includes any substitutions in the morx or mort tables.

      Note: does not examine the GSUB table.

      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      2.3.0
    • aatLayoutHasTracking

      public static Bool aatLayoutHasTracking(Face face)
      Tests whether the specified face includes any tracking information in the trak table.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      2.3.0
    • blobCopyWritableOrFail

      public static Blob blobCopyWritableOrFail(Blob blob)
      Makes a writable copy of blob.
      Parameters:
      blob - A blob.
      Returns:
      The new blob, or nullptr if allocation failed
      Since:
      1.8.0
    • blobCreate

      public static Blob blobCreate(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Creates a new "blob" object wrapping data. The mode parameter is used to negotiate ownership and lifecycle of data.
      Parameters:
      data - Pointer to blob data.
      length - Length of data in bytes.
      mode - Memory mode for data.
      userData - Data parameter to pass to destroy.
      destroy - Callback to call when data is not needed anymore.
      Returns:
      New blob, or the empty blob if something failed or if length is zero. Destroy with hb_blob_destroy().
      Since:
      0.9.2
    • blobCreateFromFile

      public static Blob blobCreateFromFile(String fileName)

      Creates a new blob containing the data from the specified binary font file.

      The filename is passed directly to the system on all platforms, except on Windows, where the filename is interpreted as UTF-8. Only if the filename is not valid UTF-8, it will be interpreted according to the system codepage.

      Parameters:
      fileName - A font filename
      Returns:
      An hb_blob_t pointer with the content of the file, or hb_blob_get_empty() if failed.
      Since:
      1.7.7
    • blobCreateFromFileOrFail

      public static Blob blobCreateFromFileOrFail(String fileName)

      Creates a new blob containing the data from the specified file.

      The filename is passed directly to the system on all platforms, except on Windows, where the filename is interpreted as UTF-8. Only if the filename is not valid UTF-8, it will be interpreted according to the system codepage.

      Parameters:
      fileName - A filename
      Returns:
      An hb_blob_t pointer with the content of the file, or NULL if failed.
      Since:
      2.8.2
    • blobCreateOrFail

      public static Blob blobCreateOrFail(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)

      Creates a new "blob" object wrapping data. The mode parameter is used to negotiate ownership and lifecycle of data.

      Note that this function returns a freshly-allocated empty blob even if length is zero. This is in contrast to hb_blob_create(), which returns the singleton empty blob (as returned by hb_blob_get_empty()) if length is zero.

      Parameters:
      data - Pointer to blob data.
      length - Length of data in bytes.
      mode - Memory mode for data.
      userData - Data parameter to pass to destroy.
      destroy - Callback to call when data is not needed anymore.
      Returns:
      New blob, or NULL if failed. Destroy with hb_blob_destroy().
      Since:
      2.8.2
    • blobCreateSubBlob

      public static Blob blobCreateSubBlob(Blob parent, int offset, int length)

      Returns a blob that represents a range of bytes in parent. The new blob is always created with HB_MEMORY_MODE_READONLY, meaning that it will never modify data in the parent blob. The parent data is not expected to be modified, and will result in undefined behavior if it is.

      Makes parent immutable.

      Parameters:
      parent - Parent blob.
      offset - Start offset of sub-blob within parent, in bytes.
      length - Length of sub-blob.
      Returns:
      New blob, or the empty blob if something failed or if length is zero or offset is beyond the end of parent's data. Destroy with hb_blob_destroy().
      Since:
      0.9.2
    • blobDestroy

      public static void blobDestroy(Blob blob)

      Decreases the reference count on blob, and if it reaches zero, destroys blob, freeing all memory, possibly calling the destroy-callback the blob was created for if it has not been called already.

      See TODO:link object types for more information.

      Parameters:
      blob - a blob.
      Since:
      0.9.2
    • blobGetData

      public static @Nullable String @Nullable [] blobGetData(Blob blob)
      Fetches the data from a blob.
      Parameters:
      blob - a blob.
      Returns:
      the byte data of blob.
      Since:
      0.9.2
    • blobGetDataWritable

      public static String[] blobGetDataWritable(Blob blob)

      Tries to make blob data writable (possibly copying it) and return pointer to data.

      Fails if blob has been made immutable, or if memory allocation fails.

      Parameters:
      blob - a blob.
      Returns:
      Writable blob data, or NULL if failed.
      Since:
      0.9.2
    • blobGetEmpty

      public static Blob blobGetEmpty()

      Returns the singleton empty blob.

      See TODO:link object types for more information.

      Returns:
      The empty blob.
      Since:
      0.9.2
    • blobGetLength

      public static int blobGetLength(Blob blob)
      Fetches the length of a blob's data.
      Parameters:
      blob - a blob.
      Returns:
      the length of blob data in bytes.
      Since:
      0.9.2
    • blobGetUserData

      public static @Nullable MemorySegment blobGetUserData(Blob blob, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified font-functions structure.
      Parameters:
      blob - a blob
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.2
    • blobIsImmutable

      public static Bool blobIsImmutable(Blob blob)
      Tests whether a blob is immutable.
      Parameters:
      blob - a blob.
      Returns:
      true if blob is immutable, false otherwise
      Since:
      0.9.2
    • blobMakeImmutable

      public static void blobMakeImmutable(Blob blob)
      Makes a blob immutable.
      Parameters:
      blob - a blob
      Since:
      0.9.2
    • blobReference

      public static Blob blobReference(Blob blob)

      Increases the reference count on blob.

      See TODO:link object types for more information.

      Parameters:
      blob - a blob.
      Returns:
      blob.
      Since:
      0.9.2
    • blobSetUserData

      public static Bool blobSetUserData(Blob blob, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified blob.
      Parameters:
      blob - An hb_blob_t
      key - The user-data key to set
      data - A pointer to the user data to set
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • bufferAdd

      public static void bufferAdd(Buffer buffer, Codepoint codepoint, int cluster)

      Appends a character with the Unicode value of codepoint to buffer, and gives it the initial cluster value of cluster. Clusters can be any thing the client wants, they are usually used to refer to the index of the character in the input text stream and are output in hb_glyph_info_t.cluster field.

      This function does not check the validity of codepoint, it is up to the caller to ensure it is a valid Unicode code point.

      Parameters:
      buffer - An hb_buffer_t
      codepoint - A Unicode code point.
      cluster - The cluster value of codepoint.
      Since:
      0.9.7
    • bufferAddCodepoints

      public static void bufferAddCodepoints(Buffer buffer, @Nullable Codepoint @Nullable [] text, int itemOffset, int itemLength)

      Appends characters from text array to buffer. The itemOffset is the position of the first character from text that will be appended, and itemLength is the number of character. When shaping part of a larger text (e.g. a run of text from a paragraph), instead of passing just the substring corresponding to the run, it is preferable to pass the whole paragraph and specify the run start and length as itemOffset and itemLength, respectively, to give HarfBuzz the full context to be able, for example, to do cross-run Arabic shaping or properly handle combining marks at stat of run.

      This function does not check the validity of text, it is up to the caller to ensure it contains a valid Unicode scalar values. In contrast, hb_buffer_add_utf32() can be used that takes similar input but performs sanity-check on the input.

      Parameters:
      buffer - a hb_buffer_t to append characters to.
      text - an array of Unicode code points to append.
      itemOffset - the offset of the first code point to add to the buffer.
      itemLength - the number of code points to add to the buffer, or -1 for the end of text (assuming it is NULL terminated).
      Since:
      0.9.31
    • bufferAddLatin1

      public static void bufferAddLatin1(Buffer buffer, @Nullable byte @Nullable [] text, int itemOffset, int itemLength)

      Similar to hb_buffer_add_codepoints(), but allows only access to first 256 Unicode code points that can fit in 8-bit strings.

      Has nothing to do with non-Unicode Latin-1 encoding.

      Parameters:
      buffer - An hb_buffer_t
      text - an array of UTF-8 characters to append
      itemOffset - the offset of the first character to add to the buffer
      itemLength - the number of characters to add to the buffer, or -1 for the end of text (assuming it is NULL terminated)
      Since:
      0.9.39
    • bufferAddUtf16

      public static void bufferAddUtf16(Buffer buffer, @Nullable short @Nullable [] text, int itemOffset, int itemLength)

      See hb_buffer_add_codepoints().

      Replaces invalid UTF-16 characters with the buffer replacement code point, see hb_buffer_set_replacement_codepoint().

      Parameters:
      buffer - An hb_buffer_t
      text - An array of UTF-16 characters to append
      itemOffset - The offset of the first character to add to the buffer
      itemLength - The number of characters to add to the buffer, or -1 for the end of text (assuming it is NULL terminated)
      Since:
      0.9.2
    • bufferAddUtf32

      public static void bufferAddUtf32(Buffer buffer, @Nullable int @Nullable [] text, int itemOffset, int itemLength)

      See hb_buffer_add_codepoints().

      Replaces invalid UTF-32 characters with the buffer replacement code point, see hb_buffer_set_replacement_codepoint().

      Parameters:
      buffer - An hb_buffer_t
      text - An array of UTF-32 characters to append
      itemOffset - The offset of the first character to add to the buffer
      itemLength - The number of characters to add to the buffer, or -1 for the end of text (assuming it is NULL terminated)
      Since:
      0.9.2
    • bufferAddUtf8

      public static void bufferAddUtf8(Buffer buffer, @Nullable byte @Nullable [] text, int itemOffset, int itemLength)

      See hb_buffer_add_codepoints().

      Replaces invalid UTF-8 characters with the buffer replacement code point, see hb_buffer_set_replacement_codepoint().

      Parameters:
      buffer - An hb_buffer_t
      text - An array of UTF-8 characters to append.
      itemOffset - The offset of the first character to add to the buffer.
      itemLength - The number of characters to add to the buffer, or -1 for the end of text (assuming it is NULL terminated).
      Since:
      0.9.2
    • bufferAllocationSuccessful

      public static Bool bufferAllocationSuccessful(Buffer buffer)
      Check if allocating memory for the buffer succeeded.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      true if buffer memory allocation succeeded, false otherwise.
      Since:
      0.9.2
    • bufferAppend

      public static void bufferAppend(Buffer buffer, Buffer source, int start, int end)
      Append (part of) contents of another buffer to this buffer.
      Parameters:
      buffer - An hb_buffer_t
      source - source hb_buffer_t
      start - start index into source buffer to copy. Use 0 to copy from start of buffer.
      end - end index into source buffer to copy. Use UINTMAX (or ((unsigned int) -1)) to copy to end of buffer.
      Since:
      1.5.0
    • bufferClearContents

      public static void bufferClearContents(Buffer buffer)
      Similar to hb_buffer_reset(), but does not clear the Unicode functions and the replacement code point.
      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.11
    • bufferCreate

      public static Buffer bufferCreate()
      Creates a new hb_buffer_t with all properties to defaults.
      Returns:
      A newly allocated hb_buffer_t with a reference count of 1. The initial reference count should be released with hb_buffer_destroy() when you are done using the hb_buffer_t. This function never returns NULL. If memory cannot be allocated, a special hb_buffer_t object will be returned on which hb_buffer_allocation_successful() returns false.
      Since:
      0.9.2
    • bufferCreateSimilar

      public static Buffer bufferCreateSimilar(Buffer src)
      Creates a new hb_buffer_t, similar to hb_buffer_create(). The only difference is that the buffer is configured similarly to src.
      Parameters:
      src - An hb_buffer_t
      Returns:
      A newly allocated hb_buffer_t, similar to hb_buffer_create().
      Since:
      3.3.0
    • bufferDeserializeGlyphs

      public static Bool bufferDeserializeGlyphs(Buffer buffer, @Nullable String @Nullable [] buf, @Nullable Out<String> endPtr, @Nullable Font font, BufferSerializeFormat format)
      Deserializes glyphs buffer from textual representation in the format produced by hb_buffer_serialize_glyphs().
      Parameters:
      buffer - an hb_buffer_t buffer.
      buf - string to deserialize
      endPtr - output pointer to the character after last consumed one.
      font - font for getting glyph IDs
      format - the hb_buffer_serialize_format_t of the input buf
      Returns:
      true if the full string was parsed, false otherwise.
      Since:
      0.9.7
    • bufferDeserializeUnicode

      public static Bool bufferDeserializeUnicode(Buffer buffer, @Nullable String @Nullable [] buf, @Nullable Out<String> endPtr, BufferSerializeFormat format)
      Deserializes Unicode buffer from textual representation in the format produced by hb_buffer_serialize_unicode().
      Parameters:
      buffer - an hb_buffer_t buffer.
      buf - string to deserialize
      endPtr - output pointer to the character after last consumed one.
      format - the hb_buffer_serialize_format_t of the input buf
      Returns:
      true if the full string was parsed, false otherwise.
      Since:
      2.7.3
    • bufferDestroy

      public static void bufferDestroy(Buffer buffer)
      Deallocate the buffer. Decreases the reference count on buffer by one. If the result is zero, then buffer and all associated resources are freed. See hb_buffer_reference().
      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.2
    • bufferDiff

      public static Set<BufferDiffFlags> bufferDiff(Buffer buffer, Buffer reference, Codepoint dottedcircleGlyph, int positionFuzz)
      If dottedcircle_glyph is (hb_codepoint_t) -1 then HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT and HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT are never returned. This should be used by most callers if just comparing two buffers is needed.
      Parameters:
      buffer - a buffer.
      reference - other buffer to compare to.
      dottedcircleGlyph - glyph id of U+25CC DOTTED CIRCLE, or (hb_codepoint_t) -1.
      positionFuzz - allowed absolute difference in position values.
      Since:
      1.5.0
    • bufferGetClusterLevel

      public static BufferClusterLevel bufferGetClusterLevel(Buffer buffer)
      Fetches the cluster level of a buffer. The hb_buffer_cluster_level_t dictates one aspect of how HarfBuzz will treat non-base characters during shaping.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The cluster level of buffer
      Since:
      0.9.42
    • bufferGetContentType

      public static BufferContentType bufferGetContentType(Buffer buffer)
      Fetches the type of buffer contents. Buffers are either empty, contain characters (before shaping), or contain glyphs (the result of shaping).
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The type of buffer contents
      Since:
      0.9.5
    • bufferGetDirection

      public static Direction bufferGetDirection(Buffer buffer)
      See hb_buffer_set_direction()
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The direction of the buffer.
      Since:
      0.9.2
    • bufferGetEmpty

      public static Buffer bufferGetEmpty()
      Fetches an empty hb_buffer_t.
      Returns:
      The empty buffer
      Since:
      0.9.2
    • bufferGetFlags

      public static Set<BufferFlags> bufferGetFlags(Buffer buffer)
      Fetches the hb_buffer_flags_t of buffer.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer flags
      Since:
      0.9.7
    • bufferGetGlyphInfos

      public static GlyphInfo[] bufferGetGlyphInfos(Buffer buffer)
      Returns buffer glyph information array. Returned pointer is valid as long as buffer contents are not modified.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer glyph information array. The value valid as long as buffer has not been modified.
      Since:
      0.9.2
    • bufferGetGlyphPositions

      public static GlyphPosition[] bufferGetGlyphPositions(Buffer buffer)

      Returns buffer glyph position array. Returned pointer is valid as long as buffer contents are not modified.

      If buffer did not have positions before, the positions will be initialized to zeros, unless this function is called from within a buffer message callback (see hb_buffer_set_message_func()), in which case NULL is returned.

      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer glyph position array. The value valid as long as buffer has not been modified.
      Since:
      0.9.2
    • bufferGetInvisibleGlyph

      public static Codepoint bufferGetInvisibleGlyph(Buffer buffer)
      See hb_buffer_set_invisible_glyph().
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer invisible hb_codepoint_t
      Since:
      2.0.0
    • bufferGetLanguage

      public static @Nullable Language bufferGetLanguage(Buffer buffer)
      See hb_buffer_set_language().
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The hb_language_t of the buffer. Must not be freed by the caller.
      Since:
      0.9.2
    • bufferGetLength

      public static int bufferGetLength(Buffer buffer)
      Returns the number of items in the buffer.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer length. The value valid as long as buffer has not been modified.
      Since:
      0.9.2
    • bufferGetNotFoundGlyph

      public static Codepoint bufferGetNotFoundGlyph(Buffer buffer)
      See hb_buffer_set_not_found_glyph().
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer not-found hb_codepoint_t
      Since:
      3.1.0
    • bufferGetNotFoundVariationSelectorGlyph

      public static Codepoint bufferGetNotFoundVariationSelectorGlyph(Buffer buffer)
      See hb_buffer_set_not_found_variation_selector_glyph().
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer not-found-variation-selector hb_codepoint_t
      Since:
      10.0.0
    • bufferGetRandomState

      public static int bufferGetRandomState(Buffer buffer)
      See hb_buffer_set_random_state().
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer random state
      Since:
      8.4.0
    • bufferGetReplacementCodepoint

      public static Codepoint bufferGetReplacementCodepoint(Buffer buffer)
      Fetches the hb_codepoint_t that replaces invalid entries for a given encoding when adding text to buffer.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The buffer replacement hb_codepoint_t
      Since:
      0.9.31
    • bufferGetScript

      public static Script bufferGetScript(Buffer buffer)
      Fetches the script of buffer.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The hb_script_t of the buffer
      Since:
      0.9.2
    • bufferGetSegmentProperties

      public static void bufferGetSegmentProperties(Buffer buffer, SegmentProperties props)
      Sets props to the hb_segment_properties_t of buffer.
      Parameters:
      buffer - An hb_buffer_t
      props - The output hb_segment_properties_t
      Since:
      0.9.7
    • bufferGetUnicodeFuncs

      public static UnicodeFuncs bufferGetUnicodeFuncs(Buffer buffer)
      Fetches the Unicode-functions structure of a buffer.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The Unicode-functions structure
      Since:
      0.9.2
    • bufferGetUserData

      public static @Nullable MemorySegment bufferGetUserData(Buffer buffer, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified buffer.
      Parameters:
      buffer - An hb_buffer_t
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.2
    • bufferGuessSegmentProperties

      public static void bufferGuessSegmentProperties(Buffer buffer)

      Sets unset buffer segment properties based on buffer Unicode contents. If buffer is not empty, it must have content type HB_BUFFER_CONTENT_TYPE_UNICODE.

      If buffer script is not set (ie. is HB_SCRIPT_INVALID), it will be set to the Unicode script of the first character in the buffer that has a script other than HB_SCRIPT_COMMON, HB_SCRIPT_INHERITED, and HB_SCRIPT_UNKNOWN.

      Next, if buffer direction is not set (ie. is HB_DIRECTION_INVALID), it will be set to the natural horizontal direction of the buffer script as returned by hb_script_get_horizontal_direction(). If hb_script_get_horizontal_direction() returns HB_DIRECTION_INVALID, then HB_DIRECTION_LTR is used.

      Finally, if buffer language is not set (ie. is HB_LANGUAGE_INVALID), it will be set to the process's default language as returned by hb_language_get_default(). This may change in the future by taking buffer script into consideration when choosing a language. Note that hb_language_get_default() is NOT threadsafe the first time it is called. See documentation for that function for details.

      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.7
    • bufferHasPositions

      public static Bool bufferHasPositions(Buffer buffer)
      Returns whether buffer has glyph position data. A buffer gains position data when hb_buffer_get_glyph_positions() is called on it, and cleared of position data when hb_buffer_clear_contents() is called.
      Parameters:
      buffer - an hb_buffer_t.
      Returns:
      true if the buffer has position array, false otherwise.
      Since:
      2.7.3
    • bufferNormalizeGlyphs

      public static void bufferNormalizeGlyphs(Buffer buffer)

      Reorders a glyph buffer to have canonical in-cluster glyph order / position. The resulting clusters should behave identical to pre-reordering clusters.

      This has nothing to do with Unicode normalization.

      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.2
    • bufferPreAllocate

      public static Bool bufferPreAllocate(Buffer buffer, int size)
      Pre allocates memory for buffer to fit at least size number of items.
      Parameters:
      buffer - An hb_buffer_t
      size - Number of items to pre allocate.
      Returns:
      true if buffer memory allocation succeeded, false otherwise
      Since:
      0.9.2
    • bufferReference

      public static Buffer bufferReference(Buffer buffer)
      Increases the reference count on buffer by one. This prevents buffer from being destroyed until a matching call to hb_buffer_destroy() is made.
      Parameters:
      buffer - An hb_buffer_t
      Returns:
      The referenced hb_buffer_t.
      Since:
      0.9.2
    • bufferReset

      public static void bufferReset(Buffer buffer)
      Resets the buffer to its initial status, as if it was just newly created with hb_buffer_create().
      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.2
    • bufferReverse

      public static void bufferReverse(Buffer buffer)
      Reverses buffer contents.
      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.2
    • bufferReverseClusters

      public static void bufferReverseClusters(Buffer buffer)
      Reverses buffer clusters. That is, the buffer contents are reversed, then each cluster (consecutive items having the same cluster number) are reversed again.
      Parameters:
      buffer - An hb_buffer_t
      Since:
      0.9.2
    • bufferReverseRange

      public static void bufferReverseRange(Buffer buffer, int start, int end)
      Reverses buffer contents between start and end.
      Parameters:
      buffer - An hb_buffer_t
      start - start index
      end - end index
      Since:
      0.9.41
    • bufferSerialize

      public static int bufferSerialize(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags)
      Serializes buffer into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information. This is useful for showing the contents of the buffer, for example during debugging. See the documentation of hb_buffer_serialize_unicode() and hb_buffer_serialize_glyphs() for a description of the output format.
      Parameters:
      buffer - an hb_buffer_t buffer.
      start - the first item in buffer to serialize.
      end - the last item in buffer to serialize.
      buf - output string to write serialized buffer into.
      bufConsumed - if not NULL, will be set to the number of bytes written into buf.
      font - the hb_font_t used to shape this buffer, needed to read glyph names and extents. If NULL, an empty font will be used.
      format - the hb_buffer_serialize_format_t to use for formatting the output.
      flags - the hb_buffer_serialize_flags_t that control what glyph properties to serialize.
      Returns:
      The number of serialized items.
      Since:
      2.7.3
    • bufferSerialize

      public static int bufferSerialize(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags)
      Serializes buffer into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information. This is useful for showing the contents of the buffer, for example during debugging. See the documentation of hb_buffer_serialize_unicode() and hb_buffer_serialize_glyphs() for a description of the output format.
      Parameters:
      buffer - an hb_buffer_t buffer.
      start - the first item in buffer to serialize.
      end - the last item in buffer to serialize.
      buf - output string to write serialized buffer into.
      bufConsumed - if not NULL, will be set to the number of bytes written into buf.
      font - the hb_font_t used to shape this buffer, needed to read glyph names and extents. If NULL, an empty font will be used.
      format - the hb_buffer_serialize_format_t to use for formatting the output.
      flags - the hb_buffer_serialize_flags_t that control what glyph properties to serialize.
      Returns:
      The number of serialized items.
      Since:
      2.7.3
    • bufferSerializeFormatFromString

      public static BufferSerializeFormat bufferSerializeFormatFromString(@Nullable byte @Nullable [] str)
      Parses a string into an hb_buffer_serialize_format_t. Does not check if str is a valid buffer serialization format, use hb_buffer_serialize_list_formats() to get the list of supported formats.
      Parameters:
      str - a string to parse
      Returns:
      The parsed hb_buffer_serialize_format_t.
      Since:
      0.9.7
    • bufferSerializeFormatToString

      public static String bufferSerializeFormatToString(BufferSerializeFormat format)
      Converts format to the string corresponding it, or NULL if it is not a valid hb_buffer_serialize_format_t.
      Parameters:
      format - an hb_buffer_serialize_format_t to convert.
      Returns:
      A NULL terminated string corresponding to format. Should not be freed.
      Since:
      0.9.7
    • bufferSerializeGlyphs

      public static int bufferSerializeGlyphs(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags)

      Serializes buffer into a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:

      text

      A human-readable, plain text format. The serialized glyphs will look something like:

      [uni0651=0@518,0+0|uni0628=0+1897]
      
      • The serialized glyphs are delimited with [ and ].
      • Glyphs are separated with |
      • Each glyph starts with glyph name, or glyph index if HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set. Then,
        • If HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, = then hb_glyph_info_t.cluster.
        • If HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set, the hb_glyph_position_t in the format:
          • If both hb_glyph_position_t.x_offset and hb_glyph_position_t.y_offset are not 0, @x_offset,y_offset. Then,
          • +x_advance, then ,y_advance if hb_glyph_position_t.y_advance is not 0. Then,
        • If HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set, the hb_glyph_extents_t in the format <x_bearing,y_bearing,width,height>
      json

      A machine-readable, structured format. The serialized glyphs will look something like:

      [{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0},
      {"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}]
      

      Each glyph is a JSON object, with the following properties:

      • g: the glyph name or glyph index if HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set.
      • cl: hb_glyph_info_t.cluster if HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set.
      • dx,dy,ax,ay: hb_glyph_position_t.x_offset, hb_glyph_position_t.y_offset, hb_glyph_position_t.x_advance and hb_glyph_position_t.y_advance respectively, if HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set.
      • xb,yb,w,h: hb_glyph_extents_t.x_bearing, hb_glyph_extents_t.y_bearing, hb_glyph_extents_t.width and hb_glyph_extents_t.height respectively if HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set.
      Parameters:
      buffer - an hb_buffer_t buffer.
      start - the first item in buffer to serialize.
      end - the last item in buffer to serialize.
      buf - output string to write serialized buffer into.
      bufConsumed - if not NULL, will be set to the number of bytes written into buf.
      font - the hb_font_t used to shape this buffer, needed to read glyph names and extents. If NULL, an empty font will be used.
      format - the hb_buffer_serialize_format_t to use for formatting the output.
      flags - the hb_buffer_serialize_flags_t that control what glyph properties to serialize.
      Returns:
      The number of serialized items.
      Since:
      0.9.7
    • bufferSerializeGlyphs

      public static int bufferSerializeGlyphs(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags)

      Serializes buffer into a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:

      text

      A human-readable, plain text format. The serialized glyphs will look something like:

      [uni0651=0@518,0+0|uni0628=0+1897]
      
      • The serialized glyphs are delimited with [ and ].
      • Glyphs are separated with |
      • Each glyph starts with glyph name, or glyph index if HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set. Then,
        • If HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, = then hb_glyph_info_t.cluster.
        • If HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set, the hb_glyph_position_t in the format:
          • If both hb_glyph_position_t.x_offset and hb_glyph_position_t.y_offset are not 0, @x_offset,y_offset. Then,
          • +x_advance, then ,y_advance if hb_glyph_position_t.y_advance is not 0. Then,
        • If HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set, the hb_glyph_extents_t in the format <x_bearing,y_bearing,width,height>
      json

      A machine-readable, structured format. The serialized glyphs will look something like:

      [{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0},
      {"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}]
      

      Each glyph is a JSON object, with the following properties:

      • g: the glyph name or glyph index if HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set.
      • cl: hb_glyph_info_t.cluster if HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set.
      • dx,dy,ax,ay: hb_glyph_position_t.x_offset, hb_glyph_position_t.y_offset, hb_glyph_position_t.x_advance and hb_glyph_position_t.y_advance respectively, if HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set.
      • xb,yb,w,h: hb_glyph_extents_t.x_bearing, hb_glyph_extents_t.y_bearing, hb_glyph_extents_t.width and hb_glyph_extents_t.height respectively if HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set.
      Parameters:
      buffer - an hb_buffer_t buffer.
      start - the first item in buffer to serialize.
      end - the last item in buffer to serialize.
      buf - output string to write serialized buffer into.
      bufConsumed - if not NULL, will be set to the number of bytes written into buf.
      font - the hb_font_t used to shape this buffer, needed to read glyph names and extents. If NULL, an empty font will be used.
      format - the hb_buffer_serialize_format_t to use for formatting the output.
      flags - the hb_buffer_serialize_flags_t that control what glyph properties to serialize.
      Returns:
      The number of serialized items.
      Since:
      0.9.7
    • bufferSerializeListFormats

      public static String[] bufferSerializeListFormats()
      Returns a list of supported buffer serialization formats.
      Returns:
      A string array of buffer serialization formats. Should not be freed.
      Since:
      0.9.7
    • bufferSerializeUnicode

      public static int bufferSerializeUnicode(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, Set<BufferSerializeFlags> flags)

      Serializes buffer into a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping). This is useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:

      text

      A human-readable, plain text format. The serialized codepoints will look something like:

       <U+0651=0|U+0628=1>
      
      • Glyphs are separated with |
      • Unicode codepoints are expressed as zero-padded four (or more) digit hexadecimal numbers preceded by U+
      • If HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, the cluster will be indicated with a = then hb_glyph_info_t.cluster.
      json

      A machine-readable, structured format. The serialized codepoints will be a list of objects with the following properties:

      • u: the Unicode codepoint as a decimal integer
      • cl: hb_glyph_info_t.cluster if HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set.

      For example:

      [{u:1617,cl:0},{u:1576,cl:1}]
      
      Parameters:
      buffer - an hb_buffer_t buffer.
      start - the first item in buffer to serialize.
      end - the last item in buffer to serialize.
      buf - output string to write serialized buffer into.
      bufConsumed - if not NULL, will be set to the number of bytes written into buf.
      format - the hb_buffer_serialize_format_t to use for formatting the output.
      flags - the hb_buffer_serialize_flags_t that control what glyph properties to serialize.
      Returns:
      The number of serialized items.
      Since:
      2.7.3
    • bufferSerializeUnicode

      public static int bufferSerializeUnicode(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, BufferSerializeFlags... flags)

      Serializes buffer into a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping). This is useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:

      text

      A human-readable, plain text format. The serialized codepoints will look something like:

       <U+0651=0|U+0628=1>
      
      • Glyphs are separated with |
      • Unicode codepoints are expressed as zero-padded four (or more) digit hexadecimal numbers preceded by U+
      • If HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, the cluster will be indicated with a = then hb_glyph_info_t.cluster.
      json

      A machine-readable, structured format. The serialized codepoints will be a list of objects with the following properties:

      • u: the Unicode codepoint as a decimal integer
      • cl: hb_glyph_info_t.cluster if HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set.

      For example:

      [{u:1617,cl:0},{u:1576,cl:1}]
      
      Parameters:
      buffer - an hb_buffer_t buffer.
      start - the first item in buffer to serialize.
      end - the last item in buffer to serialize.
      buf - output string to write serialized buffer into.
      bufConsumed - if not NULL, will be set to the number of bytes written into buf.
      format - the hb_buffer_serialize_format_t to use for formatting the output.
      flags - the hb_buffer_serialize_flags_t that control what glyph properties to serialize.
      Returns:
      The number of serialized items.
      Since:
      2.7.3
    • bufferSetClusterLevel

      public static void bufferSetClusterLevel(Buffer buffer, BufferClusterLevel clusterLevel)
      Sets the cluster level of a buffer. The hb_buffer_cluster_level_t dictates one aspect of how HarfBuzz will treat non-base characters during shaping.
      Parameters:
      buffer - An hb_buffer_t
      clusterLevel - The cluster level to set on the buffer
      Since:
      0.9.42
    • bufferSetContentType

      public static void bufferSetContentType(Buffer buffer, BufferContentType contentType)

      Sets the type of buffer contents. Buffers are either empty, contain characters (before shaping), or contain glyphs (the result of shaping).

      You rarely need to call this function, since a number of other functions transition the content type for you. Namely:

      • A newly created buffer starts with content type BufferContentType.INVALID. Calling hb_buffer_reset(), hb_buffer_clear_contents(), as well as calling hb_buffer_set_length() with an argument of zero all set the buffer content type to invalid as well.

      • Calling hb_buffer_add_utf8(), hb_buffer_add_utf16(), hb_buffer_add_utf32(), hb_buffer_add_codepoints() and hb_buffer_add_latin1() expect that buffer is either empty and have a content type of invalid, or that buffer content type is BufferContentType.UNICODE, and they also set the content type to Unicode if they added anything to an empty buffer.

      • Finally hb_shape() and hb_shape_full() expect that the buffer is either empty and have content type of invalid, or that buffer content type is BufferContentType.UNICODE, and upon success they set the buffer content type to BufferContentType.GLYPHS.

      The above transitions are designed such that one can use a buffer in a loop of "reset : add-text : shape" without needing to ever modify the content type manually.

      Parameters:
      buffer - An hb_buffer_t
      contentType - The type of buffer contents to set
      Since:
      0.9.5
    • bufferSetDirection

      public static void bufferSetDirection(Buffer buffer, Direction direction)
      Set the text flow direction of the buffer. No shaping can happen without setting buffer direction, and it controls the visual direction for the output glyphs; for RTL direction the glyphs will be reversed. Many layout features depend on the proper setting of the direction, for example, reversing RTL text before shaping, then shaping with LTR direction is not the same as keeping the text in logical order and shaping with RTL direction.
      Parameters:
      buffer - An hb_buffer_t
      direction - the hb_direction_t of the buffer
      Since:
      0.9.2
    • bufferSetFlags

      public static void bufferSetFlags(Buffer buffer, Set<BufferFlags> flags)
      Sets buffer flags to flags. See hb_buffer_flags_t.
      Parameters:
      buffer - An hb_buffer_t
      flags - The buffer flags to set
      Since:
      0.9.7
    • bufferSetFlags

      public static void bufferSetFlags(Buffer buffer, BufferFlags... flags)
      Sets buffer flags to flags. See hb_buffer_flags_t.
      Parameters:
      buffer - An hb_buffer_t
      flags - The buffer flags to set
      Since:
      0.9.7
    • bufferSetInvisibleGlyph

      public static void bufferSetInvisibleGlyph(Buffer buffer, Codepoint invisible)
      Sets the hb_codepoint_t that replaces invisible characters in the shaping result. If set to zero (default), the glyph for the U+0020 SPACE character is used. Otherwise, this value is used verbatim.
      Parameters:
      buffer - An hb_buffer_t
      invisible - the invisible hb_codepoint_t
      Since:
      2.0.0
    • bufferSetLanguage

      public static void bufferSetLanguage(Buffer buffer, @Nullable Language language)

      Sets the language of buffer to language.

      Languages are crucial for selecting which OpenType feature to apply to the buffer which can result in applying language-specific behaviour. Languages are orthogonal to the scripts, and though they are related, they are different concepts and should not be confused with each other.

      Use hb_language_from_string() to convert from BCP 47 language tags to hb_language_t.

      Parameters:
      buffer - An hb_buffer_t
      language - An hb_language_t to set
      Since:
      0.9.2
    • bufferSetLength

      public static Bool bufferSetLength(Buffer buffer, int length)
      Similar to hb_buffer_pre_allocate(), but clears any new items added at the end.
      Parameters:
      buffer - An hb_buffer_t
      length - The new length of buffer
      Returns:
      true if buffer memory allocation succeeded, false otherwise.
      Since:
      0.9.2
    • bufferSetMessageFunc

      public static void bufferSetMessageFunc(Buffer buffer, @Nullable BufferMessageFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_buffer_message_func_t.
      Parameters:
      buffer - An hb_buffer_t
      func - Callback function
      destroy - The function to call when userData is not needed anymore
      Since:
      1.1.3
    • bufferSetNotFoundGlyph

      public static void bufferSetNotFoundGlyph(Buffer buffer, Codepoint notFound)

      Sets the hb_codepoint_t that replaces characters not found in the font during shaping.

      The not-found glyph defaults to zero, sometimes known as the ".notdef" glyph. This API allows for differentiating the two.

      Parameters:
      buffer - An hb_buffer_t
      notFound - the not-found hb_codepoint_t
      Since:
      3.1.0
    • bufferSetNotFoundVariationSelectorGlyph

      public static void bufferSetNotFoundVariationSelectorGlyph(Buffer buffer, Codepoint notFoundVariationSelector)

      Sets the hb_codepoint_t that replaces variation-selector characters not resolved in the font during shaping.

      The not-found-variation-selector glyph defaults to HB_CODEPOINT_INVALID, in which case an unresolved variation-selector will be removed from the glyph string during shaping. This API allows for changing that and retaining a glyph, such that the situation can be detected by the client and handled accordingly (e.g. by using a different font).

      Parameters:
      buffer - An hb_buffer_t
      notFoundVariationSelector - the not-found-variation-selector hb_codepoint_t
      Since:
      10.0.0
    • bufferSetRandomState

      public static void bufferSetRandomState(Buffer buffer, int state)

      Sets the random state of the buffer. The state changes every time a glyph uses randomness (eg. the rand OpenType feature). This function together with hb_buffer_get_random_state() allow for transferring the current random state to a subsequent buffer, to get better randomness distribution.

      Defaults to 1 and when buffer contents are cleared. A value of 0 disables randomness during shaping.

      Parameters:
      buffer - An hb_buffer_t
      state - the new random state
      Since:
      8.4.0
    • bufferSetReplacementCodepoint

      public static void bufferSetReplacementCodepoint(Buffer buffer, Codepoint replacement)

      Sets the hb_codepoint_t that replaces invalid entries for a given encoding when adding text to buffer.

      Default is HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT.

      Parameters:
      buffer - An hb_buffer_t
      replacement - the replacement hb_codepoint_t
      Since:
      0.9.31
    • bufferSetScript

      public static void bufferSetScript(Buffer buffer, Script script)

      Sets the script of buffer to script.

      Script is crucial for choosing the proper shaping behaviour for scripts that require it (e.g. Arabic) and the which OpenType features defined in the font to be applied.

      You can pass one of the predefined hb_script_t values, or use hb_script_from_string() or hb_script_from_iso15924_tag() to get the corresponding script from an ISO 15924 script tag.

      Parameters:
      buffer - An hb_buffer_t
      script - An hb_script_t to set.
      Since:
      0.9.2
    • bufferSetSegmentProperties

      public static void bufferSetSegmentProperties(Buffer buffer, SegmentProperties props)
      Sets the segment properties of the buffer, a shortcut for calling hb_buffer_set_direction(), hb_buffer_set_script() and hb_buffer_set_language() individually.
      Parameters:
      buffer - An hb_buffer_t
      props - An hb_segment_properties_t to use
      Since:
      0.9.7
    • bufferSetUnicodeFuncs

      public static void bufferSetUnicodeFuncs(Buffer buffer, UnicodeFuncs unicodeFuncs)
      Sets the Unicode-functions structure of a buffer to unicodeFuncs.
      Parameters:
      buffer - An hb_buffer_t
      unicodeFuncs - The Unicode-functions structure
      Since:
      0.9.2
    • bufferSetUserData

      public static Bool bufferSetUserData(Buffer buffer, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified buffer.
      Parameters:
      buffer - An hb_buffer_t
      key - The user-data key
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • calloc

      public static @Nullable MemorySegment calloc(long nmemb, long size)
      Allocates nmemb elements of size bytes each, initialized to zero, using the allocator set at compile-time. Typically just calloc().
      Parameters:
      nmemb - The number of elements to allocate.
      size - The size of each element.
      Returns:
      A pointer to the allocated memory.
      Since:
      11.0.0
    • colorGetAlpha

      public static byte colorGetAlpha(Color color)
      Fetches the alpha channel of the given color.
      Parameters:
      color - an hb_color_t we are interested in its channels.
      Returns:
      Alpha channel value
      Since:
      2.1.0
    • colorGetBlue

      public static byte colorGetBlue(Color color)
      Fetches the blue channel of the given color.
      Parameters:
      color - an hb_color_t we are interested in its channels.
      Returns:
      Blue channel value
      Since:
      2.1.0
    • colorGetGreen

      public static byte colorGetGreen(Color color)
      Fetches the green channel of the given color.
      Parameters:
      color - an hb_color_t we are interested in its channels.
      Returns:
      Green channel value
      Since:
      2.1.0
    • colorGetRed

      public static byte colorGetRed(Color color)
      Fetches the red channel of the given color.
      Parameters:
      color - an hb_color_t we are interested in its channels.
      Returns:
      Red channel value
      Since:
      2.1.0
    • colorLineGetColorStops

      public static int colorLineGetColorStops(ColorLine colorLine, int start, @Nullable Out<ColorStop[]> colorStops)

      Fetches a list of color stops from the given color line object.

      Note that due to variations being applied, the returned color stops may be out of order. It is the callers responsibility to ensure that color stops are sorted by their offset before they are used.

      Parameters:
      colorLine - a hb_color_line_t object
      start - the index of the first color stop to return
      colorStops - Array of hb_color_stop_t to populate
      Returns:
      the total number of color stops in colorLine
      Since:
      7.0.0
    • colorLineGetExtend

      public static PaintExtend colorLineGetExtend(ColorLine colorLine)
      Fetches the extend mode of the color line object.
      Parameters:
      colorLine - a hb_color_line_t object
      Returns:
      the extend mode of colorLine
      Since:
      7.0.0
    • directionFromString

      public static Direction directionFromString(@Nullable byte @Nullable [] str)

      Converts a string to an hb_direction_t.

      Matching is loose and applies only to the first letter. For examples, "LTR" and "left-to-right" will both return HB_DIRECTION_LTR.

      Unmatched strings will return HB_DIRECTION_INVALID.

      Parameters:
      str - String to convert
      Returns:
      The hb_direction_t matching str
      Since:
      0.9.2
    • directionToString

      public static String directionToString(Direction direction)
      Converts an hb_direction_t to a string.
      Parameters:
      direction - The hb_direction_t to convert
      Returns:
      The string corresponding to direction
      Since:
      0.9.2
    • drawClosePath

      public static void drawClosePath(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st)
      Perform a "close-path" draw operation.
      Parameters:
      dfuncs - draw functions
      drawData - associated draw data passed by the caller
      st - current draw state
      Since:
      4.0.0
    • drawCubicTo

      public static void drawCubicTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float control1X, float control1Y, float control2X, float control2Y, float toX, float toY)
      Perform a "cubic-to" draw operation.
      Parameters:
      dfuncs - draw functions
      drawData - associated draw data passed by the caller
      st - current draw state
      control1X - X component of first control point
      control1Y - Y component of first control point
      control2X - X component of second control point
      control2Y - Y component of second control point
      toX - X component of target point
      toY - Y component of target point
      Since:
      4.0.0
    • drawFuncsCreate

      public static DrawFuncs drawFuncsCreate()
      Creates a new draw callbacks object.
      Returns:
      A newly allocated hb_draw_funcs_t with a reference count of 1. The initial reference count should be released with hb_draw_funcs_destroy when you are done using the hb_draw_funcs_t. This function never returns NULL. If memory cannot be allocated, a special singleton hb_draw_funcs_t object will be returned.
      Since:
      4.0.0
    • drawFuncsDestroy

      public static void drawFuncsDestroy(DrawFuncs dfuncs)
      Deallocate the dfuncs. Decreases the reference count on dfuncs by one. If the result is zero, then dfuncs and all associated resources are freed. See hb_draw_funcs_reference().
      Parameters:
      dfuncs - draw functions
      Since:
      4.0.0
    • drawFuncsGetEmpty

      public static DrawFuncs drawFuncsGetEmpty()
      Fetches the singleton empty draw-functions structure.
      Returns:
      The empty draw-functions structure
      Since:
      7.0.0
    • drawFuncsGetUserData

      public static @Nullable MemorySegment drawFuncsGetUserData(DrawFuncs dfuncs, UserDataKey key)
      Fetches the user-data associated with the specified key, attached to the specified draw-functions structure.
      Parameters:
      dfuncs - The draw-functions structure
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      7.0.0
    • drawFuncsIsImmutable

      public static Bool drawFuncsIsImmutable(DrawFuncs dfuncs)
      Checks whether dfuncs is immutable.
      Parameters:
      dfuncs - draw functions
      Returns:
      true if dfuncs is immutable, false otherwise
      Since:
      4.0.0
    • drawFuncsMakeImmutable

      public static void drawFuncsMakeImmutable(DrawFuncs dfuncs)
      Makes dfuncs object immutable.
      Parameters:
      dfuncs - draw functions
      Since:
      4.0.0
    • drawFuncsReference

      public static DrawFuncs drawFuncsReference(DrawFuncs dfuncs)

      Increases the reference count on dfuncs by one.

      This prevents dfuncs from being destroyed until a matching call to hb_draw_funcs_destroy() is made.

      Parameters:
      dfuncs - draw functions
      Returns:
      The referenced hb_draw_funcs_t.
      Since:
      4.0.0
    • drawFuncsSetClosePathFunc

      public static void drawFuncsSetClosePathFunc(DrawFuncs dfuncs, @Nullable DrawClosePathFunc func, @Nullable DestroyFunc destroy)
      Sets close-path callback to the draw functions object.
      Parameters:
      dfuncs - draw functions object
      func - close-path callback
      destroy - The function to call when userData is not needed anymore
      Since:
      4.0.0
    • drawFuncsSetCubicToFunc

      public static void drawFuncsSetCubicToFunc(DrawFuncs dfuncs, @Nullable DrawCubicToFunc func, @Nullable DestroyFunc destroy)
      Sets cubic-to callback to the draw functions object.
      Parameters:
      dfuncs - draw functions
      func - cubic-to callback
      destroy - The function to call when userData is not needed anymore
      Since:
      4.0.0
    • drawFuncsSetLineToFunc

      public static void drawFuncsSetLineToFunc(DrawFuncs dfuncs, @Nullable DrawLineToFunc func, @Nullable DestroyFunc destroy)
      Sets line-to callback to the draw functions object.
      Parameters:
      dfuncs - draw functions object
      func - line-to callback
      destroy - The function to call when userData is not needed anymore
      Since:
      4.0.0
    • drawFuncsSetMoveToFunc

      public static void drawFuncsSetMoveToFunc(DrawFuncs dfuncs, @Nullable DrawMoveToFunc func, @Nullable DestroyFunc destroy)
      Sets move-to callback to the draw functions object.
      Parameters:
      dfuncs - draw functions object
      func - move-to callback
      destroy - The function to call when userData is not needed anymore
      Since:
      4.0.0
    • drawFuncsSetQuadraticToFunc

      public static void drawFuncsSetQuadraticToFunc(DrawFuncs dfuncs, @Nullable DrawQuadraticToFunc func, @Nullable DestroyFunc destroy)
      Sets quadratic-to callback to the draw functions object.
      Parameters:
      dfuncs - draw functions object
      func - quadratic-to callback
      destroy - The function to call when userData is not needed anymore
      Since:
      4.0.0
    • drawFuncsSetUserData

      public static Bool drawFuncsSetUserData(DrawFuncs dfuncs, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified draw-functions structure.
      Parameters:
      dfuncs - The draw-functions structure
      key - The user-data key
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      7.0.0
    • drawLineTo

      public static void drawLineTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float toX, float toY)
      Perform a "line-to" draw operation.
      Parameters:
      dfuncs - draw functions
      drawData - associated draw data passed by the caller
      st - current draw state
      toX - X component of target point
      toY - Y component of target point
      Since:
      4.0.0
    • drawMoveTo

      public static void drawMoveTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float toX, float toY)
      Perform a "move-to" draw operation.
      Parameters:
      dfuncs - draw functions
      drawData - associated draw data passed by the caller
      st - current draw state
      toX - X component of target point
      toY - Y component of target point
      Since:
      4.0.0
    • drawQuadraticTo

      public static void drawQuadraticTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float controlX, float controlY, float toX, float toY)
      Perform a "quadratic-to" draw operation.
      Parameters:
      dfuncs - draw functions
      drawData - associated draw data passed by the caller
      st - current draw state
      controlX - X component of control point
      controlY - Y component of control point
      toX - X component of target point
      toY - Y component of target point
      Since:
      4.0.0
    • faceBuilderAddTable

      public static Bool faceBuilderAddTable(Face face, Tag tag, Blob blob)
      Add table for tag with data provided by blob to the face. face must be created using hb_face_builder_create().
      Parameters:
      face - A face object created with hb_face_builder_create()
      tag - The hb_tag_t of the table to add
      blob - The blob containing the table data to add
      Since:
      1.9.0
    • faceBuilderCreate

      public static Face faceBuilderCreate()
      Creates a hb_face_t that can be used with hb_face_builder_add_table(). After tables are added to the face, it can be compiled to a binary font file by calling hb_face_reference_blob().
      Returns:
      New face.
      Since:
      1.9.0
    • faceBuilderSortTables

      public static void faceBuilderSortTables(Face face, @Nullable Tag @Nullable [] tags)
      Set the ordering of tables for serialization. Any tables not specified in the tags list will be ordered after the tables in tags, ordered by the default sort ordering.
      Parameters:
      face - A face object created with hb_face_builder_create()
      tags - ordered list of table tags terminated by HB_TAG_NONE
      Since:
      5.3.0
    • faceCollectNominalGlyphMapping

      public static void faceCollectNominalGlyphMapping(Face face, Map mapping, @Nullable Set unicodes)
      Collects the mapping from Unicode characters to nominal glyphs of the face, and optionally all of the Unicode characters covered by face.
      Parameters:
      face - A face object
      mapping - The map to add Unicode-to-glyph mapping to
      unicodes - The set to add Unicode characters to, or NULL
      Since:
      7.0.0
    • faceCollectUnicodes

      public static void faceCollectUnicodes(Face face, Set out)
      Collects all of the Unicode characters covered by face and adds them to the hb_set_t set out.
      Parameters:
      face - A face object
      out - The set to add Unicode characters to
      Since:
      1.9.0
    • faceCollectVariationSelectors

      public static void faceCollectVariationSelectors(Face face, Set out)
      Collects all Unicode "Variation Selector" characters covered by face and adds them to the hb_set_t set out.
      Parameters:
      face - A face object
      out - The set to add Variation Selector characters to
      Since:
      1.9.0
    • faceCollectVariationUnicodes

      public static void faceCollectVariationUnicodes(Face face, Codepoint variationSelector, Set out)
      Collects all Unicode characters for variationSelector covered by face and adds them to the hb_set_t set out.
      Parameters:
      face - A face object
      variationSelector - The Variation Selector to query
      out - The set to add Unicode characters to
      Since:
      1.9.0
    • faceCount

      public static int faceCount(Blob blob)
      Fetches the number of faces in a blob.
      Parameters:
      blob - a blob.
      Returns:
      Number of faces in blob
      Since:
      1.7.7
    • faceCreate

      public static Face faceCreate(Blob blob, int index)

      Constructs a new face object from the specified blob and a face index into that blob.

      The face index is used for blobs of file formats such as TTC and DFont that can contain more than one face. Face indices within such collections are zero-based.

      Note: If the blob font format is not a collection, index is ignored. Otherwise, only the lower 16-bits of index are used. The unmodified index can be accessed via hb_face_get_index().

      Note: The high 16-bits of index, if non-zero, are used by hb_font_create() to load named-instances in variable fonts. See hb_font_create() for details.

      Parameters:
      blob - hb_blob_t to work upon
      index - The index of the face within blob
      Returns:
      The new face object
      Since:
      0.9.2
    • faceCreateForTables

      public static Face faceCreateForTables(@Nullable ReferenceTableFunc referenceTableFunc, @Nullable DestroyFunc destroy)

      Variant of hb_face_create(), built for those cases where it is more convenient to provide data for individual tables instead of the whole font data. With the caveat that hb_face_get_table_tags() would not work with faces created this way. You can address that by calling the hb_face_set_get_table_tags_func() function and setting the appropriate callback.

      Creates a new face object from the specified userData and referenceTableFunc, with the destroy callback.

      Parameters:
      referenceTableFunc - Table-referencing function
      destroy - A callback to call when data is not needed anymore
      Returns:
      The new face object
      Since:
      0.9.2
    • faceCreateFromFileOrFail

      public static Face faceCreateFromFileOrFail(String fileName, int index)
      A thin wrapper around hb_blob_create_from_file_or_fail() followed by hb_face_create_or_fail().
      Parameters:
      fileName - A font filename
      index - The index of the face within the file
      Returns:
      The new face object, or NULL if no face is found at the specified index or the file cannot be read.
      Since:
      10.1.0
    • faceCreateFromFileOrFailUsing

      public static Face faceCreateFromFileOrFailUsing(String fileName, int index, @Nullable String loaderName)

      A thin wrapper around the face loader functions registered with HarfBuzz. If loaderName is NULL or the empty string, the first available loader is used.

      For example, the FreeType ("ft") loader might be able to load WOFF and WOFF2 files if FreeType is built with those features, whereas the OpenType ("ot") loader will not.

      Parameters:
      fileName - A font filename
      index - The index of the face within the file
      loaderName - The name of the loader to use, or NULL
      Returns:
      The new face object, or NULL if the file cannot be read or the loader fails to load the face.
      Since:
      11.0.0
    • faceCreateOrFail

      public static Face faceCreateOrFail(Blob blob, int index)
      Like hb_face_create(), but returns NULL if the blob data contains no usable font face at the specified index.
      Parameters:
      blob - hb_blob_t to work upon
      index - The index of the face within blob
      Returns:
      The new face object, or NULL if no face is found at the specified index.
      Since:
      10.1.0
    • faceCreateOrFailUsing

      public static Face faceCreateOrFailUsing(Blob blob, int index, @Nullable String loaderName)

      A thin wrapper around the face loader functions registered with HarfBuzz. If loaderName is NULL or the empty string, the first available loader is used.

      For example, the FreeType ("ft") loader might be able to load WOFF and WOFF2 files if FreeType is built with those features, whereas the OpenType ("ot") loader will not.

      Parameters:
      blob - hb_blob_t to work upon
      index - The index of the face within blob
      loaderName - The name of the loader to use, or NULL
      Returns:
      The new face object, or NULL if the loader fails to load the face.
      Since:
      11.0.0
    • faceDestroy

      public static void faceDestroy(Face face)
      Decreases the reference count on a face object. When the reference count reaches zero, the face is destroyed, freeing all memory.
      Parameters:
      face - A face object
      Since:
      0.9.2
    • faceGetEmpty

      public static Face faceGetEmpty()
      Fetches the singleton empty face object.
      Returns:
      The empty face object
      Since:
      0.9.2
    • faceGetGlyphCount

      public static int faceGetGlyphCount(Face face)
      Fetches the glyph-count value of the specified face object.
      Parameters:
      face - A face object
      Returns:
      The glyph-count value of face
      Since:
      0.9.7
    • faceGetIndex

      public static int faceGetIndex(Face face)

      Fetches the face-index corresponding to the given face.

      Note: face indices within a collection are zero-based.

      Parameters:
      face - A face object
      Returns:
      The index of face.
      Since:
      0.9.2
    • faceGetTableTags

      public static int faceGetTableTags(Face face, int startOffset, @Nullable Out<Tag[]> tableTags)
      Fetches a list of all table tags for a face, if possible. The list returned will begin at the offset provided
      Parameters:
      face - A face object
      startOffset - The index of first table tag to retrieve
      tableTags - The array of table tags found
      Returns:
      Total number of tables, or zero if it is not possible to list
      Since:
      1.6.0
    • faceGetUpem

      public static int faceGetUpem(Face face)

      Fetches the units-per-em (UPEM) value of the specified face object.

      Typical UPEM values for fonts are 1000, or 2048, but any value in between 16 and 16,384 is allowed for OpenType fonts.

      Parameters:
      face - A face object
      Returns:
      The upem value of face
      Since:
      0.9.2
    • faceGetUserData

      public static @Nullable MemorySegment faceGetUserData(Face face, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified face object.
      Parameters:
      face - A face object
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.2
    • faceIsImmutable

      public static Bool faceIsImmutable(Face face)
      Tests whether the given face object is immutable.
      Parameters:
      face - A face object
      Returns:
      true is face is immutable, false otherwise
      Since:
      0.9.2
    • faceListLoaders

      public static String[] faceListLoaders()
      Retrieves the list of face loaders supported by HarfBuzz.
      Returns:
      a NULL-terminated array of supported face loaders constant strings. The returned array is owned by HarfBuzz and should not be modified or freed.
      Since:
      11.0.0
    • faceMakeImmutable

      public static void faceMakeImmutable(Face face)
      Makes the given face object immutable.
      Parameters:
      face - A face object
      Since:
      0.9.2
    • faceReference

      public static Face faceReference(Face face)
      Increases the reference count on a face object.
      Parameters:
      face - A face object
      Returns:
      The face object
      Since:
      0.9.2
    • faceReferenceBlob

      public static Blob faceReferenceBlob(Face face)
      Fetches a pointer to the binary blob that contains the specified face. If referencing the face data is not possible, this function creates a blob out of individual table blobs if hb_face_get_table_tags() works with this face, otherwise it returns an empty blob.
      Parameters:
      face - A face object
      Returns:
      A pointer to the blob for face
      Since:
      0.9.2
    • faceReferenceTable

      public static Blob faceReferenceTable(Face face, Tag tag)
      Fetches a reference to the specified table within the specified face. Returns an empty blob if referencing table data is not possible.
      Parameters:
      face - A face object
      tag - The hb_tag_t of the table to query
      Returns:
      A pointer to the tag table within face
      Since:
      0.9.2
    • faceSetGetTableTagsFunc

      public static void faceSetGetTableTagsFunc(Face face, @Nullable GetTableTagsFunc func, @Nullable DestroyFunc destroy)
      Sets the table-tag-fetching function for the specified face object.
      Parameters:
      face - A face object
      func - The table-tag-fetching function
      destroy - A callback to call when func is not needed anymore
      Since:
      10.0.0
    • faceSetGlyphCount

      public static void faceSetGlyphCount(Face face, int glyphCount)

      Sets the glyph count for a face object to the specified value.

      This API is used in rare circumstances.

      Parameters:
      face - A face object
      glyphCount - The glyph-count value to assign
      Since:
      0.9.7
    • faceSetIndex

      public static void faceSetIndex(Face face, int index)

      Assigns the specified face-index to face. Fails if the face is immutable.

      Note: changing the index has no effect on the face itself This only changes the value returned by hb_face_get_index().

      Parameters:
      face - A face object
      index - The index to assign
      Since:
      0.9.2
    • faceSetUpem

      public static void faceSetUpem(Face face, int upem)

      Sets the units-per-em (upem) for a face object to the specified value.

      This API is used in rare circumstances.

      Parameters:
      face - A face object
      upem - The units-per-em value to assign
      Since:
      0.9.2
    • faceSetUserData

      public static Bool faceSetUserData(Face face, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the given face object.
      Parameters:
      face - A face object
      key - The user-data key to set
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • featureFromString

      public static Bool featureFromString(@Nullable byte @Nullable [] str, Feature feature)

      Parses a string into a hb_feature_t.

      The format for specifying feature strings follows. All valid CSS font-feature-settings values other than 'normal' and the global values are also accepted, though not documented below. CSS string escapes are not supported.

      The range indices refer to the positions between Unicode characters. The position before the first character is always 0.

      The format is Python-esque. Here is how it all works:

      Syntax Value Start End Setting value: kern 1 0 ∞ Turn feature on +kern 1 0 ∞ Turn feature on -kern 0 0 ∞ Turn feature off kern=0 0 0 ∞ Turn feature off kern=1 1 0 ∞ Turn feature on aalt=2 2 0 ∞ Choose 2nd alternate Setting index: kern[] 1 0 ∞ Turn feature on kern[:] 1 0 ∞ Turn feature on kern[5:] 1 5 ∞ Turn feature on, partial kern[:5] 1 0 5 Turn feature on, partial kern[3:5] 1 3 5 Turn feature on, range kern[3] 1 3 3+1 Turn feature on, single char Mixing it all: aalt[3:5]=2 2 3 5 Turn 2nd alternate on for range
      Parameters:
      str - a string to parse
      feature - the hb_feature_t to initialize with the parsed values
      Returns:
      true if str is successfully parsed, false otherwise
      Since:
      0.9.5
    • featureToString

      public static void featureToString(Feature feature, @Nullable Out<String[]> buf)

      Converts a hb_feature_t into a NULL-terminated string in the format understood by hb_feature_from_string(). The client in responsible for allocating big enough size for buf, 128 bytes is more than enough.

      Note that the feature value will be omitted if it is '1', but the string won't include any whitespace.

      Parameters:
      feature - an hb_feature_t to convert
      buf - output string
      Since:
      0.9.5
    • fontAddGlyphOriginForDirection

      public static void fontAddGlyphOriginForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y)

      Adds the origin coordinates to an (X,Y) point coordinate, in the specified glyph ID in the specified font.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      direction - The direction of the text segment
      x - Input = The original X coordinate Output = The X coordinate plus the X-coordinate of the origin
      y - Input = The original Y coordinate Output = The Y coordinate plus the Y-coordinate of the origin
      Since:
      0.9.2
    • fontChanged

      public static void fontChanged(Font font)
      Notifies the font that underlying font data has changed. This has the effect of increasing the serial as returned by hb_font_get_serial(), which invalidates internal caches.
      Parameters:
      font - hb_font_t to work upon
      Since:
      4.4.0
    • fontCreate

      public static Font fontCreate(Face face)

      Constructs a new font object from the specified face.

      Note: If face's index value (as passed to hb_face_create() has non-zero top 16-bits, those bits minus one are passed to hb_font_set_var_named_instance(), effectively loading a named-instance of a variable font, instead of the default-instance. This allows specifying which named-instance to load by default when creating the face.

      Parameters:
      face - a face.
      Returns:
      The new font object
      Since:
      0.9.2
    • fontCreateSubFont

      public static Font fontCreateSubFont(Font parent)
      Constructs a sub-font font object from the specified parent font, replicating the parent's properties.
      Parameters:
      parent - The parent font object
      Returns:
      The new sub-font font object
      Since:
      0.9.2
    • fontDestroy

      public static void fontDestroy(Font font)
      Decreases the reference count on the given font object. When the reference count reaches zero, the font is destroyed, freeing all memory.
      Parameters:
      font - hb_font_t to work upon
      Since:
      0.9.2
    • fontDrawGlyph

      public static void fontDrawGlyph(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData)

      Draws the outline that corresponds to a glyph in the specified font.

      This is an older name for hb_font_draw_glyph_or_fail(), with no return value.

      The outline is returned by way of calls to the callbacks of the dfuncs objects, with drawData passed to them.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID
      dfuncs - hb_draw_funcs_t to draw to
      drawData - User data to pass to draw callbacks
      Since:
      7.0.0
    • fontDrawGlyphOrFail

      public static Bool fontDrawGlyphOrFail(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData)

      Draws the outline that corresponds to a glyph in the specified font.

      This is a newer name for hb_font_draw_glyph(), that returns false if the font has no outlines for the glyph.

      The outline is returned by way of calls to the callbacks of the dfuncs objects, with drawData passed to them.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID
      dfuncs - hb_draw_funcs_t to draw to
      drawData - User data to pass to draw callbacks
      Returns:
      true if glyph was drawn, false otherwise
      Since:
      11.2.0
    • fontFuncsCreate

      public static FontFuncs fontFuncsCreate()
      Creates a new hb_font_funcs_t structure of font functions.
      Returns:
      The font-functions structure
      Since:
      0.9.2
    • fontFuncsDestroy

      public static void fontFuncsDestroy(FontFuncs ffuncs)
      Decreases the reference count on a font-functions structure. When the reference count reaches zero, the font-functions structure is destroyed, freeing all memory.
      Parameters:
      ffuncs - The font-functions structure
      Since:
      0.9.2
    • fontFuncsGetEmpty

      public static FontFuncs fontFuncsGetEmpty()
      Fetches an empty font-functions structure.
      Returns:
      The font-functions structure
      Since:
      0.9.2
    • fontFuncsGetUserData

      public static @Nullable MemorySegment fontFuncsGetUserData(FontFuncs ffuncs, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified font-functions structure.
      Parameters:
      ffuncs - The font-functions structure
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.2
    • fontFuncsIsImmutable

      public static Bool fontFuncsIsImmutable(FontFuncs ffuncs)
      Tests whether a font-functions structure is immutable.
      Parameters:
      ffuncs - The font-functions structure
      Returns:
      true if ffuncs is immutable, false otherwise
      Since:
      0.9.2
    • fontFuncsMakeImmutable

      public static void fontFuncsMakeImmutable(FontFuncs ffuncs)
      Makes a font-functions structure immutable.
      Parameters:
      ffuncs - The font-functions structure
      Since:
      0.9.2
    • fontFuncsReference

      public static FontFuncs fontFuncsReference(FontFuncs ffuncs)
      Increases the reference count on a font-functions structure.
      Parameters:
      ffuncs - The font-functions structure
      Returns:
      The font-functions structure
      Since:
      0.9.2
    • fontFuncsSetDrawGlyphFunc

      @Deprecated public static void fontFuncsSetDrawGlyphFunc(FontFuncs ffuncs, @Nullable FontDrawGlyphFunc func, @Nullable DestroyFunc destroy)
      Deprecated.
      Use hb_font_funcs_set_draw_glyph_or_fail_func instead.
      Sets the implementation function for hb_font_draw_glyph_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      7.0.0
    • fontFuncsSetDrawGlyphOrFailFunc

      public static void fontFuncsSetDrawGlyphOrFailFunc(FontFuncs ffuncs, @Nullable FontDrawGlyphOrFailFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_draw_glyph_or_fail_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      11.2.0
    • fontFuncsSetFontHExtentsFunc

      public static void fontFuncsSetFontHExtentsFunc(FontFuncs ffuncs, @Nullable FontGetFontHExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_font_h_extents_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      1.1.2
    • fontFuncsSetFontVExtentsFunc

      public static void fontFuncsSetFontVExtentsFunc(FontFuncs ffuncs, @Nullable FontGetFontVExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_font_v_extents_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      1.1.2
    • fontFuncsSetGlyphContourPointFunc

      public static void fontFuncsSetGlyphContourPointFunc(FontFuncs ffuncs, @Nullable FontGetGlyphContourPointFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_contour_point_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphExtentsFunc

      public static void fontFuncsSetGlyphExtentsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphExtentsFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_extents_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphFromNameFunc

      public static void fontFuncsSetGlyphFromNameFunc(FontFuncs ffuncs, @Nullable FontGetGlyphFromNameFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_from_name_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphFunc

      @Deprecated public static void fontFuncsSetGlyphFunc(FontFuncs ffuncs, @Nullable FontGetGlyphFunc func, @Nullable DestroyFunc destroy)
      Deprecated.
      Deprecated. Use hb_font_funcs_set_nominal_glyph_func() and hb_font_funcs_set_variation_glyph_func() instead.
      Parameters:
      ffuncs - The font-functions structure
      func - callback function
      destroy - function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphHAdvanceFunc

      public static void fontFuncsSetGlyphHAdvanceFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHAdvanceFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_h_advance_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphHAdvancesFunc

      public static void fontFuncsSetGlyphHAdvancesFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHAdvancesFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_h_advances_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      1.8.6
    • fontFuncsSetGlyphHKerningFunc

      public static void fontFuncsSetGlyphHKerningFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHKerningFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_h_kerning_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphHOriginFunc

      public static void fontFuncsSetGlyphHOriginFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHOriginFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_h_origin_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphHOriginsFunc

      public static void fontFuncsSetGlyphHOriginsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHOriginsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_h_origins_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      11.3.0
    • fontFuncsSetGlyphNameFunc

      public static void fontFuncsSetGlyphNameFunc(FontFuncs ffuncs, @Nullable FontGetGlyphNameFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_name_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphShapeFunc

      @Deprecated public static void fontFuncsSetGlyphShapeFunc(FontFuncs ffuncs, @Nullable FontGetGlyphShapeFunc func, @Nullable DestroyFunc destroy)
      Deprecated.
      Use hb_font_funcs_set_draw_glyph_func() instead
      Sets the implementation function for hb_font_get_glyph_shape_func_t, which is the same as hb_font_draw_glyph_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      4.0.0
    • fontFuncsSetGlyphVAdvanceFunc

      public static void fontFuncsSetGlyphVAdvanceFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVAdvanceFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_v_advance_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphVAdvancesFunc

      public static void fontFuncsSetGlyphVAdvancesFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVAdvancesFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_v_advances_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      1.8.6
    • fontFuncsSetGlyphVKerningFunc

      @Deprecated public static void fontFuncsSetGlyphVKerningFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVKerningFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Deprecated.
      Sets the implementation function for hb_font_get_glyph_v_kerning_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphVOriginFunc

      public static void fontFuncsSetGlyphVOriginFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVOriginFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_v_origin_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • fontFuncsSetGlyphVOriginsFunc

      public static void fontFuncsSetGlyphVOriginsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVOriginsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_glyph_v_origins_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      userData - Data to pass to func
      destroy - The function to call when userData is not needed anymore
      Since:
      11.3.0
    • fontFuncsSetNominalGlyphFunc

      public static void fontFuncsSetNominalGlyphFunc(FontFuncs ffuncs, @Nullable FontGetNominalGlyphFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_nominal_glyph_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      1.2.3
    • fontFuncsSetNominalGlyphsFunc

      public static void fontFuncsSetNominalGlyphsFunc(FontFuncs ffuncs, @Nullable FontGetNominalGlyphsFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_nominal_glyphs_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      2.0.0
    • fontFuncsSetPaintGlyphFunc

      @Deprecated public static void fontFuncsSetPaintGlyphFunc(FontFuncs ffuncs, @Nullable FontPaintGlyphFunc func, @Nullable DestroyFunc destroy)
      Deprecated.
      Use hb_font_funcs_set_paint_glyph_or_fail_func() instead.
      Sets the implementation function for hb_font_paint_glyph_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is no longer needed
      Since:
      7.0.0
    • fontFuncsSetPaintGlyphOrFailFunc

      public static void fontFuncsSetPaintGlyphOrFailFunc(FontFuncs ffuncs, @Nullable FontPaintGlyphOrFailFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_paint_glyph_or_fail_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is no longer needed
      Since:
      11.2.0
    • fontFuncsSetUserData

      public static Bool fontFuncsSetUserData(FontFuncs ffuncs, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified font-functions structure.
      Parameters:
      ffuncs - The font-functions structure
      key - The user-data key to set
      data - A pointer to the user data set
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • fontFuncsSetVariationGlyphFunc

      public static void fontFuncsSetVariationGlyphFunc(FontFuncs ffuncs, @Nullable FontGetVariationGlyphFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_font_get_variation_glyph_func_t.
      Parameters:
      ffuncs - A font-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      1.2.3
    • fontGetEmpty

      public static Font fontGetEmpty()
      Fetches the empty font object.
      Returns:
      The empty font object
      Since:
      0.9.2
    • fontGetExtentsForDirection

      public static void fontGetExtentsForDirection(Font font, Direction direction, FontExtents extents)

      Fetches the extents for a font in a text segment of the specified direction.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      direction - The direction of the text segment
      extents - The hb_font_extents_t retrieved
      Since:
      1.1.3
    • fontGetFace

      public static Face fontGetFace(Font font)
      Fetches the face associated with the specified font object.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      The hb_face_t value
      Since:
      0.9.2
    • fontGetGlyph

      public static Bool fontGetGlyph(Font font, Codepoint unicode, Codepoint variationSelector, Codepoint glyph)

      Fetches the glyph ID for a Unicode code point in the specified font, with an optional variation selector.

      If variationSelector is 0, calls hb_font_get_nominal_glyph(); otherwise calls hb_font_get_variation_glyph().

      Parameters:
      font - hb_font_t to work upon
      unicode - The Unicode code point to query
      variationSelector - A variation-selector code point
      glyph - The glyph ID retrieved
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphAdvanceForDirection

      public static void fontGetGlyphAdvanceForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y)

      Fetches the advance for a glyph ID from the specified font, in a text segment of the specified direction.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      direction - The direction of the text segment
      x - The horizontal advance retrieved
      y - The vertical advance retrieved
      Since:
      0.9.2
    • fontGetGlyphAdvancesForDirection

      public static void fontGetGlyphAdvancesForDirection(Font font, Direction direction, int count, MemorySegment firstGlyph, int glyphStride, Position firstAdvance, Out<Integer> advanceStride)

      Fetches the advances for a sequence of glyph IDs in the specified font, in a text segment of the specified direction.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      direction - The direction of the text segment
      count - The number of glyph IDs in the sequence queried
      firstGlyph - The first glyph ID to query
      glyphStride - The stride between successive glyph IDs
      firstAdvance - The first advance retrieved
      advanceStride - The stride between successive advances
      Since:
      1.8.6
    • fontGetGlyphContourPoint

      public static Bool fontGetGlyphContourPoint(Font font, Codepoint glyph, int pointIndex, Position x, Position y)
      Fetches the (x,y) coordinates of a specified contour-point index in the specified glyph, within the specified font.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      pointIndex - The contour-point index to query
      x - The X value retrieved for the contour point
      y - The Y value retrieved for the contour point
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphContourPointForOrigin

      public static Bool fontGetGlyphContourPointForOrigin(Font font, Codepoint glyph, int pointIndex, Direction direction, Position x, Position y)

      Fetches the (X,Y) coordinates of a specified contour-point index in the specified glyph ID in the specified font, with respect to the origin in a text segment in the specified direction.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      pointIndex - The contour-point index to query
      direction - The direction of the text segment
      x - The X value retrieved for the contour point
      y - The Y value retrieved for the contour point
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphExtents

      public static Bool fontGetGlyphExtents(Font font, Codepoint glyph, GlyphExtents extents)
      Fetches the hb_glyph_extents_t data for a glyph ID in the specified font.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      extents - The hb_glyph_extents_t retrieved
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphExtentsForOrigin

      public static Bool fontGetGlyphExtentsForOrigin(Font font, Codepoint glyph, Direction direction, GlyphExtents extents)

      Fetches the hb_glyph_extents_t data for a glyph ID in the specified font, with respect to the origin in a text segment in the specified direction.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      direction - The direction of the text segment
      extents - The hb_glyph_extents_t retrieved
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphFromName

      public static Bool fontGetGlyphFromName(Font font, @Nullable String @Nullable [] name, Codepoint glyph)

      Fetches the glyph ID that corresponds to a name string in the specified font.

      Note: len == -1 means the name string is null-terminated.

      Parameters:
      font - hb_font_t to work upon
      name - The name string to query
      glyph - The glyph ID retrieved
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphHAdvance

      public static Position fontGetGlyphHAdvance(Font font, Codepoint glyph)
      Fetches the advance for a glyph ID in the specified font, for horizontal text segments.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      Returns:
      The advance of glyph within font
      Since:
      0.9.2
    • fontGetGlyphHAdvances

      public static void fontGetGlyphHAdvances(Font font, int count, MemorySegment firstGlyph, int glyphStride, Position firstAdvance, int advanceStride)
      Fetches the advances for a sequence of glyph IDs in the specified font, for horizontal text segments.
      Parameters:
      font - hb_font_t to work upon
      count - The number of glyph IDs in the sequence queried
      firstGlyph - The first glyph ID to query
      glyphStride - The stride between successive glyph IDs
      firstAdvance - The first advance retrieved
      advanceStride - The stride between successive advances
      Since:
      1.8.6
    • fontGetGlyphHKerning

      public static Position fontGetGlyphHKerning(Font font, Codepoint leftGlyph, Codepoint rightGlyph)

      Fetches the kerning-adjustment value for a glyph-pair in the specified font, for horizontal text segments.

      It handles legacy kerning only (as returned by the corresponding hb_font_funcs_t function).

      Parameters:
      font - hb_font_t to work upon
      leftGlyph - The glyph ID of the left glyph in the glyph pair
      rightGlyph - The glyph ID of the right glyph in the glyph pair
      Returns:
      The kerning adjustment value
      Since:
      0.9.2
    • fontGetGlyphHOrigin

      public static Bool fontGetGlyphHOrigin(Font font, Codepoint glyph, Position x, Position y)
      Fetches the (X,Y) coordinates of the origin for a glyph ID in the specified font, for horizontal text segments.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      x - The X coordinate of the origin
      y - The Y coordinate of the origin
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphHOrigins

      public static Bool fontGetGlyphHOrigins(Font font, int count, MemorySegment firstGlyph, int glyphStride, Position firstX, int xStride, Position firstY, int yStride)
      Fetches the (X,Y) coordinates of the origin for requested glyph IDs in the specified font, for horizontal text segments.
      Parameters:
      font - hb_font_t to work upon
      count - The number of glyph IDs in the sequence queried
      firstGlyph - The first glyph ID to query
      glyphStride - The stride between successive glyph IDs
      firstX - The first X coordinate of the origin retrieved
      xStride - The stride between successive X coordinates
      firstY - The first Y coordinate of the origin retrieved
      yStride - The stride between successive Y coordinates
      Returns:
      true if data found, false otherwise
      Since:
      11.3.0
    • fontGetGlyphKerningForDirection

      public static void fontGetGlyphKerningForDirection(Font font, Codepoint firstGlyph, Codepoint secondGlyph, Direction direction, Position x, Position y)

      Fetches the kerning-adjustment value for a glyph-pair in the specified font.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      firstGlyph - The glyph ID of the first glyph in the glyph pair to query
      secondGlyph - The glyph ID of the second glyph in the glyph pair to query
      direction - The direction of the text segment
      x - The horizontal kerning-adjustment value retrieved
      y - The vertical kerning-adjustment value retrieved
      Since:
      0.9.2
    • fontGetGlyphName

      public static Bool fontGetGlyphName(Font font, Codepoint glyph, @Nullable Out<String[]> name)

      Fetches the glyph-name string for a glyph ID in the specified font.

      According to the OpenType specification, glyph names are limited to 63 characters and can only contain (a subset of) ASCII.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      name - Name string retrieved for the glyph ID
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphOriginForDirection

      public static void fontGetGlyphOriginForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y)

      Fetches the (X,Y) coordinates of the origin for a glyph in the specified font.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      direction - The direction of the text segment
      x - The X coordinate retrieved for the origin
      y - The Y coordinate retrieved for the origin
      Since:
      0.9.2
    • fontGetGlyphShape

      @Deprecated public static void fontGetGlyphShape(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData)
      Deprecated.
      Use hb_font_draw_glyph() instead
      Fetches the glyph shape that corresponds to a glyph in the specified font. The shape is returned by way of calls to the callbacks of the dfuncs objects, with drawData passed to them.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID
      dfuncs - hb_draw_funcs_t to draw to
      drawData - User data to pass to draw callbacks
      Since:
      4.0.0
    • fontGetGlyphVAdvance

      public static Position fontGetGlyphVAdvance(Font font, Codepoint glyph)
      Fetches the advance for a glyph ID in the specified font, for vertical text segments.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      Returns:
      The advance of glyph within font
      Since:
      0.9.2
    • fontGetGlyphVAdvances

      public static void fontGetGlyphVAdvances(Font font, int count, MemorySegment firstGlyph, int glyphStride, Position firstAdvance, Out<Integer> advanceStride)
      Fetches the advances for a sequence of glyph IDs in the specified font, for vertical text segments.
      Parameters:
      font - hb_font_t to work upon
      count - The number of glyph IDs in the sequence queried
      firstGlyph - The first glyph ID to query
      glyphStride - The stride between successive glyph IDs
      firstAdvance - The first advance retrieved
      advanceStride - The stride between successive advances
      Since:
      1.8.6
    • fontGetGlyphVKerning

      @Deprecated public static Position fontGetGlyphVKerning(Font font, Codepoint topGlyph, Codepoint bottomGlyph)
      Deprecated.

      Fetches the kerning-adjustment value for a glyph-pair in the specified font, for vertical text segments.

      It handles legacy kerning only (as returned by the corresponding hb_font_funcs_t function).

      Parameters:
      font - hb_font_t to work upon
      topGlyph - The glyph ID of the top glyph in the glyph pair
      bottomGlyph - The glyph ID of the bottom glyph in the glyph pair
      Returns:
      The kerning adjustment value
      Since:
      0.9.2
    • fontGetGlyphVOrigin

      public static Bool fontGetGlyphVOrigin(Font font, Codepoint glyph, Position x, Position y)
      Fetches the (X,Y) coordinates of the origin for a glyph ID in the specified font, for vertical text segments.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      x - The X coordinate of the origin
      y - The Y coordinate of the origin
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGetGlyphVOrigins

      public static Bool fontGetGlyphVOrigins(Font font, int count, MemorySegment firstGlyph, int glyphStride, Position firstX, int xStride, Position firstY, int yStride)
      Fetches the (X,Y) coordinates of the origin for requested glyph IDs in the specified font, for vertical text segments.
      Parameters:
      font - hb_font_t to work upon
      count - The number of glyph IDs in the sequence queried
      firstGlyph - The first glyph ID to query
      glyphStride - The stride between successive glyph IDs
      firstX - The first X coordinate of the origin retrieved
      xStride - The stride between successive X coordinates
      firstY - The first Y coordinate of the origin retrieved
      yStride - The stride between successive Y coordinates
      Returns:
      true if data found, false otherwise
      Since:
      11.3.0
    • fontGetHExtents

      public static Bool fontGetHExtents(Font font, FontExtents extents)
      Fetches the extents for a specified font, for horizontal text segments.
      Parameters:
      font - hb_font_t to work upon
      extents - The font extents retrieved
      Returns:
      true if data found, false otherwise
      Since:
      1.1.3
    • fontGetNominalGlyph

      public static Bool fontGetNominalGlyph(Font font, Codepoint unicode, Codepoint glyph)

      Fetches the nominal glyph ID for a Unicode code point in the specified font.

      This version of the function should not be used to fetch glyph IDs for code points modified by variation selectors. For variation-selector support, user hb_font_get_variation_glyph() or use hb_font_get_glyph().

      Parameters:
      font - hb_font_t to work upon
      unicode - The Unicode code point to query
      glyph - The glyph ID retrieved
      Returns:
      true if data found, false otherwise
      Since:
      1.2.3
    • fontGetNominalGlyphs

      public static int fontGetNominalGlyphs(Font font, int count, MemorySegment firstUnicode, int unicodeStride, Codepoint firstGlyph, int glyphStride)
      Fetches the nominal glyph IDs for a sequence of Unicode code points. Glyph IDs must be returned in a hb_codepoint_t output parameter. Stops at the first unsupported glyph ID.
      Parameters:
      font - hb_font_t to work upon
      count - number of code points to query
      firstUnicode - The first Unicode code point to query
      unicodeStride - The stride between successive code points
      firstGlyph - The first glyph ID retrieved
      glyphStride - The stride between successive glyph IDs
      Returns:
      the number of code points processed
      Since:
      2.6.3
    • fontGetParent

      public static Font fontGetParent(Font font)
      Fetches the parent font of font.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      The parent font object
      Since:
      0.9.2
    • fontGetPpem

      public static void fontGetPpem(Font font, Out<Integer> xPpem, Out<Integer> yPpem)
      Fetches the horizontal and vertical points-per-em (ppem) of a font.
      Parameters:
      font - hb_font_t to work upon
      xPpem - Horizontal ppem value
      yPpem - Vertical ppem value
      Since:
      0.9.2
    • fontGetPtem

      public static float fontGetPtem(Font font)
      Fetches the "point size" of a font. Used in CoreText to implement optical sizing.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      Point size. A value of zero means "not set."
      Since:
      1.6.0
    • fontGetScale

      public static void fontGetScale(Font font, Out<Integer> xScale, Out<Integer> yScale)
      Fetches the horizontal and vertical scale of a font.
      Parameters:
      font - hb_font_t to work upon
      xScale - Horizontal scale value
      yScale - Vertical scale value
      Since:
      0.9.2
    • fontGetSerial

      public static int fontGetSerial(Font font)
      Returns the internal serial number of the font. The serial number is increased every time a setting on the font is changed, using a setter function.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      serial number
      Since:
      4.4.0
    • fontGetSyntheticBold

      public static void fontGetSyntheticBold(Font font, Out<Float> xEmbolden, Out<Float> yEmbolden, Bool inPlace)
      Fetches the "synthetic boldness" parameters of a font.
      Parameters:
      font - hb_font_t to work upon
      xEmbolden - return location for horizontal value
      yEmbolden - return location for vertical value
      inPlace - return location for in-place value
      Since:
      7.0.0
    • fontGetSyntheticSlant

      public static float fontGetSyntheticSlant(Font font)
      Fetches the "synthetic slant" of a font.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      Synthetic slant. By default is zero.
      Since:
      3.3.0
    • fontGetUserData

      public static @Nullable MemorySegment fontGetUserData(Font font, UserDataKey key)
      Fetches the user-data object associated with the specified key, attached to the specified font object.
      Parameters:
      font - hb_font_t to work upon
      key - The user-data key to query
      Returns:
      Pointer to the user data
      Since:
      0.9.2
    • fontGetVExtents

      public static Bool fontGetVExtents(Font font, FontExtents extents)
      Fetches the extents for a specified font, for vertical text segments.
      Parameters:
      font - hb_font_t to work upon
      extents - The font extents retrieved
      Returns:
      true if data found, false otherwise
      Since:
      1.1.3
    • fontGetVarCoordsDesign

      public static MemorySegment fontGetVarCoordsDesign(Font font, Out<Integer> length)

      Fetches the list of variation coordinates (in design-space units) currently set on a font.

      Note that if no variation coordinates are set, this function may return null.

      If variations have been set on the font using normalized coordinates (i.e. via hb_font_set_var_coords_normalized()), the design coordinates will have NaN (Not a Number) values.

      Return value is valid as long as variation coordinates of the font are not modified.

      Parameters:
      font - hb_font_t to work upon
      length - Number of coordinates retrieved
      Returns:
      coordinates array
      Since:
      3.3.0
    • fontGetVarCoordsNormalized

      public static MemorySegment fontGetVarCoordsNormalized(Font font, Out<Integer> length)

      Fetches the list of normalized variation coordinates currently set on a font.

      Note that if no variation coordinates are set, this function may return null.

      Return value is valid as long as variation coordinates of the font are not modified.

      Parameters:
      font - hb_font_t to work upon
      length - Number of coordinates retrieved
      Returns:
      coordinates array
      Since:
      1.4.2
    • fontGetVarNamedInstance

      public static int fontGetVarNamedInstance(Font font)
      Returns the currently-set named-instance index of the font.
      Parameters:
      font - a font.
      Returns:
      Named-instance index or HB_FONT_NO_VAR_NAMED_INSTANCE.
      Since:
      7.0.0
    • fontGetVariationGlyph

      public static Bool fontGetVariationGlyph(Font font, Codepoint unicode, Codepoint variationSelector, Codepoint glyph)
      Fetches the glyph ID for a Unicode code point when followed by by the specified variation-selector code point, in the specified font.
      Parameters:
      font - hb_font_t to work upon
      unicode - The Unicode code point to query
      variationSelector - The variation-selector code point to query
      glyph - The glyph ID retrieved
      Returns:
      true if data found, false otherwise
      Since:
      1.2.3
    • fontGlyphFromString

      public static Bool fontGlyphFromString(Font font, @Nullable byte @Nullable [] s, Codepoint glyph)

      Fetches the glyph ID from font that matches the specified string. Strings of the format gidDDD or uniUUUU are parsed automatically.

      Note: len == -1 means the string is null-terminated.

      Parameters:
      font - hb_font_t to work upon
      s - string to query
      glyph - The glyph ID corresponding to the string requested
      Returns:
      true if data found, false otherwise
      Since:
      0.9.2
    • fontGlyphToString

      public static void fontGlyphToString(Font font, Codepoint glyph, @Nullable Out<String[]> s)

      Fetches the name of the specified glyph ID in font and returns it in string s.

      If the glyph ID has no name in font, a string of the form gidDDD is generated, with DDD being the glyph ID.

      According to the OpenType specification, glyph names are limited to 63 characters and can only contain (a subset of) ASCII.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      s - The string containing the glyph name
      Since:
      0.9.2
    • fontIsImmutable

      public static Bool fontIsImmutable(Font font)
      Tests whether a font object is immutable.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      true if font is immutable, false otherwise
      Since:
      0.9.2
    • fontIsSynthetic

      public static Bool fontIsSynthetic(Font font)
      Tests whether a font is synthetic. A synthetic font is one that has either synthetic slant or synthetic bold set on it.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      true if the font is synthetic, false otherwise.
      Since:
      11.2.0
    • fontListFuncs

      public static String[] fontListFuncs()
      Retrieves the list of font functions supported by HarfBuzz.
      Returns:
      a NULL-terminated array of supported font functions constant strings. The returned array is owned by HarfBuzz and should not be modified or freed.
      Since:
      11.0.0
    • fontMakeImmutable

      public static void fontMakeImmutable(Font font)
      Makes font immutable.
      Parameters:
      font - hb_font_t to work upon
      Since:
      0.9.2
    • fontPaintGlyph

      public static void fontPaintGlyph(Font font, Codepoint glyph, PaintFuncs pfuncs, @Nullable MemorySegment paintData, int paletteIndex, Color foreground)

      Paints the glyph. This function is similar to hb_font_paint_glyph_or_fail(), but if painting a color glyph failed, it will fall back to painting an outline monochrome glyph.

      The painting instructions are returned by way of calls to the callbacks of the funcs object, with paintData passed to them.

      If the font has color palettes (see hb_ot_color_has_palettes()), then paletteIndex selects the palette to use. If the font only has one palette, this will be 0.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID
      pfuncs - hb_paint_funcs_t to paint with
      paintData - User data to pass to paint callbacks
      paletteIndex - The index of the font's color palette to use
      foreground - The foreground color, unpremultipled
      Since:
      7.0.0
    • fontPaintGlyphOrFail

      public static Bool fontPaintGlyphOrFail(Font font, Codepoint glyph, PaintFuncs pfuncs, @Nullable MemorySegment paintData, int paletteIndex, Color foreground)

      Paints a color glyph.

      This function is similar to, but lower-level than, hb_font_paint_glyph(). It is suitable for clients that need more control. If there are no color glyphs available, it will return false. The client can then fall back to hb_font_draw_glyph_or_fail() for the monochrome outline glyph.

      The painting instructions are returned by way of calls to the callbacks of the funcs object, with paintData passed to them.

      If the font has color palettes (see hb_ot_color_has_palettes()), then paletteIndex selects the palette to use. If the font only has one palette, this will be 0.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID
      pfuncs - hb_paint_funcs_t to paint with
      paintData - User data to pass to paint callbacks
      paletteIndex - The index of the font's color palette to use
      foreground - The foreground color, unpremultipled
      Returns:
      true if glyph was painted, false otherwise
      Since:
      11.2.0
    • fontReference

      public static Font fontReference(Font font)
      Increases the reference count on the given font object.
      Parameters:
      font - hb_font_t to work upon
      Returns:
      The font object
      Since:
      0.9.2
    • fontSetFace

      public static void fontSetFace(Font font, Face face)
      Sets face as the font-face value of font.
      Parameters:
      font - hb_font_t to work upon
      face - The hb_face_t to assign
      Since:
      1.4.3
    • fontSetFuncs

      public static void fontSetFuncs(Font font, FontFuncs klass, @Nullable MemorySegment fontData, @Nullable DestroyFunc destroy)
      Replaces the font-functions structure attached to a font, updating the font's user-data with fontData and the destroy callback.
      Parameters:
      font - hb_font_t to work upon
      klass - The font-functions structure.
      fontData - Data to attach to font
      destroy - The function to call when fontData is not needed anymore
      Since:
      0.9.2
    • fontSetFuncsData

      public static void fontSetFuncsData(Font font, @Nullable MemorySegment fontData, @Nullable DestroyFunc destroy)
      Replaces the user data attached to a font, updating the font's destroy callback.
      Parameters:
      font - hb_font_t to work upon
      fontData - Data to attach to font
      destroy - The function to call when fontData is not needed anymore
      Since:
      0.9.2
    • fontSetFuncsUsing

      public static Bool fontSetFuncsUsing(Font font, String name)

      Sets the font-functions structure to use for a font, based on the specified name.

      If name is NULL or the empty string, the default (first) functioning font-functions are used. This default can be changed by setting the HB_FONT_FUNCS environment variable to the name of the desired font-functions.

      Parameters:
      font - hb_font_t to work upon
      name - The name of the font-functions structure to use, or NULL
      Returns:
      true if the font-functions was found and set, false otherwise
      Since:
      11.0.0
    • fontSetParent

      public static void fontSetParent(Font font, Font parent)
      Sets the parent font of font.
      Parameters:
      font - hb_font_t to work upon
      parent - The parent font object to assign
      Since:
      1.0.5
    • fontSetPpem

      public static void fontSetPpem(Font font, int xPpem, int yPpem)

      Sets the horizontal and vertical pixels-per-em (PPEM) of a font.

      These values are used for pixel-size-specific adjustment to shaping and draw results, though for the most part they are unused and can be left unset.

      Parameters:
      font - hb_font_t to work upon
      xPpem - Horizontal ppem value to assign
      yPpem - Vertical ppem value to assign
      Since:
      0.9.2
    • fontSetPtem

      public static void fontSetPtem(Font font, float ptem)

      Sets the "point size" of a font. Set to zero to unset. Used in CoreText to implement optical sizing.

      Note: There are 72 points in an inch.

      Parameters:
      font - hb_font_t to work upon
      ptem - font size in points.
      Since:
      1.6.0
    • fontSetScale

      public static void fontSetScale(Font font, int xScale, int yScale)

      Sets the horizontal and vertical scale of a font.

      The font scale is a number related to, but not the same as, font size. Typically the client establishes a scale factor to be used between the two. For example, 64, or 256, which would be the fractional-precision part of the font scale. This is necessary because hb_position_t values are integer types and you need to leave room for fractional values in there.

      For example, to set the font size to 20, with 64 levels of fractional precision you would call hb_font_set_scale(font, 20 * 64, 20 * 64).

      In the example above, even what font size 20 means is up to you. It might be 20 pixels, or 20 points, or 20 millimeters. HarfBuzz does not care about that. You can set the point size of the font using hb_font_set_ptem(), and the pixel size using hb_font_set_ppem().

      The choice of scale is yours but needs to be consistent between what you set here, and what you expect out of hb_position_t as well has draw / paint API output values.

      Fonts default to a scale equal to the UPEM value of their face. A font with this setting is sometimes called an "unscaled" font.

      Parameters:
      font - hb_font_t to work upon
      xScale - Horizontal scale value to assign
      yScale - Vertical scale value to assign
      Since:
      0.9.2
    • fontSetSyntheticBold

      public static void fontSetSyntheticBold(Font font, float xEmbolden, float yEmbolden, Bool inPlace)

      Sets the "synthetic boldness" of a font.

      Positive values for xEmbolden / yEmbolden make a font bolder, negative values thinner. Typical values are in the 0.01 to 0.05 range. The default value is zero.

      Synthetic boldness is applied by offsetting the contour points of the glyph shape.

      Synthetic boldness is applied when rendering a glyph via hb_font_draw_glyph_or_fail().

      If inPlace is false, then glyph advance-widths are also adjusted, otherwise they are not. The in-place mode is useful for simulating font grading.

      Parameters:
      font - hb_font_t to work upon
      xEmbolden - the amount to embolden horizontally
      yEmbolden - the amount to embolden vertically
      inPlace - whether to embolden glyphs in-place
      Since:
      7.0.0
    • fontSetSyntheticSlant

      public static void fontSetSyntheticSlant(Font font, float slant)

      Sets the "synthetic slant" of a font. By default is zero. Synthetic slant is the graphical skew applied to the font at rendering time.

      HarfBuzz needs to know this value to adjust shaping results, metrics, and style values to match the slanted rendering.

      Note: The glyph shape fetched via the hb_font_draw_glyph_or_fail() function is slanted to reflect this value as well.

      Note: The slant value is a ratio. For example, a 20% slant would be represented as a 0.2 value.

      Parameters:
      font - hb_font_t to work upon
      slant - synthetic slant value.
      Since:
      3.3.0
    • fontSetUserData

      public static Bool fontSetUserData(Font font, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified font object.
      Parameters:
      font - hb_font_t to work upon
      key - The user-data key
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • fontSetVarCoordsDesign

      public static void fontSetVarCoordsDesign(Font font, @Nullable float @Nullable [] coords)

      Applies a list of variation coordinates (in design-space units) to a font.

      Note that this overrides all existing variations set on font. Axes not included in coords will be effectively set to their default values.

      Parameters:
      font - hb_font_t to work upon
      coords - Array of variation coordinates to apply
      Since:
      1.4.2
    • fontSetVarCoordsNormalized

      public static void fontSetVarCoordsNormalized(Font font, @Nullable int @Nullable [] coords)

      Applies a list of variation coordinates (in normalized units) to a font.

      Note that this overrides all existing variations set on font. Axes not included in coords will be effectively set to their default values.

      Note: Coordinates should be normalized to 2.14.

      Parameters:
      font - hb_font_t to work upon
      coords - Array of variation coordinates to apply
      Since:
      1.4.2
    • fontSetVarNamedInstance

      public static void fontSetVarNamedInstance(Font font, int instanceIndex)
      Sets design coords of a font from a named-instance index.
      Parameters:
      font - a font.
      instanceIndex - named instance index.
      Since:
      2.6.0
    • fontSetVariation

      public static void fontSetVariation(Font font, Tag tag, float value)

      Change the value of one variation axis on the font.

      Note: This function is expensive to be called repeatedly. If you want to set multiple variation axes at the same time, use hb_font_set_variations() instead.

      Parameters:
      font - hb_font_t to work upon
      tag - The hb_tag_t tag of the variation-axis name
      value - The value of the variation axis
      Since:
      7.1.0
    • fontSetVariations

      public static void fontSetVariations(Font font, @Nullable Variation @Nullable [] variations)

      Applies a list of font-variation settings to a font.

      Note that this overrides all existing variations set on font. Axes not included in variations will be effectively set to their default values.

      Parameters:
      font - hb_font_t to work upon
      variations - Array of variation settings to apply
      Since:
      1.4.2
    • fontSubtractGlyphOriginForDirection

      public static void fontSubtractGlyphOriginForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y)

      Subtracts the origin coordinates from an (X,Y) point coordinate, in the specified glyph ID in the specified font.

      Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of direction.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph ID to query
      direction - The direction of the text segment
      x - Input = The original X coordinate Output = The X coordinate minus the X-coordinate of the origin
      y - Input = The original Y coordinate Output = The Y coordinate minus the Y-coordinate of the origin
      Since:
      0.9.2
    • free

      public static void free(@Nullable MemorySegment ptr)
      Frees the memory pointed to by ptr, using the allocator set at compile-time. Typically just free().
      Parameters:
      ptr - The pointer to the memory to free.
      Since:
      11.0.0
    • ftFaceCreate

      public static Face ftFaceCreate(@Nullable org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy)

      Creates an hb_face_t face object from the specified FT_Face.

      Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned hb_face_t will use the native HarfBuzz font implementation, unless you call hb_ft_font_set_funcs() on them.

      This variant of the function does not provide any life-cycle management.

      Most client programs should use hb_ft_face_create_referenced() (or, perhaps, hb_ft_face_create_cached()) instead.

      If you know you have valid reasons not to use hb_ft_face_create_referenced(), then it is the client program's responsibility to destroy ftFace after the hb_face_t face object has been destroyed.

      Parameters:
      ftFace - FT_Face to work upon
      destroy - A callback to call when the face object is not needed anymore
      Returns:
      the new hb_face_t face object
      Since:
      0.9.2
    • ftFaceCreateCached

      public static Face ftFaceCreateCached(@Nullable org.freedesktop.freetype.Face ftFace)

      Creates an hb_face_t face object from the specified FT_Face.

      Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned hb_face_t will use the native HarfBuzz font implementation, unless you call hb_ft_font_set_funcs() on them.

      This variant of the function caches the newly created hb_face_t face object, using the generic pointer of ftFace. Subsequent function calls that are passed the same ftFace parameter will have the same hb_face_t returned to them, and that hb_face_t will be correctly reference counted.

      However, client programs are still responsible for destroying ftFace after the last hb_face_t face object has been destroyed.

      Parameters:
      ftFace - FT_Face to work upon
      Returns:
      the new hb_face_t face object
      Since:
      0.9.2
    • ftFaceCreateFromBlobOrFail

      public static Face ftFaceCreateFromBlobOrFail(Blob blob, int index)

      Creates an hb_face_t face object from the specified font blob and face index.

      This is similar in functionality to hb_face_create_from_blob_or_fail(), but uses the FreeType library for loading the font blob. This can be useful, for example, to load WOFF and WOFF2 font data.

      Parameters:
      blob - A blob
      index - The index of the face within the blob
      Returns:
      The new face object, or NULL if loading fails (eg. blob does not contain valid font data).
      Since:
      11.0.0
    • ftFaceCreateFromFileOrFail

      public static Face ftFaceCreateFromFileOrFail(String fileName, int index)

      Creates an hb_face_t face object from the specified font file and face index.

      This is similar in functionality to hb_face_create_from_file_or_fail(), but uses the FreeType library for loading the font file. This can be useful, for example, to load WOFF and WOFF2 font data.

      Parameters:
      fileName - A font filename
      index - The index of the face within the file
      Returns:
      The new face object, or NULL if no face is found at the specified index or the file cannot be read.
      Since:
      10.1.0
    • ftFaceCreateReferenced

      public static Face ftFaceCreateReferenced(@Nullable org.freedesktop.freetype.Face ftFace)

      Creates an hb_face_t face object from the specified FT_Face.

      Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned hb_face_t will use the native HarfBuzz font implementation, unless you call hb_ft_font_set_funcs() on them.

      This is the preferred variant of the hb_ft_face_create* function family, because it calls FT_Reference_Face() on ftFace, ensuring that ftFace remains alive as long as the resulting hb_face_t face object remains alive. Also calls FT_Done_Face() when the hb_face_t face object is destroyed.

      Use this version unless you know you have good reasons not to.

      Parameters:
      ftFace - FT_Face to work upon
      Returns:
      the new hb_face_t face object
      Since:
      0.9.38
    • ftFontChanged

      public static void ftFontChanged(Font font)
      Refreshes the state of font when the underlying FT_Face has changed. This function should be called after changing the size or variation-axis settings on the FT_Face.
      Parameters:
      font - hb_font_t to work upon
      Since:
      1.0.5
    • ftFontCreate

      public static Font ftFontCreate(@Nullable org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy)

      Creates an hb_font_t font object from the specified FT_Face.

      Note: You must set the face size on ftFace before calling hb_ft_font_create() on it. HarfBuzz assumes size is always set and will access size member of FT_Face unconditionally.

      This variant of the function does not provide any life-cycle management.

      Most client programs should use hb_ft_font_create_referenced() instead.

      If you know you have valid reasons not to use hb_ft_font_create_referenced(), then it is the client program's responsibility to destroy ftFace only after the hb_font_t font object has been destroyed.

      HarfBuzz will use the destroy callback on the hb_font_t font object if it is supplied when you use this function. However, even if destroy is provided, it is the client program's responsibility to destroy ftFace, and it is the client program's responsibility to ensure that ftFace is destroyed only after the hb_font_t font object has been destroyed.

      Parameters:
      ftFace - FT_Face to work upon
      destroy - A callback to call when the font object is not needed anymore
      Returns:
      the new hb_font_t font object
      Since:
      0.9.2
    • ftFontCreateReferenced

      public static Font ftFontCreateReferenced(@Nullable org.freedesktop.freetype.Face ftFace)

      Creates an hb_font_t font object from the specified FT_Face.

      Note: You must set the face size on ftFace before calling hb_ft_font_create_referenced() on it. HarfBuzz assumes size is always set and will access size member of FT_Face unconditionally.

      This is the preferred variant of the hb_ft_font_create* function family, because it calls FT_Reference_Face() on ftFace, ensuring that ftFace remains alive as long as the resulting hb_font_t font object remains alive.

      Use this version unless you know you have good reasons not to.

      Parameters:
      ftFace - FT_Face to work upon
      Returns:
      the new hb_font_t font object
      Since:
      0.9.38
    • ftFontGetFace

      @Deprecated public static @Nullable org.freedesktop.freetype.Face ftFontGetFace(Font font)
      Deprecated.
      Use hb_ft_font_get_ft_face() instead.

      Fetches the FT_Face associated with the specified hb_font_t font object.

      This function works with hb_font_t objects created by hb_ft_font_create() or hb_ft_font_create_referenced().

      Parameters:
      font - hb_font_t to work upon
      Returns:
      the FT_Face found or NULL
      Since:
      0.9.2
    • ftFontGetFtFace

      public static @Nullable org.freedesktop.freetype.Face ftFontGetFtFace(Font font)

      Fetches the FT_Face associated with the specified hb_font_t font object.

      This function works with hb_font_t objects created by hb_ft_font_create() or hb_ft_font_create_referenced().

      Parameters:
      font - hb_font_t to work upon
      Returns:
      the FT_Face found or NULL
      Since:
      10.4.0
    • ftFontGetLoadFlags

      public static int ftFontGetLoadFlags(Font font)

      Fetches the FT_Load_Glyph load flags of the specified hb_font_t.

      For more information, see https://freetype.org/freetype2/docs/reference/ft2-glyph_retrieval.html`ft_load_xxx`

      This function works with hb_font_t objects created by hb_ft_font_create() or hb_ft_font_create_referenced().

      Parameters:
      font - hb_font_t to work upon
      Returns:
      FT_Load_Glyph flags found, or 0
      Since:
      1.0.5
    • ftFontLockFace

      public static @Nullable org.freedesktop.freetype.Face ftFontLockFace(Font font)

      Gets the FT_Face associated with font.

      This face will be kept around and access to the FT_Face object from other HarfBuzz API wil be blocked until you call hb_ft_font_unlock_face().

      This function works with hb_font_t objects created by hb_ft_font_create() or hb_ft_font_create_referenced().

      Parameters:
      font - hb_font_t to work upon
      Returns:
      the FT_Face associated with font or NULL
      Since:
      2.6.5
    • ftFontSetFuncs

      public static void ftFontSetFuncs(Font font)

      Configures the font-functions structure of the specified hb_font_t font object to use FreeType font functions.

      In particular, you can use this function to configure an existing hb_face_t face object for use with FreeType font functions even if that hb_face_t face object was initially created with hb_face_create(), and therefore was not initially configured to use FreeType font functions.

      An hb_font_t object created with hb_ft_font_create() is preconfigured for FreeType font functions and does not require this function to be used.

      Note that if you modify the underlying hb_font_t after calling this function, you need to call hb_ft_hb_font_changed() to update the underlying FT_Face.

      Note: Internally, this function creates an FT_Face.

      Parameters:
      font - hb_font_t to work upon
      Since:
      1.0.5
    • ftFontSetLoadFlags

      public static void ftFontSetLoadFlags(Font font, int loadFlags)

      Sets the FT_Load_Glyph load flags for the specified hb_font_t.

      For more information, see https://freetype.org/freetype2/docs/reference/ft2-glyph_retrieval.html`ft_load_xxx`

      This function works with hb_font_t objects created by hb_ft_font_create() or hb_ft_font_create_referenced().

      Parameters:
      font - hb_font_t to work upon
      loadFlags - The FreeType load flags to set
      Since:
      1.0.5
    • ftFontUnlockFace

      public static void ftFontUnlockFace(Font font)
      Releases an FT_Face previously obtained with hb_ft_font_lock_face().
      Parameters:
      font - hb_font_t to work upon
      Since:
      2.6.5
    • ftHbFontChanged

      public static Bool ftHbFontChanged(Font font)

      Refreshes the state of the underlying FT_Face of font when the hb_font_t font has changed. This function should be called after changing the size or variation-axis settings on the font. This call is fast if nothing has changed on font.

      Note that as of version 11.0.0, calling this function is not necessary, as HarfBuzz will automatically detect changes to the font and update the underlying FT_Face as needed.

      Parameters:
      font - hb_font_t to work upon
      Returns:
      true if changed, false otherwise
      Since:
      4.4.0
    • glibBlobCreate

      public static Blob glibBlobCreate(byte[] gbytes)
      Creates an hb_blob_t blob from the specified GBytes data structure.
      Parameters:
      gbytes - the GBytes structure to work upon
      Returns:
      the new hb_blob_t blob object
      Since:
      0.9.38
    • glibGetUnicodeFuncs

      public static UnicodeFuncs glibGetUnicodeFuncs()
      Fetches a Unicode-functions structure that is populated with the appropriate GLib function for each method.
      Returns:
      a pointer to the hb_unicode_funcs_t Unicode-functions structure
      Since:
      0.9.38
    • glibScriptFromScript

      public static UnicodeScript glibScriptFromScript(Script script)
      Fetches the GUnicodeScript identifier that corresponds to the specified hb_script_t script.
      Parameters:
      script - The hb_script_t to query
      Returns:
      the GUnicodeScript identifier found
      Since:
      0.9.38
    • glibScriptToScript

      public static Script glibScriptToScript(UnicodeScript script)
      Fetches the hb_script_t script that corresponds to the specified GUnicodeScript identifier.
      Parameters:
      script - The GUnicodeScript identifier to query
      Returns:
      the hb_script_t script found
      Since:
      0.9.38
    • glyphInfoGetGlyphFlags

      public static Set<GlyphFlags> glyphInfoGetGlyphFlags(GlyphInfo info)
      Returns glyph flags encoded within a hb_glyph_info_t.
      Parameters:
      info - a hb_glyph_info_t
      Returns:
      The hb_glyph_flags_t encoded within info
      Since:
      1.5.0
    • languageFromString

      public static @Nullable Language languageFromString(@Nullable byte @Nullable [] str)
      Converts str representing a BCP 47 language tag to the corresponding hb_language_t.
      Parameters:
      str - a string representing a BCP 47 language tag
      Returns:
      The hb_language_t corresponding to the BCP 47 language tag.
      Since:
      0.9.2
    • languageGetDefault

      public static @Nullable Language languageGetDefault()

      Fetch the default language from current locale.

      Note that the first time this function is called, it calls "setlocale (LC_CTYPE, nullptr)" to fetch current locale. The underlying setlocale function is, in many implementations, NOT threadsafe. To avoid problems, call this function once before multiple threads can call it. This function is only used from hb_buffer_guess_segment_properties() by HarfBuzz itself.

      Returns:
      The default language of the locale as an hb_language_t
      Since:
      0.9.2
    • languageMatches

      public static Bool languageMatches(@Nullable Language language, @Nullable Language specific)
      Check whether a second language tag is the same or a more specific version of the provided language tag. For example, "fa_IR.utf8" is a more specific tag for "fa" or for "fa_IR".
      Parameters:
      language - The hb_language_t to work on
      specific - Another hb_language_t
      Returns:
      true if languages match, false otherwise.
      Since:
      5.0.0
    • languageToString

      public static String languageToString(@Nullable Language language)
      Converts an hb_language_t to a string.
      Parameters:
      language - The hb_language_t to convert
      Returns:
      A NULL-terminated string representing the language. Must not be freed by the caller.
      Since:
      0.9.2
    • malloc

      public static @Nullable MemorySegment malloc(long size)
      Allocates size bytes of memory, using the allocator set at compile-time. Typically just malloc().
      Parameters:
      size - The size of the memory to allocate.
      Returns:
      A pointer to the allocated memory.
      Since:
      11.0.0
    • mapAllocationSuccessful

      public static Bool mapAllocationSuccessful(Map map)
      Tests whether memory allocation for a set was successful.
      Parameters:
      map - A map
      Returns:
      true if allocation succeeded, false otherwise
      Since:
      1.7.7
    • mapClear

      public static void mapClear(Map map)
      Clears out the contents of map.
      Parameters:
      map - A map
      Since:
      1.7.7
    • mapCopy

      public static Map mapCopy(Map map)
      Allocate a copy of map.
      Parameters:
      map - A map
      Returns:
      Newly-allocated map.
      Since:
      4.4.0
    • mapCreate

      public static Map mapCreate()
      Creates a new, initially empty map.
      Returns:
      The new hb_map_t
      Since:
      1.7.7
    • mapDel

      public static void mapDel(Map map, Codepoint key)
      Removes key and its stored value from map.
      Parameters:
      map - A map
      key - The key to delete
      Since:
      1.7.7
    • mapDestroy

      public static void mapDestroy(Map map)
      Decreases the reference count on a map. When the reference count reaches zero, the map is destroyed, freeing all memory.
      Parameters:
      map - A map
      Since:
      1.7.7
    • mapGet

      public static Codepoint mapGet(Map map, Codepoint key)
      Fetches the value stored for key in map.
      Parameters:
      map - A map
      key - The key to query
      Since:
      1.7.7
    • mapGetEmpty

      public static Map mapGetEmpty()
      Fetches the singleton empty hb_map_t.
      Returns:
      The empty hb_map_t
      Since:
      1.7.7
    • mapGetPopulation

      public static int mapGetPopulation(Map map)
      Returns the number of key-value pairs in the map.
      Parameters:
      map - A map
      Returns:
      The population of map
      Since:
      1.7.7
    • mapGetUserData

      public static @Nullable MemorySegment mapGetUserData(Map map, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified map.
      Parameters:
      map - A map
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      1.7.7
    • mapHas

      public static Bool mapHas(Map map, Codepoint key)
      Tests whether key is an element of map.
      Parameters:
      map - A map
      key - The key to query
      Returns:
      true if key is found in map, false otherwise
      Since:
      1.7.7
    • mapHash

      public static int mapHash(Map map)
      Creates a hash representing map.
      Parameters:
      map - A map
      Returns:
      A hash of map.
      Since:
      4.4.0
    • mapIsEmpty

      public static Bool mapIsEmpty(Map map)
      Tests whether map is empty (contains no elements).
      Parameters:
      map - A map
      Returns:
      true if map is empty
      Since:
      1.7.7
    • mapIsEqual

      public static Bool mapIsEqual(Map map, Map other)
      Tests whether map and other are equal (contain the same elements).
      Parameters:
      map - A map
      other - Another map
      Returns:
      true if the two maps are equal, false otherwise.
      Since:
      4.3.0
    • mapKeys

      public static void mapKeys(Map map, Set keys)
      Add the keys of map to keys.
      Parameters:
      map - A map
      keys - A set
      Since:
      7.0.0
    • mapNext

      public static Bool mapNext(Map map, Out<Integer> idx, Codepoint key, Codepoint value)

      Fetches the next key/value pair in map.

      Set idx to -1 to get started.

      If the map is modified during iteration, the behavior is undefined.

      The order in which the key/values are returned is undefined.

      Parameters:
      map - A map
      idx - Iterator internal state
      key - Key retrieved
      value - Value retrieved
      Returns:
      true if there was a next value, false otherwise
      Since:
      7.0.0
    • mapReference

      public static Map mapReference(Map map)
      Increases the reference count on a map.
      Parameters:
      map - A map
      Returns:
      The map
      Since:
      1.7.7
    • mapSet

      public static void mapSet(Map map, Codepoint key, Codepoint value)
      Stores value in the map.
      Parameters:
      map - A map
      key - The key to store in the map
      value - The value to store for key
      Since:
      1.7.7
    • mapSetUserData

      public static Bool mapSetUserData(Map map, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified map.
      Parameters:
      map - A map
      key - The user-data key to set
      data - A pointer to the user data to set
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      1.7.7
    • mapUpdate

      public static void mapUpdate(Map map, Map other)
      Add the contents of other to map.
      Parameters:
      map - A map
      other - Another map
      Since:
      7.0.0
    • mapValues

      public static void mapValues(Map map, Set values)
      Add the values of map to values.
      Parameters:
      map - A map
      values - A set
      Since:
      7.0.0
    • otColorGlyphGetLayers

      public static int otColorGlyphGetLayers(Face face, Codepoint glyph, int startOffset, @Nullable Out<OtColorLayer[]> layers)
      Fetches a list of all color layers for the specified glyph index in the specified face. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      glyph - The glyph index to query
      startOffset - offset of the first layer to retrieve
      layers - The array of layers found
      Returns:
      Total number of layers available for the glyph index queried
      Since:
      2.1.0
    • otColorGlyphHasPaint

      public static Bool otColorGlyphHasPaint(Face face, Codepoint glyph)
      Tests where a face includes COLRv1 paint data for glyph.
      Parameters:
      face - hb_face_t to work upon
      glyph - The glyph index to query
      Returns:
      true if data found, false otherwise
      Since:
      7.0.0
    • otColorGlyphReferencePng

      public static Blob otColorGlyphReferencePng(Font font, Codepoint glyph)

      Fetches the PNG image for a glyph. This function takes a font object, not a face object, as input. To get an optimally sized PNG blob, the PPEM values must be set on the font object. If PPEM is unset, the blob returned will be the largest PNG available.

      If the glyph has no PNG image, the singleton empty blob is returned.

      Parameters:
      font - hb_font_t to work upon
      glyph - a glyph index
      Returns:
      An hb_blob_t containing the PNG image for the glyph, if available
      Since:
      2.1.0
    • otColorGlyphReferenceSvg

      public static Blob otColorGlyphReferenceSvg(Face face, Codepoint glyph)

      Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded.

      If the glyph has no SVG document, the singleton empty blob is returned.

      Parameters:
      face - hb_face_t to work upon
      glyph - a svg glyph index
      Returns:
      An hb_blob_t containing the SVG document of the glyph, if available
      Since:
      2.1.0
    • otColorHasLayers

      public static Bool otColorHasLayers(Face face)
      Tests whether a face includes a COLR table with data according to COLRv0.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      2.1.0
    • otColorHasPaint

      public static Bool otColorHasPaint(Face face)
      Tests where a face includes a COLR table with data according to COLRv1.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      7.0.0
    • otColorHasPalettes

      public static Bool otColorHasPalettes(Face face)
      Tests whether a face includes a CPAL color-palette table.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      2.1.0
    • otColorHasPng

      public static Bool otColorHasPng(Face face)
      Tests whether a face has PNG glyph images (either in CBDT or sbix tables).
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      2.1.0
    • otColorHasSvg

      public static Bool otColorHasSvg(Face face)
      Tests whether a face includes any SVG glyph images.
      Parameters:
      face - hb_face_t to work upon.
      Returns:
      true if data found, false otherwise.
      Since:
      2.1.0
    • otColorPaletteColorGetNameId

      public static OtNameId otColorPaletteColorGetNameId(Face face, int colorIndex)

      Fetches the name table Name ID that provides display names for the specified color in a face's CPAL color palette.

      Display names can be generic (e.g., "Background") or specific (e.g., "Eye color").

      Parameters:
      face - hb_face_t to work upon
      colorIndex - The index of the color
      Returns:
      the Name ID found for the color.
      Since:
      2.1.0
    • otColorPaletteGetColors

      public static int otColorPaletteGetColors(Face face, int paletteIndex, int startOffset, @Nullable Out<Color[]> colors)

      Fetches a list of the colors in a color palette.

      After calling this function, colors will be filled with the palette colors. If colors is NULL, the function will just return the number of total colors without storing any actual colors; this can be used for allocating a buffer of suitable size before calling hb_ot_color_palette_get_colors() a second time.

      The RGBA values in the palette are unpremultiplied. See the OpenType spec CPAL section for details.

      Parameters:
      face - hb_face_t to work upon
      paletteIndex - the index of the color palette to query
      startOffset - offset of the first color to retrieve
      colors - The array of hb_color_t records found
      Returns:
      the total number of colors in the palette
      Since:
      2.1.0
    • otColorPaletteGetCount

      public static int otColorPaletteGetCount(Face face)
      Fetches the number of color palettes in a face.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      the number of palettes found
      Since:
      2.1.0
    • otColorPaletteGetFlags

      public static Set<OtColorPaletteFlags> otColorPaletteGetFlags(Face face, int paletteIndex)
      Fetches the flags defined for a color palette.
      Parameters:
      face - hb_face_t to work upon
      paletteIndex - The index of the color palette
      Returns:
      the hb_ot_color_palette_flags_t of the requested color palette
      Since:
      2.1.0
    • otColorPaletteGetNameId

      public static OtNameId otColorPaletteGetNameId(Face face, int paletteIndex)

      Fetches the name table Name ID that provides display names for a CPAL color palette.

      Palette display names can be generic (e.g., "Default") or provide specific, themed names (e.g., "Spring", "Summer", "Fall", and "Winter").

      Parameters:
      face - hb_face_t to work upon
      paletteIndex - The index of the color palette
      Returns:
      the Named ID found for the palette. If the requested palette has no name the result is HB_OT_NAME_ID_INVALID.
      Since:
      2.1.0
    • otFontSetFuncs

      public static void otFontSetFuncs(Font font)
      Sets the font functions to use when working with font to the HarfBuzz's native implementation. This is the default for fonts newly created.
      Parameters:
      font - hb_font_t to work upon
      Since:
      0.9.28
    • otLayoutCollectFeatures

      public static void otLayoutCollectFeatures(Face face, Tag tableTag, @Nullable Tag @Nullable [] scripts, @Nullable Tag @Nullable [] languages, @Nullable Tag @Nullable [] features, Set featureIndexes)
      Fetches a list of all feature indexes in the specified face's GSUB table or GPOS table, underneath the specified scripts, languages, and features. If no list of scripts is provided, all scripts will be queried. If no list of languages is provided, all languages will be queried. If no list of features is provided, all features will be queried.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scripts - The array of scripts to collect features for, terminated by HB_TAG_NONE
      languages - The array of languages to collect features for, terminated by HB_TAG_NONE
      features - The array of features to collect, terminated by HB_TAG_NONE
      featureIndexes - The set of feature indexes found for the query
      Since:
      1.8.5
    • otLayoutCollectFeaturesMap

      public static void otLayoutCollectFeaturesMap(Face face, Tag tableTag, int scriptIndex, int languageIndex, Map featureMap)
      Fetches the mapping from feature tags to feature indexes for the specified script and language.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageIndex - The index of the requested language tag
      featureMap - The map of feature tag to feature index.
      Since:
      8.1.0
    • otLayoutCollectLookups

      public static void otLayoutCollectLookups(Face face, Tag tableTag, @Nullable Tag @Nullable [] scripts, @Nullable Tag @Nullable [] languages, @Nullable Tag @Nullable [] features, Set lookupIndexes)
      Fetches a list of all feature-lookup indexes in the specified face's GSUB table or GPOS table, underneath the specified scripts, languages, and features. If no list of scripts is provided, all scripts will be queried. If no list of languages is provided, all languages will be queried. If no list of features is provided, all features will be queried.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scripts - The array of scripts to collect lookups for, terminated by HB_TAG_NONE
      languages - The array of languages to collect lookups for, terminated by HB_TAG_NONE
      features - The array of features to collect lookups for, terminated by HB_TAG_NONE
      lookupIndexes - The array of lookup indexes found for the query
      Since:
      0.9.8
    • otLayoutFeatureGetCharacters

      public static int otLayoutFeatureGetCharacters(Face face, Tag tableTag, int featureIndex, int startOffset, @Nullable Out<Codepoint[]> characters)
      Fetches a list of the characters defined as having a variant under the specified "Character Variant" ("cvXX") feature tag.
      Parameters:
      face - hb_face_t to work upon
      tableTag - table tag to query, "GSUB" or "GPOS".
      featureIndex - index of feature to query.
      startOffset - offset of the first character to retrieve
      characters - A buffer pointer. The Unicode codepoints of the characters for which this feature provides glyph variants.
      Returns:
      Number of total sample characters in the cvXX feature.
      Since:
      2.0.0
    • otLayoutFeatureGetLookups

      public static int otLayoutFeatureGetLookups(Face face, Tag tableTag, int featureIndex, int startOffset, @Nullable Out<int[]> lookupIndexes)
      Fetches a list of all lookups enumerated for the specified feature, in the specified face's GSUB table or GPOS table. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      featureIndex - The index of the requested feature
      startOffset - offset of the first lookup to retrieve
      lookupIndexes - The array of lookup indexes found for the query
      Returns:
      Total number of lookups.
      Since:
      0.9.7
    • otLayoutFeatureGetNameIds

      public static Bool otLayoutFeatureGetNameIds(Face face, Tag tableTag, int featureIndex, @Nullable OtNameId labelId, @Nullable OtNameId tooltipId, @Nullable OtNameId sampleId, @Nullable Out<Integer> numNamedParameters, @Nullable OtNameId firstParamId)
      Fetches name indices from feature parameters for "Stylistic Set" ('ssXX') or "Character Variant" ('cvXX') features.
      Parameters:
      face - hb_face_t to work upon
      tableTag - table tag to query, "GSUB" or "GPOS".
      featureIndex - index of feature to query.
      labelId - The ‘name’ table name ID that specifies a string for a user-interface label for this feature.
      tooltipId - The ‘name’ table name ID that specifies a string that an application can use for tooltip text for this feature.
      sampleId - The ‘name’ table name ID that specifies sample text that illustrates the effect of this feature.
      numNamedParameters - Number of named parameters.
      firstParamId - The first ‘name’ table name ID used to specify strings for user-interface labels for the feature parameters. (Must be zero if numParameters is zero.)
      Returns:
      true if data found, false otherwise
      Since:
      2.0.0
    • otLayoutFeatureWithVariationsGetLookups

      public static int otLayoutFeatureWithVariationsGetLookups(Face face, Tag tableTag, int featureIndex, int variationsIndex, int startOffset, @Nullable Out<int[]> lookupIndexes)
      Fetches a list of all lookups enumerated for the specified feature, in the specified face's GSUB table or GPOS table, enabled at the specified variations index. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      featureIndex - The index of the feature to query
      variationsIndex - The index of the feature variation to query
      startOffset - offset of the first lookup to retrieve
      lookupIndexes - The array of lookups found for the query
      Returns:
      Total number of lookups.
      Since:
      1.4.0
    • otLayoutGetAttachPoints

      public static int otLayoutGetAttachPoints(Face face, Codepoint glyph, int startOffset, @Nullable Out<int[]> pointArray)

      Fetches a list of all attachment points for the specified glyph in the GDEF table of the face. The list returned will begin at the offset provided.

      Useful if the client program wishes to cache the list.

      Parameters:
      face - The hb_face_t to work on
      glyph - The hb_codepoint_t code point to query
      startOffset - offset of the first attachment point to retrieve
      pointArray - The array of attachment points found for the query
      Returns:
      Total number of attachment points for glyph.
    • otLayoutGetBaseline

      public static Bool otLayoutGetBaseline(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Tag scriptTag, Tag languageTag, @Nullable Position coord)
      Fetches a baseline value from the face.
      Parameters:
      font - a font
      baselineTag - a baseline tag
      direction - text direction.
      scriptTag - script tag.
      languageTag - language tag, currently unused.
      coord - baseline value if found.
      Returns:
      true if found baseline value in the font.
      Since:
      2.6.0
    • otLayoutGetBaseline2

      public static Bool otLayoutGetBaseline2(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Script script, @Nullable Language language, @Nullable Position coord)

      Fetches a baseline value from the face.

      This function is like hb_ot_layout_get_baseline() but takes hb_script_t and hb_language_t instead of OpenType hb_tag_t.

      Parameters:
      font - a font
      baselineTag - a baseline tag
      direction - text direction.
      script - script.
      language - language, currently unused.
      coord - baseline value if found.
      Returns:
      true if found baseline value in the font.
      Since:
      8.0.0
    • otLayoutGetBaselineWithFallback

      public static void otLayoutGetBaselineWithFallback(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Tag scriptTag, Tag languageTag, Position coord)
      Fetches a baseline value from the face, and synthesizes it if the font does not have it.
      Parameters:
      font - a font
      baselineTag - a baseline tag
      direction - text direction.
      scriptTag - script tag.
      languageTag - language tag, currently unused.
      coord - baseline value if found.
      Since:
      4.0.0
    • otLayoutGetBaselineWithFallback2

      public static void otLayoutGetBaselineWithFallback2(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Script script, @Nullable Language language, Position coord)

      Fetches a baseline value from the face, and synthesizes it if the font does not have it.

      This function is like hb_ot_layout_get_baseline_with_fallback() but takes hb_script_t and hb_language_t instead of OpenType hb_tag_t.

      Parameters:
      font - a font
      baselineTag - a baseline tag
      direction - text direction.
      script - script.
      language - language, currently unused.
      coord - baseline value if found.
      Since:
      8.0.0
    • otLayoutGetFontExtents

      public static Bool otLayoutGetFontExtents(Font font, Direction direction, Tag scriptTag, Tag languageTag, @Nullable FontExtents extents)

      Fetches script/language-specific font extents. These values are looked up in the BASE table's MinMax records.

      If no such extents are found, the default extents for the font are fetched. As such, the return value of this function can for the most part be ignored. Note that the per-script/language extents do not have a line-gap value, and the line-gap is set to zero in that case.

      Parameters:
      font - a font
      direction - text direction.
      scriptTag - script tag.
      languageTag - language tag.
      extents - font extents if found.
      Returns:
      true if found script/language-specific font extents.
      Since:
      8.0.0
    • otLayoutGetFontExtents2

      public static Bool otLayoutGetFontExtents2(Font font, Direction direction, Script script, @Nullable Language language, @Nullable FontExtents extents)

      Fetches script/language-specific font extents. These values are looked up in the BASE table's MinMax records.

      If no such extents are found, the default extents for the font are fetched. As such, the return value of this function can for the most part be ignored. Note that the per-script/language extents do not have a line-gap value, and the line-gap is set to zero in that case.

      This function is like hb_ot_layout_get_font_extents() but takes hb_script_t and hb_language_t instead of OpenType hb_tag_t.

      Parameters:
      font - a font
      direction - text direction.
      script - script.
      language - language.
      extents - font extents if found.
      Returns:
      true if found script/language-specific font extents.
      Since:
      8.0.0
    • otLayoutGetGlyphClass

      public static OtLayoutGlyphClass otLayoutGetGlyphClass(Face face, Codepoint glyph)
      Fetches the GDEF class of the requested glyph in the specified face.
      Parameters:
      face - The hb_face_t to work on
      glyph - The hb_codepoint_t code point to query
      Returns:
      The hb_ot_layout_glyph_class_t glyph class of the given code point in the GDEF table of the face.
      Since:
      0.9.7
    • otLayoutGetGlyphsInClass

      public static void otLayoutGetGlyphsInClass(Face face, OtLayoutGlyphClass klass, Set glyphs)
      Retrieves the set of all glyphs from the face that belong to the requested glyph class in the face's GDEF table.
      Parameters:
      face - The hb_face_t to work on
      klass - The hb_ot_layout_glyph_class_t GDEF class to retrieve
      glyphs - The hb_set_t set of all glyphs belonging to the requested class.
      Since:
      0.9.7
    • otLayoutGetHorizontalBaselineTagForScript

      public static OtLayoutBaselineTag otLayoutGetHorizontalBaselineTagForScript(Script script)
      Fetches the dominant horizontal baseline tag used by script.
      Parameters:
      script - a script tag.
      Returns:
      dominant baseline tag for the script.
      Since:
      4.0.0
    • otLayoutGetLigatureCarets

      public static int otLayoutGetLigatureCarets(Font font, Direction direction, Codepoint glyph, int startOffset, @Nullable Out<Position[]> caretArray)

      Fetches a list of the caret positions defined for a ligature glyph in the GDEF table of the font. The list returned will begin at the offset provided.

      Note that a ligature that is formed from n characters will have n-1 caret positions. The first character is not represented in the array, since its caret position is the glyph position.

      The positions returned by this function are 'unshaped', and will have to be fixed up for kerning that may be applied to the ligature glyph.

      Parameters:
      font - The hb_font_t to work on
      direction - The hb_direction_t text direction to use
      glyph - The hb_codepoint_t code point to query
      startOffset - offset of the first caret position to retrieve
      caretArray - The array of caret positions found for the query
      Returns:
      Total number of ligature caret positions for glyph.
    • otLayoutGetSizeParams

      public static Bool otLayoutGetSizeParams(Face face, Out<Integer> designSize, Out<Integer> subfamilyId, OtNameId subfamilyNameId, Out<Integer> rangeStart, Out<Integer> rangeEnd)

      Fetches optical-size feature data (i.e., the size feature from GPOS). Note that the subfamily_id and the subfamily name string (accessible via the subfamily_name_id) as used here are defined as pertaining only to fonts within a font family that differ specifically in their respective size ranges; other ways to differentiate fonts within a subfamily are not covered by the size feature.

      For more information on this distinction, see the size feature documentation.

      Parameters:
      face - hb_face_t to work upon
      designSize - The design size of the face
      subfamilyId - The identifier of the face within the font subfamily
      subfamilyNameId - The ‘name’ table name ID of the face within the font subfamily
      rangeStart - The minimum size of the recommended size range for the face
      rangeEnd - The maximum size of the recommended size range for the face
      Returns:
      true if data found, false otherwise
      Since:
      0.9.10
    • otLayoutHasGlyphClasses

      public static Bool otLayoutHasGlyphClasses(Face face)
      Tests whether a face has any glyph classes defined in its GDEF table.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
    • otLayoutHasPositioning

      public static Bool otLayoutHasPositioning(Face face)
      Tests whether the specified face includes any GPOS positioning.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if the face has GPOS data, false otherwise
    • otLayoutHasSubstitution

      public static Bool otLayoutHasSubstitution(Face face)
      Tests whether the specified face includes any GSUB substitutions.
      Parameters:
      face - hb_face_t to work upon
      Returns:
      true if data found, false otherwise
      Since:
      0.6.0
    • otLayoutLanguageFindFeature

      public static Bool otLayoutLanguageFindFeature(Face face, Tag tableTag, int scriptIndex, int languageIndex, Tag featureTag, Out<Integer> featureIndex)
      Fetches the index of a given feature tag in the specified face's GSUB table or GPOS table, underneath the specified script and language.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageIndex - The index of the requested language tag
      featureTag - hb_tag_t of the feature tag requested
      featureIndex - The index of the requested feature
      Returns:
      true if the feature is found, false otherwise
      Since:
      0.6.0
    • otLayoutLanguageGetFeatureIndexes

      public static int otLayoutLanguageGetFeatureIndexes(Face face, Tag tableTag, int scriptIndex, int languageIndex, int startOffset, @Nullable Out<int[]> featureIndexes)
      Fetches a list of all features in the specified face's GSUB table or GPOS table, underneath the specified script and language. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageIndex - The index of the requested language tag
      startOffset - offset of the first feature tag to retrieve
      featureIndexes - The array of feature indexes found for the query
      Returns:
      Total number of features.
      Since:
      0.6.0
    • otLayoutLanguageGetFeatureTags

      public static int otLayoutLanguageGetFeatureTags(Face face, Tag tableTag, int scriptIndex, int languageIndex, int startOffset, @Nullable Out<Tag[]> featureTags)
      Fetches a list of all features in the specified face's GSUB table or GPOS table, underneath the specified script and language. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageIndex - The index of the requested language tag
      startOffset - offset of the first feature tag to retrieve
      featureTags - The array of hb_tag_t feature tags found for the query
      Returns:
      Total number of feature tags.
      Since:
      0.6.0
    • otLayoutLanguageGetRequiredFeature

      public static Bool otLayoutLanguageGetRequiredFeature(Face face, Tag tableTag, int scriptIndex, int languageIndex, Out<Integer> featureIndex, Tag featureTag)
      Fetches the tag of a requested feature index in the given face's GSUB or GPOS table, underneath the specified script and language.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageIndex - The index of the requested language tag
      featureIndex - The index of the requested feature
      featureTag - The hb_tag_t of the requested feature
      Returns:
      true if the feature is found, false otherwise
      Since:
      0.9.30
    • otLayoutLanguageGetRequiredFeatureIndex

      public static Bool otLayoutLanguageGetRequiredFeatureIndex(Face face, Tag tableTag, int scriptIndex, int languageIndex, Out<Integer> featureIndex)
      Fetches the index of a requested feature in the given face's GSUB or GPOS table, underneath the specified script and language.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageIndex - The index of the requested language tag
      featureIndex - The index of the requested feature
      Returns:
      true if the feature is found, false otherwise
      Since:
      0.6.0
    • otLayoutLookupCollectGlyphs

      public static void otLayoutLookupCollectGlyphs(Face face, Tag tableTag, int lookupIndex, @Nullable Set glyphsBefore, @Nullable Set glyphsInput, @Nullable Set glyphsAfter, @Nullable Set glyphsOutput)
      Fetches a list of all glyphs affected by the specified lookup in the specified face's GSUB table or GPOS table.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      lookupIndex - The index of the feature lookup to query
      glyphsBefore - Array of glyphs preceding the substitution range
      glyphsInput - Array of input glyphs that would be substituted by the lookup
      glyphsAfter - Array of glyphs following the substitution range
      glyphsOutput - Array of glyphs that would be the substituted output of the lookup
      Since:
      0.9.7
    • otLayoutLookupGetGlyphAlternates

      public static int otLayoutLookupGetGlyphAlternates(Face face, int lookupIndex, Codepoint glyph, int startOffset, @Nullable Out<Codepoint[]> alternateGlyphs)
      Fetches alternates of a glyph from a given GSUB lookup index. Note that for one-to-one GSUB glyph substitutions, this function fetches the substituted glyph.
      Parameters:
      face - a face.
      lookupIndex - index of the feature lookup to query.
      glyph - a glyph id.
      startOffset - starting offset.
      alternateGlyphs - A glyphs buffer. Alternate glyphs associated with the glyph id.
      Returns:
      Total number of alternates found in the specific lookup index for the given glyph id.
      Since:
      2.6.8
    • otLayoutLookupGetOpticalBound

      public static Position otLayoutLookupGetOpticalBound(Font font, int lookupIndex, Direction direction, Codepoint glyph)
      Fetches the optical bound of a glyph positioned at the margin of text. The direction identifies which edge of the glyph to query.
      Parameters:
      font - a font.
      lookupIndex - index of the feature lookup to query.
      direction - edge of the glyph to query.
      glyph - a glyph id.
      Returns:
      Adjustment value. Negative values mean the glyph will stick out of the margin.
      Since:
      5.3.0
    • otLayoutLookupSubstituteClosure

      public static void otLayoutLookupSubstituteClosure(Face face, int lookupIndex, Set glyphs)
      Compute the transitive closure of glyphs needed for a specified lookup.
      Parameters:
      face - hb_face_t to work upon
      lookupIndex - index of the feature lookup to query
      glyphs - Array of glyphs comprising the transitive closure of the lookup
      Since:
      0.9.7
    • otLayoutLookupWouldSubstitute

      public static Bool otLayoutLookupWouldSubstitute(Face face, int lookupIndex, MemorySegment glyphs, int glyphsLength, Bool zeroContext)
      Tests whether a specified lookup in the specified face would trigger a substitution on the given glyph sequence.
      Parameters:
      face - hb_face_t to work upon
      lookupIndex - The index of the lookup to query
      glyphs - The sequence of glyphs to query for substitution
      glyphsLength - The length of the glyph sequence
      zeroContext - hb_bool_t indicating whether pre-/post-context are disallowed in substitutions
      Returns:
      true if a substitution would be triggered, false otherwise
      Since:
      0.9.7
    • otLayoutLookupsSubstituteClosure

      public static void otLayoutLookupsSubstituteClosure(Face face, Set lookups, Set glyphs)
      Compute the transitive closure of glyphs needed for all of the provided lookups.
      Parameters:
      face - hb_face_t to work upon
      lookups - The set of lookups to query
      glyphs - Array of glyphs comprising the transitive closure of the lookups
      Since:
      1.8.1
    • otLayoutScriptFindLanguage

      @Deprecated public static Bool otLayoutScriptFindLanguage(Face face, Tag tableTag, int scriptIndex, Tag languageTag, MemorySegment languageIndex)
      Deprecated.
      Fetches the index of a given language tag in the specified face's GSUB table or GPOS table, underneath the specified script tag.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageTag - The hb_tag_t of the requested language
      languageIndex - The index of the requested language
      Returns:
      true if the language tag is found, false otherwise
      Since:
      0.6.0
    • otLayoutScriptGetLanguageTags

      public static int otLayoutScriptGetLanguageTags(Face face, Tag tableTag, int scriptIndex, int startOffset, @Nullable Out<Tag[]> languageTags)
      Fetches a list of language tags in the given face's GSUB or GPOS table, underneath the specified script index. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      startOffset - offset of the first language tag to retrieve
      languageTags - Array of language tags found in the table
      Returns:
      Total number of language tags.
      Since:
      0.6.0
    • otLayoutScriptSelectLanguage

      public static Bool otLayoutScriptSelectLanguage(Face face, Tag tableTag, int scriptIndex, int languageCount, MemorySegment languageTags, Out<Integer> languageIndex)

      Fetches the index of the first language tag fom languageTags that is present in the specified face's GSUB or GPOS table, underneath the specified script index.

      If none of the given language tags is found, false is returned and languageIndex is set to the default language index.

      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageCount - The number of languages in the specified script
      languageTags - The array of language tags
      languageIndex - The index of the requested language
      Returns:
      true if one of the given language tags is found, false otherwise
      Since:
      2.0.0
    • otLayoutScriptSelectLanguage2

      public static Bool otLayoutScriptSelectLanguage2(Face face, Tag tableTag, int scriptIndex, int languageCount, MemorySegment languageTags, Out<Integer> languageIndex, Tag chosenLanguage)

      Fetches the index of the first language tag fom languageTags that is present in the specified face's GSUB or GPOS table, underneath the specified script index.

      If none of the given language tags is found, false is returned and languageIndex is set to HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX and chosenLanguage is set to HB_TAG_NONE.

      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptIndex - The index of the requested script tag
      languageCount - The number of languages in the specified script
      languageTags - The array of language tags
      languageIndex - The index of the chosen language
      chosenLanguage - hb_tag_t of the chosen language
      Returns:
      true if one of the given language tags is found, false otherwise
      Since:
      7.0.0
    • otLayoutTableChooseScript

      public static Bool otLayoutTableChooseScript(Face face, Tag tableTag, MemorySegment scriptTags, Out<Integer> scriptIndex, Tag chosenScript)
      Deprecated since 2.0.0
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptTags - Array of hb_tag_t script tags
      scriptIndex - The index of the chosen script
      chosenScript - hb_tag_t of the chosen script
    • otLayoutTableFindFeatureVariations

      public static Bool otLayoutTableFindFeatureVariations(Face face, Tag tableTag, MemorySegment coords, int numCoords, Out<Integer> variationsIndex)
      Fetches a list of feature variations in the specified face's GSUB table or GPOS table, at the specified variation coordinates.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      coords - The variation coordinates to query
      numCoords - The number of variation coordinates
      variationsIndex - The array of feature variations found for the query
      Returns:
      true if feature variations were found, false otherwise.
      Since:
      1.4.0
    • otLayoutTableFindScript

      public static Bool otLayoutTableFindScript(Face face, Tag tableTag, Tag scriptTag, Out<Integer> scriptIndex)
      Fetches the index if a given script tag in the specified face's GSUB table or GPOS table.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptTag - hb_tag_t of the script tag requested
      scriptIndex - The index of the requested script tag
      Returns:
      true if the script is found, false otherwise
    • otLayoutTableGetFeatureTags

      public static int otLayoutTableGetFeatureTags(Face face, Tag tableTag, int startOffset, @Nullable Out<Tag[]> featureTags)
      Fetches a list of all feature tags in the given face's GSUB or GPOS table. Note that there might be duplicate feature tags, belonging to different script/language-system pairs of the table.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      startOffset - offset of the first feature tag to retrieve
      featureTags - Array of feature tags found in the table
      Returns:
      Total number of feature tags.
      Since:
      0.6.0
    • otLayoutTableGetLookupCount

      public static int otLayoutTableGetLookupCount(Face face, Tag tableTag)
      Fetches the total number of lookups enumerated in the specified face's GSUB table or GPOS table.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      Returns:
      Total number of lookups.
      Since:
      0.9.22
    • otLayoutTableGetScriptTags

      public static int otLayoutTableGetScriptTags(Face face, Tag tableTag, int startOffset, @Nullable Out<Tag[]> scriptTags)
      Fetches a list of all scripts enumerated in the specified face's GSUB table or GPOS table. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      startOffset - offset of the first script tag to retrieve
      scriptTags - The array of hb_tag_t script tags found for the query
      Returns:
      Total number of script tags.
    • otLayoutTableSelectScript

      public static Bool otLayoutTableSelectScript(Face face, Tag tableTag, int scriptCount, MemorySegment scriptTags, @Nullable Out<Integer> scriptIndex, @Nullable Tag chosenScript)

      Selects an OpenType script for tableTag from the scriptTags array.

      If the table does not have any of the requested scripts, then DFLT, dflt, and latn tags are tried in that order. If the table still does not have any of these scripts, scriptIndex is set to HB_OT_LAYOUT_NO_SCRIPT_INDEX and chosenScript is set to HB_TAG_NONE.

      Parameters:
      face - hb_face_t to work upon
      tableTag - HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
      scriptCount - Number of script tags in the array
      scriptTags - Array of hb_tag_t script tags
      scriptIndex - The index of the requested script
      chosenScript - hb_tag_t of the requested script
      Returns:
      true if one of the requested scripts is selected, false if a fallback script is selected or if no scripts are selected.
      Since:
      2.0.0
    • otMathGetConstant

      public static Position otMathGetConstant(Font font, OtMathConstant constant)

      Fetches the specified math constant. For most constants, the value returned is an hb_position_t.

      However, if the requested constant is HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN, HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN or HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT, then the return value is an integer between 0 and 100 representing that percentage.

      Parameters:
      font - hb_font_t to work upon
      constant - hb_ot_math_constant_t the constant to retrieve
      Returns:
      the requested constant or zero
      Since:
      1.3.3
    • otMathGetGlyphAssembly

      public static int otMathGetGlyphAssembly(Font font, Codepoint glyph, Direction direction, int startOffset, @Nullable Out<OtMathGlyphPart[]> parts, Position italicsCorrection)

      Fetches the GlyphAssembly for the specified font, glyph index, and direction. Returned are a list of hb_ot_math_glyph_part_t glyph parts that can be used to draw the glyph and an italics-correction value (if one is defined in the font).

      The direction parameter is only used to select between horizontal or vertical directions for the construction. Even though all hb_direction_t values are accepted, only the result of HB_DIRECTION_IS_HORIZONTAL is considered.

      Parameters:
      font - hb_font_t to work upon
      glyph - The index of the glyph to stretch
      direction - direction of the stretching (horizontal or vertical)
      startOffset - offset of the first glyph part to retrieve
      parts - the glyph parts returned
      italicsCorrection - italics correction of the glyph assembly
      Returns:
      the total number of parts in the glyph assembly
      Since:
      1.3.3
    • otMathGetGlyphItalicsCorrection

      public static Position otMathGetGlyphItalicsCorrection(Font font, Codepoint glyph)
      Fetches an italics-correction value (if one exists) for the specified glyph index.
      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph index from which to retrieve the value
      Returns:
      the italics correction of the glyph or zero
      Since:
      1.3.3
    • otMathGetGlyphKerning

      public static Position otMathGetGlyphKerning(Font font, Codepoint glyph, OtMathKern kern, Position correctionHeight)

      Fetches the math kerning (cut-ins) value for the specified font, glyph index, and kern.

      If the MathKern table is found, the function examines it to find a height value that is greater or equal to correctionHeight. If such a height value is found, corresponding kerning value from the table is returned. If no such height value is found, the last kerning value is returned.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph index from which to retrieve the value
      kern - The hb_ot_math_kern_t from which to retrieve the value
      correctionHeight - the correction height to use to determine the kerning.
      Returns:
      requested kerning value or zero
      Since:
      1.3.3
    • otMathGetGlyphKernings

      public static int otMathGetGlyphKernings(Font font, Codepoint glyph, OtMathKern kern, int startOffset, @Nullable Out<OtMathKernEntry[]> kernEntries)

      Fetches the raw MathKern (cut-in) data for the specified font, glyph index, and kern. The corresponding list of kern values and correction heights is returned as a list of hb_ot_math_kern_entry_t structs.

      See also hb_ot_math_get_glyph_kerning, which handles selecting the appropriate kern value for a given correction height.

      For a glyph with n defined kern values (where n > 0), there are only n−1 defined correction heights, as each correction height defines a boundary past which the next kern value should be selected. Therefore, only the hb_ot_math_kern_entry_t.kern_value of the uppermost hb_ot_math_kern_entry_t actually comes from the font; its corresponding hb_ot_math_kern_entry_t.max_correction_height is always set to INT32_MAX.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph index from which to retrieve the kernings
      kern - The hb_ot_math_kern_t from which to retrieve the kernings
      startOffset - offset of the first kern entry to retrieve
      kernEntries - array of kern entries returned
      Returns:
      the total number of kern values available or zero
      Since:
      3.4.0
    • otMathGetGlyphTopAccentAttachment

      public static Position otMathGetGlyphTopAccentAttachment(Font font, Codepoint glyph)

      Fetches a top-accent-attachment value (if one exists) for the specified glyph index.

      For any glyph that does not have a top-accent-attachment value - that is, a glyph not covered by the MathTopAccentAttachment table (or, when font has no MathTopAccentAttachment table or no MATH table, any glyph) - the function synthesizes a value, returning the position at one-half the glyph's advance width.

      Parameters:
      font - hb_font_t to work upon
      glyph - The glyph index from which to retrieve the value
      Returns:
      the top accent attachment of the glyph or 0.5 * the advance width of glyph
      Since:
      1.3.3
    • otMathGetGlyphVariants

      public static int otMathGetGlyphVariants(Font font, Codepoint glyph, Direction direction, int startOffset, @Nullable Out<OtMathGlyphVariant[]> variants)

      Fetches the MathGlyphConstruction for the specified font, glyph index, and direction. The corresponding list of size variants is returned as a list of hb_ot_math_glyph_variant_t structs.

      The direction parameter is only used to select between horizontal or vertical directions for the construction. Even though all hb_direction_t values are accepted, only the result of HB_DIRECTION_IS_HORIZONTAL is considered.

      Parameters:
      font - hb_font_t to work upon
      glyph - The index of the glyph to stretch
      direction - The direction of the stretching (horizontal or vertical)
      startOffset - offset of the first variant to retrieve
      variants - array of variants returned
      Returns:
      the total number of size variants available or zero
      Since:
      1.3.3
    • otMathGetMinConnectorOverlap

      public static Position otMathGetMinConnectorOverlap(Font font, Direction direction)

      Fetches the MathVariants table for the specified font and returns the minimum overlap of connecting glyphs that are required to draw a glyph assembly in the specified direction.

      The direction parameter is only used to select between horizontal or vertical directions for the construction. Even though all hb_direction_t values are accepted, only the result of HB_DIRECTION_IS_HORIZONTAL is considered.

      Parameters:
      font - hb_font_t to work upon
      direction - direction of the stretching (horizontal or vertical)
      Returns:
      requested minimum connector overlap or zero
      Since:
      1.3.3
    • otMathHasData

      public static Bool otMathHasData(Face face)
      Tests whether a face has a MATH table.
      Parameters:
      face - hb_face_t to test
      Returns:
      true if the table is found, false otherwise
      Since:
      1.3.3
    • otMathIsGlyphExtendedShape

      public static Bool otMathIsGlyphExtendedShape(Face face, Codepoint glyph)
      Tests whether the given glyph index is an extended shape in the face.
      Parameters:
      face - hb_face_t to work upon
      glyph - The glyph index to test
      Returns:
      true if the glyph is an extended shape, false otherwise
      Since:
      1.3.3
    • otMetaGetEntryTags

      public static int otMetaGetEntryTags(Face face, int startOffset, @Nullable Out<OtMetaTag[]> entries)
      Fetches all available feature types.
      Parameters:
      face - a face object
      startOffset - iteration's start offset
      entries - entries tags buffer
      Returns:
      Number of all available feature types.
      Since:
      2.6.0
    • otMetaReferenceEntry

      public static Blob otMetaReferenceEntry(Face face, OtMetaTag metaTag)
      It fetches metadata entry of a given tag from a font.
      Parameters:
      face - a hb_face_t object.
      metaTag - tag of metadata you like to have.
      Returns:
      A blob containing the blob.
      Since:
      2.6.0
    • otMetricsGetPosition

      public static Bool otMetricsGetPosition(Font font, OtMetricsTag metricsTag, @Nullable Position position)
      Fetches metrics value corresponding to metricsTag from font.
      Parameters:
      font - an hb_font_t object.
      metricsTag - tag of metrics value you like to fetch.
      position - result of metrics value from the font.
      Returns:
      Whether found the requested metrics in the font.
      Since:
      2.6.0
    • otMetricsGetPositionWithFallback

      public static void otMetricsGetPositionWithFallback(Font font, OtMetricsTag metricsTag, @Nullable Position position)
      Fetches metrics value corresponding to metricsTag from font, and synthesizes a value if it the value is missing in the font.
      Parameters:
      font - an hb_font_t object.
      metricsTag - tag of metrics value you like to fetch.
      position - result of metrics value from the font.
      Since:
      4.0.0
    • otMetricsGetVariation

      public static float otMetricsGetVariation(Font font, OtMetricsTag metricsTag)
      Fetches metrics value corresponding to metricsTag from font with the current font variation settings applied.
      Parameters:
      font - an hb_font_t object.
      metricsTag - tag of metrics value you like to fetch.
      Returns:
      The requested metric value.
      Since:
      2.6.0
    • otMetricsGetXVariation

      public static Position otMetricsGetXVariation(Font font, OtMetricsTag metricsTag)
      Fetches horizontal metrics value corresponding to metricsTag from font with the current font variation settings applied.
      Parameters:
      font - an hb_font_t object.
      metricsTag - tag of metrics value you like to fetch.
      Returns:
      The requested metric value.
      Since:
      2.6.0
    • otMetricsGetYVariation

      public static Position otMetricsGetYVariation(Font font, OtMetricsTag metricsTag)
      Fetches vertical metrics value corresponding to metricsTag from font with the current font variation settings applied.
      Parameters:
      font - an hb_font_t object.
      metricsTag - tag of metrics value you like to fetch.
      Returns:
      The requested metric value.
      Since:
      2.6.0
    • otNameGetUtf16

      public static int otNameGetUtf16(Face face, OtNameId nameId, @Nullable Language language, @Nullable Out<short[]> text)
      Fetches a font name from the OpenType 'name' table. If language is HB_LANGUAGE_INVALID, English ("en") is assumed. Returns string in UTF-16 encoding. A NUL terminator is always written for convenience, and isn't included in the output textSize.
      Parameters:
      face - font face.
      nameId - OpenType name identifier to fetch.
      language - language to fetch the name for.
      text - buffer to write fetched name into.
      Returns:
      full length of the requested string, or 0 if not found.
      Since:
      2.1.0
    • otNameGetUtf32

      public static int otNameGetUtf32(Face face, OtNameId nameId, @Nullable Language language, @Nullable Out<int[]> text)
      Fetches a font name from the OpenType 'name' table. If language is HB_LANGUAGE_INVALID, English ("en") is assumed. Returns string in UTF-32 encoding. A NUL terminator is always written for convenience, and isn't included in the output textSize.
      Parameters:
      face - font face.
      nameId - OpenType name identifier to fetch.
      language - language to fetch the name for.
      text - buffer to write fetched name into.
      Returns:
      full length of the requested string, or 0 if not found.
      Since:
      2.1.0
    • otNameGetUtf8

      public static int otNameGetUtf8(Face face, OtNameId nameId, @Nullable Language language, @Nullable Out<String[]> text)
      Fetches a font name from the OpenType 'name' table. If language is HB_LANGUAGE_INVALID, English ("en") is assumed. Returns string in UTF-8 encoding. A NUL terminator is always written for convenience, and isn't included in the output textSize.
      Parameters:
      face - font face.
      nameId - OpenType name identifier to fetch.
      language - language to fetch the name for.
      text - buffer to write fetched name into.
      Returns:
      full length of the requested string, or 0 if not found.
      Since:
      2.1.0
    • otShapeGlyphsClosure

      public static void otShapeGlyphsClosure(Font font, Buffer buffer, @Nullable Feature @Nullable [] features, Set glyphs)
      Computes the transitive closure of glyphs needed for a specified input buffer under the given font and feature list. The closure is computed as a set, not as a list.
      Parameters:
      font - hb_font_t to work upon
      buffer - The input buffer to compute from
      features - The features enabled on the buffer
      glyphs - The hb_set_t set of glyphs comprising the transitive closure of the query
      Since:
      0.9.2
    • otShapePlanCollectLookups

      public static void otShapePlanCollectLookups(ShapePlan shapePlan, Tag tableTag, Set lookupIndexes)
      Computes the complete set of GSUB or GPOS lookups that are applicable under a given shapePlan.
      Parameters:
      shapePlan - hb_shape_plan_t to query
      tableTag - GSUB or GPOS
      lookupIndexes - The hb_set_t set of lookups returned
      Since:
      0.9.7
    • otShapePlanGetFeatureTags

      public static int otShapePlanGetFeatureTags(ShapePlan shapePlan, int startOffset, @Nullable Out<Tag[]> tags)
      Fetches the list of OpenType feature tags enabled for a shaping plan, if possible.
      Parameters:
      shapePlan - A shaping plan
      startOffset - The index of first feature to retrieve
      tags - The array of enabled feature
      Returns:
      Total number of feature tagss.
      Since:
      10.3.0
    • otTagFromLanguage

      @Deprecated public static Tag otTagFromLanguage(@Nullable Language language)
      Deprecated.
      use hb_ot_tags_from_script_and_language() instead
      Converts an hb_language_t to an hb_tag_t.
      Parameters:
      language - an hb_language_t to convert.
      Since:
      0.6.0
    • otTagToLanguage

      public static @Nullable Language otTagToLanguage(Tag tag)
      Converts a language tag to an hb_language_t.
      Parameters:
      tag - an language tag
      Returns:
      The hb_language_t corresponding to tag.
      Since:
      0.9.2
    • otTagToScript

      public static Script otTagToScript(Tag tag)
      Converts a script tag to an hb_script_t.
      Parameters:
      tag - a script tag
      Returns:
      The hb_script_t corresponding to tag.
    • otTagsFromScript

      @Deprecated public static void otTagsFromScript(Script script, Tag scriptTag1, Tag scriptTag2)
      Deprecated.
      use hb_ot_tags_from_script_and_language() instead
      Converts an hb_script_t to script tags.
      Parameters:
      script - an hb_script_t to convert.
      scriptTag1 - output hb_tag_t.
      scriptTag2 - output hb_tag_t.
      Since:
      0.6.0
    • otTagsToScriptAndLanguage

      public static void otTagsToScriptAndLanguage(Tag scriptTag, Tag languageTag, @Nullable Out<Script> script, @Nullable Language language)
      Converts a script tag and a language tag to an hb_script_t and an hb_language_t.
      Parameters:
      scriptTag - a script tag
      languageTag - a language tag
      script - the hb_script_t corresponding to scriptTag.
      language - the hb_language_t corresponding to scriptTag and languageTag.
      Since:
      2.0.0
    • otVarFindAxis

      @Deprecated public static Bool otVarFindAxis(Face face, Tag axisTag, MemorySegment axisIndex, OtVarAxis axisInfo)
      Deprecated.
      use hb_ot_var_find_axis_info() instead
      Fetches the variation-axis information corresponding to the specified axis tag in the specified face.
      Parameters:
      face - hb_face_t to work upon
      axisTag - The hb_tag_t of the variation axis to query
      axisIndex - The index of the variation axis
      axisInfo - The hb_ot_var_axis_info_t of the axis tag queried
      Since:
      1.4.2
    • otVarFindAxisInfo

      public static Bool otVarFindAxisInfo(Face face, Tag axisTag, OtVarAxisInfo axisInfo)
      Fetches the variation-axis information corresponding to the specified axis tag in the specified face.
      Parameters:
      face - hb_face_t to work upon
      axisTag - The hb_tag_t of the variation axis to query
      axisInfo - The hb_ot_var_axis_info_t of the axis tag queried
      Returns:
      true if data found, false otherwise
      Since:
      2.2.0
    • otVarGetAxes

      @Deprecated public static int otVarGetAxes(Face face, int startOffset, @Nullable Out<OtVarAxis[]> axesArray)
      Deprecated.
      use hb_ot_var_get_axis_infos() instead
      Fetches a list of all variation axes in the specified face. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      startOffset - offset of the first lookup to retrieve
      axesArray - The array of variation axes found
      Since:
      1.4.2
    • otVarGetAxisCount

      public static int otVarGetAxisCount(Face face)
      Fetches the number of OpenType variation axes included in the face.
      Parameters:
      face - The hb_face_t to work on
      Returns:
      the number of variation axes defined
      Since:
      1.4.2
    • otVarGetAxisInfos

      public static int otVarGetAxisInfos(Face face, int startOffset, @Nullable Out<OtVarAxisInfo[]> axesArray)
      Fetches a list of all variation axes in the specified face. The list returned will begin at the offset provided.
      Parameters:
      face - hb_face_t to work upon
      startOffset - offset of the first lookup to retrieve
      axesArray - The array of variation axes found
      Returns:
      the number of variation axes in the face
      Since:
      2.2.0
    • otVarGetNamedInstanceCount

      public static int otVarGetNamedInstanceCount(Face face)
      Fetches the number of named instances included in the face.
      Parameters:
      face - The hb_face_t to work on
      Returns:
      the number of named instances defined
      Since:
      2.2.0
    • otVarHasData

      public static Bool otVarHasData(Face face)
      Tests whether a face includes any OpenType variation data in the fvar table.
      Parameters:
      face - The hb_face_t to work on
      Returns:
      true if data found, false otherwise
      Since:
      1.4.2
    • otVarNamedInstanceGetDesignCoords

      public static int otVarNamedInstanceGetDesignCoords(Face face, int instanceIndex, @Nullable Out<float[]> coords)
      Fetches the design-space coordinates corresponding to the given named instance in the face.
      Parameters:
      face - The hb_face_t to work on
      instanceIndex - The index of the named instance to query
      coords - The array of coordinates found for the query
      Returns:
      the number of variation axes in the face
      Since:
      2.2.0
    • otVarNamedInstanceGetPostscriptNameId

      public static OtNameId otVarNamedInstanceGetPostscriptNameId(Face face, int instanceIndex)
      Fetches the name table Name ID that provides display names for the "PostScript name" defined for the given named instance in the face.
      Parameters:
      face - The hb_face_t to work on
      instanceIndex - The index of the named instance to query
      Returns:
      the Name ID found for the PostScript name
      Since:
      2.2.0
    • otVarNamedInstanceGetSubfamilyNameId

      public static OtNameId otVarNamedInstanceGetSubfamilyNameId(Face face, int instanceIndex)
      Fetches the name table Name ID that provides display names for the "Subfamily name" defined for the given named instance in the face.
      Parameters:
      face - The hb_face_t to work on
      instanceIndex - The index of the named instance to query
      Returns:
      the Name ID found for the Subfamily name
      Since:
      2.2.0
    • otVarNormalizeCoords

      public static void otVarNormalizeCoords(Face face, int coordsLength, MemorySegment designCoords, Out<Integer> normalizedCoords)

      Normalizes the given design-space coordinates. The minimum and maximum values for the axis are mapped to the interval [-1,1], with the default axis value mapped to 0.

      The normalized values have 14 bits of fixed-point sub-integer precision as per OpenType specification.

      Any additional scaling defined in the face's avar table is also applied, as described at https://docs.microsoft.com/en-us/typography/opentype/spec/avar

      Note: coordsLength must be the same as the number of axes in the face, as for example returned by hb_ot_var_get_axis_count(). Otherwise, the behavior is undefined.

      Parameters:
      face - The hb_face_t to work on
      coordsLength - The length of the coordinate array
      designCoords - The design-space coordinates to normalize
      normalizedCoords - The normalized coordinates
      Since:
      1.4.2
    • otVarNormalizeVariations

      public static void otVarNormalizeVariations(Face face, Variation variations, int variationsLength, @Nullable Out<int[]> coords)
      Normalizes all of the coordinates in the given list of variation axes.
      Parameters:
      face - The hb_face_t to work on
      variations - The array of variations to normalize
      variationsLength - The number of variations to normalize
      coords - The array of normalized coordinates
      Since:
      1.4.2
    • paintColor

      public static void paintColor(PaintFuncs funcs, @Nullable MemorySegment paintData, Bool isForeground, Color color)
      Perform a "color" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      isForeground - whether the color is the foreground
      color - The color to use
      Since:
      7.0.0
    • paintColorGlyph

      public static Bool paintColorGlyph(PaintFuncs funcs, @Nullable MemorySegment paintData, Codepoint glyph, Font font)
      Perform a "color-glyph" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      glyph - the glyph ID
      font - the font
      Since:
      8.2.0
    • paintCustomPaletteColor

      public static Bool paintCustomPaletteColor(PaintFuncs funcs, @Nullable MemorySegment paintData, int colorIndex, Color color)
      Gets the custom palette color for colorIndex.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      colorIndex - color index
      color - fetched color
      Returns:
      true if found, false otherwise
      Since:
      7.0.0
    • paintFuncsCreate

      public static PaintFuncs paintFuncsCreate()

      Creates a new hb_paint_funcs_t structure of paint functions.

      The initial reference count of 1 should be released with hb_paint_funcs_destroy() when you are done using the hb_paint_funcs_t. This function never returns NULL. If memory cannot be allocated, a special singleton hb_paint_funcs_t object will be returned.

      Returns:
      the paint-functions structure
      Since:
      7.0.0
    • paintFuncsDestroy

      public static void paintFuncsDestroy(PaintFuncs funcs)

      Decreases the reference count on a paint-functions structure.

      When the reference count reaches zero, the structure is destroyed, freeing all memory.

      Parameters:
      funcs - The paint-functions structure
      Since:
      7.0.0
    • paintFuncsGetEmpty

      public static PaintFuncs paintFuncsGetEmpty()
      Fetches the singleton empty paint-functions structure.
      Returns:
      The empty paint-functions structure
      Since:
      7.0.0
    • paintFuncsGetUserData

      public static @Nullable MemorySegment paintFuncsGetUserData(PaintFuncs funcs, UserDataKey key)
      Fetches the user-data associated with the specified key, attached to the specified paint-functions structure.
      Parameters:
      funcs - The paint-functions structure
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      7.0.0
    • paintFuncsIsImmutable

      public static Bool paintFuncsIsImmutable(PaintFuncs funcs)
      Tests whether a paint-functions structure is immutable.
      Parameters:
      funcs - The paint-functions structure
      Returns:
      true if funcs is immutable, false otherwise
      Since:
      7.0.0
    • paintFuncsMakeImmutable

      public static void paintFuncsMakeImmutable(PaintFuncs funcs)

      Makes a paint-functions structure immutable.

      After this call, all attempts to set one of the callbacks on funcs will fail.

      Parameters:
      funcs - The paint-functions structure
      Since:
      7.0.0
    • paintFuncsReference

      public static PaintFuncs paintFuncsReference(PaintFuncs funcs)

      Increases the reference count on a paint-functions structure.

      This prevents funcs from being destroyed until a matching call to hb_paint_funcs_destroy() is made.

      Parameters:
      funcs - The paint-functions structure
      Returns:
      The paint-functions structure
      Since:
      7.0.0
    • paintFuncsSetColorFunc

      public static void paintFuncsSetColorFunc(PaintFuncs funcs, @Nullable PaintColorFunc func, @Nullable DestroyFunc destroy)
      Sets the paint-color callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The paint-color callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetColorGlyphFunc

      public static void paintFuncsSetColorGlyphFunc(PaintFuncs funcs, @Nullable PaintColorGlyphFunc func, @Nullable DestroyFunc destroy)
      Sets the color-glyph callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The color-glyph callback
      destroy - Function to call when userData is no longer needed
      Since:
      8.2.0
    • paintFuncsSetCustomPaletteColorFunc

      public static void paintFuncsSetCustomPaletteColorFunc(PaintFuncs funcs, @Nullable PaintCustomPaletteColorFunc func, @Nullable DestroyFunc destroy)
      Sets the custom-palette-color callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The custom-palette-color callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetImageFunc

      public static void paintFuncsSetImageFunc(PaintFuncs funcs, @Nullable PaintImageFunc func, @Nullable DestroyFunc destroy)
      Sets the paint-image callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The paint-image callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetLinearGradientFunc

      public static void paintFuncsSetLinearGradientFunc(PaintFuncs funcs, @Nullable PaintLinearGradientFunc func, @Nullable DestroyFunc destroy)
      Sets the linear-gradient callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The linear-gradient callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPopClipFunc

      public static void paintFuncsSetPopClipFunc(PaintFuncs funcs, @Nullable PaintPopClipFunc func, @Nullable DestroyFunc destroy)
      Sets the pop-clip callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The pop-clip callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPopGroupFunc

      public static void paintFuncsSetPopGroupFunc(PaintFuncs funcs, @Nullable PaintPopGroupFunc func, @Nullable DestroyFunc destroy)
      Sets the pop-group callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The pop-group callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPopTransformFunc

      public static void paintFuncsSetPopTransformFunc(PaintFuncs funcs, @Nullable PaintPopTransformFunc func, @Nullable DestroyFunc destroy)
      Sets the pop-transform callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The pop-transform callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPushClipGlyphFunc

      public static void paintFuncsSetPushClipGlyphFunc(PaintFuncs funcs, @Nullable PaintPushClipGlyphFunc func, @Nullable DestroyFunc destroy)
      Sets the push-clip-glyph callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The push-clip-glyph callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPushClipRectangleFunc

      public static void paintFuncsSetPushClipRectangleFunc(PaintFuncs funcs, @Nullable PaintPushClipRectangleFunc func, @Nullable DestroyFunc destroy)
      Sets the push-clip-rect callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The push-clip-rectangle callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPushGroupFunc

      public static void paintFuncsSetPushGroupFunc(PaintFuncs funcs, @Nullable PaintPushGroupFunc func, @Nullable DestroyFunc destroy)
      Sets the push-group callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The push-group callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetPushTransformFunc

      public static void paintFuncsSetPushTransformFunc(PaintFuncs funcs, @Nullable PaintPushTransformFunc func, @Nullable DestroyFunc destroy)
      Sets the push-transform callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The push-transform callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetRadialGradientFunc

      public static void paintFuncsSetRadialGradientFunc(PaintFuncs funcs, @Nullable PaintRadialGradientFunc func, @Nullable DestroyFunc destroy)
      Sets the radial-gradient callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The radial-gradient callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetSweepGradientFunc

      public static void paintFuncsSetSweepGradientFunc(PaintFuncs funcs, @Nullable PaintSweepGradientFunc func, @Nullable DestroyFunc destroy)
      Sets the sweep-gradient callback on the paint functions struct.
      Parameters:
      funcs - A paint functions struct
      func - The sweep-gradient callback
      destroy - Function to call when userData is no longer needed
      Since:
      7.0.0
    • paintFuncsSetUserData

      public static Bool paintFuncsSetUserData(PaintFuncs funcs, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified paint-functions structure.
      Parameters:
      funcs - The paint-functions structure
      key - The user-data key
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      7.0.0
    • paintImage

      public static void paintImage(PaintFuncs funcs, @Nullable MemorySegment paintData, Blob image, int width, int height, Tag format, float slant, @Nullable GlyphExtents extents)
      Perform a "image" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      image - image data
      width - width of the raster image in pixels, or 0
      height - height of the raster image in pixels, or 0
      format - the image format as a tag
      slant - Deprecated. set to 0.0
      extents - the extents of the glyph
      Since:
      7.0.0
    • paintLinearGradient

      public static void paintLinearGradient(PaintFuncs funcs, @Nullable MemorySegment paintData, ColorLine colorLine, float x0, float y0, float x1, float y1, float x2, float y2)
      Perform a "linear-gradient" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      colorLine - Color information for the gradient
      x0 - X coordinate of the first point
      y0 - Y coordinate of the first point
      x1 - X coordinate of the second point
      y1 - Y coordinate of the second point
      x2 - X coordinate of the third point
      y2 - Y coordinate of the third point
      Since:
      7.0.0
    • paintPopClip

      public static void paintPopClip(PaintFuncs funcs, @Nullable MemorySegment paintData)
      Perform a "pop-clip" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      Since:
      7.0.0
    • paintPopGroup

      public static void paintPopGroup(PaintFuncs funcs, @Nullable MemorySegment paintData, PaintCompositeMode mode)
      Perform a "pop-group" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      mode - the compositing mode to use
      Since:
      7.0.0
    • paintPopTransform

      public static void paintPopTransform(PaintFuncs funcs, @Nullable MemorySegment paintData)
      Perform a "pop-transform" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      Since:
      7.0.0
    • paintPushClipGlyph

      public static void paintPushClipGlyph(PaintFuncs funcs, @Nullable MemorySegment paintData, Codepoint glyph, Font font)
      Perform a "push-clip-glyph" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      glyph - the glyph ID
      font - the font
      Since:
      7.0.0
    • paintPushClipRectangle

      public static void paintPushClipRectangle(PaintFuncs funcs, @Nullable MemorySegment paintData, float xmin, float ymin, float xmax, float ymax)
      Perform a "push-clip-rect" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      xmin - min X for the rectangle
      ymin - min Y for the rectangle
      xmax - max X for the rectangle
      ymax - max Y for the rectangle
      Since:
      7.0.0
    • paintPushFontTransform

      public static void paintPushFontTransform(PaintFuncs funcs, @Nullable MemorySegment paintData, Font font)
      Push the transform reflecting the font's scale and slant settings onto the paint functions.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      font - a font
      Since:
      11.0.0
    • paintPushGroup

      public static void paintPushGroup(PaintFuncs funcs, @Nullable MemorySegment paintData)
      Perform a "push-group" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      Since:
      7.0.0
    • paintPushInverseFontTransform

      public static void paintPushInverseFontTransform(PaintFuncs funcs, @Nullable MemorySegment paintData, Font font)
      Push the inverse of the transform reflecting the font's scale and slant settings onto the paint functions.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      font - a font
      Since:
      11.0.0
    • paintPushTransform

      public static void paintPushTransform(PaintFuncs funcs, @Nullable MemorySegment paintData, float xx, float yx, float xy, float yy, float dx, float dy)
      Perform a "push-transform" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      xx - xx component of the transform matrix
      yx - yx component of the transform matrix
      xy - xy component of the transform matrix
      yy - yy component of the transform matrix
      dx - dx component of the transform matrix
      dy - dy component of the transform matrix
      Since:
      7.0.0
    • paintRadialGradient

      public static void paintRadialGradient(PaintFuncs funcs, @Nullable MemorySegment paintData, ColorLine colorLine, float x0, float y0, float r0, float x1, float y1, float r1)
      Perform a "radial-gradient" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      colorLine - Color information for the gradient
      x0 - X coordinate of the first circle's center
      y0 - Y coordinate of the first circle's center
      r0 - radius of the first circle
      x1 - X coordinate of the second circle's center
      y1 - Y coordinate of the second circle's center
      r1 - radius of the second circle
      Since:
      7.0.0
    • paintSweepGradient

      public static void paintSweepGradient(PaintFuncs funcs, @Nullable MemorySegment paintData, ColorLine colorLine, float x0, float y0, float startAngle, float endAngle)
      Perform a "sweep-gradient" paint operation.
      Parameters:
      funcs - paint functions
      paintData - associated data passed by the caller
      colorLine - Color information for the gradient
      x0 - X coordinate of the circle's center
      y0 - Y coordinate of the circle's center
      startAngle - the start angle
      endAngle - the end angle
      Since:
      7.0.0
    • realloc

      public static @Nullable MemorySegment realloc(@Nullable MemorySegment ptr, long size)
      Reallocates the memory pointed to by ptr to size bytes, using the allocator set at compile-time. Typically just realloc().
      Parameters:
      ptr - The pointer to the memory to reallocate.
      size - The new size of the memory.
      Returns:
      A pointer to the reallocated memory.
      Since:
      11.0.0
    • scriptFromIso15924Tag

      public static Script scriptFromIso15924Tag(Tag tag)
      Converts an ISO 15924 script tag to a corresponding hb_script_t.
      Parameters:
      tag - an hb_tag_t representing an ISO 15924 tag.
      Returns:
      An hb_script_t corresponding to the ISO 15924 tag.
      Since:
      0.9.2
    • scriptFromString

      public static Script scriptFromString(@Nullable byte @Nullable [] str)
      Converts a string str representing an ISO 15924 script tag to a corresponding hb_script_t. Shorthand for hb_tag_from_string() then hb_script_from_iso15924_tag().
      Parameters:
      str - a string representing an ISO 15924 tag.
      Returns:
      An hb_script_t corresponding to the ISO 15924 tag.
      Since:
      0.9.2
    • scriptGetHorizontalDirection

      public static Direction scriptGetHorizontalDirection(Script script)

      Fetches the hb_direction_t of a script when it is set horizontally. All right-to-left scripts will return HB_DIRECTION_RTL. All left-to-right scripts will return HB_DIRECTION_LTR.

      Scripts that can be written either right-to-left or left-to-right will return HB_DIRECTION_INVALID.

      Unknown scripts will return HB_DIRECTION_LTR.

      Parameters:
      script - The hb_script_t to query
      Returns:
      The horizontal hb_direction_t of script
      Since:
      0.9.2
    • scriptToIso15924Tag

      public static Tag scriptToIso15924Tag(Script script)
      Converts an hb_script_t to a corresponding ISO 15924 script tag.
      Parameters:
      script - an hb_script_t to convert.
      Returns:
      An hb_tag_t representing an ISO 15924 script tag.
      Since:
      0.9.2
    • segmentPropertiesEqual

      public static Bool segmentPropertiesEqual(SegmentProperties a, SegmentProperties b)
      Checks the equality of two hb_segment_properties_t's.
      Parameters:
      a - first hb_segment_properties_t to compare.
      b - second hb_segment_properties_t to compare.
      Returns:
      true if all properties of a equal those of b, false otherwise.
      Since:
      0.9.7
    • segmentPropertiesHash

      public static int segmentPropertiesHash(SegmentProperties p)
      Creates a hash representing p.
      Parameters:
      p - hb_segment_properties_t to hash.
      Returns:
      A hash of p.
      Since:
      0.9.7
    • segmentPropertiesOverlay

      public static void segmentPropertiesOverlay(SegmentProperties p, SegmentProperties src)

      Fills in missing fields of p from src in a considered manner.

      First, if p does not have direction set, direction is copied from src.

      Next, if p and src have the same direction (which can be unset), if p does not have script set, script is copied from src.

      Finally, if p and src have the same direction and script (which either can be unset), if p does not have language set, language is copied from src.

      Parameters:
      p - hb_segment_properties_t to fill in.
      src - hb_segment_properties_t to fill in from.
      Since:
      3.3.0
    • setAdd

      public static void setAdd(Set set, Codepoint codepoint)
      Adds codepoint to set.
      Parameters:
      set - A set
      codepoint - The element to add to set
      Since:
      0.9.2
    • setAddRange

      public static void setAddRange(Set set, Codepoint first, Codepoint last)
      Adds all of the elements from first to last (inclusive) to set.
      Parameters:
      set - A set
      first - The first element to add to set
      last - The final element to add to set
      Since:
      0.9.7
    • setAddSortedArray

      public static void setAddSortedArray(Set set, @Nullable Codepoint @Nullable [] sortedCodepoints)
      Adds numCodepoints codepoints to a set at once. The codepoints array must be in increasing order, with size at least numCodepoints.
      Parameters:
      set - A set
      sortedCodepoints - Array of codepoints to add
      Since:
      4.1.0
    • setAllocationSuccessful

      public static Bool setAllocationSuccessful(Set set)
      Tests whether memory allocation for a set was successful.
      Parameters:
      set - A set
      Returns:
      true if allocation succeeded, false otherwise
      Since:
      0.9.2
    • setClear

      public static void setClear(Set set)
      Clears out the contents of a set.
      Parameters:
      set - A set
      Since:
      0.9.2
    • setCopy

      public static Set setCopy(Set set)
      Allocate a copy of set.
      Parameters:
      set - A set
      Returns:
      Newly-allocated set.
      Since:
      2.8.2
    • setCreate

      public static Set setCreate()
      Creates a new, initially empty set.
      Returns:
      The new hb_set_t
      Since:
      0.9.2
    • setDel

      public static void setDel(Set set, Codepoint codepoint)
      Removes codepoint from set.
      Parameters:
      set - A set
      codepoint - Removes codepoint from set
      Since:
      0.9.2
    • setDelRange

      public static void setDelRange(Set set, Codepoint first, Codepoint last)

      Removes all of the elements from first to last (inclusive) from set.

      If last is HB_SET_VALUE_INVALID, then all values greater than or equal to first are removed.

      Parameters:
      set - A set
      first - The first element to remove from set
      last - The final element to remove from set
      Since:
      0.9.7
    • setDestroy

      public static void setDestroy(Set set)
      Decreases the reference count on a set. When the reference count reaches zero, the set is destroyed, freeing all memory.
      Parameters:
      set - A set
      Since:
      0.9.2
    • setGetEmpty

      public static Set setGetEmpty()
      Fetches the singleton empty hb_set_t.
      Returns:
      The empty hb_set_t
      Since:
      0.9.2
    • setGetMax

      public static Codepoint setGetMax(Set set)
      Finds the largest element in the set.
      Parameters:
      set - A set
      Returns:
      maximum of set, or HB_SET_VALUE_INVALID if set is empty.
      Since:
      0.9.7
    • setGetMin

      public static Codepoint setGetMin(Set set)
      Finds the smallest element in the set.
      Parameters:
      set - A set
      Returns:
      minimum of set, or HB_SET_VALUE_INVALID if set is empty.
      Since:
      0.9.7
    • setGetPopulation

      public static int setGetPopulation(Set set)
      Returns the number of elements in the set.
      Parameters:
      set - A set
      Returns:
      The population of set
      Since:
      0.9.7
    • setGetUserData

      public static @Nullable MemorySegment setGetUserData(Set set, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified set.
      Parameters:
      set - A set
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.2
    • setHas

      public static Bool setHas(Set set, Codepoint codepoint)
      Tests whether codepoint belongs to set.
      Parameters:
      set - A set
      codepoint - The element to query
      Returns:
      true if codepoint is in set, false otherwise
      Since:
      0.9.2
    • setHash

      public static int setHash(Set set)
      Creates a hash representing set.
      Parameters:
      set - A set
      Returns:
      A hash of set.
      Since:
      4.4.0
    • setIntersect

      public static void setIntersect(Set set, Set other)
      Makes set the intersection of set and other.
      Parameters:
      set - A set
      other - Another set
      Since:
      0.9.2
    • setInvert

      public static void setInvert(Set set)
      Inverts the contents of set.
      Parameters:
      set - A set
      Since:
      3.0.0
    • setIsEmpty

      public static Bool setIsEmpty(Set set)
      Tests whether a set is empty (contains no elements).
      Parameters:
      set - a set.
      Returns:
      true if set is empty
      Since:
      0.9.7
    • setIsEqual

      public static Bool setIsEqual(Set set, Set other)
      Tests whether set and other are equal (contain the same elements).
      Parameters:
      set - A set
      other - Another set
      Returns:
      true if the two sets are equal, false otherwise.
      Since:
      0.9.7
    • setIsInverted

      public static Bool setIsInverted(Set set)
      Returns whether the set is inverted.
      Parameters:
      set - A set
      Returns:
      true if the set is inverted, false otherwise
      Since:
      7.0.0
    • setIsSubset

      public static Bool setIsSubset(Set set, Set largerSet)
      Tests whether set is a subset of largerSet.
      Parameters:
      set - A set
      largerSet - Another set
      Returns:
      true if the set is a subset of (or equal to) largerSet, false otherwise.
      Since:
      1.8.1
    • setNext

      public static Bool setNext(Set set, Codepoint codepoint)

      Fetches the next element in set that is greater than current value of codepoint.

      Set codepoint to HB_SET_VALUE_INVALID to get started.

      Parameters:
      set - A set
      codepoint - Input = Code point to query Output = Code point retrieved
      Returns:
      true if there was a next value, false otherwise
      Since:
      0.9.2
    • setNextMany

      public static int setNextMany(Set set, Codepoint codepoint, @Nullable Codepoint @Nullable [] out)
      Finds the next element in set that is greater than codepoint. Writes out codepoints to out, until either the set runs out of elements, or size codepoints are written, whichever comes first.
      Parameters:
      set - A set
      codepoint - Outputting codepoints starting after this one. Use HB_SET_VALUE_INVALID to get started.
      out - An array of codepoints to write to.
      Returns:
      the number of values written.
      Since:
      4.2.0
    • setNextRange

      public static Bool setNextRange(Set set, Codepoint first, Codepoint last)

      Fetches the next consecutive range of elements in set that are greater than current value of last.

      Set last to HB_SET_VALUE_INVALID to get started.

      Parameters:
      set - A set
      first - The first code point in the range
      last - Input = The current last code point in the range Output = The last code point in the range
      Returns:
      true if there was a next range, false otherwise
      Since:
      0.9.7
    • setPrevious

      public static Bool setPrevious(Set set, Codepoint codepoint)

      Fetches the previous element in set that is lower than current value of codepoint.

      Set codepoint to HB_SET_VALUE_INVALID to get started.

      Parameters:
      set - A set
      codepoint - Input = Code point to query Output = Code point retrieved
      Returns:
      true if there was a previous value, false otherwise
      Since:
      1.8.0
    • setPreviousRange

      public static Bool setPreviousRange(Set set, Codepoint first, Codepoint last)

      Fetches the previous consecutive range of elements in set that are greater than current value of last.

      Set first to HB_SET_VALUE_INVALID to get started.

      Parameters:
      set - A set
      first - Input = The current first code point in the range Output = The first code point in the range
      last - The last code point in the range
      Returns:
      true if there was a previous range, false otherwise
      Since:
      1.8.0
    • setReference

      public static Set setReference(Set set)
      Increases the reference count on a set.
      Parameters:
      set - A set
      Returns:
      The set
      Since:
      0.9.2
    • setSet

      public static void setSet(Set set, Set other)
      Makes the contents of set equal to the contents of other.
      Parameters:
      set - A set
      other - Another set
      Since:
      0.9.2
    • setSetUserData

      public static Bool setSetUserData(Set set, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified set.
      Parameters:
      set - A set
      key - The user-data key to set
      data - A pointer to the user data to set
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • setSubtract

      public static void setSubtract(Set set, Set other)
      Subtracts the contents of other from set.
      Parameters:
      set - A set
      other - Another set
      Since:
      0.9.2
    • setSymmetricDifference

      public static void setSymmetricDifference(Set set, Set other)
      Makes set the symmetric difference of set and other.
      Parameters:
      set - A set
      other - Another set
      Since:
      0.9.2
    • setUnion

      public static void setUnion(Set set, Set other)
      Makes set the union of set and other.
      Parameters:
      set - A set
      other - Another set
      Since:
      0.9.2
    • shape

      public static void shape(Font font, Buffer buffer, @Nullable Feature @Nullable [] features)
      Shapes buffer using font turning its Unicode characters content to positioned glyphs. If features is not NULL, it will be used to control the features applied during shaping. If two features have the same tag but overlapping ranges the value of the feature with the higher index takes precedence.
      Parameters:
      font - an hb_font_t to use for shaping
      buffer - an hb_buffer_t to shape
      features - an array of user specified hb_feature_t or NULL
      Since:
      0.9.2
    • shapeFull

      public static Bool shapeFull(Font font, Buffer buffer, @Nullable Feature @Nullable [] features, @Nullable String @Nullable [] shaperList)
      See hb_shape() for details. If shaperList is not NULL, the specified shapers will be used in the given order, otherwise the default shapers list will be used.
      Parameters:
      font - an hb_font_t to use for shaping
      buffer - an hb_buffer_t to shape
      features - an array of user specified hb_feature_t or NULL
      shaperList - a NULL-terminated array of shapers to use or NULL
      Returns:
      false if all shapers failed, true otherwise
      Since:
      0.9.2
    • shapeListShapers

      public static String[] shapeListShapers()
      Retrieves the list of shapers supported by HarfBuzz.
      Returns:
      a NULL-terminated array of supported shapers constant string. The returned array is owned by HarfBuzz and should not be modified or freed.
      Since:
      0.9.2
    • shapePlanCreate

      public static ShapePlan shapePlanCreate(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @Nullable String @Nullable [] shaperList)
      Constructs a shaping plan for a combination of face, userFeatures, props, and shaperList.
      Parameters:
      face - hb_face_t to use
      props - The hb_segment_properties_t of the segment
      userFeatures - The list of user-selected features
      shaperList - List of shapers to try
      Returns:
      The shaping plan
      Since:
      0.9.7
    • shapePlanCreate2

      public static ShapePlan shapePlanCreate2(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @Nullable int @Nullable [] coords, @Nullable String @Nullable [] shaperList)
      The variable-font version of hb_shape_plan_create. Constructs a shaping plan for a combination of face, userFeatures, props, and shaperList, plus the variation-space coordinates coords.
      Parameters:
      face - hb_face_t to use
      props - The hb_segment_properties_t of the segment
      userFeatures - The list of user-selected features
      coords - The list of variation-space coordinates
      shaperList - List of shapers to try
      Returns:
      The shaping plan
      Since:
      1.4.0
    • shapePlanCreateCached

      public static ShapePlan shapePlanCreateCached(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @Nullable String @Nullable [] shaperList)
      Creates a cached shaping plan suitable for reuse, for a combination of face, userFeatures, props, and shaperList.
      Parameters:
      face - hb_face_t to use
      props - The hb_segment_properties_t of the segment
      userFeatures - The list of user-selected features
      shaperList - List of shapers to try
      Returns:
      The shaping plan
      Since:
      0.9.7
    • shapePlanCreateCached2

      public static ShapePlan shapePlanCreateCached2(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @Nullable int @Nullable [] coords, @Nullable String @Nullable [] shaperList)
      The variable-font version of hb_shape_plan_create_cached. Creates a cached shaping plan suitable for reuse, for a combination of face, userFeatures, props, and shaperList, plus the variation-space coordinates coords.
      Parameters:
      face - hb_face_t to use
      props - The hb_segment_properties_t of the segment
      userFeatures - The list of user-selected features
      coords - The list of variation-space coordinates
      shaperList - List of shapers to try
      Returns:
      The shaping plan
      Since:
      1.4.0
    • shapePlanDestroy

      public static void shapePlanDestroy(ShapePlan shapePlan)
      Decreases the reference count on the given shaping plan. When the reference count reaches zero, the shaping plan is destroyed, freeing all memory.
      Parameters:
      shapePlan - A shaping plan
      Since:
      0.9.7
    • shapePlanExecute

      public static Bool shapePlanExecute(ShapePlan shapePlan, Font font, Buffer buffer, @Nullable Feature @Nullable [] features)
      Executes the given shaping plan on the specified buffer, using the given font and features.
      Parameters:
      shapePlan - A shaping plan
      font - The hb_font_t to use
      buffer - The hb_buffer_t to work upon
      features - Features to enable
      Returns:
      true if success, false otherwise.
      Since:
      0.9.7
    • shapePlanGetEmpty

      public static ShapePlan shapePlanGetEmpty()
      Fetches the singleton empty shaping plan.
      Returns:
      The empty shaping plan
      Since:
      0.9.7
    • shapePlanGetShaper

      public static String shapePlanGetShaper(ShapePlan shapePlan)
      Fetches the shaper from a given shaping plan.
      Parameters:
      shapePlan - A shaping plan
      Returns:
      The shaper
      Since:
      0.9.7
    • shapePlanGetUserData

      public static @Nullable MemorySegment shapePlanGetUserData(ShapePlan shapePlan, UserDataKey key)
      Fetches the user data associated with the specified key, attached to the specified shaping plan.
      Parameters:
      shapePlan - A shaping plan
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.7
    • shapePlanReference

      public static ShapePlan shapePlanReference(ShapePlan shapePlan)
      Increases the reference count on the given shaping plan.
      Parameters:
      shapePlan - A shaping plan
      Returns:
      shapePlan
      Since:
      0.9.7
    • shapePlanSetUserData

      public static Bool shapePlanSetUserData(ShapePlan shapePlan, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the given shaping plan.
      Parameters:
      shapePlan - A shaping plan
      key - The user-data key to set
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise.
      Since:
      0.9.7
    • styleGetValue

      public static float styleGetValue(Font font, StyleTag styleTag)
      Searches variation axes of a hb_font_t object for a specific axis first, if not set, first tries to get default style values in STAT table then tries to polyfill from different tables of the font.
      Parameters:
      font - a hb_font_t object.
      styleTag - a style tag.
      Returns:
      Corresponding axis or default value to a style tag.
      Since:
      3.0.0
    • tagFromString

      public static Tag tagFromString(@Nullable byte @Nullable [] str)
      Converts a string into an hb_tag_t. Valid tags are four characters. Shorter input strings will be padded with spaces. Longer input strings will be truncated.
      Parameters:
      str - String to convert
      Returns:
      The hb_tag_t corresponding to str
      Since:
      0.9.2
    • tagToString

      public static void tagToString(Tag tag, @Nullable Out<byte[]> buf)
      Converts an hb_tag_t to a string and returns it in buf. Strings will be four characters long.
      Parameters:
      tag - hb_tag_t to convert
      buf - Converted string
      Since:
      0.9.5
    • unicodeCombiningClass

      public static UnicodeCombiningClass unicodeCombiningClass(UnicodeFuncs ufuncs, Codepoint unicode)
      Retrieves the Canonical Combining Class (ccc) property of code point unicode.
      Parameters:
      ufuncs - The Unicode-functions structure
      unicode - The code point to query
      Returns:
      The hb_unicode_combining_class_t of unicode
      Since:
      0.9.2
    • unicodeCompose

      public static Bool unicodeCompose(UnicodeFuncs ufuncs, Codepoint a, Codepoint b, Codepoint ab)

      Fetches the composition of a sequence of two Unicode code points.

      Calls the composition function of the specified Unicode-functions structure ufuncs.

      Parameters:
      ufuncs - The Unicode-functions structure
      a - The first Unicode code point to compose
      b - The second Unicode code point to compose
      ab - The composition of a, b
      Returns:
      true if a and b composed, false otherwise
      Since:
      0.9.2
    • unicodeDecompose

      public static Bool unicodeDecompose(UnicodeFuncs ufuncs, Codepoint ab, Codepoint a, Codepoint b)

      Fetches the decomposition of a Unicode code point.

      Calls the decomposition function of the specified Unicode-functions structure ufuncs.

      Parameters:
      ufuncs - The Unicode-functions structure
      ab - Unicode code point to decompose
      a - The first code point of the decomposition of ab
      b - The second code point of the decomposition of ab
      Returns:
      true if ab was decomposed, false otherwise
      Since:
      0.9.2
    • unicodeDecomposeCompatibility

      @Deprecated public static int unicodeDecomposeCompatibility(UnicodeFuncs ufuncs, Codepoint u, Codepoint decomposed)
      Deprecated.
      Fetches the compatibility decomposition of a Unicode code point. Deprecated.
      Parameters:
      ufuncs - The Unicode-functions structure
      u - Code point to decompose
      decomposed - Compatibility decomposition of u
      Returns:
      length of decomposed.
      Since:
      0.9.2
    • unicodeEastasianWidth

      @Deprecated public static int unicodeEastasianWidth(UnicodeFuncs ufuncs, Codepoint unicode)
      Deprecated.
      Don't use. Not used by HarfBuzz.
      Parameters:
      ufuncs - a Unicode-function structure
      unicode - The code point to query
      Since:
      0.9.2
    • unicodeFuncsCreate

      public static UnicodeFuncs unicodeFuncsCreate(@Nullable UnicodeFuncs parent)
      Creates a new hb_unicode_funcs_t structure of Unicode functions.
      Parameters:
      parent - Parent Unicode-functions structure
      Returns:
      The Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsDestroy

      public static void unicodeFuncsDestroy(UnicodeFuncs ufuncs)
      Decreases the reference count on a Unicode-functions structure. When the reference count reaches zero, the Unicode-functions structure is destroyed, freeing all memory.
      Parameters:
      ufuncs - The Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsGetDefault

      public static UnicodeFuncs unicodeFuncsGetDefault()
      Fetches a pointer to the default Unicode-functions structure that is used when no functions are explicitly set on hb_buffer_t.
      Returns:
      a pointer to the hb_unicode_funcs_t Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsGetEmpty

      public static UnicodeFuncs unicodeFuncsGetEmpty()
      Fetches the singleton empty Unicode-functions structure.
      Returns:
      The empty Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsGetParent

      public static UnicodeFuncs unicodeFuncsGetParent(UnicodeFuncs ufuncs)
      Fetches the parent of the Unicode-functions structure ufuncs.
      Parameters:
      ufuncs - The Unicode-functions structure
      Returns:
      The parent Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsGetUserData

      public static @Nullable MemorySegment unicodeFuncsGetUserData(UnicodeFuncs ufuncs, UserDataKey key)
      Fetches the user-data associated with the specified key, attached to the specified Unicode-functions structure.
      Parameters:
      ufuncs - The Unicode-functions structure
      key - The user-data key to query
      Returns:
      A pointer to the user data
      Since:
      0.9.2
    • unicodeFuncsIsImmutable

      public static Bool unicodeFuncsIsImmutable(UnicodeFuncs ufuncs)
      Tests whether the specified Unicode-functions structure is immutable.
      Parameters:
      ufuncs - The Unicode-functions structure
      Returns:
      true if ufuncs is immutable, false otherwise
      Since:
      0.9.2
    • unicodeFuncsMakeImmutable

      public static void unicodeFuncsMakeImmutable(UnicodeFuncs ufuncs)
      Makes the specified Unicode-functions structure immutable.
      Parameters:
      ufuncs - The Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsReference

      public static UnicodeFuncs unicodeFuncsReference(UnicodeFuncs ufuncs)
      Increases the reference count on a Unicode-functions structure.
      Parameters:
      ufuncs - The Unicode-functions structure
      Returns:
      The Unicode-functions structure
      Since:
      0.9.2
    • unicodeFuncsSetCombiningClassFunc

      public static void unicodeFuncsSetCombiningClassFunc(UnicodeFuncs ufuncs, @Nullable UnicodeCombiningClassFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_unicode_combining_class_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetComposeFunc

      public static void unicodeFuncsSetComposeFunc(UnicodeFuncs ufuncs, @Nullable UnicodeComposeFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_unicode_compose_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetDecomposeCompatibilityFunc

      @Deprecated public static void unicodeFuncsSetDecomposeCompatibilityFunc(UnicodeFuncs ufuncs, @Nullable UnicodeDecomposeCompatibilityFunc func, @Nullable DestroyFunc destroy)
      Deprecated.
      Sets the implementation function for hb_unicode_decompose_compatibility_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetDecomposeFunc

      public static void unicodeFuncsSetDecomposeFunc(UnicodeFuncs ufuncs, @Nullable UnicodeDecomposeFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_unicode_decompose_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetEastasianWidthFunc

      @Deprecated public static void unicodeFuncsSetEastasianWidthFunc(UnicodeFuncs ufuncs, @Nullable UnicodeEastasianWidthFunc func, @Nullable DestroyFunc destroy)
      Deprecated.
      Sets the implementation function for hb_unicode_eastasian_width_func_t.
      Parameters:
      ufuncs - a Unicode-function structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetGeneralCategoryFunc

      public static void unicodeFuncsSetGeneralCategoryFunc(UnicodeFuncs ufuncs, @Nullable UnicodeGeneralCategoryFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_unicode_general_category_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetMirroringFunc

      public static void unicodeFuncsSetMirroringFunc(UnicodeFuncs ufuncs, @Nullable UnicodeMirroringFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_unicode_mirroring_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetScriptFunc

      public static void unicodeFuncsSetScriptFunc(UnicodeFuncs ufuncs, @Nullable UnicodeScriptFunc func, @Nullable DestroyFunc destroy)
      Sets the implementation function for hb_unicode_script_func_t.
      Parameters:
      ufuncs - A Unicode-functions structure
      func - The callback function to assign
      destroy - The function to call when userData is not needed anymore
      Since:
      0.9.2
    • unicodeFuncsSetUserData

      public static Bool unicodeFuncsSetUserData(UnicodeFuncs ufuncs, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace)
      Attaches a user-data key/data pair to the specified Unicode-functions structure.
      Parameters:
      ufuncs - The Unicode-functions structure
      key - The user-data key
      data - A pointer to the user data
      destroy - A callback to call when data is not needed anymore
      replace - Whether to replace an existing data with the same key
      Returns:
      true if success, false otherwise
      Since:
      0.9.2
    • unicodeGeneralCategory

      public static UnicodeGeneralCategory unicodeGeneralCategory(UnicodeFuncs ufuncs, Codepoint unicode)
      Retrieves the General Category (gc) property of code point unicode.
      Parameters:
      ufuncs - The Unicode-functions structure
      unicode - The code point to query
      Returns:
      The hb_unicode_general_category_t of unicode
      Since:
      0.9.2
    • unicodeMirroring

      public static Codepoint unicodeMirroring(UnicodeFuncs ufuncs, Codepoint unicode)
      Retrieves the Bi-directional Mirroring Glyph code point defined for code point unicode.
      Parameters:
      ufuncs - The Unicode-functions structure
      unicode - The code point to query
      Returns:
      The hb_codepoint_t of the Mirroring Glyph for unicode
      Since:
      0.9.2
    • unicodeScript

      public static Script unicodeScript(UnicodeFuncs ufuncs, Codepoint unicode)
      Retrieves the hb_script_t script to which code point unicode belongs.
      Parameters:
      ufuncs - The Unicode-functions structure
      unicode - The code point to query
      Returns:
      The hb_script_t of unicode
      Since:
      0.9.2
    • variationFromString

      public static Bool variationFromString(@Nullable byte @Nullable [] str, Variation variation)

      Parses a string into a hb_variation_t.

      The format for specifying variation settings follows. All valid CSS font-variation-settings values other than 'normal' and 'inherited' are also accepted, though, not documented below.

      The format is a tag, optionally followed by an equals sign, followed by a number. For example wght=500, or slnt=-7.5.

      Parameters:
      str - a string to parse
      variation - the hb_variation_t to initialize with the parsed values
      Returns:
      true if str is successfully parsed, false otherwise
      Since:
      1.4.2
    • variationToString

      public static void variationToString(Variation variation, @Nullable Out<String[]> buf)

      Converts an hb_variation_t into a NULL-terminated string in the format understood by hb_variation_from_string(). The client in responsible for allocating big enough size for buf, 128 bytes is more than enough.

      Note that the string won't include any whitespace.

      Parameters:
      variation - an hb_variation_t to convert
      buf - output string
      Since:
      1.4.2