Class HarfBuzz
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUsed when getting or setting AAT feature selectors.static final intThe default code point for replacing invalid characters in a given encoding.static final CodepointUnusedhb_codepoint_tvalue.static final intSpecial setting forhb_feature_t.start to apply the feature from the start of the buffer.static final intConstant signifying that a font does not have any named-instance index set.static final intSpecial value for language index indicating default or unsupported language.static final intSpecial value for feature index indicating unsupported feature.static final intSpecial value for script index indicating unsupported script.static final intSpecial value for variations index indicating unsupported variation.static final intMaximum number of OpenType tags that can correspond to a givehb_language_t.static final intMaximum number of OpenType tags that can correspond to a givehb_script_t.static final intDeprecated.static final intDeprecated.static final intMaximum valid Unicode code point.static final intDeprecated.static final intstatic final intstatic final intstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OtNameIdaatLayoutFeatureTypeGetNameId(Face face, AatLayoutFeatureType featureType) Fetches the name identifier of the specified feature type in the face'snametable.static intaatLayoutFeatureTypeGetSelectorInfos(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.static intaatLayoutGetFeatureTypes(Face face, int startOffset, @Nullable Out<AatLayoutFeatureType[]> features) Fetches a list of the AAT feature types included in the specified face.static BoolaatLayoutHasPositioning(Face face) Tests whether the specified face includes any positioning information in thekerxtable.static BoolaatLayoutHasSubstitution(Face face) Tests whether the specified face includes any substitutions in themorxormorttables.static BoolaatLayoutHasTracking(Face face) Tests whether the specified face includes any tracking information in thetraktable.static BlobblobCopyWritableOrFail(Blob blob) Makes a writable copy ofblob.static BlobblobCreate(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata.Themodeparameter is used to negotiate ownership and lifecycle ofdata.static BlobblobCreateFromFile(String fileName) Creates a new blob containing the data from the specified binary font file.static BlobblobCreateFromFileOrFail(String fileName) Creates a new blob containing the data from the specified file.static BlobblobCreateOrFail(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata.Themodeparameter is used to negotiate ownership and lifecycle ofdata.static BlobblobCreateSubBlob(Blob parent, int offset, int length) Returns a blob that represents a range of bytes inparent.The new blob is always created withHB_MEMORY_MODE_READONLY, meaning that it will never modify data in the parent blob.static voidblobDestroy(Blob blob) Decreases the reference count onblob,and if it reaches zero, destroysblob,freeing all memory, possibly calling the destroy-callback the blob was created for if it has not been called already.static @Nullable String @Nullable []blobGetData(Blob blob) Fetches the data from a blob.static String[]blobGetDataWritable(Blob blob) Tries to make blob data writable (possibly copying it) and return pointer to data.static BlobReturns the singleton empty blob.static intblobGetLength(Blob blob) Fetches the length of a blob's data.static @Nullable MemorySegmentblobGetUserData(Blob blob, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified font-functions structure.static BoolblobIsImmutable(Blob blob) Tests whether a blob is immutable.static voidblobMakeImmutable(Blob blob) Makes a blob immutable.static BlobblobReference(Blob blob) Increases the reference count onblob.static BoolblobSetUserData(Blob blob, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified blob.static voidAppends a character with the Unicode value ofcodepointtobuffer,and gives it the initial cluster value ofcluster.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 inhb_glyph_info_t.cluster field.static voidbufferAddCodepoints(Buffer buffer, @Nullable Codepoint @Nullable [] text, int itemOffset, int itemLength) Appends characters fromtextarray tobuffer.TheitemOffsetis the position of the first character fromtextthat will be appended, anditemLengthis the number of character.static voidbufferAddLatin1(Buffer buffer, @org.jspecify.annotations.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.static voidbufferAddUtf16(Buffer buffer, @org.jspecify.annotations.Nullable short @Nullable [] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().static voidbufferAddUtf32(Buffer buffer, @org.jspecify.annotations.Nullable int @Nullable [] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().static voidbufferAddUtf8(Buffer buffer, @org.jspecify.annotations.Nullable byte @Nullable [] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().static BoolbufferAllocationSuccessful(Buffer buffer) Check if allocating memory for the buffer succeeded.static voidbufferAppend(Buffer buffer, Buffer source, int start, int end) Append (part of) contents of another buffer to this buffer.static voidbufferClearContents(Buffer buffer) Similar to hb_buffer_reset(), but does not clear the Unicode functions and the replacement code point.static BufferCreates a newhb_buffer_twith all properties to defaults.static BufferCreates a newhb_buffer_t, similar to hb_buffer_create().static BoolbufferDeserializeGlyphs(Buffer buffer, @Nullable String @Nullable [] buf, @Nullable Out<String> endPtr, @Nullable Font font, BufferSerializeFormat format) Deserializes glyphsbufferfrom textual representation in the format produced by hb_buffer_serialize_glyphs().static BoolbufferDeserializeUnicode(Buffer buffer, @Nullable String @Nullable [] buf, @Nullable Out<String> endPtr, BufferSerializeFormat format) Deserializes Unicodebufferfrom textual representation in the format produced by hb_buffer_serialize_unicode().static voidbufferDestroy(Buffer buffer) Deallocate thebuffer.Decreases the reference count onbufferby one.static Set<BufferDiffFlags> bufferDiff(Buffer buffer, Buffer reference, Codepoint dottedcircleGlyph, int positionFuzz) If dottedcircle_glyph is (hb_codepoint_t) -1 thenHB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENTandHB_BUFFER_DIFF_FLAG_NOTDEF_PRESENTare never returned.static BufferClusterLevelbufferGetClusterLevel(Buffer buffer) Fetches the cluster level of a buffer.static BufferContentTypebufferGetContentType(Buffer buffer) Fetches the type ofbuffercontents.static DirectionbufferGetDirection(Buffer buffer) See hb_buffer_set_direction()static BufferFetches an emptyhb_buffer_t.static Set<BufferFlags> bufferGetFlags(Buffer buffer) Fetches thehb_buffer_flags_tofbuffer.static GlyphInfo[]bufferGetGlyphInfos(Buffer buffer) Returnsbufferglyph information array.static GlyphPosition[]bufferGetGlyphPositions(Buffer buffer) Returnsbufferglyph position array.static CodepointbufferGetInvisibleGlyph(Buffer buffer) See hb_buffer_set_invisible_glyph().static @Nullable LanguagebufferGetLanguage(Buffer buffer) See hb_buffer_set_language().static intbufferGetLength(Buffer buffer) Returns the number of items in the buffer.static CodepointbufferGetNotFoundGlyph(Buffer buffer) See hb_buffer_set_not_found_glyph().static CodepointSee hb_buffer_set_not_found_variation_selector_glyph().static intbufferGetRandomState(Buffer buffer) See hb_buffer_set_random_state().static CodepointbufferGetReplacementCodepoint(Buffer buffer) Fetches thehb_codepoint_tthat replaces invalid entries for a given encoding when adding text tobuffer.static ScriptbufferGetScript(Buffer buffer) Fetches the script ofbuffer.static voidbufferGetSegmentProperties(Buffer buffer, SegmentProperties props) Setspropsto thehb_segment_properties_tofbuffer.static UnicodeFuncsbufferGetUnicodeFuncs(Buffer buffer) Fetches the Unicode-functions structure of a buffer.static @Nullable MemorySegmentbufferGetUserData(Buffer buffer, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified buffer.static voidbufferGuessSegmentProperties(Buffer buffer) Sets unset buffer segment properties based on buffer Unicode contents.static BoolbufferHasPositions(Buffer buffer) Returns whetherbufferhas glyph position data.static voidbufferNormalizeGlyphs(Buffer buffer) Reorders a glyph buffer to have canonical in-cluster glyph order / position.static BoolbufferPreAllocate(Buffer buffer, int size) Pre allocates memory forbufferto fit at leastsizenumber of items.static BufferbufferReference(Buffer buffer) Increases the reference count onbufferby one.static voidbufferReset(Buffer buffer) Resets the buffer to its initial status, as if it was just newly created with hb_buffer_create().static voidbufferReverse(Buffer buffer) Reverses buffer contents.static voidbufferReverseClusters(Buffer buffer) Reverses buffer clusters.static voidbufferReverseRange(Buffer buffer, int start, int end) Reverses buffer contents betweenstartandend.static intbufferSerialize(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbufferinto a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information.static intbufferSerialize(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbufferinto a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information.static BufferSerializeFormatbufferSerializeFormatFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Parses a string into anhb_buffer_serialize_format_t.static StringConvertsformatto the string corresponding it, orNULLif it is not a validhb_buffer_serialize_format_t.static intbufferSerializeGlyphs(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbufferinto a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging.static intbufferSerializeGlyphs(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbufferinto a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging.static String[]Returns a list of supported buffer serialization formats.static intbufferSerializeUnicode(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbufferinto a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping).static intbufferSerializeUnicode(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbufferinto a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping).static voidbufferSetClusterLevel(Buffer buffer, BufferClusterLevel clusterLevel) Sets the cluster level of a buffer.static voidbufferSetContentType(Buffer buffer, BufferContentType contentType) Sets the type ofbuffercontents.static voidbufferSetDirection(Buffer buffer, Direction direction) Set the text flow direction of the buffer.static voidbufferSetFlags(Buffer buffer, Set<BufferFlags> flags) Setsbufferflags toflags.Seehb_buffer_flags_t.static voidbufferSetFlags(Buffer buffer, BufferFlags... flags) Setsbufferflags toflags.Seehb_buffer_flags_t.static voidbufferSetInvisibleGlyph(Buffer buffer, Codepoint invisible) Sets thehb_codepoint_tthat replaces invisible characters in the shaping result.static voidbufferSetLanguage(Buffer buffer, @Nullable Language language) Sets the language ofbuffertolanguage.static BoolbufferSetLength(Buffer buffer, int length) Similar to hb_buffer_pre_allocate(), but clears any new items added at the end.static voidbufferSetMessageFunc(Buffer buffer, @Nullable BufferMessageFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_buffer_message_func_t.static voidbufferSetNotFoundGlyph(Buffer buffer, Codepoint notFound) Sets thehb_codepoint_tthat replaces characters not found in the font during shaping.static voidbufferSetNotFoundVariationSelectorGlyph(Buffer buffer, Codepoint notFoundVariationSelector) Sets thehb_codepoint_tthat replaces variation-selector characters not resolved in the font during shaping.static voidbufferSetRandomState(Buffer buffer, int state) Sets the random state of the buffer.static voidbufferSetReplacementCodepoint(Buffer buffer, Codepoint replacement) Sets thehb_codepoint_tthat replaces invalid entries for a given encoding when adding text tobuffer.static voidbufferSetScript(Buffer buffer, Script script) Sets the script ofbuffertoscript.static voidbufferSetSegmentProperties(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.static voidbufferSetUnicodeFuncs(Buffer buffer, UnicodeFuncs unicodeFuncs) Sets the Unicode-functions structure of a buffer tounicodeFuncs.static BoolbufferSetUserData(Buffer buffer, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified buffer.static @Nullable MemorySegmentcalloc(long nmemb, long size) Allocatesnmembelements ofsizebytes each, initialized to zero, using the allocator set at compile-time.static bytecolorGetAlpha(Color color) Fetches the alpha channel of the givencolor.static bytecolorGetBlue(Color color) Fetches the blue channel of the givencolor.static bytecolorGetGreen(Color color) Fetches the green channel of the givencolor.static bytecolorGetRed(Color color) Fetches the red channel of the givencolor.static intcolorLineGetColorStops(ColorLine colorLine, int start, @Nullable Out<ColorStop[]> colorStops) Fetches a list of color stops from the given color line object.static PaintExtendcolorLineGetExtend(ColorLine colorLine) Fetches the extend mode of the color line object.static DirectiondirectionFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Converts a string to anhb_direction_t.static StringdirectionToString(Direction direction) Converts anhb_direction_tto a string.static voiddrawClosePath(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st) Perform a "close-path" draw operation.static voiddrawCubicTo(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.static DrawFuncsCreates a new draw callbacks object.static voiddrawFuncsDestroy(DrawFuncs dfuncs) Deallocate thedfuncs.Decreases the reference count ondfuncsby one.static DrawFuncsFetches the singleton empty draw-functions structure.static @Nullable MemorySegmentdrawFuncsGetUserData(DrawFuncs dfuncs, UserDataKey key) Fetches the user-data associated with the specified key, attached to the specified draw-functions structure.static BooldrawFuncsIsImmutable(DrawFuncs dfuncs) Checks whetherdfuncsis immutable.static voiddrawFuncsMakeImmutable(DrawFuncs dfuncs) Makesdfuncsobject immutable.static DrawFuncsdrawFuncsReference(DrawFuncs dfuncs) Increases the reference count ondfuncsby one.static voiddrawFuncsSetClosePathFunc(DrawFuncs dfuncs, @Nullable DrawClosePathFunc func, @Nullable DestroyFunc destroy) Sets close-path callback to the draw functions object.static voiddrawFuncsSetCubicToFunc(DrawFuncs dfuncs, @Nullable DrawCubicToFunc func, @Nullable DestroyFunc destroy) Sets cubic-to callback to the draw functions object.static voiddrawFuncsSetLineToFunc(DrawFuncs dfuncs, @Nullable DrawLineToFunc func, @Nullable DestroyFunc destroy) Sets line-to callback to the draw functions object.static voiddrawFuncsSetMoveToFunc(DrawFuncs dfuncs, @Nullable DrawMoveToFunc func, @Nullable DestroyFunc destroy) Sets move-to callback to the draw functions object.static voiddrawFuncsSetQuadraticToFunc(DrawFuncs dfuncs, @Nullable DrawQuadraticToFunc func, @Nullable DestroyFunc destroy) Sets quadratic-to callback to the draw functions object.static BooldrawFuncsSetUserData(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.static voiddrawLineTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float toX, float toY) Perform a "line-to" draw operation.static voiddrawMoveTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float toX, float toY) Perform a "move-to" draw operation.static voiddrawQuadraticTo(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float controlX, float controlY, float toX, float toY) Perform a "quadratic-to" draw operation.static BoolfaceBuilderAddTable(Face face, Tag tag, Blob blob) Add table fortagwith data provided byblobto the face.static FaceCreates ahb_face_tthat can be used with hb_face_builder_add_table().static voidfaceBuilderSortTables(Face face, @Nullable Tag @Nullable [] tags) Set the ordering of tables for serialization.static voidfaceCollectNominalGlyphMapping(Face face, Map mapping, @Nullable Set unicodes) Collects the mapping from Unicode characters to nominal glyphs of theface,and optionally all of the Unicode characters covered byface.static voidfaceCollectUnicodes(Face face, Set out) Collects all of the Unicode characters covered byfaceand adds them to thehb_set_tsetout.static voidfaceCollectVariationSelectors(Face face, Set out) Collects all Unicode "Variation Selector" characters covered byfaceand adds them to thehb_set_tsetout.static voidfaceCollectVariationUnicodes(Face face, Codepoint variationSelector, Set out) Collects all Unicode characters forvariationSelectorcovered byfaceand adds them to thehb_set_tsetout.static intFetches the number of faces in a blob.static FacefaceCreate(Blob blob, int index) Constructs a new face object from the specified blob and a face index into that blob.static FacefaceCreateForTables(@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.static FacefaceCreateFromFileOrFail(String fileName, int index) A thin wrapper around hb_blob_create_from_file_or_fail() followed by hb_face_create_or_fail().static FacefaceCreateFromFileOrFailUsing(String fileName, int index, @Nullable String loaderName) A thin wrapper around the face loader functions registered with HarfBuzz.static FacefaceCreateOrFail(Blob blob, int index) Like hb_face_create(), but returnsNULLif the blob data contains no usable font face at the specified index.static FacefaceCreateOrFailUsing(Blob blob, int index, @Nullable String loaderName) A thin wrapper around the face loader functions registered with HarfBuzz.static voidfaceDestroy(Face face) Decreases the reference count on a face object.static FaceFetches the singleton empty face object.static intfaceGetGlyphCount(Face face) Fetches the glyph-count value of the specified face object.static intfaceGetIndex(Face face) Fetches the face-index corresponding to the given face.static intfaceGetTableTags(Face face, int startOffset, @Nullable Out<Tag[]> tableTags) Fetches a list of all table tags for a face, if possible.static intfaceGetUpem(Face face) Fetches the units-per-em (UPEM) value of the specified face object.static @Nullable MemorySegmentfaceGetUserData(Face face, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified face object.static BoolfaceIsImmutable(Face face) Tests whether the given face object is immutable.static String[]Retrieves the list of face loaders supported by HarfBuzz.static voidfaceMakeImmutable(Face face) Makes the given face object immutable.static FacefaceReference(Face face) Increases the reference count on a face object.static BlobfaceReferenceBlob(Face face) Fetches a pointer to the binary blob that contains the specified face.static BlobfaceReferenceTable(Face face, Tag tag) Fetches a reference to the specified table within the specified face.static voidfaceSetGetTableTagsFunc(Face face, @Nullable GetTableTagsFunc func, @Nullable DestroyFunc destroy) Sets the table-tag-fetching function for the specified face object.static voidfaceSetGlyphCount(Face face, int glyphCount) Sets the glyph count for a face object to the specified value.static voidfaceSetIndex(Face face, int index) Assigns the specified face-index toface.Fails if the face is immutable.static voidfaceSetUpem(Face face, int upem) Sets the units-per-em (upem) for a face object to the specified value.static BoolfaceSetUserData(Face face, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the given face object.static BoolfeatureFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str, Feature feature) Parses a string into ahb_feature_t.static voidfeatureToString(Feature feature, @Nullable Out<String[]> buf) Converts ahb_feature_tinto aNULL-terminated string in the format understood by hb_feature_from_string().static voidfontAddGlyphOriginForDirection(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.static voidfontChanged(Font font) Notifies thefontthat underlying font data has changed.static FontfontCreate(Face face) Constructs a new font object from the specified face.static FontfontCreateSubFont(Font parent) Constructs a sub-font font object from the specifiedparentfont, replicating the parent's properties.static voidfontDestroy(Font font) Decreases the reference count on the given font object.static voidfontDrawGlyph(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData) Draws the outline that corresponds to a glyph in the specifiedfont.static BoolfontDrawGlyphOrFail(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData) Draws the outline that corresponds to a glyph in the specifiedfont.static FontFuncsCreates a newhb_font_funcs_tstructure of font functions.static voidfontFuncsDestroy(FontFuncs ffuncs) Decreases the reference count on a font-functions structure.static FontFuncsFetches an empty font-functions structure.static @Nullable MemorySegmentfontFuncsGetUserData(FontFuncs ffuncs, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified font-functions structure.static BoolfontFuncsIsImmutable(FontFuncs ffuncs) Tests whether a font-functions structure is immutable.static voidfontFuncsMakeImmutable(FontFuncs ffuncs) Makes a font-functions structure immutable.static FontFuncsfontFuncsReference(FontFuncs ffuncs) Increases the reference count on a font-functions structure.static voidfontFuncsSetDrawGlyphFunc(FontFuncs ffuncs, @Nullable FontDrawGlyphFunc func, @Nullable DestroyFunc destroy) Deprecated.Use hb_font_funcs_set_draw_glyph_or_fail_func instead.static voidfontFuncsSetDrawGlyphOrFailFunc(FontFuncs ffuncs, @Nullable FontDrawGlyphOrFailFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_draw_glyph_or_fail_func_t.static voidfontFuncsSetFontHExtentsFunc(FontFuncs ffuncs, @Nullable FontGetFontHExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_font_h_extents_func_t.static voidfontFuncsSetFontVExtentsFunc(FontFuncs ffuncs, @Nullable FontGetFontVExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_font_v_extents_func_t.static voidfontFuncsSetGlyphContourPointFunc(FontFuncs ffuncs, @Nullable FontGetGlyphContourPointFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_contour_point_func_t.static voidfontFuncsSetGlyphExtentsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphExtentsFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_extents_func_t.static voidfontFuncsSetGlyphFromNameFunc(FontFuncs ffuncs, @Nullable FontGetGlyphFromNameFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_from_name_func_t.static voidfontFuncsSetGlyphFunc(FontFuncs ffuncs, @Nullable FontGetGlyphFunc func, @Nullable DestroyFunc destroy) Deprecated.static voidfontFuncsSetGlyphHAdvanceFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHAdvanceFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_advance_func_t.static voidfontFuncsSetGlyphHAdvancesFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHAdvancesFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_advances_func_t.static voidfontFuncsSetGlyphHKerningFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHKerningFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_kerning_func_t.static voidfontFuncsSetGlyphHOriginFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHOriginFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_origin_func_t.static voidfontFuncsSetGlyphHOriginsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphHOriginsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_origins_func_t.static voidfontFuncsSetGlyphNameFunc(FontFuncs ffuncs, @Nullable FontGetGlyphNameFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_name_func_t.static voidfontFuncsSetGlyphShapeFunc(FontFuncs ffuncs, @Nullable FontGetGlyphShapeFunc func, @Nullable DestroyFunc destroy) Deprecated.Use hb_font_funcs_set_draw_glyph_func() insteadstatic voidfontFuncsSetGlyphVAdvanceFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVAdvanceFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_advance_func_t.static voidfontFuncsSetGlyphVAdvancesFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVAdvancesFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_advances_func_t.static voidfontFuncsSetGlyphVKerningFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVKerningFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Deprecated.static voidfontFuncsSetGlyphVOriginFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVOriginFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_origin_func_t.static voidfontFuncsSetGlyphVOriginsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphVOriginsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_origins_func_t.static voidfontFuncsSetNominalGlyphFunc(FontFuncs ffuncs, @Nullable FontGetNominalGlyphFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyph_func_t.static voidfontFuncsSetNominalGlyphsFunc(FontFuncs ffuncs, @Nullable FontGetNominalGlyphsFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyphs_func_t.static voidfontFuncsSetPaintGlyphFunc(FontFuncs ffuncs, @Nullable FontPaintGlyphFunc func, @Nullable DestroyFunc destroy) Deprecated.Use hb_font_funcs_set_paint_glyph_or_fail_func() instead.static voidfontFuncsSetPaintGlyphOrFailFunc(FontFuncs ffuncs, @Nullable FontPaintGlyphOrFailFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_paint_glyph_or_fail_func_t.static BoolfontFuncsSetUserData(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.static voidfontFuncsSetVariationGlyphFunc(FontFuncs ffuncs, @Nullable FontGetVariationGlyphFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_variation_glyph_func_t.static FontFetches the empty font object.static voidfontGetExtentsForDirection(Font font, Direction direction, FontExtents extents) Fetches the extents for a font in a text segment of the specified direction.static FacefontGetFace(Font font) Fetches the face associated with the specified font object.static BoolfontGetGlyph(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.static voidfontGetGlyphAdvanceForDirection(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.static voidfontGetGlyphAdvancesForDirection(Font font, Direction direction, int count, Codepoint firstGlyph, int glyphStride, Position firstAdvance, int advanceStride) Fetches the advances for a sequence of glyph IDs in the specified font, in a text segment of the specified direction.static BoolfontGetGlyphContourPoint(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.static BoolfontGetGlyphContourPointForOrigin(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.static BoolfontGetGlyphExtents(Font font, Codepoint glyph, GlyphExtents extents) Fetches thehb_glyph_extents_tdata for a glyph ID in the specified font.static BoolfontGetGlyphExtentsForOrigin(Font font, Codepoint glyph, Direction direction, GlyphExtents extents) Fetches thehb_glyph_extents_tdata for a glyph ID in the specified font, with respect to the origin in a text segment in the specified direction.static BoolfontGetGlyphFromName(Font font, @Nullable String @Nullable [] name, Codepoint glyph) Fetches the glyph ID that corresponds to a name string in the specifiedfont.static PositionfontGetGlyphHAdvance(Font font, Codepoint glyph) Fetches the advance for a glyph ID in the specified font, for horizontal text segments.static voidfontGetGlyphHAdvances(Font font, int count, Codepoint firstGlyph, int glyphStride, Position firstAdvance, int advanceStride) Fetches the advances for a sequence of glyph IDs in the specified font, for horizontal text segments.static PositionfontGetGlyphHKerning(Font font, Codepoint leftGlyph, Codepoint rightGlyph) Fetches the kerning-adjustment value for a glyph-pair in the specified font, for horizontal text segments.static BoolfontGetGlyphHOrigin(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.static BoolfontGetGlyphHOrigins(Font font, int count, Codepoint 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.static voidfontGetGlyphKerningForDirection(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.static BoolfontGetGlyphName(Font font, Codepoint glyph, @Nullable Out<String[]> name) Fetches the glyph-name string for a glyph ID in the specifiedfont.static voidfontGetGlyphOriginForDirection(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.static voidfontGetGlyphShape(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData) Deprecated.Use hb_font_draw_glyph() insteadstatic PositionfontGetGlyphVAdvance(Font font, Codepoint glyph) Fetches the advance for a glyph ID in the specified font, for vertical text segments.static voidfontGetGlyphVAdvances(Font font, int count, Codepoint firstGlyph, int glyphStride, Position firstAdvance, int advanceStride) Fetches the advances for a sequence of glyph IDs in the specified font, for vertical text segments.static PositionfontGetGlyphVKerning(Font font, Codepoint topGlyph, Codepoint bottomGlyph) Deprecated.static BoolfontGetGlyphVOrigin(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.static BoolfontGetGlyphVOrigins(Font font, int count, Codepoint 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.static BoolfontGetHExtents(Font font, FontExtents extents) Fetches the extents for a specified font, for horizontal text segments.static BoolfontGetNominalGlyph(Font font, Codepoint unicode, Codepoint glyph) Fetches the nominal glyph ID for a Unicode code point in the specified font.static intfontGetNominalGlyphs(Font font, int count, Codepoint firstUnicode, int unicodeStride, Codepoint firstGlyph, int glyphStride) Fetches the nominal glyph IDs for a sequence of Unicode code points.static FontfontGetParent(Font font) Fetches the parent font offont.static voidFetches the horizontal and vertical points-per-em (ppem) of a font.static floatfontGetPtem(Font font) Fetches the "point size" of a font.static voidFetches the horizontal and vertical scale of a font.static intfontGetSerial(Font font) Returns the internal serial number of the font.static voidFetches the "synthetic boldness" parameters of a font.static floatfontGetSyntheticSlant(Font font) Fetches the "synthetic slant" of a font.static @Nullable MemorySegmentfontGetUserData(Font font, UserDataKey key) Fetches the user-data object associated with the specified key, attached to the specified font object.static MemorySegmentfontGetVarCoordsDesign(Font font, Out<Integer> length) Fetches the list of variation coordinates (in design-space units) currently set on a font.static MemorySegmentfontGetVarCoordsNormalized(Font font, Out<Integer> length) Fetches the list of normalized variation coordinates currently set on a font.static BoolfontGetVariationGlyph(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.static intfontGetVarNamedInstance(Font font) Returns the currently-set named-instance index of the font.static BoolfontGetVExtents(Font font, FontExtents extents) Fetches the extents for a specified font, for vertical text segments.static BoolfontGlyphFromString(Font font, @org.jspecify.annotations.Nullable byte @Nullable [] s, Codepoint glyph) Fetches the glyph ID fromfontthat matches the specified string.static voidfontGlyphToString(Font font, Codepoint glyph, @Nullable Out<String[]> s) Fetches the name of the specified glyph ID infontand returns it in strings.static BoolfontIsImmutable(Font font) Tests whether a font object is immutable.static BoolfontIsSynthetic(Font font) Tests whether a font is synthetic.static String[]Retrieves the list of font functions supported by HarfBuzz.static voidfontMakeImmutable(Font font) Makesfontimmutable.static voidfontPaintGlyph(Font font, Codepoint glyph, PaintFuncs pfuncs, @Nullable MemorySegment paintData, int paletteIndex, Color foreground) Paints the glyph.static BoolfontPaintGlyphOrFail(Font font, Codepoint glyph, PaintFuncs pfuncs, @Nullable MemorySegment paintData, int paletteIndex, Color foreground) Paints a color glyph.static FontfontReference(Font font) Increases the reference count on the given font object.static voidfontSetFace(Font font, Face face) Setsfaceas the font-face value offont.static voidfontSetFuncs(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 withfontDataand thedestroycallback.static voidfontSetFuncsData(Font font, @Nullable MemorySegment fontData, @Nullable DestroyFunc destroy) Replaces the user data attached to a font, updating the font'sdestroycallback.static BoolfontSetFuncsUsing(Font font, String name) Sets the font-functions structure to use for a font, based on the specified name.static voidfontSetParent(Font font, Font parent) Sets the parent font offont.static voidfontSetPpem(Font font, int xPpem, int yPpem) Sets the horizontal and vertical pixels-per-em (PPEM) of a font.static voidfontSetPtem(Font font, float ptem) Sets the "point size" of a font.static voidfontSetScale(Font font, int xScale, int yScale) Sets the horizontal and vertical scale of a font.static voidfontSetSyntheticBold(Font font, float xEmbolden, float yEmbolden, Bool inPlace) Sets the "synthetic boldness" of a font.static voidfontSetSyntheticSlant(Font font, float slant) Sets the "synthetic slant" of a font.static BoolfontSetUserData(Font font, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified font object.static voidfontSetVarCoordsDesign(Font font, @org.jspecify.annotations.Nullable float @Nullable [] coords) Applies a list of variation coordinates (in design-space units) to a font.static voidfontSetVarCoordsNormalized(Font font, @org.jspecify.annotations.Nullable int @Nullable [] coords) Applies a list of variation coordinates (in normalized units) to a font.static voidfontSetVariation(Font font, Tag tag, float value) Change the value of one variation axis on the font.static voidfontSetVariations(Font font, @Nullable Variation @Nullable [] variations) Applies a list of font-variation settings to a font.static voidfontSetVarNamedInstance(Font font, int instanceIndex) Sets design coords of a font from a named-instance index.static voidfontSubtractGlyphOriginForDirection(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.static voidfree(@Nullable MemorySegment ptr) Frees the memory pointed to byptr,using the allocator set at compile-time.static FaceftFaceCreate(@Nullable org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy) Creates anhb_face_tface object from the specified FT_Face.static FaceftFaceCreateCached(@Nullable org.freedesktop.freetype.Face ftFace) Creates anhb_face_tface object from the specified FT_Face.static FaceftFaceCreateFromBlobOrFail(Blob blob, int index) Creates anhb_face_tface object from the specified font blob and face index.static FaceftFaceCreateFromFileOrFail(String fileName, int index) Creates anhb_face_tface object from the specified font file and face index.static FaceftFaceCreateReferenced(@Nullable org.freedesktop.freetype.Face ftFace) Creates anhb_face_tface object from the specified FT_Face.static voidftFontChanged(Font font) Refreshes the state offontwhen the underlying FT_Face has changed.static FontftFontCreate(@Nullable org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy) Creates anhb_font_tfont object from the specified FT_Face.static FontftFontCreateReferenced(@Nullable org.freedesktop.freetype.Face ftFace) Creates anhb_font_tfont object from the specified FT_Face.static @Nullable org.freedesktop.freetype.FaceftFontGetFace(Font font) Deprecated.Use hb_ft_font_get_ft_face() instead.static @Nullable org.freedesktop.freetype.FaceftFontGetFtFace(Font font) Fetches the FT_Face associated with the specifiedhb_font_tfont object.static intftFontGetLoadFlags(Font font) Fetches the FT_Load_Glyph load flags of the specifiedhb_font_t.static @Nullable org.freedesktop.freetype.FaceftFontLockFace(Font font) Gets the FT_Face associated withfont.static voidftFontSetFuncs(Font font) Configures the font-functions structure of the specifiedhb_font_tfont object to use FreeType font functions.static voidftFontSetLoadFlags(Font font, int loadFlags) Sets the FT_Load_Glyph load flags for the specifiedhb_font_t.static voidftFontUnlockFace(Font font) Releases an FT_Face previously obtained with hb_ft_font_lock_face().static BoolftHbFontChanged(Font font) Refreshes the state of the underlying FT_Face offontwhen the hb_font_tfonthas changed.static BlobglibBlobCreate(byte[] gbytes) Creates anhb_blob_tblob from the specified GBytes data structure.static UnicodeFuncsFetches a Unicode-functions structure that is populated with the appropriate GLib function for each method.static UnicodeScriptglibScriptFromScript(Script script) Fetches the GUnicodeScript identifier that corresponds to the specifiedhb_script_tscript.static ScriptglibScriptToScript(UnicodeScript script) Fetches thehb_script_tscript that corresponds to the specified GUnicodeScript identifier.static Set<GlyphFlags> Returns glyph flags encoded within ahb_glyph_info_t.static voidstatic @Nullable LanguagelanguageFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Convertsstrrepresenting a BCP 47 language tag to the correspondinghb_language_t.static @Nullable LanguageFetch the default language from current locale.static BoollanguageMatches(@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.static StringlanguageToString(@Nullable Language language) Converts anhb_language_tto a string.static @Nullable MemorySegmentmalloc(long size) Allocatessizebytes of memory, using the allocator set at compile-time.static BoolTests whether memory allocation for a set was successful.static voidClears out the contents ofmap.static MapAllocate a copy ofmap.static MapCreates a new, initially empty map.static voidRemoveskeyand its stored value frommap.static voidmapDestroy(Map map) Decreases the reference count on a map.static CodepointFetches the value stored forkeyinmap.static MapFetches the singleton emptyhb_map_t.static intmapGetPopulation(Map map) Returns the number of key-value pairs in the map.static @Nullable MemorySegmentmapGetUserData(Map map, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified map.static BoolTests whetherkeyis an element ofmap.static intCreates a hash representingmap.static BoolmapIsEmpty(Map map) Tests whethermapis empty (contains no elements).static BoolmapIsEqual(Map map, Map other) Tests whethermapandotherare equal (contain the same elements).static voidAdd the keys ofmaptokeys.static BoolFetches the next key/value pair inmap.static MapmapReference(Map map) Increases the reference count on a map.static voidStoresvaluein the map.static BoolmapSetUserData(Map map, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified map.static voidAdd the contents ofothertomap.static voidAdd the values ofmaptovalues.static intotColorGlyphGetLayers(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.static BoolotColorGlyphHasPaint(Face face, Codepoint glyph) Tests where a face includes COLRv1 paint data forglyph.static BlobotColorGlyphReferencePng(Font font, Codepoint glyph) Fetches the PNG image for a glyph.static BlobotColorGlyphReferenceSvg(Face face, Codepoint glyph) Fetches the SVG document for a glyph.static BoolotColorHasLayers(Face face) Tests whether a face includes aCOLRtable with data according to COLRv0.static BoolotColorHasPaint(Face face) Tests where a face includes aCOLRtable with data according to COLRv1.static BoolotColorHasPalettes(Face face) Tests whether a face includes aCPALcolor-palette table.static BoolotColorHasPng(Face face) Tests whether a face has PNG glyph images (either inCBDTorsbixtables).static BoolotColorHasSvg(Face face) Tests whether a face includes anySVGglyph images.static OtNameIdotColorPaletteColorGetNameId(Face face, int colorIndex) Fetches thenametable Name ID that provides display names for the specified color in a face'sCPALcolor palette.static intotColorPaletteGetColors(Face face, int paletteIndex, int startOffset, @Nullable Out<Color[]> colors) Fetches a list of the colors in a color palette.static intotColorPaletteGetCount(Face face) Fetches the number of color palettes in a face.static Set<OtColorPaletteFlags> otColorPaletteGetFlags(Face face, int paletteIndex) Fetches the flags defined for a color palette.static OtNameIdotColorPaletteGetNameId(Face face, int paletteIndex) Fetches thenametable Name ID that provides display names for aCPALcolor palette.static voidotFontSetFuncs(Font font) Sets the font functions to use when working withfontto the HarfBuzz's native implementation.static voidotLayoutCollectFeatures(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.static voidotLayoutCollectFeaturesMap(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.static voidotLayoutCollectLookups(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.static intotLayoutFeatureGetCharacters(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.static intotLayoutFeatureGetLookups(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.static BoolotLayoutFeatureGetNameIds(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.static intotLayoutFeatureWithVariationsGetLookups(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.static intotLayoutGetAttachPoints(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.static BoolotLayoutGetBaseline(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Tag scriptTag, Tag languageTag, @Nullable Position coord) Fetches a baseline value from the face.static BoolotLayoutGetBaseline2(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Script script, @Nullable Language language, @Nullable Position coord) Fetches a baseline value from the face.static voidotLayoutGetBaselineWithFallback(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.static voidotLayoutGetBaselineWithFallback2(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.static BoolotLayoutGetFontExtents(Font font, Direction direction, Tag scriptTag, Tag languageTag, @Nullable FontExtents extents) Fetches script/language-specific font extents.static BoolotLayoutGetFontExtents2(Font font, Direction direction, Script script, @Nullable Language language, @Nullable FontExtents extents) Fetches script/language-specific font extents.static OtLayoutGlyphClassotLayoutGetGlyphClass(Face face, Codepoint glyph) Fetches the GDEF class of the requested glyph in the specified face.static voidotLayoutGetGlyphsInClass(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.static OtLayoutBaselineTagFetches the dominant horizontal baseline tag used byscript.static intotLayoutGetLigatureCarets(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.static BoolotLayoutGetSizeParams(Face face, Out<Integer> designSize, Out<Integer> subfamilyId, OtNameId subfamilyNameId, Out<Integer> rangeStart, Out<Integer> rangeEnd) Fetches optical-size feature data (i.e., thesizefeature from GPOS).static BoolotLayoutHasGlyphClasses(Face face) Tests whether a face has any glyph classes defined in its GDEF table.static BoolotLayoutHasPositioning(Face face) Tests whether the specified face includes any GPOS positioning.static BoolotLayoutHasSubstitution(Face face) Tests whether the specified face includes any GSUB substitutions.static BoolotLayoutLanguageFindFeature(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.static intotLayoutLanguageGetFeatureIndexes(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.static intotLayoutLanguageGetFeatureTags(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.static BoolotLayoutLanguageGetRequiredFeature(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.static BoolotLayoutLanguageGetRequiredFeatureIndex(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.static voidotLayoutLookupCollectGlyphs(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.static intotLayoutLookupGetGlyphAlternates(Face face, int lookupIndex, Codepoint glyph, int startOffset, @Nullable Out<Codepoint[]> alternateGlyphs) Fetches alternates of a glyph from a given GSUB lookup index.static PositionotLayoutLookupGetOpticalBound(Font font, int lookupIndex, Direction direction, Codepoint glyph) Fetches the optical bound of a glyph positioned at the margin of text.static voidotLayoutLookupsSubstituteClosure(Face face, Set lookups, Set glyphs) Compute the transitive closure of glyphs needed for all of the provided lookups.static voidotLayoutLookupSubstituteClosure(Face face, int lookupIndex, Set glyphs) Compute the transitive closure of glyphs needed for a specified lookup.static BoolotLayoutLookupWouldSubstitute(Face face, int lookupIndex, Codepoint glyphs, int glyphsLength, Bool zeroContext) Tests whether a specified lookup in the specified face would trigger a substitution on the given glyph sequence.static BoolotLayoutScriptFindLanguage(Face face, Tag tableTag, int scriptIndex, Tag languageTag, MemorySegment languageIndex) Deprecated.static intotLayoutScriptGetLanguageTags(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.static BoolotLayoutScriptSelectLanguage(Face face, Tag tableTag, int scriptIndex, int languageCount, Tag languageTags, Out<Integer> languageIndex) Fetches the index of the first language tag fomlanguageTagsthat is present in the specified face's GSUB or GPOS table, underneath the specified script index.static BoolotLayoutScriptSelectLanguage2(Face face, Tag tableTag, int scriptIndex, int languageCount, Tag languageTags, Out<Integer> languageIndex, Tag chosenLanguage) Fetches the index of the first language tag fomlanguageTagsthat is present in the specified face's GSUB or GPOS table, underneath the specified script index.static BoolotLayoutTableChooseScript(Face face, Tag tableTag, Tag scriptTags, Out<Integer> scriptIndex, Tag chosenScript) Deprecated since 2.0.0static BoolotLayoutTableFindFeatureVariations(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.static BoolFetches the index if a given script tag in the specified face's GSUB table or GPOS table.static intotLayoutTableGetFeatureTags(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.static intotLayoutTableGetLookupCount(Face face, Tag tableTag) Fetches the total number of lookups enumerated in the specified face's GSUB table or GPOS table.static intotLayoutTableGetScriptTags(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.static BoolotLayoutTableSelectScript(Face face, Tag tableTag, int scriptCount, Tag scriptTags, @Nullable Out<Integer> scriptIndex, @Nullable Tag chosenScript) Selects an OpenType script fortableTagfrom thescriptTagsarray.static PositionotMathGetConstant(Font font, OtMathConstant constant) Fetches the specified math constant.static intotMathGetGlyphAssembly(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.static PositionotMathGetGlyphItalicsCorrection(Font font, Codepoint glyph) Fetches an italics-correction value (if one exists) for the specified glyph index.static PositionotMathGetGlyphKerning(Font font, Codepoint glyph, OtMathKern kern, Position correctionHeight) Fetches the math kerning (cut-ins) value for the specified font, glyph index, andkern.static intotMathGetGlyphKernings(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, andkern.The corresponding list of kern values and correction heights is returned as a list ofhb_ot_math_kern_entry_tstructs.static PositionotMathGetGlyphTopAccentAttachment(Font font, Codepoint glyph) Fetches a top-accent-attachment value (if one exists) for the specified glyph index.static intotMathGetGlyphVariants(Font font, Codepoint glyph, Direction direction, int startOffset, @Nullable Out<OtMathGlyphVariant[]> variants) Fetches the MathGlyphConstruction for the specified font, glyph index, and direction.static PositionotMathGetMinConnectorOverlap(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.static BoolotMathHasData(Face face) Tests whether a face has aMATHtable.static BoolotMathIsGlyphExtendedShape(Face face, Codepoint glyph) Tests whether the given glyph index is an extended shape in the face.static intotMetaGetEntryTags(Face face, int startOffset, @Nullable Out<OtMetaTag[]> entries) Fetches all available feature types.static BlobotMetaReferenceEntry(Face face, OtMetaTag metaTag) It fetches metadata entry of a given tag from a font.static BoolotMetricsGetPosition(Font font, OtMetricsTag metricsTag, @Nullable Position position) Fetches metrics value corresponding tometricsTagfromfont.static voidotMetricsGetPositionWithFallback(Font font, OtMetricsTag metricsTag, @Nullable Position position) Fetches metrics value corresponding tometricsTagfromfont,and synthesizes a value if it the value is missing in the font.static floatotMetricsGetVariation(Font font, OtMetricsTag metricsTag) Fetches metrics value corresponding tometricsTagfromfontwith the current font variation settings applied.static PositionotMetricsGetXVariation(Font font, OtMetricsTag metricsTag) Fetches horizontal metrics value corresponding tometricsTagfromfontwith the current font variation settings applied.static PositionotMetricsGetYVariation(Font font, OtMetricsTag metricsTag) Fetches vertical metrics value corresponding tometricsTagfromfontwith the current font variation settings applied.static intotNameGetUtf16(Face face, OtNameId nameId, @Nullable Language language, @Nullable Out<short[]> text) Fetches a font name from the OpenType 'name' table.static intotNameGetUtf32(Face face, OtNameId nameId, @Nullable Language language, @Nullable Out<int[]> text) Fetches a font name from the OpenType 'name' table.static intotNameGetUtf8(Face face, OtNameId nameId, @Nullable Language language, @Nullable Out<String[]> text) Fetches a font name from the OpenType 'name' table.static voidotShapeGlyphsClosure(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.static voidotShapePlanCollectLookups(ShapePlan shapePlan, Tag tableTag, Set lookupIndexes) Computes the complete set of GSUB or GPOS lookups that are applicable under a givenshapePlan.static intotShapePlanGetFeatureTags(ShapePlan shapePlan, int startOffset, @Nullable Out<Tag[]> tags) Fetches the list of OpenType feature tags enabled for a shaping plan, if possible.static TagotTagFromLanguage(@Nullable Language language) Deprecated.use hb_ot_tags_from_script_and_language() insteadstatic voidotTagsFromScript(Script script, Tag scriptTag1, Tag scriptTag2) Deprecated.use hb_ot_tags_from_script_and_language() insteadstatic voidotTagsToScriptAndLanguage(Tag scriptTag, Tag languageTag, @Nullable Out<Script> script, @Nullable Language language) Converts a script tag and a language tag to anhb_script_tand anhb_language_t.static @Nullable LanguageotTagToLanguage(Tag tag) Converts a language tag to anhb_language_t.static ScriptotTagToScript(Tag tag) Converts a script tag to anhb_script_t.static BoolotVarFindAxis(Face face, Tag axisTag, MemorySegment axisIndex, OtVarAxis axisInfo) Deprecated.use hb_ot_var_find_axis_info() insteadstatic BoolotVarFindAxisInfo(Face face, Tag axisTag, OtVarAxisInfo axisInfo) Fetches the variation-axis information corresponding to the specified axis tag in the specified face.static intotVarGetAxes(Face face, int startOffset, @Nullable Out<OtVarAxis[]> axesArray) Deprecated.use hb_ot_var_get_axis_infos() insteadstatic intotVarGetAxisCount(Face face) Fetches the number of OpenType variation axes included in the face.static intotVarGetAxisInfos(Face face, int startOffset, @Nullable Out<OtVarAxisInfo[]> axesArray) Fetches a list of all variation axes in the specified face.static intFetches the number of named instances included in the face.static BoolotVarHasData(Face face) Tests whether a face includes any OpenType variation data in thefvartable.static intotVarNamedInstanceGetDesignCoords(Face face, int instanceIndex, @Nullable Out<float[]> coords) Fetches the design-space coordinates corresponding to the given named instance in the face.static OtNameIdotVarNamedInstanceGetPostscriptNameId(Face face, int instanceIndex) Fetches thenametable Name ID that provides display names for the "PostScript name" defined for the given named instance in the face.static OtNameIdotVarNamedInstanceGetSubfamilyNameId(Face face, int instanceIndex) Fetches thenametable Name ID that provides display names for the "Subfamily name" defined for the given named instance in the face.static voidotVarNormalizeCoords(Face face, int coordsLength, MemorySegment designCoords, Out<Integer> normalizedCoords) Normalizes the given design-space coordinates.static voidotVarNormalizeVariations(Face face, Variation variations, int variationsLength, @Nullable Out<int[]> coords) Normalizes all of the coordinates in the given list of variation axes.static voidpaintColor(PaintFuncs funcs, @Nullable MemorySegment paintData, Bool isForeground, Color color) Perform a "color" paint operation.static BoolpaintColorGlyph(PaintFuncs funcs, @Nullable MemorySegment paintData, Codepoint glyph, Font font) Perform a "color-glyph" paint operation.static BoolpaintCustomPaletteColor(PaintFuncs funcs, @Nullable MemorySegment paintData, int colorIndex, Color color) Gets the custom palette color forcolorIndex.static PaintFuncsCreates a newhb_paint_funcs_tstructure of paint functions.static voidpaintFuncsDestroy(PaintFuncs funcs) Decreases the reference count on a paint-functions structure.static PaintFuncsFetches the singleton empty paint-functions structure.static @Nullable MemorySegmentpaintFuncsGetUserData(PaintFuncs funcs, UserDataKey key) Fetches the user-data associated with the specified key, attached to the specified paint-functions structure.static BoolpaintFuncsIsImmutable(PaintFuncs funcs) Tests whether a paint-functions structure is immutable.static voidMakes a paint-functions structure immutable.static PaintFuncspaintFuncsReference(PaintFuncs funcs) Increases the reference count on a paint-functions structure.static voidpaintFuncsSetColorFunc(PaintFuncs funcs, @Nullable PaintColorFunc func, @Nullable DestroyFunc destroy) Sets the paint-color callback on the paint functions struct.static voidpaintFuncsSetColorGlyphFunc(PaintFuncs funcs, @Nullable PaintColorGlyphFunc func, @Nullable DestroyFunc destroy) Sets the color-glyph callback on the paint functions struct.static voidpaintFuncsSetCustomPaletteColorFunc(PaintFuncs funcs, @Nullable PaintCustomPaletteColorFunc func, @Nullable DestroyFunc destroy) Sets the custom-palette-color callback on the paint functions struct.static voidpaintFuncsSetImageFunc(PaintFuncs funcs, @Nullable PaintImageFunc func, @Nullable DestroyFunc destroy) Sets the paint-image callback on the paint functions struct.static voidpaintFuncsSetLinearGradientFunc(PaintFuncs funcs, @Nullable PaintLinearGradientFunc func, @Nullable DestroyFunc destroy) Sets the linear-gradient callback on the paint functions struct.static voidpaintFuncsSetPopClipFunc(PaintFuncs funcs, @Nullable PaintPopClipFunc func, @Nullable DestroyFunc destroy) Sets the pop-clip callback on the paint functions struct.static voidpaintFuncsSetPopGroupFunc(PaintFuncs funcs, @Nullable PaintPopGroupFunc func, @Nullable DestroyFunc destroy) Sets the pop-group callback on the paint functions struct.static voidpaintFuncsSetPopTransformFunc(PaintFuncs funcs, @Nullable PaintPopTransformFunc func, @Nullable DestroyFunc destroy) Sets the pop-transform callback on the paint functions struct.static voidpaintFuncsSetPushClipGlyphFunc(PaintFuncs funcs, @Nullable PaintPushClipGlyphFunc func, @Nullable DestroyFunc destroy) Sets the push-clip-glyph callback on the paint functions struct.static voidpaintFuncsSetPushClipRectangleFunc(PaintFuncs funcs, @Nullable PaintPushClipRectangleFunc func, @Nullable DestroyFunc destroy) Sets the push-clip-rect callback on the paint functions struct.static voidpaintFuncsSetPushGroupFunc(PaintFuncs funcs, @Nullable PaintPushGroupFunc func, @Nullable DestroyFunc destroy) Sets the push-group callback on the paint functions struct.static voidpaintFuncsSetPushTransformFunc(PaintFuncs funcs, @Nullable PaintPushTransformFunc func, @Nullable DestroyFunc destroy) Sets the push-transform callback on the paint functions struct.static voidpaintFuncsSetRadialGradientFunc(PaintFuncs funcs, @Nullable PaintRadialGradientFunc func, @Nullable DestroyFunc destroy) Sets the radial-gradient callback on the paint functions struct.static voidpaintFuncsSetSweepGradientFunc(PaintFuncs funcs, @Nullable PaintSweepGradientFunc func, @Nullable DestroyFunc destroy) Sets the sweep-gradient callback on the paint functions struct.static BoolpaintFuncsSetUserData(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.static voidpaintImage(PaintFuncs funcs, @Nullable MemorySegment paintData, Blob image, int width, int height, Tag format, float slant, @Nullable GlyphExtents extents) Perform a "image" paint operation.static voidpaintLinearGradient(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.static voidpaintPopClip(PaintFuncs funcs, @Nullable MemorySegment paintData) Perform a "pop-clip" paint operation.static voidpaintPopGroup(PaintFuncs funcs, @Nullable MemorySegment paintData, PaintCompositeMode mode) Perform a "pop-group" paint operation.static voidpaintPopTransform(PaintFuncs funcs, @Nullable MemorySegment paintData) Perform a "pop-transform" paint operation.static voidpaintPushClipGlyph(PaintFuncs funcs, @Nullable MemorySegment paintData, Codepoint glyph, Font font) Perform a "push-clip-glyph" paint operation.static voidpaintPushClipRectangle(PaintFuncs funcs, @Nullable MemorySegment paintData, float xmin, float ymin, float xmax, float ymax) Perform a "push-clip-rect" paint operation.static voidpaintPushFontTransform(PaintFuncs funcs, @Nullable MemorySegment paintData, Font font) Push the transform reflecting the font's scale and slant settings onto the paint functions.static voidpaintPushGroup(PaintFuncs funcs, @Nullable MemorySegment paintData) Perform a "push-group" paint operation.static voidpaintPushInverseFontTransform(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.static voidpaintPushTransform(PaintFuncs funcs, @Nullable MemorySegment paintData, float xx, float yx, float xy, float yy, float dx, float dy) Perform a "push-transform" paint operation.static voidpaintRadialGradient(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.static voidpaintSweepGradient(PaintFuncs funcs, @Nullable MemorySegment paintData, ColorLine colorLine, float x0, float y0, float startAngle, float endAngle) Perform a "sweep-gradient" paint operation.static @Nullable MemorySegmentrealloc(@Nullable MemorySegment ptr, long size) Reallocates the memory pointed to byptrtosizebytes, using the allocator set at compile-time.static ScriptscriptFromIso15924Tag(Tag tag) Converts an ISO 15924 script tag to a correspondinghb_script_t.static ScriptscriptFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Converts a stringstrrepresenting an ISO 15924 script tag to a correspondinghb_script_t.static DirectionscriptGetHorizontalDirection(Script script) Fetches thehb_direction_tof a script when it is set horizontally.static TagscriptToIso15924Tag(Script script) Converts anhb_script_tto a corresponding ISOÂ 15924 script tag.static BoolChecks the equality of twohb_segment_properties_t's.static intCreates a hash representingp.static voidFills in missing fields ofpfromsrcin a considered manner.static voidAddscodepointtoset.static voidsetAddRange(Set set, Codepoint first, Codepoint last) Adds all of the elements fromfirsttolast(inclusive) toset.static voidsetAddSortedArray(Set set, @Nullable Codepoint @Nullable [] sortedCodepoints) AddsnumCodepointscodepoints to a set at once.static BoolTests whether memory allocation for a set was successful.static voidClears out the contents of a set.static SetAllocate a copy ofset.static SetCreates a new, initially empty set.static voidRemovescodepointfromset.static voidsetDelRange(Set set, Codepoint first, Codepoint last) Removes all of the elements fromfirsttolast(inclusive) fromset.static voidsetDestroy(Set set) Decreases the reference count on a set.static SetFetches the singleton emptyhb_set_t.static CodepointFinds the largest element in the set.static CodepointFinds the smallest element in the set.static intsetGetPopulation(Set set) Returns the number of elements in the set.static @Nullable MemorySegmentsetGetUserData(Set set, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified set.static BoolTests whethercodepointbelongs toset.static intCreates a hash representingset.static voidsetIntersect(Set set, Set other) Makessetthe intersection ofsetandother.static voidInverts the contents ofset.static BoolsetIsEmpty(Set set) Tests whether a set is empty (contains no elements).static BoolsetIsEqual(Set set, Set other) Tests whethersetandotherare equal (contain the same elements).static BoolsetIsInverted(Set set) Returns whether the set is inverted.static BoolsetIsSubset(Set set, Set largerSet) Tests whethersetis a subset oflargerSet.static BoolFetches the next element insetthat is greater than current value ofcodepoint.static intsetNextMany(Set set, Codepoint codepoint, @Nullable Codepoint @Nullable [] out) Finds the next element insetthat is greater thancodepoint.Writes out codepoints toout,until either the set runs out of elements, orsizecodepoints are written, whichever comes first.static BoolsetNextRange(Set set, Codepoint first, Codepoint last) Fetches the next consecutive range of elements insetthat are greater than current value oflast.static BoolsetPrevious(Set set, Codepoint codepoint) Fetches the previous element insetthat is lower than current value ofcodepoint.static BoolsetPreviousRange(Set set, Codepoint first, Codepoint last) Fetches the previous consecutive range of elements insetthat are greater than current value oflast.static SetsetReference(Set set) Increases the reference count on a set.static voidMakes the contents ofsetequal to the contents ofother.static BoolsetSetUserData(Set set, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified set.static voidsetSubtract(Set set, Set other) Subtracts the contents ofotherfromset.static voidsetSymmetricDifference(Set set, Set other) Makessetthe symmetric difference ofsetandother.static voidMakessetthe union ofsetandother.static voidShapesbufferusingfontturning its Unicode characters content to positioned glyphs.static BoolshapeFull(Font font, Buffer buffer, @Nullable Feature @Nullable [] features, @Nullable String @Nullable [] shaperList) See hb_shape() for details.static String[]Retrieves the list of shapers supported by HarfBuzz.static ShapePlanshapePlanCreate(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @Nullable String @Nullable [] shaperList) Constructs a shaping plan for a combination offace,userFeatures,props,andshaperList.static ShapePlanshapePlanCreate2(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @org.jspecify.annotations.Nullable int @Nullable [] coords, @Nullable String @Nullable [] shaperList) The variable-font version ofhb_shape_plan_create.static ShapePlanshapePlanCreateCached(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @Nullable String @Nullable [] shaperList) Creates a cached shaping plan suitable for reuse, for a combination offace,userFeatures,props,andshaperList.static ShapePlanshapePlanCreateCached2(Face face, SegmentProperties props, @Nullable Feature @Nullable [] userFeatures, @org.jspecify.annotations.Nullable int @Nullable [] coords, @Nullable String @Nullable [] shaperList) The variable-font version ofhb_shape_plan_create_cached.static voidshapePlanDestroy(ShapePlan shapePlan) Decreases the reference count on the given shaping plan.static BoolshapePlanExecute(ShapePlan shapePlan, Font font, Buffer buffer, @Nullable Feature @Nullable [] features) Executes the given shaping plan on the specified buffer, using the givenfontandfeatures.static ShapePlanFetches the singleton empty shaping plan.static StringshapePlanGetShaper(ShapePlan shapePlan) Fetches the shaper from a given shaping plan.static @Nullable MemorySegmentshapePlanGetUserData(ShapePlan shapePlan, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified shaping plan.static ShapePlanshapePlanReference(ShapePlan shapePlan) Increases the reference count on the given shaping plan.static BoolshapePlanSetUserData(ShapePlan shapePlan, UserDataKey key, @Nullable MemorySegment data, @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the given shaping plan.static floatstyleGetValue(Font font, StyleTag styleTag) Searches variation axes of ahb_font_tobject for a specific axis first, if not set, first tries to get default style values inSTATtable then tries to polyfill from different tables of the font.static TagtagFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Converts a string into anhb_tag_t.static voidtagToString(Tag tag, @Nullable Out<byte[]> buf) Converts anhb_tag_tto a string and returns it inbuf.Strings will be four characters long.static UnicodeCombiningClassunicodeCombiningClass(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves the Canonical Combining Class (ccc) property of code pointunicode.static BoolunicodeCompose(UnicodeFuncs ufuncs, Codepoint a, Codepoint b, Codepoint ab) Fetches the composition of a sequence of two Unicode code points.static BoolunicodeDecompose(UnicodeFuncs ufuncs, Codepoint ab, Codepoint a, Codepoint b) Fetches the decomposition of a Unicode code point.static intunicodeDecomposeCompatibility(UnicodeFuncs ufuncs, Codepoint u, Codepoint decomposed) Deprecated.static intunicodeEastasianWidth(UnicodeFuncs ufuncs, Codepoint unicode) Deprecated.static UnicodeFuncsunicodeFuncsCreate(@Nullable UnicodeFuncs parent) Creates a newhb_unicode_funcs_tstructure of Unicode functions.static voidunicodeFuncsDestroy(UnicodeFuncs ufuncs) Decreases the reference count on a Unicode-functions structure.static UnicodeFuncsFetches a pointer to the default Unicode-functions structure that is used when no functions are explicitly set onhb_buffer_t.static UnicodeFuncsFetches the singleton empty Unicode-functions structure.static UnicodeFuncsunicodeFuncsGetParent(UnicodeFuncs ufuncs) Fetches the parent of the Unicode-functions structureufuncs.static @Nullable MemorySegmentunicodeFuncsGetUserData(UnicodeFuncs ufuncs, UserDataKey key) Fetches the user-data associated with the specified key, attached to the specified Unicode-functions structure.static BoolunicodeFuncsIsImmutable(UnicodeFuncs ufuncs) Tests whether the specified Unicode-functions structure is immutable.static voidMakes the specified Unicode-functions structure immutable.static UnicodeFuncsunicodeFuncsReference(UnicodeFuncs ufuncs) Increases the reference count on a Unicode-functions structure.static voidunicodeFuncsSetCombiningClassFunc(UnicodeFuncs ufuncs, @Nullable UnicodeCombiningClassFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_combining_class_func_t.static voidunicodeFuncsSetComposeFunc(UnicodeFuncs ufuncs, @Nullable UnicodeComposeFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_compose_func_t.static voidunicodeFuncsSetDecomposeCompatibilityFunc(UnicodeFuncs ufuncs, @Nullable UnicodeDecomposeCompatibilityFunc func, @Nullable DestroyFunc destroy) Deprecated.static voidunicodeFuncsSetDecomposeFunc(UnicodeFuncs ufuncs, @Nullable UnicodeDecomposeFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_decompose_func_t.static voidunicodeFuncsSetEastasianWidthFunc(UnicodeFuncs ufuncs, @Nullable UnicodeEastasianWidthFunc func, @Nullable DestroyFunc destroy) Deprecated.static voidunicodeFuncsSetGeneralCategoryFunc(UnicodeFuncs ufuncs, @Nullable UnicodeGeneralCategoryFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_general_category_func_t.static voidunicodeFuncsSetMirroringFunc(UnicodeFuncs ufuncs, @Nullable UnicodeMirroringFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_mirroring_func_t.static voidunicodeFuncsSetScriptFunc(UnicodeFuncs ufuncs, @Nullable UnicodeScriptFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_script_func_t.static BoolunicodeFuncsSetUserData(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.static UnicodeGeneralCategoryunicodeGeneralCategory(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves the General Category (gc) property of code pointunicode.static CodepointunicodeMirroring(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves the Bi-directional Mirroring Glyph code point defined for code pointunicode.static ScriptunicodeScript(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves thehb_script_tscript to which code pointunicodebelongs.static BoolvariationFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str, Variation variation) Parses a string into ahb_variation_t.static voidvariationToString(Variation variation, @Nullable Out<String[]> buf) Converts anhb_variation_tinto aNULL-terminated string in the format understood by hb_variation_from_string().
-
Field Details
-
AAT_LAYOUT_NO_SELECTOR_INDEX
public static final int AAT_LAYOUT_NO_SELECTOR_INDEXUsed 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_DEFAULTThe 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
-
FEATURE_GLOBAL_START
public static final int FEATURE_GLOBAL_STARTSpecial setting forhb_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_INSTANCEConstant 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_INDEXSpecial value for language index indicating default or unsupported language.- See Also:
-
OT_LAYOUT_NO_FEATURE_INDEX
public static final int OT_LAYOUT_NO_FEATURE_INDEXSpecial value for feature index indicating unsupported feature.- See Also:
-
OT_LAYOUT_NO_SCRIPT_INDEX
public static final int OT_LAYOUT_NO_SCRIPT_INDEXSpecial value for script index indicating unsupported script.- See Also:
-
OT_LAYOUT_NO_VARIATIONS_INDEX
public static final int OT_LAYOUT_NO_VARIATIONS_INDEXSpecial value for variations index indicating unsupported variation.- See Also:
-
OT_MAX_TAGS_PER_LANGUAGE
public static final int OT_MAX_TAGS_PER_LANGUAGEMaximum number of OpenType tags that can correspond to a givehb_language_t.- Since:
- 2.0.0
- See Also:
-
OT_MAX_TAGS_PER_SCRIPT
public static final int OT_MAX_TAGS_PER_SCRIPTMaximum number of OpenType tags that can correspond to a givehb_script_t.- Since:
- 2.0.0
- See Also:
-
OT_VAR_NO_AXIS_INDEX
Deprecated.Do not use.- Since:
- 1.4.2
- See Also:
-
UNICODE_COMBINING_CLASS_CCC133
-
UNICODE_MAX
public static final int UNICODE_MAXMaximum valid Unicode code point.- Since:
- 1.9.0
- See Also:
-
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
- See Also:
-
-
Constructor Details
-
HarfBuzz
public HarfBuzz()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
aatLayoutFeatureTypeGetNameId
Fetches the name identifier of the specified feature type in the face'snametable.- Parameters:
face-hb_face_tto work uponfeatureType- Thehb_aat_layout_feature_type_tof 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,
defaultIndexis set toHB_AAT_LAYOUT_NO_SELECTOR_INDEX, then the feature type is non-exclusive. Otherwise,defaultIndexis the index of the selector that is selected by default.- Parameters:
face-hb_face_tto work uponfeatureType- Thehb_aat_layout_feature_type_tof the requested feature typestartOffset- offset of the first feature type to retrieveselectors- 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_tto work uponstartOffset- offset of the first feature type to retrievefeatures- Array of feature types found- Returns:
- Number of all available feature types.
- Since:
- 2.2.0
-
aatLayoutHasPositioning
-
aatLayoutHasSubstitution
-
aatLayoutHasTracking
-
blobCopyWritableOrFail
-
blobCreate
public static Blob blobCreate(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata.Themodeparameter is used to negotiate ownership and lifecycle ofdata.- Parameters:
data- Pointer to blob data.length- Length ofdatain bytes.mode- Memory mode fordata.userData- Data parameter to pass todestroy.destroy- Callback to call whendatais not needed anymore.- Returns:
- New blob, or the empty blob if something failed or if
lengthis zero. Destroy with hb_blob_destroy(). - Since:
- 0.9.2
-
blobCreateFromFile
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_tpointer with the content of the file, or hb_blob_get_empty() if failed. - Since:
- 1.7.7
-
blobCreateFromFileOrFail
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_tpointer with the content of the file, orNULLif 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 wrappingdata.Themodeparameter is used to negotiate ownership and lifecycle ofdata.Note that this function returns a freshly-allocated empty blob even if
lengthis zero. This is in contrast to hb_blob_create(), which returns the singleton empty blob (as returned by hb_blob_get_empty()) iflengthis zero.- Parameters:
data- Pointer to blob data.length- Length ofdatain bytes.mode- Memory mode fordata.userData- Data parameter to pass todestroy.destroy- Callback to call whendatais not needed anymore.- Returns:
- New blob, or
NULLif failed. Destroy with hb_blob_destroy(). - Since:
- 2.8.2
-
blobCreateSubBlob
Returns a blob that represents a range of bytes inparent.The new blob is always created withHB_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
parentimmutable.- Parameters:
parent- Parent blob.offset- Start offset of sub-blob withinparent,in bytes.length- Length of sub-blob.- Returns:
- New blob, or the empty blob if something failed or if
lengthis zero oroffsetis beyond the end ofparent'sdata. Destroy with hb_blob_destroy(). - Since:
- 0.9.2
-
blobDestroy
Decreases the reference count onblob,and if it reaches zero, destroysblob,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
-
blobGetDataWritable
-
blobGetEmpty
Returns the singleton empty blob.See TODO:link object types for more information.
- Returns:
- The empty blob.
- Since:
- 0.9.2
-
blobGetLength
Fetches the length of a blob's data.- Parameters:
blob- a blob.- Returns:
- the length of
blobdata in bytes. - Since:
- 0.9.2
-
blobGetUserData
Fetches the user data associated with the specified key, attached to the specified font-functions structure.- Parameters:
blob- a blobkey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.2
-
blobIsImmutable
-
blobMakeImmutable
Makes a blob immutable.- Parameters:
blob- a blob- Since:
- 0.9.2
-
blobReference
-
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- Anhb_blob_tkey- The user-data key to setdata- A pointer to the user data to setdestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
bufferAdd
Appends a character with the Unicode value ofcodepointtobuffer,and gives it the initial cluster value ofcluster.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 inhb_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- Anhb_buffer_tcodepoint- A Unicode code point.cluster- The cluster value ofcodepoint.- Since:
- 0.9.7
-
bufferAddCodepoints
public static void bufferAddCodepoints(Buffer buffer, @Nullable Codepoint @Nullable [] text, int itemOffset, int itemLength) Appends characters fromtextarray tobuffer.TheitemOffsetis the position of the first character fromtextthat will be appended, anditemLengthis 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 asitemOffsetanditemLength,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- ahb_buffer_tto append characters to.text- an array of Unicode code points to append.itemOffset- the offset of the first code point to add to thebuffer.itemLength- the number of code points to add to thebuffer,or -1 for the end oftext(assuming it isNULLterminated).- Since:
- 0.9.31
-
bufferAddLatin1
public static void bufferAddLatin1(Buffer buffer, @org.jspecify.annotations.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.<note>Has nothing to do with non-Unicode Latin-1 encoding.</note>
- Parameters:
buffer- Anhb_buffer_ttext- an array of UTF-8 characters to appenditemOffset- the offset of the first character to add to thebufferitemLength- the number of characters to add to thebuffer,or -1 for the end oftext(assuming it isNULLterminated)- Since:
- 0.9.39
-
bufferAddUtf16
public static void bufferAddUtf16(Buffer buffer, @org.jspecify.annotations.Nullable short @Nullable [] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().Replaces invalid UTF-16 characters with the
bufferreplacement code point, see hb_buffer_set_replacement_codepoint().- Parameters:
buffer- Anhb_buffer_ttext- An array of UTF-16 characters to appenditemOffset- The offset of the first character to add to thebufferitemLength- The number of characters to add to thebuffer,or -1 for the end oftext(assuming it isNULLterminated)- Since:
- 0.9.2
-
bufferAddUtf32
public static void bufferAddUtf32(Buffer buffer, @org.jspecify.annotations.Nullable int @Nullable [] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().Replaces invalid UTF-32 characters with the
bufferreplacement code point, see hb_buffer_set_replacement_codepoint().- Parameters:
buffer- Anhb_buffer_ttext- An array of UTF-32 characters to appenditemOffset- The offset of the first character to add to thebufferitemLength- The number of characters to add to thebuffer,or -1 for the end oftext(assuming it isNULLterminated)- Since:
- 0.9.2
-
bufferAddUtf8
public static void bufferAddUtf8(Buffer buffer, @org.jspecify.annotations.Nullable byte @Nullable [] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().Replaces invalid UTF-8 characters with the
bufferreplacement code point, see hb_buffer_set_replacement_codepoint().- Parameters:
buffer- Anhb_buffer_ttext- An array of UTF-8 characters to append.itemOffset- The offset of the first character to add to thebuffer.itemLength- The number of characters to add to thebuffer,or -1 for the end oftext(assuming it isNULLterminated).- Since:
- 0.9.2
-
bufferAllocationSuccessful
-
bufferAppend
Append (part of) contents of another buffer to this buffer.- Parameters:
buffer- Anhb_buffer_tsource- sourcehb_buffer_tstart- start index into source buffer to copy. Use 0 to copy from start of buffer.end- end index into source buffer to copy. UseUINTMAX(or ((unsigned int) -1)) to copy to end of buffer.- Since:
- 1.5.0
-
bufferClearContents
Similar to hb_buffer_reset(), but does not clear the Unicode functions and the replacement code point.- Parameters:
buffer- Anhb_buffer_t- Since:
- 0.9.11
-
bufferCreate
Creates a newhb_buffer_twith all properties to defaults.- Returns:
- A newly allocated
hb_buffer_twith a reference count of 1. The initial reference count should be released with hb_buffer_destroy() when you are done using thehb_buffer_t. This function never returnsNULL. If memory cannot be allocated, a specialhb_buffer_tobject will be returned on which hb_buffer_allocation_successful() returnsfalse. - Since:
- 0.9.2
-
bufferCreateSimilar
-
bufferDeserializeGlyphs
public static Bool bufferDeserializeGlyphs(Buffer buffer, @Nullable String @Nullable [] buf, @Nullable Out<String> endPtr, @Nullable Font font, BufferSerializeFormat format) Deserializes glyphsbufferfrom textual representation in the format produced by hb_buffer_serialize_glyphs().- Parameters:
buffer- anhb_buffer_tbuffer.buf- string to deserializeendPtr- output pointer to the character after last consumed one.font- font for getting glyph IDsformat- thehb_buffer_serialize_format_tof the inputbuf- Returns:
trueif the full string was parsed,falseotherwise.- Since:
- 0.9.7
-
bufferDeserializeUnicode
public static Bool bufferDeserializeUnicode(Buffer buffer, @Nullable String @Nullable [] buf, @Nullable Out<String> endPtr, BufferSerializeFormat format) Deserializes Unicodebufferfrom textual representation in the format produced by hb_buffer_serialize_unicode().- Parameters:
buffer- anhb_buffer_tbuffer.buf- string to deserializeendPtr- output pointer to the character after last consumed one.format- thehb_buffer_serialize_format_tof the inputbuf- Returns:
trueif the full string was parsed,falseotherwise.- Since:
- 2.7.3
-
bufferDestroy
Deallocate thebuffer.Decreases the reference count onbufferby one. If the result is zero, thenbufferand all associated resources are freed. See hb_buffer_reference().- Parameters:
buffer- Anhb_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 thenHB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENTandHB_BUFFER_DIFF_FLAG_NOTDEF_PRESENTare 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
Fetches the cluster level of a buffer. Thehb_buffer_cluster_level_tdictates one aspect of how HarfBuzz will treat non-base characters during shaping.- Parameters:
buffer- Anhb_buffer_t- Returns:
- The cluster level of
buffer - Since:
- 0.9.42
-
bufferGetContentType
Fetches the type ofbuffercontents. Buffers are either empty, contain characters (before shaping), or contain glyphs (the result of shaping).- Parameters:
buffer- Anhb_buffer_t- Returns:
- The type of
buffercontents - Since:
- 0.9.5
-
bufferGetDirection
-
bufferGetEmpty
Fetches an emptyhb_buffer_t.- Returns:
- The empty buffer
- Since:
- 0.9.2
-
bufferGetFlags
Fetches thehb_buffer_flags_tofbuffer.- Parameters:
buffer- Anhb_buffer_t- Returns:
- The
bufferflags - Since:
- 0.9.7
-
bufferGetGlyphInfos
Returnsbufferglyph information array. Returned pointer is valid as long asbuffercontents are not modified.- Parameters:
buffer- Anhb_buffer_t- Returns:
- The
bufferglyph information array. The value valid as long as buffer has not been modified. - Since:
- 0.9.2
-
bufferGetGlyphPositions
Returnsbufferglyph position array. Returned pointer is valid as long asbuffercontents 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
NULLis returned.- Parameters:
buffer- Anhb_buffer_t- Returns:
- The
bufferglyph position array. The value valid as long as buffer has not been modified. - Since:
- 0.9.2
-
bufferGetInvisibleGlyph
-
bufferGetLanguage
-
bufferGetLength
Returns the number of items in the buffer.- Parameters:
buffer- Anhb_buffer_t- Returns:
- The
bufferlength. The value valid as long as buffer has not been modified. - Since:
- 0.9.2
-
bufferGetNotFoundGlyph
-
bufferGetNotFoundVariationSelectorGlyph
-
bufferGetRandomState
See hb_buffer_set_random_state().- Parameters:
buffer- Anhb_buffer_t- Returns:
- The
bufferrandom state - Since:
- 8.4.0
-
bufferGetReplacementCodepoint
-
bufferGetScript
-
bufferGetSegmentProperties
Setspropsto thehb_segment_properties_tofbuffer.- Parameters:
buffer- Anhb_buffer_tprops- The outputhb_segment_properties_t- Since:
- 0.9.7
-
bufferGetUnicodeFuncs
Fetches the Unicode-functions structure of a buffer.- Parameters:
buffer- Anhb_buffer_t- Returns:
- The Unicode-functions structure
- Since:
- 0.9.2
-
bufferGetUserData
Fetches the user data associated with the specified key, attached to the specified buffer.- Parameters:
buffer- Anhb_buffer_tkey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.2
-
bufferGuessSegmentProperties
Sets unset buffer segment properties based on buffer Unicode contents. If buffer is not empty, it must have content typeHB_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 thanHB_SCRIPT_COMMON,HB_SCRIPT_INHERITED, andHB_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() returnsHB_DIRECTION_INVALID, thenHB_DIRECTION_LTRis 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- Anhb_buffer_t- Since:
- 0.9.7
-
bufferHasPositions
Returns whetherbufferhas 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- anhb_buffer_t.- Returns:
trueif thebufferhas position array,falseotherwise.- Since:
- 2.7.3
-
bufferNormalizeGlyphs
Reorders a glyph buffer to have canonical in-cluster glyph order / position. The resulting clusters should behave identical to pre-reordering clusters.<note>This has nothing to do with Unicode normalization.</note>
- Parameters:
buffer- Anhb_buffer_t- Since:
- 0.9.2
-
bufferPreAllocate
-
bufferReference
-
bufferReset
Resets the buffer to its initial status, as if it was just newly created with hb_buffer_create().- Parameters:
buffer- Anhb_buffer_t- Since:
- 0.9.2
-
bufferReverse
Reverses buffer contents.- Parameters:
buffer- Anhb_buffer_t- Since:
- 0.9.2
-
bufferReverseClusters
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- Anhb_buffer_t- Since:
- 0.9.2
-
bufferReverseRange
Reverses buffer contents betweenstartandend.- Parameters:
buffer- Anhb_buffer_tstart- start indexend- 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) Serializesbufferinto 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- anhb_buffer_tbuffer.start- the first item inbufferto serialize.end- the last item inbufferto serialize.buf- output string to write serialized buffer into.bufConsumed- if notNULL, will be set to the number of bytes written intobuf.font- thehb_font_tused to shape this buffer, needed to read glyph names and extents. IfNULL, an empty font will be used.format- thehb_buffer_serialize_format_tto use for formatting the output.flags- thehb_buffer_serialize_flags_tthat 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) Serializesbufferinto 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- anhb_buffer_tbuffer.start- the first item inbufferto serialize.end- the last item inbufferto serialize.buf- output string to write serialized buffer into.bufConsumed- if notNULL, will be set to the number of bytes written intobuf.font- thehb_font_tused to shape this buffer, needed to read glyph names and extents. IfNULL, an empty font will be used.format- thehb_buffer_serialize_format_tto use for formatting the output.flags- thehb_buffer_serialize_flags_tthat control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Since:
- 2.7.3
-
bufferSerializeFormatFromString
public static BufferSerializeFormat bufferSerializeFormatFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Parses a string into anhb_buffer_serialize_format_t. Does not check ifstris 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
Convertsformatto the string corresponding it, orNULLif it is not a validhb_buffer_serialize_format_t.- Parameters:
format- anhb_buffer_serialize_format_tto convert.- Returns:
- A
NULLterminated string corresponding toformat.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) Serializesbufferinto 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_NAMESflag is set. Then, - If
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERSis not set,=thenhb_glyph_info_t.cluster. - If
HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONSis not set, thehb_glyph_position_tin the format: - If both
hb_glyph_position_t.x_offset andhb_glyph_position_t.y_offset are not 0,@x_offset,y_offset. Then, +x_advance, then,y_advanceifhb_glyph_position_t.y_advance is not 0. Then,- If
HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTSis set, thehb_glyph_extents_tin 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 ifHB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMESflag is set.cl:hb_glyph_info_t.cluster ifHB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERSis not set.dx,dy,ax,ay:hb_glyph_position_t.x_offset,hb_glyph_position_t.y_offset,hb_glyph_position_t.x_advance andhb_glyph_position_t.y_advance respectively, ifHB_BUFFER_SERIALIZE_FLAG_NO_POSITIONSis not set.xb,yb,w,h:hb_glyph_extents_t.x_bearing,hb_glyph_extents_t.y_bearing,hb_glyph_extents_t.width andhb_glyph_extents_t.height respectively ifHB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTSis set.
- Parameters:
buffer- anhb_buffer_tbuffer.start- the first item inbufferto serialize.end- the last item inbufferto serialize.buf- output string to write serialized buffer into.bufConsumed- if notNULL, will be set to the number of bytes written intobuf.font- thehb_font_tused to shape this buffer, needed to read glyph names and extents. IfNULL, an empty font will be used.format- thehb_buffer_serialize_format_tto use for formatting the output.flags- thehb_buffer_serialize_flags_tthat control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Since:
- 0.9.7
- The serialized glyphs are delimited with
-
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) Serializesbufferinto 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_NAMESflag is set. Then, - If
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERSis not set,=thenhb_glyph_info_t.cluster. - If
HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONSis not set, thehb_glyph_position_tin the format: - If both
hb_glyph_position_t.x_offset andhb_glyph_position_t.y_offset are not 0,@x_offset,y_offset. Then, +x_advance, then,y_advanceifhb_glyph_position_t.y_advance is not 0. Then,- If
HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTSis set, thehb_glyph_extents_tin 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 ifHB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMESflag is set.cl:hb_glyph_info_t.cluster ifHB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERSis not set.dx,dy,ax,ay:hb_glyph_position_t.x_offset,hb_glyph_position_t.y_offset,hb_glyph_position_t.x_advance andhb_glyph_position_t.y_advance respectively, ifHB_BUFFER_SERIALIZE_FLAG_NO_POSITIONSis not set.xb,yb,w,h:hb_glyph_extents_t.x_bearing,hb_glyph_extents_t.y_bearing,hb_glyph_extents_t.width andhb_glyph_extents_t.height respectively ifHB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTSis set.
- Parameters:
buffer- anhb_buffer_tbuffer.start- the first item inbufferto serialize.end- the last item inbufferto serialize.buf- output string to write serialized buffer into.bufConsumed- if notNULL, will be set to the number of bytes written intobuf.font- thehb_font_tused to shape this buffer, needed to read glyph names and extents. IfNULL, an empty font will be used.format- thehb_buffer_serialize_format_tto use for formatting the output.flags- thehb_buffer_serialize_flags_tthat control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Since:
- 0.9.7
- The serialized glyphs are delimited with
-
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) Serializesbufferinto 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_CLUSTERSis not set, the cluster will be indicated with a=thenhb_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 integercl:hb_glyph_info_t.cluster ifHB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERSis not set.
For example:
[{u:1617,cl:0},{u:1576,cl:1}]- Parameters:
buffer- anhb_buffer_tbuffer.start- the first item inbufferto serialize.end- the last item inbufferto serialize.buf- output string to write serialized buffer into.bufConsumed- if notNULL, will be set to the number of bytes written intobuf.format- thehb_buffer_serialize_format_tto use for formatting the output.flags- thehb_buffer_serialize_flags_tthat control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Since:
- 2.7.3
- Glyphs are separated with
-
bufferSerializeUnicode
public static int bufferSerializeUnicode(Buffer buffer, int start, int end, @Nullable Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbufferinto 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_CLUSTERSis not set, the cluster will be indicated with a=thenhb_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 integercl:hb_glyph_info_t.cluster ifHB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERSis not set.
For example:
[{u:1617,cl:0},{u:1576,cl:1}]- Parameters:
buffer- anhb_buffer_tbuffer.start- the first item inbufferto serialize.end- the last item inbufferto serialize.buf- output string to write serialized buffer into.bufConsumed- if notNULL, will be set to the number of bytes written intobuf.format- thehb_buffer_serialize_format_tto use for formatting the output.flags- thehb_buffer_serialize_flags_tthat control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Since:
- 2.7.3
- Glyphs are separated with
-
bufferSetClusterLevel
Sets the cluster level of a buffer. Thehb_buffer_cluster_level_tdictates one aspect of how HarfBuzz will treat non-base characters during shaping.- Parameters:
buffer- Anhb_buffer_tclusterLevel- The cluster level to set on the buffer- Since:
- 0.9.42
-
bufferSetContentType
Sets the type ofbuffercontents. 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 toBufferContentType.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- Anhb_buffer_tcontentType- The type of buffer contents to set- Since:
- 0.9.5
- A newly created buffer starts with content type
-
bufferSetDirection
Set the text flow direction of the buffer. No shaping can happen without settingbufferdirection, 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- Anhb_buffer_tdirection- thehb_direction_tof thebuffer- Since:
- 0.9.2
-
bufferSetFlags
Setsbufferflags toflags.Seehb_buffer_flags_t.- Parameters:
buffer- Anhb_buffer_tflags- The buffer flags to set- Since:
- 0.9.7
-
bufferSetFlags
Setsbufferflags toflags.Seehb_buffer_flags_t.- Parameters:
buffer- Anhb_buffer_tflags- The buffer flags to set- Since:
- 0.9.7
-
bufferSetInvisibleGlyph
Sets thehb_codepoint_tthat 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- Anhb_buffer_tinvisible- the invisiblehb_codepoint_t- Since:
- 2.0.0
-
bufferSetLanguage
Sets the language ofbuffertolanguage.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- Anhb_buffer_tlanguage- An hb_language_t to set- Since:
- 0.9.2
-
bufferSetLength
-
bufferSetMessageFunc
public static void bufferSetMessageFunc(Buffer buffer, @Nullable BufferMessageFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_buffer_message_func_t.- Parameters:
buffer- Anhb_buffer_tfunc- Callback functiondestroy- The function to call whenuserDatais not needed anymore- Since:
- 1.1.3
-
bufferSetNotFoundGlyph
Sets thehb_codepoint_tthat 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- Anhb_buffer_tnotFound- the not-foundhb_codepoint_t- Since:
- 3.1.0
-
bufferSetNotFoundVariationSelectorGlyph
public static void bufferSetNotFoundVariationSelectorGlyph(Buffer buffer, Codepoint notFoundVariationSelector) Sets thehb_codepoint_tthat 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- Anhb_buffer_tnotFoundVariationSelector- the not-found-variation-selectorhb_codepoint_t- Since:
- 10.0.0
-
bufferSetRandomState
Sets the random state of the buffer. The state changes every time a glyph uses randomness (eg. therandOpenType 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- Anhb_buffer_tstate- the new random state- Since:
- 8.4.0
-
bufferSetReplacementCodepoint
Sets thehb_codepoint_tthat replaces invalid entries for a given encoding when adding text tobuffer.Default is
HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT.- Parameters:
buffer- Anhb_buffer_treplacement- the replacementhb_codepoint_t- Since:
- 0.9.31
-
bufferSetScript
Sets the script ofbuffertoscript.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_tvalues, 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- Anhb_buffer_tscript- Anhb_script_tto set.- Since:
- 0.9.2
-
bufferSetSegmentProperties
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- Anhb_buffer_tprops- Anhb_segment_properties_tto use- Since:
- 0.9.7
-
bufferSetUnicodeFuncs
Sets the Unicode-functions structure of a buffer tounicodeFuncs.- Parameters:
buffer- Anhb_buffer_tunicodeFuncs- 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- Anhb_buffer_tkey- The user-data keydata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
calloc
Allocatesnmembelements ofsizebytes 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
Fetches the alpha channel of the givencolor.- Parameters:
color- anhb_color_twe are interested in its channels.- Returns:
- Alpha channel value
- Since:
- 2.1.0
-
colorGetBlue
Fetches the blue channel of the givencolor.- Parameters:
color- anhb_color_twe are interested in its channels.- Returns:
- Blue channel value
- Since:
- 2.1.0
-
colorGetGreen
Fetches the green channel of the givencolor.- Parameters:
color- anhb_color_twe are interested in its channels.- Returns:
- Green channel value
- Since:
- 2.1.0
-
colorGetRed
Fetches the red channel of the givencolor.- Parameters:
color- anhb_color_twe 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- ahb_color_line_tobjectstart- the index of the first color stop to returncolorStops- Array ofhb_color_stop_tto populate- Returns:
- the total number of color stops in
colorLine - Since:
- 7.0.0
-
colorLineGetExtend
Fetches the extend mode of the color line object.- Parameters:
colorLine- ahb_color_line_tobject- Returns:
- the extend mode of
colorLine - Since:
- 7.0.0
-
directionFromString
public static Direction directionFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Converts a string to anhb_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_tmatchingstr - Since:
- 0.9.2
-
directionToString
-
drawClosePath
Perform a "close-path" draw operation.- Parameters:
dfuncs- draw functionsdrawData- associated draw data passed by the callerst- 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 functionsdrawData- associated draw data passed by the callerst- current draw statecontrol1X- X component of first control pointcontrol1Y- Y component of first control pointcontrol2X- X component of second control pointcontrol2Y- Y component of second control pointtoX- X component of target pointtoY- Y component of target point- Since:
- 4.0.0
-
drawFuncsCreate
Creates a new draw callbacks object.- Returns:
- A newly allocated
hb_draw_funcs_twith a reference count of 1. The initial reference count should be released with hb_draw_funcs_destroy when you are done using thehb_draw_funcs_t. This function never returnsNULL. If memory cannot be allocated, a special singletonhb_draw_funcs_tobject will be returned. - Since:
- 4.0.0
-
drawFuncsDestroy
Deallocate thedfuncs.Decreases the reference count ondfuncsby one. If the result is zero, thendfuncsand all associated resources are freed. See hb_draw_funcs_reference().- Parameters:
dfuncs- draw functions- Since:
- 4.0.0
-
drawFuncsGetEmpty
Fetches the singleton empty draw-functions structure.- Returns:
- The empty draw-functions structure
- Since:
- 7.0.0
-
drawFuncsGetUserData
Fetches the user-data associated with the specified key, attached to the specified draw-functions structure.- Parameters:
dfuncs- The draw-functions structurekey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 7.0.0
-
drawFuncsIsImmutable
-
drawFuncsMakeImmutable
Makesdfuncsobject immutable.- Parameters:
dfuncs- draw functions- Since:
- 4.0.0
-
drawFuncsReference
-
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 objectfunc- close-path callbackdestroy- The function to call whenuserDatais 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 functionsfunc- cubic-to callbackdestroy- The function to call whenuserDatais 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 objectfunc- line-to callbackdestroy- The function to call whenuserDatais 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 objectfunc- move-to callbackdestroy- The function to call whenuserDatais 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 objectfunc- quadratic-to callbackdestroy- The function to call whenuserDatais 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 structurekey- The user-data keydata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- 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 functionsdrawData- associated draw data passed by the callerst- current draw statetoX- X component of target pointtoY- 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 functionsdrawData- associated draw data passed by the callerst- current draw statetoX- X component of target pointtoY- 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 functionsdrawData- associated draw data passed by the callerst- current draw statecontrolX- X component of control pointcontrolY- Y component of control pointtoX- X component of target pointtoY- Y component of target point- Since:
- 4.0.0
-
faceBuilderAddTable
Add table fortagwith data provided byblobto the face.facemust be created using hb_face_builder_create().- Parameters:
face- A face object created with hb_face_builder_create()tag- Thehb_tag_tof the table to addblob- The blob containing the table data to add- Since:
- 1.9.0
-
faceBuilderCreate
Creates ahb_face_tthat 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
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 byHB_TAG_NONE- Since:
- 5.3.0
-
faceCollectNominalGlyphMapping
Collects the mapping from Unicode characters to nominal glyphs of theface,and optionally all of the Unicode characters covered byface.- Parameters:
face- A face objectmapping- The map to add Unicode-to-glyph mapping tounicodes- The set to add Unicode characters to, orNULL- Since:
- 7.0.0
-
faceCollectUnicodes
-
faceCollectVariationSelectors
-
faceCollectVariationUnicodes
Collects all Unicode characters forvariationSelectorcovered byfaceand adds them to thehb_set_tsetout.- Parameters:
face- A face objectvariationSelector- The Variation Selector to queryout- The set to add Unicode characters to- Since:
- 1.9.0
-
faceCount
Fetches the number of faces in a blob.- Parameters:
blob- a blob.- Returns:
- Number of faces in
blob - Since:
- 1.7.7
-
faceCreate
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>Note: If the blob font format is not a collection,
indexis ignored. Otherwise, only the lower 16-bits ofindexare used. The unmodifiedindexcan be accessed via hb_face_get_index().</note><note>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.</note>- Parameters:
blob-hb_blob_tto work uponindex- The index of the face withinblob- 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
userDataandreferenceTableFunc,with thedestroycallback.- Parameters:
referenceTableFunc- Table-referencing functiondestroy- A callback to call whendatais not needed anymore- Returns:
- The new face object
- Since:
- 0.9.2
-
faceCreateFromFileOrFail
A thin wrapper around hb_blob_create_from_file_or_fail() followed by hb_face_create_or_fail().- Parameters:
fileName- A font filenameindex- The index of the face within the file- Returns:
- The new face object, or
NULLif 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. IfloaderNameisNULLor 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 filenameindex- The index of the face within the fileloaderName- The name of the loader to use, orNULL- Returns:
- The new face object, or
NULLif the file cannot be read or the loader fails to load the face. - Since:
- 11.0.0
-
faceCreateOrFail
Like hb_face_create(), but returnsNULLif the blob data contains no usable font face at the specified index.- Parameters:
blob-hb_blob_tto work uponindex- The index of the face withinblob- Returns:
- The new face object, or
NULLif no face is found at the specified index. - Since:
- 10.1.0
-
faceCreateOrFailUsing
A thin wrapper around the face loader functions registered with HarfBuzz. IfloaderNameisNULLor 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_tto work uponindex- The index of the face withinblobloaderName- The name of the loader to use, orNULL- Returns:
- The new face object, or
NULLif the loader fails to load the face. - Since:
- 11.0.0
-
faceDestroy
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
Fetches the singleton empty face object.- Returns:
- The empty face object
- Since:
- 0.9.2
-
faceGetGlyphCount
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
Fetches the face-index corresponding to the given face.<note>Note: face indices within a collection are zero-based.</note>
- Parameters:
face- A face object- Returns:
- The index of
face. - Since:
- 0.9.2
-
faceGetTableTags
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 objectstartOffset- The index of first table tag to retrievetableTags- 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
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
Fetches the user data associated with the specified key, attached to the specified face object.- Parameters:
face- A face objectkey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.2
-
faceIsImmutable
-
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
Makes the given face object immutable.- Parameters:
face- A face object- Since:
- 0.9.2
-
faceReference
-
faceReferenceBlob
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
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 objecttag- Thehb_tag_tof the table to query- Returns:
- A pointer to the
tagtable withinface - 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 objectfunc- The table-tag-fetching functiondestroy- A callback to call whenfuncis not needed anymore- Since:
- 10.0.0
-
faceSetGlyphCount
Sets the glyph count for a face object to the specified value.This API is used in rare circumstances.
- Parameters:
face- A face objectglyphCount- The glyph-count value to assign- Since:
- 0.9.7
-
faceSetIndex
Assigns the specified face-index toface.Fails if the face is immutable.<note>Note: changing the index has no effect on the face itself This only changes the value returned by hb_face_get_index().</note>
- Parameters:
face- A face objectindex- The index to assign- Since:
- 0.9.2
-
faceSetUpem
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 objectupem- 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 objectkey- The user-data key to setdata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
featureFromString
public static Bool featureFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str, Feature feature) Parses a string into ahb_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:
<informaltable pgwide='1' align='left' frame='none'> <tgroup cols='5'> <thead> <row><entry>Syntax</entry> <entry>Value</entry> <entry>Start</entry> <entry>End</entry></row> </thead> <tbody> <row><entry>Setting value:</entry></row> <row><entry>kern</entry> <entry>1</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature on</entry></row> <row><entry>+kern</entry> <entry>1</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature on</entry></row> <row><entry>-kern</entry> <entry>0</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature off</entry></row> <row><entry>kern=0</entry> <entry>0</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature off</entry></row> <row><entry>kern=1</entry> <entry>1</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature on</entry></row> <row><entry>aalt=2</entry> <entry>2</entry> <entry>0</entry> <entry>∞</entry> <entry>Choose 2nd alternate</entry></row> <row><entry>Setting index:</entry></row> <row><entry>kern[]</entry> <entry>1</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature on</entry></row> <row><entry>kern[:]</entry> <entry>1</entry> <entry>0</entry> <entry>∞</entry> <entry>Turn feature on</entry></row> <row><entry>kern[5:]</entry> <entry>1</entry> <entry>5</entry> <entry>∞</entry> <entry>Turn feature on, partial</entry></row> <row><entry>kern[:5]</entry> <entry>1</entry> <entry>0</entry> <entry>5</entry> <entry>Turn feature on, partial</entry></row> <row><entry>kern[3:5]</entry> <entry>1</entry> <entry>3</entry> <entry>5</entry> <entry>Turn feature on, range</entry></row> <row><entry>kern[3]</entry> <entry>1</entry> <entry>3</entry> <entry>3+1</entry> <entry>Turn feature on, single char</entry></row> <row><entry>Mixing it all:</entry></row> <row><entry>aalt[3:5]=2</entry> <entry>2</entry> <entry>3</entry> <entry>5</entry> <entry>Turn 2nd alternate on for range</entry></row> </tbody> </tgroup> </informaltable>
- Parameters:
str- a string to parsefeature- thehb_feature_tto initialize with the parsed values- Returns:
trueifstris successfully parsed,falseotherwise- Since:
- 0.9.5
-
featureToString
Converts ahb_feature_tinto aNULL-terminated string in the format understood by hb_feature_from_string(). The client in responsible for allocating big enough size forbuf,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- anhb_feature_tto convertbuf- 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_tto work uponglyph- The glyph ID to querydirection- The direction of the text segmentx- Input = The original X coordinate Output = The X coordinate plus the X-coordinate of the originy- Input = The original Y coordinate Output = The Y coordinate plus the Y-coordinate of the origin- Since:
- 0.9.2
-
fontChanged
Notifies thefontthat 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_tto work upon- Since:
- 4.4.0
-
fontCreate
Constructs a new font object from the specified face.<note>Note: If
face'sindex 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.</note>- Parameters:
face- a face.- Returns:
- The new font object
- Since:
- 0.9.2
-
fontCreateSubFont
-
fontDestroy
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_tto 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 specifiedfont.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
dfuncsobjects, withdrawDatapassed to them.- Parameters:
font-hb_font_tto work uponglyph- The glyph IDdfuncs-hb_draw_funcs_tto draw todrawData- 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 specifiedfont.This is a newer name for hb_font_draw_glyph(), that returns
falseif the font has no outlines for the glyph.The outline is returned by way of calls to the callbacks of the
dfuncsobjects, withdrawDatapassed to them.- Parameters:
font-hb_font_tto work uponglyph- The glyph IDdfuncs-hb_draw_funcs_tto draw todrawData- User data to pass to draw callbacks- Returns:
trueif glyph was drawn,falseotherwise- Since:
- 11.2.0
-
fontFuncsCreate
Creates a newhb_font_funcs_tstructure of font functions.- Returns:
- The font-functions structure
- Since:
- 0.9.2
-
fontFuncsDestroy
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
Fetches an empty font-functions structure.- Returns:
- The font-functions structure
- Since:
- 0.9.2
-
fontFuncsGetUserData
Fetches the user data associated with the specified key, attached to the specified font-functions structure.- Parameters:
ffuncs- The font-functions structurekey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.2
-
fontFuncsIsImmutable
-
fontFuncsMakeImmutable
Makes a font-functions structure immutable.- Parameters:
ffuncs- The font-functions structure- Since:
- 0.9.2
-
fontFuncsReference
-
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 forhb_font_draw_glyph_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 7.0.0
-
fontFuncsSetDrawGlyphOrFailFunc
public static void fontFuncsSetDrawGlyphOrFailFunc(FontFuncs ffuncs, @Nullable FontDrawGlyphOrFailFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_draw_glyph_or_fail_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 forhb_font_get_font_h_extents_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_font_v_extents_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais not needed anymore- Since:
- 1.1.2
-
fontFuncsSetGlyphContourPointFunc
public static void fontFuncsSetGlyphContourPointFunc(FontFuncs ffuncs, @Nullable FontGetGlyphContourPointFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_contour_point_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
fontFuncsSetGlyphExtentsFunc
public static void fontFuncsSetGlyphExtentsFunc(FontFuncs ffuncs, @Nullable FontGetGlyphExtentsFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_extents_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
fontFuncsSetGlyphFromNameFunc
public static void fontFuncsSetGlyphFromNameFunc(FontFuncs ffuncs, @Nullable FontGetGlyphFromNameFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_from_name_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 structurefunc- callback functiondestroy- function to call whenuserDatais 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 forhb_font_get_glyph_h_advance_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_h_advances_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_h_kerning_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_h_origin_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_h_origins_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais not needed anymore- Since:
- 11.3.0
-
fontFuncsSetGlyphNameFunc
public static void fontFuncsSetGlyphNameFunc(FontFuncs ffuncs, @Nullable FontGetGlyphNameFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_name_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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() insteadSets the implementation function forhb_font_get_glyph_shape_func_t, which is the same ashb_font_draw_glyph_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_v_advance_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_v_advances_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_v_kerning_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_v_origin_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais 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 forhb_font_get_glyph_v_origins_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assignuserData- Data to pass tofuncdestroy- The function to call whenuserDatais not needed anymore- Since:
- 11.3.0
-
fontFuncsSetNominalGlyphFunc
public static void fontFuncsSetNominalGlyphFunc(FontFuncs ffuncs, @Nullable FontGetNominalGlyphFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyph_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 1.2.3
-
fontFuncsSetNominalGlyphsFunc
public static void fontFuncsSetNominalGlyphsFunc(FontFuncs ffuncs, @Nullable FontGetNominalGlyphsFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyphs_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 forhb_font_paint_glyph_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais no longer needed- Since:
- 7.0.0
-
fontFuncsSetPaintGlyphOrFailFunc
public static void fontFuncsSetPaintGlyphOrFailFunc(FontFuncs ffuncs, @Nullable FontPaintGlyphOrFailFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_paint_glyph_or_fail_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 structurekey- The user-data key to setdata- A pointer to the user data setdestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
fontFuncsSetVariationGlyphFunc
public static void fontFuncsSetVariationGlyphFunc(FontFuncs ffuncs, @Nullable FontGetVariationGlyphFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_variation_glyph_func_t.- Parameters:
ffuncs- A font-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 1.2.3
-
fontGetEmpty
Fetches the empty font object.- Returns:
- The empty font object
- Since:
- 0.9.2
-
fontGetExtentsForDirection
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_tto work upondirection- The direction of the text segmentextents- Thehb_font_extents_tretrieved- Since:
- 1.1.3
-
fontGetFace
-
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
variationSelectoris 0, calls hb_font_get_nominal_glyph(); otherwise calls hb_font_get_variation_glyph().- Parameters:
font-hb_font_tto work uponunicode- The Unicode code point to queryvariationSelector- A variation-selector code pointglyph- The glyph ID retrieved- Returns:
trueif data found,falseotherwise- 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_tto work uponglyph- The glyph ID to querydirection- The direction of the text segmentx- The horizontal advance retrievedy- The vertical advance retrieved- Since:
- 0.9.2
-
fontGetGlyphAdvancesForDirection
public static void fontGetGlyphAdvancesForDirection(Font font, Direction direction, int count, Codepoint firstGlyph, int glyphStride, Position firstAdvance, int 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_tto work upondirection- The direction of the text segmentcount- The number of glyph IDs in the sequence queriedfirstGlyph- The first glyph ID to queryglyphStride- The stride between successive glyph IDsfirstAdvance- The first advance retrievedadvanceStride- 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_tto work uponglyph- The glyph ID to querypointIndex- The contour-point index to queryx- The X value retrieved for the contour pointy- The Y value retrieved for the contour point- Returns:
trueif data found,falseotherwise- 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_tto work uponglyph- The glyph ID to querypointIndex- The contour-point index to querydirection- The direction of the text segmentx- The X value retrieved for the contour pointy- The Y value retrieved for the contour point- Returns:
trueif data found,falseotherwise- Since:
- 0.9.2
-
fontGetGlyphExtents
Fetches thehb_glyph_extents_tdata for a glyph ID in the specified font.- Parameters:
font-hb_font_tto work uponglyph- The glyph ID to queryextents- Thehb_glyph_extents_tretrieved- Returns:
trueif data found,falseotherwise- Since:
- 0.9.2
-
fontGetGlyphExtentsForOrigin
public static Bool fontGetGlyphExtentsForOrigin(Font font, Codepoint glyph, Direction direction, GlyphExtents extents) Fetches thehb_glyph_extents_tdata 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_tto work uponglyph- The glyph ID to querydirection- The direction of the text segmentextents- Thehb_glyph_extents_tretrieved- Returns:
trueif data found,falseotherwise- 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 specifiedfont.<note>Note:
len== -1 means the name string is null-terminated.</note>- Parameters:
font-hb_font_tto work uponname- The name string to queryglyph- The glyph ID retrieved- Returns:
trueif data found,falseotherwise- Since:
- 0.9.2
-
fontGetGlyphHAdvance
-
fontGetGlyphHAdvances
public static void fontGetGlyphHAdvances(Font font, int count, Codepoint 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_tto work uponcount- The number of glyph IDs in the sequence queriedfirstGlyph- The first glyph ID to queryglyphStride- The stride between successive glyph IDsfirstAdvance- The first advance retrievedadvanceStride- The stride between successive advances- Since:
- 1.8.6
-
fontGetGlyphHKerning
Fetches the kerning-adjustment value for a glyph-pair in the specified font, for horizontal text segments.<note>It handles legacy kerning only (as returned by the corresponding
hb_font_funcs_tfunction).</note>- Parameters:
font-hb_font_tto work uponleftGlyph- The glyph ID of the left glyph in the glyph pairrightGlyph- The glyph ID of the right glyph in the glyph pair- Returns:
- The kerning adjustment value
- Since:
- 0.9.2
-
fontGetGlyphHOrigin
Fetches the (X,Y) coordinates of the origin for a glyph ID in the specified font, for horizontal text segments.- Parameters:
font-hb_font_tto work uponglyph- The glyph ID to queryx- The X coordinate of the originy- The Y coordinate of the origin- Returns:
trueif data found,falseotherwise- Since:
- 0.9.2
-
fontGetGlyphHOrigins
public static Bool fontGetGlyphHOrigins(Font font, int count, Codepoint 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_tto work uponcount- The number of glyph IDs in the sequence queriedfirstGlyph- The first glyph ID to queryglyphStride- The stride between successive glyph IDsfirstX- The first X coordinate of the origin retrievedxStride- The stride between successive X coordinatesfirstY- The first Y coordinate of the origin retrievedyStride- The stride between successive Y coordinates- Returns:
trueif data found,falseotherwise- 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_tto work uponfirstGlyph- The glyph ID of the first glyph in the glyph pair to querysecondGlyph- The glyph ID of the second glyph in the glyph pair to querydirection- The direction of the text segmentx- The horizontal kerning-adjustment value retrievedy- The vertical kerning-adjustment value retrieved- Since:
- 0.9.2
-
fontGetGlyphName
Fetches the glyph-name string for a glyph ID in the specifiedfont.According to the OpenType specification, glyph names are limited to 63 characters and can only contain (a subset of) ASCII.
- Parameters:
font-hb_font_tto work uponglyph- The glyph ID to queryname- Name string retrieved for the glyph ID- Returns:
trueif data found,falseotherwise- 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_tto work uponglyph- The glyph ID to querydirection- The direction of the text segmentx- The X coordinate retrieved for the originy- 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() insteadFetches the glyph shape that corresponds to a glyph in the specifiedfont.The shape is returned by way of calls to the callbacks of thedfuncsobjects, withdrawDatapassed to them.- Parameters:
font-hb_font_tto work uponglyph- The glyph IDdfuncs-hb_draw_funcs_tto draw todrawData- User data to pass to draw callbacks- Since:
- 4.0.0
-
fontGetGlyphVAdvance
-
fontGetGlyphVAdvances
public static void fontGetGlyphVAdvances(Font font, int count, Codepoint firstGlyph, int glyphStride, Position firstAdvance, int advanceStride) Fetches the advances for a sequence of glyph IDs in the specified font, for vertical text segments.- Parameters:
font-hb_font_tto work uponcount- The number of glyph IDs in the sequence queriedfirstGlyph- The first glyph ID to queryglyphStride- The stride between successive glyph IDsfirstAdvance- The first advance retrievedadvanceStride- 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.<note>It handles legacy kerning only (as returned by the corresponding
hb_font_funcs_tfunction).</note>- Parameters:
font-hb_font_tto work upontopGlyph- The glyph ID of the top glyph in the glyph pairbottomGlyph- The glyph ID of the bottom glyph in the glyph pair- Returns:
- The kerning adjustment value
- Since:
- 0.9.2
-
fontGetGlyphVOrigin
Fetches the (X,Y) coordinates of the origin for a glyph ID in the specified font, for vertical text segments.- Parameters:
font-hb_font_tto work uponglyph- The glyph ID to queryx- The X coordinate of the originy- The Y coordinate of the origin- Returns:
trueif data found,falseotherwise- Since:
- 0.9.2
-
fontGetGlyphVOrigins
public static Bool fontGetGlyphVOrigins(Font font, int count, Codepoint 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_tto work uponcount- The number of glyph IDs in the sequence queriedfirstGlyph- The first glyph ID to queryglyphStride- The stride between successive glyph IDsfirstX- The first X coordinate of the origin retrievedxStride- The stride between successive X coordinatesfirstY- The first Y coordinate of the origin retrievedyStride- The stride between successive Y coordinates- Returns:
trueif data found,falseotherwise- Since:
- 11.3.0
-
fontGetHExtents
Fetches the extents for a specified font, for horizontal text segments.- Parameters:
font-hb_font_tto work uponextents- The font extents retrieved- Returns:
trueif data found,falseotherwise- Since:
- 1.1.3
-
fontGetNominalGlyph
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_tto work uponunicode- The Unicode code point to queryglyph- The glyph ID retrieved- Returns:
trueif data found,falseotherwise- Since:
- 1.2.3
-
fontGetNominalGlyphs
public static int fontGetNominalGlyphs(Font font, int count, Codepoint 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 ahb_codepoint_toutput parameter. Stops at the first unsupported glyph ID.- Parameters:
font-hb_font_tto work uponcount- number of code points to queryfirstUnicode- The first Unicode code point to queryunicodeStride- The stride between successive code pointsfirstGlyph- The first glyph ID retrievedglyphStride- The stride between successive glyph IDs- Returns:
- the number of code points processed
- Since:
- 2.6.3
-
fontGetParent
-
fontGetPpem
-
fontGetPtem
Fetches the "point size" of a font. Used in CoreText to implement optical sizing.- Parameters:
font-hb_font_tto work upon- Returns:
- Point size. A value of zero means "not set."
- Since:
- 1.6.0
-
fontGetScale
-
fontGetSerial
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_tto 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_tto work uponxEmbolden- return location for horizontal valueyEmbolden- return location for vertical valueinPlace- return location for in-place value- Since:
- 7.0.0
-
fontGetSyntheticSlant
Fetches the "synthetic slant" of a font.- Parameters:
font-hb_font_tto work upon- Returns:
- Synthetic slant. By default is zero.
- Since:
- 3.3.0
-
fontGetUserData
Fetches the user-data object associated with the specified key, attached to the specified font object.- Parameters:
font-hb_font_tto work uponkey- The user-data key to query- Returns:
- Pointer to the user data
- Since:
- 0.9.2
-
fontGetVExtents
Fetches the extents for a specified font, for vertical text segments.- Parameters:
font-hb_font_tto work uponextents- The font extents retrieved- Returns:
trueif data found,falseotherwise- Since:
- 1.1.3
-
fontGetVarCoordsDesign
Fetches the list of variation coordinates (in design-space units) currently set on a font.<note>Note that if no variation coordinates are set, this function may return
null.</note><note>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.</note>
Return value is valid as long as variation coordinates of the font are not modified.
- Parameters:
font-hb_font_tto work uponlength- Number of coordinates retrieved- Returns:
- coordinates array
- Since:
- 3.3.0
-
fontGetVarCoordsNormalized
Fetches the list of normalized variation coordinates currently set on a font.<note>Note that if no variation coordinates are set, this function may return
null.</note>Return value is valid as long as variation coordinates of the font are not modified.
- Parameters:
font-hb_font_tto work uponlength- Number of coordinates retrieved- Returns:
- coordinates array
- Since:
- 1.4.2
-
fontGetVarNamedInstance
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_tto work uponunicode- The Unicode code point to queryvariationSelector- The variation-selector code point to queryglyph- The glyph ID retrieved- Returns:
trueif data found,falseotherwise- Since:
- 1.2.3
-
fontGlyphFromString
public static Bool fontGlyphFromString(Font font, @org.jspecify.annotations.Nullable byte @Nullable [] s, Codepoint glyph) Fetches the glyph ID fromfontthat matches the specified string. Strings of the formatgidDDDoruniUUUUare parsed automatically.<note>Note:
len== -1 means the string is null-terminated.</note>- Parameters:
font-hb_font_tto work upons- string to queryglyph- The glyph ID corresponding to the string requested- Returns:
trueif data found,falseotherwise- Since:
- 0.9.2
-
fontGlyphToString
Fetches the name of the specified glyph ID infontand returns it in strings.If the glyph ID has no name in
font,a string of the formgidDDDis generated, withDDDbeing 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_tto work uponglyph- The glyph ID to querys- The string containing the glyph name- Since:
- 0.9.2
-
fontIsImmutable
-
fontIsSynthetic
-
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
Makesfontimmutable.- Parameters:
font-hb_font_tto 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
funcsobject, withpaintDatapassed to them.If the font has color palettes (see hb_ot_color_has_palettes()), then
paletteIndexselects the palette to use. If the font only has one palette, this will be 0.- Parameters:
font-hb_font_tto work uponglyph- The glyph IDpfuncs-hb_paint_funcs_tto paint withpaintData- User data to pass to paint callbackspaletteIndex- The index of the font's color palette to useforeground- 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
funcsobject, withpaintDatapassed to them.If the font has color palettes (see hb_ot_color_has_palettes()), then
paletteIndexselects the palette to use. If the font only has one palette, this will be 0.- Parameters:
font-hb_font_tto work uponglyph- The glyph IDpfuncs-hb_paint_funcs_tto paint withpaintData- User data to pass to paint callbackspaletteIndex- The index of the font's color palette to useforeground- The foreground color, unpremultipled- Returns:
trueif glyph was painted,falseotherwise- Since:
- 11.2.0
-
fontReference
-
fontSetFace
-
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 withfontDataand thedestroycallback.- Parameters:
font-hb_font_tto work uponklass- The font-functions structure.fontData- Data to attach tofontdestroy- The function to call whenfontDatais 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'sdestroycallback.- Parameters:
font-hb_font_tto work uponfontData- Data to attach tofontdestroy- The function to call whenfontDatais not needed anymore- Since:
- 0.9.2
-
fontSetFuncsUsing
Sets the font-functions structure to use for a font, based on the specified name.If
nameisNULLor the empty string, the default (first) functioning font-functions are used. This default can be changed by setting theHB_FONT_FUNCSenvironment variable to the name of the desired font-functions.- Parameters:
font-hb_font_tto work uponname- The name of the font-functions structure to use, orNULL- Returns:
trueif the font-functions was found and set,falseotherwise- Since:
- 11.0.0
-
fontSetParent
-
fontSetPpem
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_tto work uponxPpem- Horizontal ppem value to assignyPpem- Vertical ppem value to assign- Since:
- 0.9.2
-
fontSetPtem
Sets the "point size" of a font. Set to zero to unset. Used in CoreText to implement optical sizing.<note>Note: There are 72 points in an inch.</note>
- Parameters:
font-hb_font_tto work uponptem- font size in points.- Since:
- 1.6.0
-
fontSetScale
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_tvalues 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_tas 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_tto work uponxScale- Horizontal scale value to assignyScale- Vertical scale value to assign- Since:
- 0.9.2
-
fontSetSyntheticBold
Sets the "synthetic boldness" of a font.Positive values for
xEmbolden/yEmboldenmake 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
inPlaceisfalse, 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_tto work uponxEmbolden- the amount to embolden horizontallyyEmbolden- the amount to embolden verticallyinPlace- whether to embolden glyphs in-place- Since:
- 7.0.0
-
fontSetSyntheticSlant
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>Note: The glyph shape fetched via the hb_font_draw_glyph_or_fail() function is slanted to reflect this value as well.</note>
<note>Note: The slant value is a ratio. For example, a 20% slant would be represented as a 0.2 value.</note>
- Parameters:
font-hb_font_tto work uponslant- 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_tto work uponkey- The user-data keydata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
fontSetVarCoordsDesign
public static void fontSetVarCoordsDesign(Font font, @org.jspecify.annotations.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 incoordswill be effectively set to their default values.- Parameters:
font-hb_font_tto work uponcoords- Array of variation coordinates to apply- Since:
- 1.4.2
-
fontSetVarCoordsNormalized
public static void fontSetVarCoordsNormalized(Font font, @org.jspecify.annotations.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 incoordswill be effectively set to their default values.<note>Note: Coordinates should be normalized to 2.14.</note>
- Parameters:
font-hb_font_tto work uponcoords- Array of variation coordinates to apply- Since:
- 1.4.2
-
fontSetVarNamedInstance
Sets design coords of a font from a named-instance index.- Parameters:
font- a font.instanceIndex- named instance index.- Since:
- 2.6.0
-
fontSetVariation
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_tto work upontag- Thehb_tag_ttag of the variation-axis namevalue- The value of the variation axis- Since:
- 7.1.0
-
fontSetVariations
Applies a list of font-variation settings to a font.Note that this overrides all existing variations set on
font.Axes not included invariationswill be effectively set to their default values.- Parameters:
font-hb_font_tto work uponvariations- 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_tto work uponglyph- The glyph ID to querydirection- The direction of the text segmentx- Input = The original X coordinate Output = The X coordinate minus the X-coordinate of the originy- Input = The original Y coordinate Output = The Y coordinate minus the Y-coordinate of the origin- Since:
- 0.9.2
-
free
Frees the memory pointed to byptr,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 anhb_face_tface 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_twill 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
ftFaceafter thehb_face_tface object has been destroyed.- Parameters:
ftFace- FT_Face to work upondestroy- A callback to call when the face object is not needed anymore- Returns:
- the new
hb_face_tface object - Since:
- 0.9.2
-
ftFaceCreateCached
Creates anhb_face_tface 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_twill 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_tface object, using thegenericpointer offtFace.Subsequent function calls that are passed the sameftFaceparameter will have the samehb_face_treturned to them, and thathb_face_twill be correctly reference counted.However, client programs are still responsible for destroying
ftFaceafter the lasthb_face_tface object has been destroyed.- Parameters:
ftFace- FT_Face to work upon- Returns:
- the new
hb_face_tface object - Since:
- 0.9.2
-
ftFaceCreateFromBlobOrFail
Creates anhb_face_tface 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 blobindex- The index of the face within the blob- Returns:
- The new face object, or
NULLif loading fails (eg. blob does not contain valid font data). - Since:
- 11.0.0
-
ftFaceCreateFromFileOrFail
Creates anhb_face_tface 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 filenameindex- The index of the face within the file- Returns:
- The new face object, or
NULLif no face is found at the specified index or the file cannot be read. - Since:
- 10.1.0
-
ftFaceCreateReferenced
Creates anhb_face_tface 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_twill 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 thatftFaceremains alive as long as the resultinghb_face_tface object remains alive. Also calls FT_Done_Face() when thehb_face_tface 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_tface object - Since:
- 0.9.38
-
ftFontChanged
Refreshes the state offontwhen 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_tto work upon- Since:
- 1.0.5
-
ftFontCreate
public static Font ftFontCreate(@Nullable org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy) Creates anhb_font_tfont object from the specified FT_Face.<note>Note: You must set the face size on
ftFacebefore calling hb_ft_font_create() on it. HarfBuzz assumes size is always set and will accesssizemember of FT_Face unconditionally.</note>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
ftFaceonly after thehb_font_tfont object has been destroyed.HarfBuzz will use the
destroycallback on thehb_font_tfont object if it is supplied when you use this function. However, even ifdestroyis provided, it is the client program's responsibility to destroyftFace,and it is the client program's responsibility to ensure thatftFaceis destroyed only after thehb_font_tfont object has been destroyed.- Parameters:
ftFace- FT_Face to work upondestroy- A callback to call when the font object is not needed anymore- Returns:
- the new
hb_font_tfont object - Since:
- 0.9.2
-
ftFontCreateReferenced
Creates anhb_font_tfont object from the specified FT_Face.<note>Note: You must set the face size on
ftFacebefore calling hb_ft_font_create_referenced() on it. HarfBuzz assumes size is always set and will accesssizemember of FT_Face unconditionally.</note>This is the preferred variant of the hb_ft_font_create* function family, because it calls FT_Reference_Face() on
ftFace,ensuring thatftFaceremains alive as long as the resultinghb_font_tfont 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_tfont object - Since:
- 0.9.38
-
ftFontGetFace
Deprecated.Use hb_ft_font_get_ft_face() instead.Fetches the FT_Face associated with the specifiedhb_font_tfont object.This function works with
hb_font_tobjects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font-hb_font_tto work upon- Returns:
- the FT_Face found or
NULL - Since:
- 0.9.2
-
ftFontGetFtFace
Fetches the FT_Face associated with the specifiedhb_font_tfont object.This function works with
hb_font_tobjects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font-hb_font_tto work upon- Returns:
- the FT_Face found or
NULL - Since:
- 10.4.0
-
ftFontGetLoadFlags
Fetches the FT_Load_Glyph load flags of the specifiedhb_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_tobjects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font-hb_font_tto work upon- Returns:
- FT_Load_Glyph flags found, or 0
- Since:
- 1.0.5
-
ftFontLockFace
Gets the FT_Face associated withfont.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_tobjects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font-hb_font_tto work upon- Returns:
- the FT_Face associated with
fontorNULL - Since:
- 2.6.5
-
ftFontSetFuncs
Configures the font-functions structure of the specifiedhb_font_tfont object to use FreeType font functions.In particular, you can use this function to configure an existing
hb_face_tface object for use with FreeType font functions even if thathb_face_tface object was initially created with hb_face_create(), and therefore was not initially configured to use FreeType font functions.An
hb_font_tobject 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_tafter calling this function, you need to call hb_ft_hb_font_changed() to update the underlying FT_Face.<note>Note: Internally, this function creates an FT_Face. </note>
- Parameters:
font-hb_font_tto work upon- Since:
- 1.0.5
-
ftFontSetLoadFlags
Sets the FT_Load_Glyph load flags for the specifiedhb_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_tobjects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font-hb_font_tto work uponloadFlags- The FreeType load flags to set- Since:
- 1.0.5
-
ftFontUnlockFace
Releases an FT_Face previously obtained with hb_ft_font_lock_face().- Parameters:
font-hb_font_tto work upon- Since:
- 2.6.5
-
ftHbFontChanged
Refreshes the state of the underlying FT_Face offontwhen the hb_font_tfonthas changed. This function should be called after changing the size or variation-axis settings on thefont.This call is fast if nothing has changed onfont.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_tto work upon- Returns:
- true if changed, false otherwise
- Since:
- 4.4.0
-
glibBlobCreate
Creates anhb_blob_tblob from the specified GBytes data structure.- Parameters:
gbytes- the GBytes structure to work upon- Returns:
- the new
hb_blob_tblob object - Since:
- 0.9.38
-
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_tUnicode-functions structure - Since:
- 0.9.38
-
glibScriptFromScript
Fetches the GUnicodeScript identifier that corresponds to the specifiedhb_script_tscript.- Parameters:
script- Thehb_script_tto query- Returns:
- the GUnicodeScript identifier found
- Since:
- 0.9.38
-
glibScriptToScript
Fetches thehb_script_tscript that corresponds to the specified GUnicodeScript identifier.- Parameters:
script- The GUnicodeScript identifier to query- Returns:
- the
hb_script_tscript found - Since:
- 0.9.38
-
glyphInfoGetGlyphFlags
Returns glyph flags encoded within ahb_glyph_info_t.- Parameters:
info- ahb_glyph_info_t- Returns:
- The
hb_glyph_flags_tencoded withininfo - Since:
- 1.5.0
-
languageFromString
public static @Nullable Language languageFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str) Convertsstrrepresenting a BCP 47 language tag to the correspondinghb_language_t.- Parameters:
str- a string representing a BCP 47 language tag- Returns:
- The
hb_language_tcorresponding to the BCP 47 language tag. - Since:
- 0.9.2
-
languageGetDefault
Fetch the default language from current locale.<note>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.</note>
- Returns:
- The default language of the locale as
an
hb_language_t - Since:
- 0.9.2
-
languageMatches
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- Thehb_language_tto work onspecific- Anotherhb_language_t- Returns:
trueif languages match,falseotherwise.- Since:
- 5.0.0
-
languageToString
-
malloc
Allocatessizebytes 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
-
mapClear
Clears out the contents ofmap.- Parameters:
map- A map- Since:
- 1.7.7
-
mapCopy
-
mapCreate
Creates a new, initially empty map.- Returns:
- The new
hb_map_t - Since:
- 1.7.7
-
mapDel
-
mapDestroy
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
-
mapGetEmpty
Fetches the singleton emptyhb_map_t.- Returns:
- The empty
hb_map_t - Since:
- 1.7.7
-
mapGetPopulation
Returns the number of key-value pairs in the map.- Parameters:
map- A map- Returns:
- The population of
map - Since:
- 1.7.7
-
mapGetUserData
Fetches the user data associated with the specified key, attached to the specified map.- Parameters:
map- A mapkey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 1.7.7
-
mapHas
-
mapHash
Creates a hash representingmap.- Parameters:
map- A map- Returns:
- A hash of
map. - Since:
- 4.4.0
-
mapIsEmpty
-
mapIsEqual
-
mapKeys
-
mapNext
Fetches the next key/value pair inmap.Set
idxto -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 mapidx- Iterator internal statekey- Key retrievedvalue- Value retrieved- Returns:
trueif there was a next value,falseotherwise- Since:
- 7.0.0
-
mapReference
-
mapSet
-
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 mapkey- The user-data key to setdata- A pointer to the user data to setdestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 1.7.7
-
mapUpdate
-
mapValues
-
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_tto work uponglyph- The glyph index to querystartOffset- offset of the first layer to retrievelayers- The array of layers found- Returns:
- Total number of layers available for the glyph index queried
- Since:
- 2.1.0
-
otColorGlyphHasPaint
-
otColorGlyphReferencePng
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 thefontobject. 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_tto work uponglyph- a glyph index- Returns:
- An
hb_blob_tcontaining the PNG image for the glyph, if available - Since:
- 2.1.0
-
otColorGlyphReferenceSvg
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_tto work uponglyph- a svg glyph index- Returns:
- An
hb_blob_tcontaining the SVG document of the glyph, if available - Since:
- 2.1.0
-
otColorHasLayers
-
otColorHasPaint
-
otColorHasPalettes
-
otColorHasPng
-
otColorHasSvg
-
otColorPaletteColorGetNameId
Fetches thenametable Name ID that provides display names for the specified color in a face'sCPALcolor palette.Display names can be generic (e.g., "Background") or specific (e.g., "Eye color").
- Parameters:
face-hb_face_tto work uponcolorIndex- 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,
colorswill be filled with the palette colors. Ifcolorsis 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_tto work uponpaletteIndex- the index of the color palette to querystartOffset- offset of the first color to retrievecolors- The array ofhb_color_trecords found- Returns:
- the total number of colors in the palette
- Since:
- 2.1.0
-
otColorPaletteGetCount
Fetches the number of color palettes in a face.- Parameters:
face-hb_face_tto work upon- Returns:
- the number of palettes found
- Since:
- 2.1.0
-
otColorPaletteGetFlags
Fetches the flags defined for a color palette.- Parameters:
face-hb_face_tto work uponpaletteIndex- The index of the color palette- Returns:
- the
hb_ot_color_palette_flags_tof the requested color palette - Since:
- 2.1.0
-
otColorPaletteGetNameId
Fetches thenametable Name ID that provides display names for aCPALcolor 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_tto work uponpaletteIndex- 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
Sets the font functions to use when working withfontto the HarfBuzz's native implementation. This is the default for fonts newly created.- Parameters:
font-hb_font_tto 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscripts- The array of scripts to collect features for, terminated byHB_TAG_NONElanguages- The array of languages to collect features for, terminated byHB_TAG_NONEfeatures- The array of features to collect, terminated byHB_TAG_NONEfeatureIndexes- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageIndex- The index of the requested language tagfeatureMap- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscripts- The array of scripts to collect lookups for, terminated byHB_TAG_NONElanguages- The array of languages to collect lookups for, terminated byHB_TAG_NONEfeatures- The array of features to collect lookups for, terminated byHB_TAG_NONElookupIndexes- 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_tto work upontableTag- table tag to query, "GSUB" or "GPOS".featureIndex- index of feature to query.startOffset- offset of the first character to retrievecharacters- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSfeatureIndex- The index of the requested featurestartOffset- offset of the first lookup to retrievelookupIndexes- 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_tto work upontableTag- 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:
trueif data found,falseotherwise- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSfeatureIndex- The index of the feature to queryvariationsIndex- The index of the feature variation to querystartOffset- offset of the first lookup to retrievelookupIndexes- 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- Thehb_face_tto work onglyph- Thehb_codepoint_tcode point to querystartOffset- offset of the first attachment point to retrievepointArray- 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 fontbaselineTag- a baseline tagdirection- text direction.scriptTag- script tag.languageTag- language tag, currently unused.coord- baseline value if found.- Returns:
trueif 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_tandhb_language_tinstead of OpenTypehb_tag_t.- Parameters:
font- a fontbaselineTag- a baseline tagdirection- text direction.script- script.language- language, currently unused.coord- baseline value if found.- Returns:
trueif 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 fontbaselineTag- a baseline tagdirection- 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_tandhb_language_tinstead of OpenTypehb_tag_t.- Parameters:
font- a fontbaselineTag- a baseline tagdirection- 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 theBASEtable'sMinMaxrecords.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 fontdirection- text direction.scriptTag- script tag.languageTag- language tag.extents- font extents if found.- Returns:
trueif 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 theBASEtable'sMinMaxrecords.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_tandhb_language_tinstead of OpenTypehb_tag_t.- Parameters:
font- a fontdirection- text direction.script- script.language- language.extents- font extents if found.- Returns:
trueif found script/language-specific font extents.- Since:
- 8.0.0
-
otLayoutGetGlyphClass
Fetches the GDEF class of the requested glyph in the specified face.- Parameters:
face- Thehb_face_tto work onglyph- Thehb_codepoint_tcode point to query- Returns:
- The
hb_ot_layout_glyph_class_tglyph class of the given code point in the GDEF table of the face. - Since:
- 0.9.7
-
otLayoutGetGlyphsInClass
Retrieves the set of all glyphs from the face that belong to the requested glyph class in the face's GDEF table.- Parameters:
face- Thehb_face_tto work onklass- Thehb_ot_layout_glyph_class_tGDEF class to retrieveglyphs- Thehb_set_tset of all glyphs belonging to the requested class.- Since:
- 0.9.7
-
otLayoutGetHorizontalBaselineTagForScript
Fetches the dominant horizontal baseline tag used byscript.- 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- Thehb_font_tto work ondirection- Thehb_direction_ttext direction to useglyph- Thehb_codepoint_tcode point to querystartOffset- offset of the first caret position to retrievecaretArray- 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., thesizefeature 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 thesizefeature.For more information on this distinction, see the
sizefeature documentation.- Parameters:
face-hb_face_tto work upondesignSize- The design size of the facesubfamilyId- The identifier of the face within the font subfamilysubfamilyNameId- The ‘name’ table name ID of the face within the font subfamilyrangeStart- The minimum size of the recommended size range for the facerangeEnd- The maximum size of the recommended size range for the face- Returns:
trueif data found,falseotherwise- Since:
- 0.9.10
-
otLayoutHasGlyphClasses
-
otLayoutHasPositioning
-
otLayoutHasSubstitution
-
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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageIndex- The index of the requested language tagfeatureTag-hb_tag_tof the feature tag requestedfeatureIndex- The index of the requested feature- Returns:
trueif the feature is found,falseotherwise- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageIndex- The index of the requested language tagstartOffset- offset of the first feature tag to retrievefeatureIndexes- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageIndex- The index of the requested language tagstartOffset- offset of the first feature tag to retrievefeatureTags- The array ofhb_tag_tfeature 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageIndex- The index of the requested language tagfeatureIndex- The index of the requested featurefeatureTag- Thehb_tag_tof the requested feature- Returns:
trueif the feature is found,falseotherwise- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageIndex- The index of the requested language tagfeatureIndex- The index of the requested feature- Returns:
trueif the feature is found,falseotherwise- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSlookupIndex- The index of the feature lookup to queryglyphsBefore- Array of glyphs preceding the substitution rangeglyphsInput- Array of input glyphs that would be substituted by the lookupglyphsAfter- Array of glyphs following the substitution rangeglyphsOutput- 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
Compute the transitive closure of glyphs needed for a specified lookup.- Parameters:
face-hb_face_tto work uponlookupIndex- index of the feature lookup to queryglyphs- Array of glyphs comprising the transitive closure of the lookup- Since:
- 0.9.7
-
otLayoutLookupWouldSubstitute
public static Bool otLayoutLookupWouldSubstitute(Face face, int lookupIndex, Codepoint 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_tto work uponlookupIndex- The index of the lookup to queryglyphs- The sequence of glyphs to query for substitutionglyphsLength- The length of the glyph sequencezeroContext-hb_bool_tindicating whether pre-/post-context are disallowed in substitutions- Returns:
trueif a substitution would be triggered,falseotherwise- Since:
- 0.9.7
-
otLayoutLookupsSubstituteClosure
Compute the transitive closure of glyphs needed for all of the provided lookups.- Parameters:
face-hb_face_tto work uponlookups- The set of lookups to queryglyphs- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageTag- Thehb_tag_tof the requested languagelanguageIndex- The index of the requested language- Returns:
trueif the language tag is found,falseotherwise- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script tagstartOffset- offset of the first language tag to retrievelanguageTags- 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, Tag languageTags, Out<Integer> languageIndex) Fetches the index of the first language tag fomlanguageTagsthat 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,
falseis returned andlanguageIndexis set to the default language index.- Parameters:
face-hb_face_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageCount- The number of languages in the specified scriptlanguageTags- The array of language tagslanguageIndex- The index of the requested language- Returns:
trueif one of the given language tags is found,falseotherwise- Since:
- 2.0.0
-
otLayoutScriptSelectLanguage2
public static Bool otLayoutScriptSelectLanguage2(Face face, Tag tableTag, int scriptIndex, int languageCount, Tag languageTags, Out<Integer> languageIndex, Tag chosenLanguage) Fetches the index of the first language tag fomlanguageTagsthat 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,
falseis returned andlanguageIndexis set toHB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEXandchosenLanguageis set toHB_TAG_NONE.- Parameters:
face-hb_face_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptIndex- The index of the requested script taglanguageCount- The number of languages in the specified scriptlanguageTags- The array of language tagslanguageIndex- The index of the chosen languagechosenLanguage-hb_tag_tof the chosen language- Returns:
trueif one of the given language tags is found,falseotherwise- Since:
- 7.0.0
-
otLayoutTableChooseScript
public static Bool otLayoutTableChooseScript(Face face, Tag tableTag, Tag scriptTags, Out<Integer> scriptIndex, Tag chosenScript) Deprecated since 2.0.0- Parameters:
face-hb_face_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptTags- Array ofhb_tag_tscript tagsscriptIndex- The index of the chosen scriptchosenScript-hb_tag_tof 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOScoords- The variation coordinates to querynumCoords- The number of variation coordinatesvariationsIndex- The array of feature variations found for the query- Returns:
trueif feature variations were found,falseotherwise.- 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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptTag-hb_tag_tof the script tag requestedscriptIndex- The index of the requested script tag- Returns:
trueif the script is found,falseotherwise
-
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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSstartOffset- offset of the first feature tag to retrievefeatureTags- Array of feature tags found in the table- Returns:
- Total number of feature tags.
- Since:
- 0.6.0
-
otLayoutTableGetLookupCount
Fetches the total number of lookups enumerated in the specified face's GSUB table or GPOS table.- Parameters:
face-hb_face_tto work upontableTag-HB_OT_TAG_GSUBorHB_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_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSstartOffset- offset of the first script tag to retrievescriptTags- The array ofhb_tag_tscript tags found for the query- Returns:
- Total number of script tags.
-
otLayoutTableSelectScript
public static Bool otLayoutTableSelectScript(Face face, Tag tableTag, int scriptCount, Tag scriptTags, @Nullable Out<Integer> scriptIndex, @Nullable Tag chosenScript) Selects an OpenType script fortableTagfrom thescriptTagsarray.If the table does not have any of the requested scripts, then
DFLT,dflt, andlatntags are tried in that order. If the table still does not have any of these scripts,scriptIndexis set toHB_OT_LAYOUT_NO_SCRIPT_INDEXandchosenScriptis set toHB_TAG_NONE.- Parameters:
face-hb_face_tto work upontableTag-HB_OT_TAG_GSUBorHB_OT_TAG_GPOSscriptCount- Number of script tags in the arrayscriptTags- Array ofhb_tag_tscript tagsscriptIndex- The index of the requested scriptchosenScript-hb_tag_tof the requested script- Returns:
trueif one of the requested scripts is selected,falseif a fallback script is selected or if no scripts are selected.- Since:
- 2.0.0
-
otMathGetConstant
Fetches the specified math constant. For most constants, the value returned is anhb_position_t.However, if the requested constant is
HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN,HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWNorHB_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_tto work uponconstant-hb_ot_math_constant_tthe 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 ofhb_ot_math_glyph_part_tglyph parts that can be used to draw the glyph and an italics-correction value (if one is defined in the font).<note>The
directionparameter is only used to select between horizontal or vertical directions for the construction. Even though allhb_direction_tvalues are accepted, only the result ofHB_DIRECTION_IS_HORIZONTALis considered.</note>- Parameters:
font-hb_font_tto work uponglyph- The index of the glyph to stretchdirection- direction of the stretching (horizontal or vertical)startOffset- offset of the first glyph part to retrieveparts- the glyph parts returneditalicsCorrection- italics correction of the glyph assembly- Returns:
- the total number of parts in the glyph assembly
- Since:
- 1.3.3
-
otMathGetGlyphItalicsCorrection
Fetches an italics-correction value (if one exists) for the specified glyph index.- Parameters:
font-hb_font_tto work uponglyph- 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, andkern.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_tto work uponglyph- The glyph index from which to retrieve the valuekern- Thehb_ot_math_kern_tfrom which to retrieve the valuecorrectionHeight- 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, andkern.The corresponding list of kern values and correction heights is returned as a list ofhb_ot_math_kern_entry_tstructs.See also
hb_ot_math_get_glyph_kerning, which handles selecting the appropriate kern value for a given correction height.<note>For a glyph with
ndefined kern values (wheren> 0), there are onlyn−1defined correction heights, as each correction height defines a boundary past which the next kern value should be selected. Therefore, only thehb_ot_math_kern_entry_t.kern_value of the uppermosthb_ot_math_kern_entry_tactually comes from the font; its correspondinghb_ot_math_kern_entry_t.max_correction_height is always set to <code>INT32_MAX</code>.</note>- Parameters:
font-hb_font_tto work uponglyph- The glyph index from which to retrieve the kerningskern- Thehb_ot_math_kern_tfrom which to retrieve the kerningsstartOffset- offset of the first kern entry to retrievekernEntries- array of kern entries returned- Returns:
- the total number of kern values available or zero
- Since:
- 3.4.0
-
otMathGetGlyphTopAccentAttachment
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
MathTopAccentAttachmenttable (or, whenfonthas noMathTopAccentAttachmenttable or noMATHtable, any glyph) - the function synthesizes a value, returning the position at one-half the glyph's advance width.- Parameters:
font-hb_font_tto work uponglyph- 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 ofhb_ot_math_glyph_variant_tstructs.<note>The
directionparameter is only used to select between horizontal or vertical directions for the construction. Even though allhb_direction_tvalues are accepted, only the result ofHB_DIRECTION_IS_HORIZONTALis considered.</note>- Parameters:
font-hb_font_tto work uponglyph- The index of the glyph to stretchdirection- The direction of the stretching (horizontal or vertical)startOffset- offset of the first variant to retrievevariants- array of variants returned- Returns:
- the total number of size variants available or zero
- Since:
- 1.3.3
-
otMathGetMinConnectorOverlap
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.<note>The
directionparameter is only used to select between horizontal or vertical directions for the construction. Even though allhb_direction_tvalues are accepted, only the result ofHB_DIRECTION_IS_HORIZONTALis considered.</note>- Parameters:
font-hb_font_tto work upondirection- direction of the stretching (horizontal or vertical)- Returns:
- requested minimum connector overlap or zero
- Since:
- 1.3.3
-
otMathHasData
-
otMathIsGlyphExtendedShape
-
otMetaGetEntryTags
public static int otMetaGetEntryTags(Face face, int startOffset, @Nullable Out<OtMetaTag[]> entries) Fetches all available feature types.- Parameters:
face- a face objectstartOffset- iteration's start offsetentries- entries tags buffer- Returns:
- Number of all available feature types.
- Since:
- 2.6.0
-
otMetaReferenceEntry
-
otMetricsGetPosition
public static Bool otMetricsGetPosition(Font font, OtMetricsTag metricsTag, @Nullable Position position) Fetches metrics value corresponding tometricsTagfromfont.- Parameters:
font- anhb_font_tobject.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 tometricsTagfromfont,and synthesizes a value if it the value is missing in the font.- Parameters:
font- anhb_font_tobject.metricsTag- tag of metrics value you like to fetch.position- result of metrics value from the font.- Since:
- 4.0.0
-
otMetricsGetVariation
Fetches metrics value corresponding tometricsTagfromfontwith the current font variation settings applied.- Parameters:
font- anhb_font_tobject.metricsTag- tag of metrics value you like to fetch.- Returns:
- The requested metric value.
- Since:
- 2.6.0
-
otMetricsGetXVariation
Fetches horizontal metrics value corresponding tometricsTagfromfontwith the current font variation settings applied.- Parameters:
font- anhb_font_tobject.metricsTag- tag of metrics value you like to fetch.- Returns:
- The requested metric value.
- Since:
- 2.6.0
-
otMetricsGetYVariation
Fetches vertical metrics value corresponding tometricsTagfromfontwith the current font variation settings applied.- Parameters:
font- anhb_font_tobject.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. IflanguageisHB_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 outputtextSize.- 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. IflanguageisHB_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 outputtextSize.- 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. IflanguageisHB_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 outputtextSize.- 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_tto work uponbuffer- The input buffer to compute fromfeatures- The features enabled on the bufferglyphs- Thehb_set_tset of glyphs comprising the transitive closure of the query- Since:
- 0.9.2
-
otShapePlanCollectLookups
Computes the complete set of GSUB or GPOS lookups that are applicable under a givenshapePlan.- Parameters:
shapePlan-hb_shape_plan_tto querytableTag- GSUB or GPOSlookupIndexes- Thehb_set_tset 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 planstartOffset- The index of first feature to retrievetags- The array of enabled feature- Returns:
- Total number of feature tagss.
- Since:
- 10.3.0
-
otTagFromLanguage
Deprecated.use hb_ot_tags_from_script_and_language() insteadConverts anhb_language_tto anhb_tag_t.- Parameters:
language- anhb_language_tto convert.- Since:
- 0.6.0
-
otTagToLanguage
-
otTagToScript
-
otTagsFromScript
Deprecated.use hb_ot_tags_from_script_and_language() insteadConverts anhb_script_tto script tags.- Parameters:
script- anhb_script_tto convert.scriptTag1- outputhb_tag_t.scriptTag2- outputhb_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 anhb_script_tand anhb_language_t.- Parameters:
scriptTag- a script taglanguageTag- a language tagscript- thehb_script_tcorresponding toscriptTag.language- thehb_language_tcorresponding toscriptTagandlanguageTag.- 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() insteadFetches the variation-axis information corresponding to the specified axis tag in the specified face.- Parameters:
face-hb_face_tto work uponaxisTag- Thehb_tag_tof the variation axis to queryaxisIndex- The index of the variation axisaxisInfo- Thehb_ot_var_axis_info_tof the axis tag queried- Since:
- 1.4.2
-
otVarFindAxisInfo
Fetches the variation-axis information corresponding to the specified axis tag in the specified face.- Parameters:
face-hb_face_tto work uponaxisTag- Thehb_tag_tof the variation axis to queryaxisInfo- Thehb_ot_var_axis_info_tof the axis tag queried- Returns:
trueif data found,falseotherwise- 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() insteadFetches a list of all variation axes in the specified face. The list returned will begin at the offset provided.- Parameters:
face-hb_face_tto work uponstartOffset- offset of the first lookup to retrieveaxesArray- The array of variation axes found- Since:
- 1.4.2
-
otVarGetAxisCount
Fetches the number of OpenType variation axes included in the face.- Parameters:
face- Thehb_face_tto 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_tto work uponstartOffset- offset of the first lookup to retrieveaxesArray- The array of variation axes found- Returns:
- the number of variation axes in the face
- Since:
- 2.2.0
-
otVarGetNamedInstanceCount
Fetches the number of named instances included in the face.- Parameters:
face- Thehb_face_tto work on- Returns:
- the number of named instances defined
- Since:
- 2.2.0
-
otVarHasData
-
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- Thehb_face_tto work oninstanceIndex- The index of the named instance to querycoords- The array of coordinates found for the query- Returns:
- the number of variation axes in the face
- Since:
- 2.2.0
-
otVarNamedInstanceGetPostscriptNameId
Fetches thenametable Name ID that provides display names for the "PostScript name" defined for the given named instance in the face.- Parameters:
face- Thehb_face_tto work oninstanceIndex- The index of the named instance to query- Returns:
- the Name ID found for the PostScript name
- Since:
- 2.2.0
-
otVarNamedInstanceGetSubfamilyNameId
Fetches thenametable Name ID that provides display names for the "Subfamily name" defined for the given named instance in the face.- Parameters:
face- Thehb_face_tto work oninstanceIndex- 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
avartable is also applied, as described at https://docs.microsoft.com/en-us/typography/opentype/spec/avarNote:
coordsLengthmust 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- Thehb_face_tto work oncoordsLength- The length of the coordinate arraydesignCoords- The design-space coordinates to normalizenormalizedCoords- 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- Thehb_face_tto work onvariations- The array of variations to normalizevariationsLength- The number of variations to normalizecoords- 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 functionspaintData- associated data passed by the callerisForeground- whether the color is the foregroundcolor- 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 functionspaintData- associated data passed by the callerglyph- the glyph IDfont- 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 forcolorIndex.- Parameters:
funcs- paint functionspaintData- associated data passed by the callercolorIndex- color indexcolor- fetched color- Returns:
trueif found,falseotherwise- Since:
- 7.0.0
-
paintFuncsCreate
Creates a newhb_paint_funcs_tstructure 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 returnsNULL. If memory cannot be allocated, a special singletonhb_paint_funcs_tobject will be returned.- Returns:
- the paint-functions structure
- Since:
- 7.0.0
-
paintFuncsDestroy
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
Fetches the singleton empty paint-functions structure.- Returns:
- The empty paint-functions structure
- Since:
- 7.0.0
-
paintFuncsGetUserData
Fetches the user-data associated with the specified key, attached to the specified paint-functions structure.- Parameters:
funcs- The paint-functions structurekey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 7.0.0
-
paintFuncsIsImmutable
Tests whether a paint-functions structure is immutable.- Parameters:
funcs- The paint-functions structure- Returns:
trueiffuncsis immutable,falseotherwise- Since:
- 7.0.0
-
paintFuncsMakeImmutable
Makes a paint-functions structure immutable.After this call, all attempts to set one of the callbacks on
funcswill fail.- Parameters:
funcs- The paint-functions structure- Since:
- 7.0.0
-
paintFuncsReference
Increases the reference count on a paint-functions structure.This prevents
funcsfrom 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 structfunc- The paint-color callbackdestroy- Function to call whenuserDatais 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 structfunc- The color-glyph callbackdestroy- Function to call whenuserDatais 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 structfunc- The custom-palette-color callbackdestroy- Function to call whenuserDatais 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 structfunc- The paint-image callbackdestroy- Function to call whenuserDatais 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 structfunc- The linear-gradient callbackdestroy- Function to call whenuserDatais 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 structfunc- The pop-clip callbackdestroy- Function to call whenuserDatais 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 structfunc- The pop-group callbackdestroy- Function to call whenuserDatais 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 structfunc- The pop-transform callbackdestroy- Function to call whenuserDatais 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 structfunc- The push-clip-glyph callbackdestroy- Function to call whenuserDatais 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 structfunc- The push-clip-rectangle callbackdestroy- Function to call whenuserDatais 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 structfunc- The push-group callbackdestroy- Function to call whenuserDatais 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 structfunc- The push-transform callbackdestroy- Function to call whenuserDatais 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 structfunc- The radial-gradient callbackdestroy- Function to call whenuserDatais 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 structfunc- The sweep-gradient callbackdestroy- Function to call whenuserDatais 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 structurekey- The user-data keydata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- 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 functionspaintData- associated data passed by the callerimage- image datawidth- width of the raster image in pixels, or 0height- height of the raster image in pixels, or 0format- the image format as a tagslant- Deprecated. set to 0.0extents- 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 functionspaintData- associated data passed by the callercolorLine- Color information for the gradientx0- X coordinate of the first pointy0- Y coordinate of the first pointx1- X coordinate of the second pointy1- Y coordinate of the second pointx2- X coordinate of the third pointy2- Y coordinate of the third point- Since:
- 7.0.0
-
paintPopClip
Perform a "pop-clip" paint operation.- Parameters:
funcs- paint functionspaintData- 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 functionspaintData- associated data passed by the callermode- the compositing mode to use- Since:
- 7.0.0
-
paintPopTransform
Perform a "pop-transform" paint operation.- Parameters:
funcs- paint functionspaintData- 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 functionspaintData- associated data passed by the callerglyph- the glyph IDfont- 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 functionspaintData- associated data passed by the callerxmin- min X for the rectangleymin- min Y for the rectanglexmax- max X for the rectangleymax- 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 functionspaintData- associated data passed by the callerfont- a font- Since:
- 11.0.0
-
paintPushGroup
Perform a "push-group" paint operation.- Parameters:
funcs- paint functionspaintData- 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 functionspaintData- associated data passed by the callerfont- 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 functionspaintData- associated data passed by the callerxx- xx component of the transform matrixyx- yx component of the transform matrixxy- xy component of the transform matrixyy- yy component of the transform matrixdx- dx component of the transform matrixdy- 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 functionspaintData- associated data passed by the callercolorLine- Color information for the gradientx0- X coordinate of the first circle's centery0- Y coordinate of the first circle's centerr0- radius of the first circlex1- X coordinate of the second circle's centery1- Y coordinate of the second circle's centerr1- 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 functionspaintData- associated data passed by the callercolorLine- Color information for the gradientx0- X coordinate of the circle's centery0- Y coordinate of the circle's centerstartAngle- the start angleendAngle- the end angle- Since:
- 7.0.0
-
realloc
Reallocates the memory pointed to byptrtosizebytes, 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
-
scriptFromString
Converts a stringstrrepresenting an ISO 15924 script tag to a correspondinghb_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_tcorresponding to the ISO 15924 tag. - Since:
- 0.9.2
-
scriptGetHorizontalDirection
Fetches thehb_direction_tof a script when it is set horizontally. All right-to-left scripts will returnHB_DIRECTION_RTL. All left-to-right scripts will returnHB_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- Thehb_script_tto query- Returns:
- The horizontal
hb_direction_tofscript - Since:
- 0.9.2
-
scriptToIso15924Tag
-
segmentPropertiesEqual
Checks the equality of twohb_segment_properties_t's.- Parameters:
a- firsthb_segment_properties_tto compare.b- secondhb_segment_properties_tto compare.- Returns:
trueif all properties ofaequal those ofb,falseotherwise.- Since:
- 0.9.7
-
segmentPropertiesHash
Creates a hash representingp.- Parameters:
p-hb_segment_properties_tto hash.- Returns:
- A hash of
p. - Since:
- 0.9.7
-
segmentPropertiesOverlay
Fills in missing fields ofpfromsrcin a considered manner.First, if
pdoes not have direction set, direction is copied fromsrc.Next, if
pandsrchave the same direction (which can be unset), ifpdoes not have script set, script is copied fromsrc.Finally, if
pandsrchave the same direction and script (which either can be unset), ifpdoes not have language set, language is copied fromsrc.- Parameters:
p-hb_segment_properties_tto fill in.src-hb_segment_properties_tto fill in from.- Since:
- 3.3.0
-
setAdd
-
setAddRange
-
setAddSortedArray
AddsnumCodepointscodepoints to a set at once. The codepoints array must be in increasing order, with size at leastnumCodepoints.- Parameters:
set- A setsortedCodepoints- Array of codepoints to add- Since:
- 4.1.0
-
setAllocationSuccessful
-
setClear
Clears out the contents of a set.- Parameters:
set- A set- Since:
- 0.9.2
-
setCopy
-
setCreate
Creates a new, initially empty set.- Returns:
- The new
hb_set_t - Since:
- 0.9.2
-
setDel
-
setDelRange
Removes all of the elements fromfirsttolast(inclusive) fromset.If
lastisHB_SET_VALUE_INVALID, then all values greater than or equal tofirstare removed.- Parameters:
set- A setfirst- The first element to remove fromsetlast- The final element to remove fromset- Since:
- 0.9.7
-
setDestroy
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
Fetches the singleton emptyhb_set_t.- Returns:
- The empty
hb_set_t - Since:
- 0.9.2
-
setGetMax
-
setGetMin
-
setGetPopulation
Returns the number of elements in the set.- Parameters:
set- A set- Returns:
- The population of
set - Since:
- 0.9.7
-
setGetUserData
Fetches the user data associated with the specified key, attached to the specified set.- Parameters:
set- A setkey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.2
-
setHas
-
setHash
Creates a hash representingset.- Parameters:
set- A set- Returns:
- A hash of
set. - Since:
- 4.4.0
-
setIntersect
-
setInvert
Inverts the contents ofset.- Parameters:
set- A set- Since:
- 3.0.0
-
setIsEmpty
-
setIsEqual
-
setIsInverted
-
setIsSubset
-
setNext
Fetches the next element insetthat is greater than current value ofcodepoint.Set
codepointtoHB_SET_VALUE_INVALIDto get started.- Parameters:
set- A setcodepoint- Input = Code point to query Output = Code point retrieved- Returns:
trueif there was a next value,falseotherwise- Since:
- 0.9.2
-
setNextMany
Finds the next element insetthat is greater thancodepoint.Writes out codepoints toout,until either the set runs out of elements, orsizecodepoints are written, whichever comes first.- Parameters:
set- A setcodepoint- Outputting codepoints starting after this one. UseHB_SET_VALUE_INVALIDto get started.out- An array of codepoints to write to.- Returns:
- the number of values written.
- Since:
- 4.2.0
-
setNextRange
Fetches the next consecutive range of elements insetthat are greater than current value oflast.Set
lasttoHB_SET_VALUE_INVALIDto get started.- Parameters:
set- A setfirst- The first code point in the rangelast- Input = The current last code point in the range Output = The last code point in the range- Returns:
trueif there was a next range,falseotherwise- Since:
- 0.9.7
-
setPrevious
Fetches the previous element insetthat is lower than current value ofcodepoint.Set
codepointtoHB_SET_VALUE_INVALIDto get started.- Parameters:
set- A setcodepoint- Input = Code point to query Output = Code point retrieved- Returns:
trueif there was a previous value,falseotherwise- Since:
- 1.8.0
-
setPreviousRange
Fetches the previous consecutive range of elements insetthat are greater than current value oflast.Set
firsttoHB_SET_VALUE_INVALIDto get started.- Parameters:
set- A setfirst- Input = The current first code point in the range Output = The first code point in the rangelast- The last code point in the range- Returns:
trueif there was a previous range,falseotherwise- Since:
- 1.8.0
-
setReference
-
setSet
-
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 setkey- The user-data key to setdata- A pointer to the user data to setdestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
setSubtract
-
setSymmetricDifference
-
setUnion
-
shape
Shapesbufferusingfontturning its Unicode characters content to positioned glyphs. Iffeaturesis notNULL, it will be used to control the features applied during shaping. If twofeatureshave the same tag but overlapping ranges the value of the feature with the higher index takes precedence.- Parameters:
font- anhb_font_tto use for shapingbuffer- anhb_buffer_tto shapefeatures- an array of user specifiedhb_feature_torNULL- 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. IfshaperListis notNULL, the specified shapers will be used in the given order, otherwise the default shapers list will be used.- Parameters:
font- anhb_font_tto use for shapingbuffer- anhb_buffer_tto shapefeatures- an array of user specifiedhb_feature_torNULLshaperList- aNULL-terminated array of shapers to use orNULL- Returns:
- false if all shapers failed, true otherwise
- Since:
- 0.9.2
-
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 offace,userFeatures,props,andshaperList.- Parameters:
face-hb_face_tto useprops- Thehb_segment_properties_tof the segmentuserFeatures- The list of user-selected featuresshaperList- 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, @org.jspecify.annotations.Nullable int @Nullable [] coords, @Nullable String @Nullable [] shaperList) The variable-font version ofhb_shape_plan_create. Constructs a shaping plan for a combination offace,userFeatures,props,andshaperList,plus the variation-space coordinatescoords.- Parameters:
face-hb_face_tto useprops- Thehb_segment_properties_tof the segmentuserFeatures- The list of user-selected featurescoords- The list of variation-space coordinatesshaperList- 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 offace,userFeatures,props,andshaperList.- Parameters:
face-hb_face_tto useprops- Thehb_segment_properties_tof the segmentuserFeatures- The list of user-selected featuresshaperList- 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, @org.jspecify.annotations.Nullable int @Nullable [] coords, @Nullable String @Nullable [] shaperList) The variable-font version ofhb_shape_plan_create_cached. Creates a cached shaping plan suitable for reuse, for a combination offace,userFeatures,props,andshaperList,plus the variation-space coordinatescoords.- Parameters:
face-hb_face_tto useprops- Thehb_segment_properties_tof the segmentuserFeatures- The list of user-selected featurescoords- The list of variation-space coordinatesshaperList- List of shapers to try- Returns:
- The shaping plan
- Since:
- 1.4.0
-
shapePlanDestroy
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 givenfontandfeatures.- Parameters:
shapePlan- A shaping planfont- Thehb_font_tto usebuffer- Thehb_buffer_tto work uponfeatures- Features to enable- Returns:
trueif success,falseotherwise.- Since:
- 0.9.7
-
shapePlanGetEmpty
Fetches the singleton empty shaping plan.- Returns:
- The empty shaping plan
- Since:
- 0.9.7
-
shapePlanGetShaper
-
shapePlanGetUserData
Fetches the user data associated with the specified key, attached to the specified shaping plan.- Parameters:
shapePlan- A shaping plankey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.7
-
shapePlanReference
-
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 plankey- The user-data key to setdata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise.- Since:
- 0.9.7
-
styleGetValue
Searches variation axes of ahb_font_tobject for a specific axis first, if not set, first tries to get default style values inSTATtable then tries to polyfill from different tables of the font.- Parameters:
font- ahb_font_tobject.styleTag- a style tag.- Returns:
- Corresponding axis or default value to a style tag.
- Since:
- 3.0.0
-
tagFromString
Converts a string into anhb_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_tcorresponding tostr - Since:
- 0.9.2
-
tagToString
-
unicodeCombiningClass
Retrieves the Canonical Combining Class (ccc) property of code pointunicode.- Parameters:
ufuncs- The Unicode-functions structureunicode- The code point to query- Returns:
- The
hb_unicode_combining_class_tofunicode - Since:
- 0.9.2
-
unicodeCompose
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 structurea- The first Unicode code point to composeb- The second Unicode code point to composeab- The composition ofa,b- Returns:
trueifaandbcomposed,falseotherwise- Since:
- 0.9.2
-
unicodeDecompose
Fetches the decomposition of a Unicode code point.Calls the decomposition function of the specified Unicode-functions structure
ufuncs.- Parameters:
ufuncs- The Unicode-functions structureab- Unicode code point to decomposea- The first code point of the decomposition ofabb- The second code point of the decomposition ofab- Returns:
trueifabwas decomposed,falseotherwise- 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 structureu- Code point to decomposedecomposed- Compatibility decomposition ofu- Returns:
- length of
decomposed. - Since:
- 0.9.2
-
unicodeEastasianWidth
Deprecated.Don't use. Not used by HarfBuzz.- Parameters:
ufuncs- a Unicode-function structureunicode- The code point to query- Since:
- 0.9.2
-
unicodeFuncsCreate
Creates a newhb_unicode_funcs_tstructure of Unicode functions.- Parameters:
parent- Parent Unicode-functions structure- Returns:
- The Unicode-functions structure
- Since:
- 0.9.2
-
unicodeFuncsDestroy
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
Fetches a pointer to the default Unicode-functions structure that is used when no functions are explicitly set onhb_buffer_t.- Returns:
- a pointer to the
hb_unicode_funcs_tUnicode-functions structure - Since:
- 0.9.2
-
unicodeFuncsGetEmpty
Fetches the singleton empty Unicode-functions structure.- Returns:
- The empty Unicode-functions structure
- Since:
- 0.9.2
-
unicodeFuncsGetParent
Fetches the parent of the Unicode-functions structureufuncs.- Parameters:
ufuncs- The Unicode-functions structure- Returns:
- The parent Unicode-functions structure
- Since:
- 0.9.2
-
unicodeFuncsGetUserData
Fetches the user-data associated with the specified key, attached to the specified Unicode-functions structure.- Parameters:
ufuncs- The Unicode-functions structurekey- The user-data key to query- Returns:
- A pointer to the user data
- Since:
- 0.9.2
-
unicodeFuncsIsImmutable
Tests whether the specified Unicode-functions structure is immutable.- Parameters:
ufuncs- The Unicode-functions structure- Returns:
trueifufuncsis immutable,falseotherwise- Since:
- 0.9.2
-
unicodeFuncsMakeImmutable
Makes the specified Unicode-functions structure immutable.- Parameters:
ufuncs- The Unicode-functions structure- Since:
- 0.9.2
-
unicodeFuncsReference
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 forhb_unicode_combining_class_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
unicodeFuncsSetComposeFunc
public static void unicodeFuncsSetComposeFunc(UnicodeFuncs ufuncs, @Nullable UnicodeComposeFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_compose_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 forhb_unicode_decompose_compatibility_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
unicodeFuncsSetDecomposeFunc
public static void unicodeFuncsSetDecomposeFunc(UnicodeFuncs ufuncs, @Nullable UnicodeDecomposeFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_decompose_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 forhb_unicode_eastasian_width_func_t.- Parameters:
ufuncs- a Unicode-function structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
unicodeFuncsSetGeneralCategoryFunc
public static void unicodeFuncsSetGeneralCategoryFunc(UnicodeFuncs ufuncs, @Nullable UnicodeGeneralCategoryFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_general_category_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
unicodeFuncsSetMirroringFunc
public static void unicodeFuncsSetMirroringFunc(UnicodeFuncs ufuncs, @Nullable UnicodeMirroringFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_mirroring_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais not needed anymore- Since:
- 0.9.2
-
unicodeFuncsSetScriptFunc
public static void unicodeFuncsSetScriptFunc(UnicodeFuncs ufuncs, @Nullable UnicodeScriptFunc func, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_script_func_t.- Parameters:
ufuncs- A Unicode-functions structurefunc- The callback function to assigndestroy- The function to call whenuserDatais 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 structurekey- The user-data keydata- A pointer to the user datadestroy- A callback to call whendatais not needed anymorereplace- Whether to replace an existing data with the same key- Returns:
trueif success,falseotherwise- Since:
- 0.9.2
-
unicodeGeneralCategory
Retrieves the General Category (gc) property of code pointunicode.- Parameters:
ufuncs- The Unicode-functions structureunicode- The code point to query- Returns:
- The
hb_unicode_general_category_tofunicode - Since:
- 0.9.2
-
unicodeMirroring
Retrieves the Bi-directional Mirroring Glyph code point defined for code pointunicode.- Parameters:
ufuncs- The Unicode-functions structureunicode- The code point to query- Returns:
- The
hb_codepoint_tof the Mirroring Glyph forunicode - Since:
- 0.9.2
-
unicodeScript
Retrieves thehb_script_tscript to which code pointunicodebelongs.- Parameters:
ufuncs- The Unicode-functions structureunicode- The code point to query- Returns:
- The
hb_script_tofunicode - Since:
- 0.9.2
-
variationFromString
public static Bool variationFromString(@org.jspecify.annotations.Nullable byte @Nullable [] str, Variation variation) Parses a string into ahb_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, orslnt=-7.5.- Parameters:
str- a string to parsevariation- thehb_variation_tto initialize with the parsed values- Returns:
trueifstris successfully parsed,falseotherwise- Since:
- 1.4.2
-
variationToString
Converts anhb_variation_tinto aNULL-terminated string in the format understood by hb_variation_from_string(). The client in responsible for allocating big enough size forbuf,128 bytes is more than enough.Note that the string won't include any whitespace.
- Parameters:
variation- anhb_variation_tto convertbuf- output string- Since:
- 1.4.2
-