Class HarfBuzz
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Used when getting or setting AAT feature selectors.static final int
The default code point for replacing invalid characters in a given encoding.static final Codepoint
Unusedhb_codepoint_t
value.static final int
Special setting forhb_feature_t
.start to apply the feature from the start of the buffer.static final int
Constant signifying that a font does not have any named-instance index set.static final int
Special value for language index indicating default or unsupported language.static final int
Special value for feature index indicating unsupported feature.static final int
Special value for script index indicating unsupported script.static final int
Special value for variations index indicating unsupported variation.static final int
Maximum number of OpenType tags that can correspond to a givehb_language_t
.static final int
Maximum number of OpenType tags that can correspond to a givehb_script_t
.static final int
Do not use.static final int
[Tibetan]static final int
Maximum valid Unicode code point.static final int
See Unicode 6.1 for details on the maximum decomposition length.static final int
static final int
static final int
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OtNameId
aatLayoutFeatureTypeGetNameId
(Face face, AatLayoutFeatureType featureType) Fetches the name identifier of the specified feature type in the face'sname
table.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.static int
aatLayoutGetFeatureTypes
(Face face, int startOffset, Out<AatLayoutFeatureType[]> features) Fetches a list of the AAT feature types included in the specified face.static Bool
aatLayoutHasPositioning
(Face face) Tests whether the specified face includes any positioning information in thekerx
table.static Bool
aatLayoutHasSubstitution
(Face face) Tests whether the specified face includes any substitutions in themorx
ormort
tables.static Bool
aatLayoutHasTracking
(Face face) Tests whether the specified face includes any tracking information in thetrak
table.static Blob
blobCopyWritableOrFail
(Blob blob) Makes a writable copy ofblob
.static Blob
blobCreate
(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata
.static Blob
blobCreateFromFile
(String fileName) Creates a new blob containing the data from the specified binary font file.static Blob
blobCreateFromFileOrFail
(String fileName) Creates a new blob containing the data from the specified binary font file.static Blob
blobCreateOrFail
(String data, int length, MemoryMode mode, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata
.static Blob
blobCreateSubBlob
(Blob parent, int offset, int length) Returns a blob that represents a range of bytes inparent
.static void
blobDestroy
(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 String[]
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 Blob
Returns the singleton empty blob.static int
blobGetLength
(Blob blob) Fetches the length of a blob's data.static MemorySegment
blobGetUserData
(Blob blob, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified font-functions structure.static Bool
blobIsImmutable
(Blob blob) Tests whether a blob is immutable.static void
blobMakeImmutable
(Blob blob) Makes a blob immutable.static Blob
blobReference
(Blob blob) Increases the reference count onblob
.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.static void
Appends a character with the Unicode value ofcodepoint
tobuffer
, and gives it the initial cluster value ofcluster
.static void
bufferAddCodepoints
(Buffer buffer, Codepoint[] text, int itemOffset, int itemLength) Appends characters fromtext
array tobuffer
.static void
bufferAddLatin1
(Buffer buffer, byte[] 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 void
bufferAddUtf16
(Buffer buffer, short[] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().static void
bufferAddUtf32
(Buffer buffer, int[] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().static void
bufferAddUtf8
(Buffer buffer, byte[] text, int itemOffset, int itemLength) See hb_buffer_add_codepoints().static Bool
bufferAllocationSuccessful
(Buffer buffer) Check if allocating memory for the buffer succeeded.static void
bufferAppend
(Buffer buffer, Buffer source, int start, int end) Append (part of) contents of another buffer to this buffer.static void
bufferClearContents
(Buffer buffer) Similar to hb_buffer_reset(), but does not clear the Unicode functions and the replacement code point.static Buffer
Creates a newhb_buffer_t
with all properties to defaults.static Buffer
Creates a newhb_buffer_t
, similar to hb_buffer_create().static Bool
bufferDeserializeGlyphs
(Buffer buffer, String[] buf, @Nullable Out<String> endPtr, @Nullable Font font, BufferSerializeFormat format) Deserializes glyphsbuffer
from textual representation in the format produced by hb_buffer_serialize_glyphs().static Bool
bufferDeserializeUnicode
(Buffer buffer, String[] buf, @Nullable Out<String> endPtr, BufferSerializeFormat format) Deserializes Unicodebuffer
from textual representation in the format produced by hb_buffer_serialize_unicode().static void
bufferDestroy
(Buffer buffer) Deallocate thebuffer
.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_PRESENT
andHB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT
are never returned.static BufferClusterLevel
bufferGetClusterLevel
(Buffer buffer) Fetches the cluster level of a buffer.static BufferContentType
bufferGetContentType
(Buffer buffer) Fetches the type ofbuffer
contents.static Direction
bufferGetDirection
(Buffer buffer) See hb_buffer_set_direction()static Buffer
Fetches an emptyhb_buffer_t
.static Set
<BufferFlags> bufferGetFlags
(Buffer buffer) Fetches thehb_buffer_flags_t
ofbuffer
.static GlyphInfo[]
bufferGetGlyphInfos
(Buffer buffer) Returnsbuffer
glyph information array.static GlyphPosition[]
bufferGetGlyphPositions
(Buffer buffer) Returnsbuffer
glyph position array.static Codepoint
bufferGetInvisibleGlyph
(Buffer buffer) See hb_buffer_set_invisible_glyph().static Language
bufferGetLanguage
(Buffer buffer) See hb_buffer_set_language().static int
bufferGetLength
(Buffer buffer) Returns the number of items in the buffer.static Codepoint
bufferGetNotFoundGlyph
(Buffer buffer) See hb_buffer_set_not_found_glyph().static int
bufferGetRandomState
(Buffer buffer) See hb_buffer_set_random_state().static Codepoint
bufferGetReplacementCodepoint
(Buffer buffer) Fetches thehb_codepoint_t
that replaces invalid entries for a given encoding when adding text tobuffer
.static Script
bufferGetScript
(Buffer buffer) Fetches the script ofbuffer
.static void
bufferGetSegmentProperties
(Buffer buffer, SegmentProperties props) Setsprops
to thehb_segment_properties_t
ofbuffer
.static UnicodeFuncs
bufferGetUnicodeFuncs
(Buffer buffer) Fetches the Unicode-functions structure of a buffer.static MemorySegment
bufferGetUserData
(Buffer buffer, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified buffer.static void
bufferGuessSegmentProperties
(Buffer buffer) Sets unset buffer segment properties based on buffer Unicode contents.static Bool
bufferHasPositions
(Buffer buffer) Returns whetherbuffer
has glyph position data.static void
bufferNormalizeGlyphs
(Buffer buffer) Reorders a glyph buffer to have canonical in-cluster glyph order / position.static Bool
bufferPreAllocate
(Buffer buffer, int size) Pre allocates memory forbuffer
to fit at leastsize
number of items.static Buffer
bufferReference
(Buffer buffer) Increases the reference count onbuffer
by one.static void
bufferReset
(Buffer buffer) Resets the buffer to its initial status, as if it was just newly created with hb_buffer_create().static void
bufferReverse
(Buffer buffer) Reverses buffer contents.static void
bufferReverseClusters
(Buffer buffer) Reverses buffer clusters.static void
bufferReverseRange
(Buffer buffer, int start, int end) Reverses buffer contents betweenstart
andend
.static int
bufferSerialize
(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbuffer
into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information.static int
bufferSerialize
(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbuffer
into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information.static BufferSerializeFormat
bufferSerializeFormatFromString
(byte[] str) Parses a string into anhb_buffer_serialize_format_t
.static String
Convertsformat
to the string corresponding it, orNULL
if it is not a validhb_buffer_serialize_format_t
.static int
bufferSerializeGlyphs
(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbuffer
into a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging.static int
bufferSerializeGlyphs
(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbuffer
into 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 int
bufferSerializeUnicode
(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbuffer
into a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping).static int
bufferSerializeUnicode
(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbuffer
into a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping).static void
bufferSetClusterLevel
(Buffer buffer, BufferClusterLevel clusterLevel) Sets the cluster level of a buffer.static void
bufferSetContentType
(Buffer buffer, BufferContentType contentType) Sets the type ofbuffer
contents.static void
bufferSetDirection
(Buffer buffer, Direction direction) Set the text flow direction of the buffer.static void
bufferSetFlags
(Buffer buffer, Set<BufferFlags> flags) Setsbuffer
flags toflags
.static void
bufferSetFlags
(Buffer buffer, BufferFlags... flags) Setsbuffer
flags toflags
.static void
bufferSetInvisibleGlyph
(Buffer buffer, Codepoint invisible) Sets thehb_codepoint_t
that replaces invisible characters in the shaping result.static void
bufferSetLanguage
(Buffer buffer, Language language) Sets the language ofbuffer
tolanguage
.static Bool
bufferSetLength
(Buffer buffer, int length) Similar to hb_buffer_pre_allocate(), but clears any new items added at the end.static void
bufferSetMessageFunc
(Buffer buffer, BufferMessageFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_buffer_message_func_t
.static void
bufferSetNotFoundGlyph
(Buffer buffer, Codepoint notFound) Sets thehb_codepoint_t
that replaces characters not found in the font during shaping.static void
bufferSetRandomState
(Buffer buffer, int state) Sets the random state of the buffer.static void
bufferSetReplacementCodepoint
(Buffer buffer, Codepoint replacement) Sets thehb_codepoint_t
that replaces invalid entries for a given encoding when adding text tobuffer
.static void
bufferSetScript
(Buffer buffer, Script script) Sets the script ofbuffer
toscript
.static void
bufferSetSegmentProperties
(Buffer buffer, SegmentProperties props) Sets the segment properties of the buffer, a shortcut for calling hb_buffer_set_direction(), hb_buffer_set_script() and hb_buffer_set_language() individually.static void
bufferSetUnicodeFuncs
(Buffer buffer, UnicodeFuncs unicodeFuncs) Sets the Unicode-functions structure of a buffer tounicodeFuncs
.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.static byte
colorGetAlpha
(Color color) Fetches the alpha channel of the givencolor
.static byte
colorGetBlue
(Color color) Fetches the blue channel of the givencolor
.static byte
colorGetGreen
(Color color) Fetches the green channel of the givencolor
.static byte
colorGetRed
(Color color) Fetches the red channel of the givencolor
.static int
colorLineGetColorStops
(ColorLine colorLine, int start, @Nullable Out<ColorStop[]> colorStops) Fetches a list of color stops from the given color line object.static PaintExtend
colorLineGetExtend
(ColorLine colorLine) Fetches the extend mode of the color line object.static Direction
directionFromString
(byte[] str) Converts a string to anhb_direction_t
.static String
directionToString
(Direction direction) Converts anhb_direction_t
to a string.static void
drawClosePath
(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st) Perform a "close-path" draw operation.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.static DrawFuncs
Creates a new draw callbacks object.static void
drawFuncsDestroy
(DrawFuncs dfuncs) Deallocate thedfuncs
.static DrawFuncs
Fetches the singleton empty draw-functions structure.static MemorySegment
drawFuncsGetUserData
(DrawFuncs dfuncs, UserDataKey key) Fetches the user-data associated with the specified key, attached to the specified draw-functions structure.static Bool
drawFuncsIsImmutable
(DrawFuncs dfuncs) Checks whetherdfuncs
is immutable.static void
drawFuncsMakeImmutable
(DrawFuncs dfuncs) Makesdfuncs
object immutable.static DrawFuncs
drawFuncsReference
(DrawFuncs dfuncs) Increases the reference count ondfuncs
by one.static void
drawFuncsSetClosePathFunc
(DrawFuncs dfuncs, DrawClosePathFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets close-path callback to the draw functions object.static void
drawFuncsSetCubicToFunc
(DrawFuncs dfuncs, DrawCubicToFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets cubic-to callback to the draw functions object.static void
drawFuncsSetLineToFunc
(DrawFuncs dfuncs, DrawLineToFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets line-to callback to the draw functions object.static void
drawFuncsSetMoveToFunc
(DrawFuncs dfuncs, DrawMoveToFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets move-to callback to the draw functions object.static void
drawFuncsSetQuadraticToFunc
(DrawFuncs dfuncs, DrawQuadraticToFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets quadratic-to callback to the draw functions object.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.static void
drawLineTo
(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float toX, float toY) Perform a "line-to" draw operation.static void
drawMoveTo
(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float toX, float toY) Perform a "move-to" draw operation.static void
drawQuadraticTo
(DrawFuncs dfuncs, @Nullable MemorySegment drawData, DrawState st, float controlX, float controlY, float toX, float toY) Perform a "quadratic-to" draw operation.static Bool
faceBuilderAddTable
(Face face, Tag tag, Blob blob) Add table fortag
with data provided byblob
to the face.static Face
Creates ahb_face_t
that can be used with hb_face_builder_add_table().static void
faceBuilderSortTables
(Face face, Tag[] tags) Set the ordering of tables for serialization.static void
faceCollectNominalGlyphMapping
(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 void
faceCollectUnicodes
(Face face, Set out) Collects all of the Unicode characters covered byface
and adds them to thehb_set_t
setout
.static void
faceCollectVariationSelectors
(Face face, Set out) Collects all Unicode "Variation Selector" characters covered byface
and adds them to thehb_set_t
setout
.static void
faceCollectVariationUnicodes
(Face face, Codepoint variationSelector, Set out) Collects all Unicode characters forvariationSelector
covered byface
and adds them to thehb_set_t
setout
.static int
Fetches the number of faces in a blob.static Face
faceCreate
(Blob blob, int index) Constructs a new face object from the specified blob and a face index into that blob.static Face
faceCreateForTables
(ReferenceTableFunc referenceTableFunc, @Nullable MemorySegment userData, @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 void
faceDestroy
(Face face) Decreases the reference count on a face object.static Face
Fetches the singleton empty face object.static int
faceGetGlyphCount
(Face face) Fetches the glyph-count value of the specified face object.static int
faceGetIndex
(Face face) Fetches the face-index corresponding to the given face.static int
faceGetTableTags
(Face face, int startOffset, Out<Tag[]> tableTags) Fetches a list of all table tags for a face, if possible.static int
faceGetUpem
(Face face) Fetches the units-per-em (UPEM) value of the specified face object.static MemorySegment
faceGetUserData
(Face face, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified face object.static Bool
faceIsImmutable
(Face face) Tests whether the given face object is immutable.static void
faceMakeImmutable
(Face face) Makes the given face object immutable.static Face
faceReference
(Face face) Increases the reference count on a face object.static Blob
faceReferenceBlob
(Face face) Fetches a pointer to the binary blob that contains the specified face.static Blob
faceReferenceTable
(Face face, Tag tag) Fetches a reference to the specified table within the specified face.static void
faceSetGlyphCount
(Face face, int glyphCount) Sets the glyph count for a face object to the specified value.static void
faceSetIndex
(Face face, int index) Assigns the specified face-index toface
.static void
faceSetUpem
(Face face, int upem) Sets the units-per-em (upem) for a face object to the specified value.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.static Bool
featureFromString
(byte[] str, Feature feature) Parses a string into ahb_feature_t
.static void
featureToString
(Feature feature, Out<String[]> buf) Converts ahb_feature_t
into aNULL
-terminated string in the format understood by hb_feature_from_string().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.static void
fontChanged
(Font font) Notifies thefont
that underlying font data has changed.static Font
fontCreate
(Face face) Constructs a new font object from the specified face.static Font
fontCreateSubFont
(Font parent) Constructs a sub-font font object from the specifiedparent
font, replicating the parent's properties.static void
fontDestroy
(Font font) Decreases the reference count on the given font object.static void
fontDrawGlyph
(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData) Draws the outline that corresponds to a glyph in the specifiedfont
.static FontFuncs
Creates a newhb_font_funcs_t
structure of font functions.static void
fontFuncsDestroy
(FontFuncs ffuncs) Decreases the reference count on a font-functions structure.static FontFuncs
Fetches an empty font-functions structure.static MemorySegment
fontFuncsGetUserData
(FontFuncs ffuncs, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified font-functions structure.static Bool
fontFuncsIsImmutable
(FontFuncs ffuncs) Tests whether a font-functions structure is immutable.static void
fontFuncsMakeImmutable
(FontFuncs ffuncs) Makes a font-functions structure immutable.static FontFuncs
fontFuncsReference
(FontFuncs ffuncs) Increases the reference count on a font-functions structure.static void
fontFuncsSetDrawGlyphFunc
(FontFuncs ffuncs, FontDrawGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_draw_glyph_func_t
.static void
fontFuncsSetFontHExtentsFunc
(FontFuncs ffuncs, FontGetFontHExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_font_h_extents_func_t
.static void
fontFuncsSetFontVExtentsFunc
(FontFuncs ffuncs, FontGetFontVExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_font_v_extents_func_t
.static void
fontFuncsSetGlyphContourPointFunc
(FontFuncs ffuncs, FontGetGlyphContourPointFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_contour_point_func_t
.static void
fontFuncsSetGlyphExtentsFunc
(FontFuncs ffuncs, FontGetGlyphExtentsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_extents_func_t
.static void
fontFuncsSetGlyphFromNameFunc
(FontFuncs ffuncs, FontGetGlyphFromNameFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_from_name_func_t
.static void
fontFuncsSetGlyphFunc
(FontFuncs ffuncs, FontGetGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Deprecated.static void
fontFuncsSetGlyphHAdvanceFunc
(FontFuncs ffuncs, FontGetGlyphHAdvanceFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_advance_func_t
.static void
fontFuncsSetGlyphHAdvancesFunc
(FontFuncs ffuncs, FontGetGlyphHAdvancesFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_advances_func_t
.static void
fontFuncsSetGlyphHKerningFunc
(FontFuncs ffuncs, FontGetGlyphHKerningFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_kerning_func_t
.static void
fontFuncsSetGlyphHOriginFunc
(FontFuncs ffuncs, FontGetGlyphHOriginFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_h_origin_func_t
.static void
fontFuncsSetGlyphNameFunc
(FontFuncs ffuncs, FontGetGlyphNameFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_name_func_t
.static void
fontFuncsSetGlyphShapeFunc
(FontFuncs ffuncs, FontGetGlyphShapeFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Deprecated.Use hb_font_funcs_set_draw_glyph_func() insteadstatic void
fontFuncsSetGlyphVAdvanceFunc
(FontFuncs ffuncs, FontGetGlyphVAdvanceFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_advance_func_t
.static void
fontFuncsSetGlyphVAdvancesFunc
(FontFuncs ffuncs, FontGetGlyphVAdvancesFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_advances_func_t
.static void
fontFuncsSetGlyphVKerningFunc
(FontFuncs ffuncs, FontGetGlyphVKerningFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Deprecated.static void
fontFuncsSetGlyphVOriginFunc
(FontFuncs ffuncs, FontGetGlyphVOriginFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_v_origin_func_t
.static void
fontFuncsSetNominalGlyphFunc
(FontFuncs ffuncs, FontGetNominalGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyph_func_t
.static void
fontFuncsSetNominalGlyphsFunc
(FontFuncs ffuncs, FontGetNominalGlyphsFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyphs_func_t
.static void
fontFuncsSetPaintGlyphFunc
(FontFuncs ffuncs, FontPaintGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_paint_glyph_func_t
.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.static void
fontFuncsSetVariationGlyphFunc
(FontFuncs ffuncs, FontGetVariationGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_variation_glyph_func_t
.static Font
Fetches the empty font object.static void
fontGetExtentsForDirection
(Font font, Direction direction, FontExtents extents) Fetches the extents for a font in a text segment of the specified direction.static Face
fontGetFace
(Font font) Fetches the face associated with the specified font object.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.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.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.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.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.static Bool
fontGetGlyphExtents
(Font font, Codepoint glyph, GlyphExtents extents) Fetches thehb_glyph_extents_t
data for a glyph ID in the specified font.static Bool
fontGetGlyphExtentsForOrigin
(Font font, Codepoint glyph, Direction direction, GlyphExtents extents) Fetches thehb_glyph_extents_t
data for a glyph ID in the specified font, with respect to the origin in a text segment in the specified direction.static Bool
fontGetGlyphFromName
(Font font, String[] name, Codepoint glyph) Fetches the glyph ID that corresponds to a name string in the specifiedfont
.static Position
fontGetGlyphHAdvance
(Font font, Codepoint glyph) Fetches the advance for a glyph ID in the specified font, for horizontal text segments.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.static Position
fontGetGlyphHKerning
(Font font, Codepoint leftGlyph, Codepoint rightGlyph) Fetches the kerning-adjustment value for a glyph-pair in the specified font, for horizontal text segments.static Bool
fontGetGlyphHOrigin
(Font font, Codepoint glyph, Position x, Position y) Fetches the (X,Y) coordinates of the origin for a glyph ID in the specified font, for horizontal text segments.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.static Bool
fontGetGlyphName
(Font font, Codepoint glyph, Out<String[]> name) Fetches the glyph-name string for a glyph ID in the specifiedfont
.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.static void
fontGetGlyphShape
(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable MemorySegment drawData) Deprecated.Use hb_font_draw_glyph() insteadstatic Position
fontGetGlyphVAdvance
(Font font, Codepoint glyph) Fetches the advance for a glyph ID in the specified font, for vertical text segments.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.static Position
fontGetGlyphVKerning
(Font font, Codepoint topGlyph, Codepoint bottomGlyph) Deprecated.static Bool
fontGetGlyphVOrigin
(Font font, Codepoint glyph, Position x, Position y) Fetches the (X,Y) coordinates of the origin for a glyph ID in the specified font, for vertical text segments.static Bool
fontGetHExtents
(Font font, FontExtents extents) Fetches the extents for a specified font, for horizontal text segments.static Bool
fontGetNominalGlyph
(Font font, Codepoint unicode, Codepoint glyph) Fetches the nominal glyph ID for a Unicode code point in the specified font.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.static Font
fontGetParent
(Font font) Fetches the parent font offont
.static void
Fetches the horizontal and vertical points-per-em (ppem) of a font.static float
fontGetPtem
(Font font) Fetches the "point size" of a font.static void
Fetches the horizontal and vertical scale of a font.static int
fontGetSerial
(Font font) Returns the internal serial number of the font.static void
Fetches the "synthetic boldness" parameters of a font.static float
fontGetSyntheticSlant
(Font font) Fetches the "synthetic slant" of a font.static MemorySegment
fontGetUserData
(Font font, UserDataKey key) Fetches the user-data object associated with the specified key, attached to the specified font object.static MemorySegment
fontGetVarCoordsDesign
(Font font, Out<Integer> length) Fetches the list of variation coordinates (in design-space units) currently set on a font.static MemorySegment
fontGetVarCoordsNormalized
(Font font, Out<Integer> length) Fetches the list of normalized variation coordinates currently set on a font.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.static int
fontGetVarNamedInstance
(Font font) Returns the currently-set named-instance index of the font.static Bool
fontGetVExtents
(Font font, FontExtents extents) Fetches the extents for a specified font, for vertical text segments.static Bool
fontGlyphFromString
(Font font, byte[] s, Codepoint glyph) Fetches the glyph ID fromfont
that matches the specified string.static void
fontGlyphToString
(Font font, Codepoint glyph, Out<String[]> s) Fetches the name of the specified glyph ID infont
and returns it in strings
.static Bool
fontIsImmutable
(Font font) Tests whether a font object is immutable.static void
fontMakeImmutable
(Font font) Makesfont
immutable.static void
fontPaintGlyph
(Font font, Codepoint glyph, PaintFuncs pfuncs, @Nullable MemorySegment paintData, int paletteIndex, Color foreground) Paints the glyph.static Font
fontReference
(Font font) Increases the reference count on the given font object.static void
fontSetFace
(Font font, Face face) Setsface
as the font-face value offont
.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 withfont
-data and thedestroy
callback.static void
fontSetFuncsData
(Font font, @Nullable MemorySegment fontData, @Nullable DestroyFunc destroy) Replaces the user data attached to a font, updating the font'sdestroy
callback.static void
fontSetParent
(Font font, Font parent) Sets the parent font offont
.static void
fontSetPpem
(Font font, int xPpem, int yPpem) Sets the horizontal and vertical pixels-per-em (PPEM) of a font.static void
fontSetPtem
(Font font, float ptem) Sets the "point size" of a font.static void
fontSetScale
(Font font, int xScale, int yScale) Sets the horizontal and vertical scale of a font.static void
fontSetSyntheticBold
(Font font, float xEmbolden, float yEmbolden, Bool inPlace) Sets the "synthetic boldness" of a font.static void
fontSetSyntheticSlant
(Font font, float slant) Sets the "synthetic slant" of a font.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.static void
fontSetVarCoordsDesign
(Font font, float[] coords) Applies a list of variation coordinates (in design-space units) to a font.static void
fontSetVarCoordsNormalized
(Font font, int[] coords) Applies a list of variation coordinates (in normalized units) to a font.static void
fontSetVariation
(Font font, Tag tag, float value) Change the value of one variation axis on the font.static void
fontSetVariations
(Font font, Variation[] variations) Applies a list of font-variation settings to a font.static void
fontSetVarNamedInstance
(Font font, int instanceIndex) Sets design coords of a font from a named-instance index.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.static Face
ftFaceCreate
(org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy) Creates anhb_face_t
face object from the specified FT_Face.static Face
ftFaceCreateCached
(org.freedesktop.freetype.Face ftFace) Creates anhb_face_t
face object from the specified FT_Face.static Face
ftFaceCreateReferenced
(org.freedesktop.freetype.Face ftFace) Creates anhb_face_t
face object from the specified FT_Face.static void
ftFontChanged
(Font font) Refreshes the state offont
when the underlying FT_Face has changed.static Font
ftFontCreate
(org.freedesktop.freetype.Face ftFace, @Nullable DestroyFunc destroy) Creates anhb_font_t
font object from the specified FT_Face.static Font
ftFontCreateReferenced
(org.freedesktop.freetype.Face ftFace) Creates anhb_font_t
font object from the specified FT_Face.static org.freedesktop.freetype.Face
ftFontGetFace
(Font font) Fetches the FT_Face associated with the specifiedhb_font_t
font object.static int
ftFontGetLoadFlags
(Font font) Fetches the FT_Load_Glyph load flags of the specifiedhb_font_t
.static org.freedesktop.freetype.Face
ftFontLockFace
(Font font) Gets the FT_Face associated withfont
.static void
ftFontSetFuncs
(Font font) Configures the font-functions structure of the specifiedhb_font_t
font object to use FreeType font functions.static void
ftFontSetLoadFlags
(Font font, int loadFlags) Sets the FT_Load_Glyph load flags for the specifiedhb_font_t
.static void
ftFontUnlockFace
(Font font) Releases an FT_Face previously obtained with hb_ft_font_lock_face().static Bool
ftHbFontChanged
(Font font) Refreshes the state of the underlying FT_Face offont
when the hb_font_tfont
has changed.static Blob
glibBlobCreate
(Bytes gbytes) Creates anhb_blob_t
blob from the specified GBytes data structure.static UnicodeFuncs
Fetches a Unicode-functions structure that is populated with the appropriate GLib function for each method.static UnicodeScript
glibScriptFromScript
(Script script) Fetches the GUnicodeScript identifier that corresponds to the specifiedhb_script_t
script.static Script
glibScriptToScript
(UnicodeScript script) Fetches thehb_script_t
script that corresponds to the specified GUnicodeScript identifier.static Set
<GlyphFlags> Returns glyph flags encoded within ahb_glyph_info_t
.static void
static Language
languageFromString
(byte[] str) Convertsstr
representing a BCP 47 language tag to the correspondinghb_language_t
.static Language
Fetch the default language from current locale.static Bool
languageMatches
(Language language, Language specific) Check whether a second language tag is the same or a more specific version of the provided language tag.static String
languageToString
(Language language) Converts anhb_language_t
to a string.static Bool
Tests whether memory allocation for a set was successful.static void
Clears out the contents ofmap
.static Map
Allocate a copy ofmap
.static Map
Creates a new, initially empty map.static void
Removeskey
and its stored value frommap
.static void
mapDestroy
(Map map) Decreases the reference count on a map.static Codepoint
Fetches the value stored forkey
inmap
.static Map
Fetches the singleton emptyhb_map_t
.static int
mapGetPopulation
(Map map) Returns the number of key-value pairs in the map.static MemorySegment
mapGetUserData
(Map map, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified map.static Bool
Tests whetherkey
is an element ofmap
.static int
Creates a hash representingmap
.static Bool
mapIsEmpty
(Map map) Tests whethermap
is empty (contains no elements).static Bool
mapIsEqual
(Map map, Map other) Tests whethermap
andother
are equal (contain the same elements).static void
Add the keys ofmap
tokeys
.static Bool
Fetches the next key/value pair inmap
.static Map
mapReference
(Map map) Increases the reference count on a map.static void
Storeskey
:value
in the map.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.static void
Add the contents ofother
tomap
.static void
Add the values ofmap
tovalues
.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.static Bool
otColorGlyphHasPaint
(Face face, Codepoint glyph) Tests where a face includes COLRv1 paint data forglyph
.static Blob
otColorGlyphReferencePng
(Font font, Codepoint glyph) Fetches the PNG image for a glyph.static Blob
otColorGlyphReferenceSvg
(Face face, Codepoint glyph) Fetches the SVG document for a glyph.static Bool
otColorHasLayers
(Face face) Tests whether a face includes aCOLR
table with data according to COLRv0.static Bool
otColorHasPaint
(Face face) Tests where a face includes aCOLR
table with data according to COLRv1.static Bool
otColorHasPalettes
(Face face) Tests whether a face includes aCPAL
color-palette table.static Bool
otColorHasPng
(Face face) Tests whether a face has PNG glyph images (either inCBDT
orsbix
tables).static Bool
otColorHasSvg
(Face face) Tests whether a face includes anySVG
glyph images.static OtNameId
otColorPaletteColorGetNameId
(Face face, int colorIndex) Fetches thename
table Name ID that provides display names for the specified color in a face'sCPAL
color palette.static int
otColorPaletteGetColors
(Face face, int paletteIndex, int startOffset, @Nullable Out<Color[]> colors) Fetches a list of the colors in a color palette.static int
otColorPaletteGetCount
(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 OtNameId
otColorPaletteGetNameId
(Face face, int paletteIndex) Fetches thename
table Name ID that provides display names for aCPAL
color palette.static void
otFontSetFuncs
(Font font) Sets the font functions to use when working withfont
.static void
otLayoutCollectFeatures
(Face face, Tag tableTag, @Nullable Tag[] scripts, @Nullable Tag[] languages, @Nullable Tag[] 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 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.static void
otLayoutCollectLookups
(Face face, Tag tableTag, @Nullable Tag[] scripts, @Nullable Tag[] languages, @Nullable Tag[] 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 int
otLayoutFeatureGetCharacters
(Face face, Tag tableTag, int featureIndex, int startOffset, Out<Codepoint[]> characters) Fetches a list of the characters defined as having a variant under the specified "Character Variant" ("cvXX") feature tag.static int
otLayoutFeatureGetLookups
(Face face, Tag tableTag, int featureIndex, int startOffset, 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 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.static int
otLayoutFeatureWithVariationsGetLookups
(Face face, Tag tableTag, int featureIndex, int variationsIndex, int startOffset, 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 int
otLayoutGetAttachPoints
(Face face, Codepoint glyph, int startOffset, Out<int[]> pointArray) Fetches a list of all attachment points for the specified glyph in the GDEF table of the face.static Bool
otLayoutGetBaseline
(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Tag scriptTag, Tag languageTag, @Nullable Position coord) Fetches a baseline value from the face.static Bool
otLayoutGetBaseline2
(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Script script, @Nullable Language language, @Nullable Position coord) Fetches a baseline value from the face.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.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.static Bool
otLayoutGetFontExtents
(Font font, Direction direction, Tag scriptTag, Tag languageTag, @Nullable FontExtents extents) Fetches script/language-specific font extents.static Bool
otLayoutGetFontExtents2
(Font font, Direction direction, Script script, @Nullable Language language, @Nullable FontExtents extents) Fetches script/language-specific font extents.static OtLayoutGlyphClass
otLayoutGetGlyphClass
(Face face, Codepoint glyph) Fetches the GDEF class of the requested glyph in the specified face.static void
otLayoutGetGlyphsInClass
(Face face, OtLayoutGlyphClass klass, Set glyphs) Retrieves the set of all glyphs from the face that belong to the requested glyph class in the face's GDEF table.static OtLayoutBaselineTag
Fetches the dominant horizontal baseline tag used byscript
.static int
otLayoutGetLigatureCarets
(Font font, Direction direction, Codepoint glyph, int startOffset, Out<Position[]> caretArray) Fetches a list of the caret positions defined for a ligature glyph in the GDEF table of the font.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., thesize
feature from GPOS).static Bool
otLayoutHasGlyphClasses
(Face face) Tests whether a face has any glyph classes defined in its GDEF table.static Bool
otLayoutHasPositioning
(Face face) Tests whether the specified face includes any GPOS positioning.static Bool
otLayoutHasSubstitution
(Face face) Tests whether the specified face includes any GSUB substitutions.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.static int
otLayoutLanguageGetFeatureIndexes
(Face face, Tag tableTag, int scriptIndex, int languageIndex, int startOffset, 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 int
otLayoutLanguageGetFeatureTags
(Face face, Tag tableTag, int scriptIndex, int languageIndex, int startOffset, 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 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.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.static void
otLayoutLookupCollectGlyphs
(Face face, Tag tableTag, int lookupIndex, Set glyphsBefore, Set glyphsInput, Set glyphsAfter, Set glyphsOutput) Fetches a list of all glyphs affected by the specified lookup in the specified face's GSUB table or GPOS table.static int
otLayoutLookupGetGlyphAlternates
(Face face, int lookupIndex, Codepoint glyph, int startOffset, Out<Codepoint[]> alternateGlyphs) Fetches alternates of a glyph from a given GSUB lookup index.static Position
otLayoutLookupGetOpticalBound
(Font font, int lookupIndex, Direction direction, Codepoint glyph) Fetches the optical bound of a glyph positioned at the margin of text.static void
otLayoutLookupsSubstituteClosure
(Face face, Set lookups, Set glyphs) Compute the transitive closure of glyphs needed for all of the provided lookups.static void
otLayoutLookupSubstituteClosure
(Face face, int lookupIndex, Set glyphs) Compute the transitive closure of glyphs needed for a specified lookup.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.static Bool
otLayoutScriptFindLanguage
(Face face, Tag tableTag, int scriptIndex, Tag languageTag, MemorySegment languageIndex) Deprecated.static int
otLayoutScriptGetLanguageTags
(Face face, Tag tableTag, int scriptIndex, int startOffset, Out<Tag[]> languageTags) Fetches a list of language tags in the given face's GSUB or GPOS table, underneath the specified script index.static Bool
otLayoutScriptSelectLanguage
(Face face, Tag tableTag, int scriptIndex, int languageCount, Tag languageTags, Out<Integer> languageIndex) Fetches the index of the first language tag fomlanguageTags
that is present in the specified face's GSUB or GPOS table, underneath the specified script index.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 fomlanguageTags
that is present in the specified face's GSUB or GPOS table, underneath the specified script index.static Bool
otLayoutTableChooseScript
(Face face, Tag tableTag, Tag scriptTags, Out<Integer> scriptIndex, Tag chosenScript) Deprecated since 2.0.0static 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.static Bool
Fetches the index if a given script tag in the specified face's GSUB table or GPOS table.static int
otLayoutTableGetFeatureTags
(Face face, Tag tableTag, int startOffset, Out<Tag[]> featureTags) Fetches a list of all feature tags in the given face's GSUB or GPOS table.static int
otLayoutTableGetLookupCount
(Face face, Tag tableTag) Fetches the total number of lookups enumerated in the specified face's GSUB table or GPOS table.static int
otLayoutTableGetScriptTags
(Face face, Tag tableTag, int startOffset, Out<Tag[]> scriptTags) Fetches a list of all scripts enumerated in the specified face's GSUB table or GPOS table.static Bool
otLayoutTableSelectScript
(Face face, Tag tableTag, int scriptCount, Tag scriptTags, @Nullable Out<Integer> scriptIndex, @Nullable Tag chosenScript) Selects an OpenType script fortableTag
from thescriptTags
array.static Position
otMathGetConstant
(Font font, OtMathConstant constant) Fetches the specified math constant.static int
otMathGetGlyphAssembly
(Font font, Codepoint glyph, Direction direction, int startOffset, Out<OtMathGlyphPart[]> parts, Position italicsCorrection) Fetches the GlyphAssembly for the specified font, glyph index, and direction.static Position
otMathGetGlyphItalicsCorrection
(Font font, Codepoint glyph) Fetches an italics-correction value (if one exists) for the specified glyph index.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
.static int
otMathGetGlyphKernings
(Font font, Codepoint glyph, OtMathKern kern, int startOffset, Out<OtMathKernEntry[]> kernEntries) Fetches the raw MathKern (cut-in) data for the specified font, glyph index, andkern
.static Position
otMathGetGlyphTopAccentAttachment
(Font font, Codepoint glyph) Fetches a top-accent-attachment value (if one exists) for the specified glyph index.static int
otMathGetGlyphVariants
(Font font, Codepoint glyph, Direction direction, int startOffset, Out<OtMathGlyphVariant[]> variants) Fetches the MathGlyphConstruction for the specified font, glyph index, and direction.static Position
otMathGetMinConnectorOverlap
(Font font, Direction direction) Fetches the MathVariants table for the specified font and returns the minimum overlap of connecting glyphs that are required to draw a glyph assembly in the specified direction.static Bool
otMathHasData
(Face face) Tests whether a face has aMATH
table.static Bool
otMathIsGlyphExtendedShape
(Face face, Codepoint glyph) Tests whether the given glyph index is an extended shape in the face.static int
otMetaGetEntryTags
(Face face, int startOffset, Out<OtMetaTag[]> entries) Fetches all available feature types.static Blob
otMetaReferenceEntry
(Face face, OtMetaTag metaTag) It fetches metadata entry of a given tag from a font.static Bool
otMetricsGetPosition
(Font font, OtMetricsTag metricsTag, @Nullable Position position) Fetches metrics value corresponding tometricsTag
fromfont
.static void
otMetricsGetPositionWithFallback
(Font font, OtMetricsTag metricsTag, @Nullable Position position) Fetches metrics value corresponding tometricsTag
fromfont
, and synthesizes a value if it the value is missing in the font.static float
otMetricsGetVariation
(Font font, OtMetricsTag metricsTag) Fetches metrics value corresponding tometricsTag
fromfont
with the current font variation settings applied.static Position
otMetricsGetXVariation
(Font font, OtMetricsTag metricsTag) Fetches horizontal metrics value corresponding tometricsTag
fromfont
with the current font variation settings applied.static Position
otMetricsGetYVariation
(Font font, OtMetricsTag metricsTag) Fetches vertical metrics value corresponding tometricsTag
fromfont
with the current font variation settings applied.static int
otNameGetUtf16
(Face face, OtNameId nameId, Language language, Out<short[]> text) Fetches a font name from the OpenType 'name' table.static int
otNameGetUtf32
(Face face, OtNameId nameId, Language language, Out<int[]> text) Fetches a font name from the OpenType 'name' table.static int
Fetches a font name from the OpenType 'name' table.static void
otShapeGlyphsClosure
(Font font, Buffer buffer, Feature[] features, Set glyphs) Computes the transitive closure of glyphs needed for a specified input buffer under the given font and feature list.static void
otShapePlanCollectLookups
(ShapePlan shapePlan, Tag tableTag, Set lookupIndexes) Computes the complete set of GSUB or GPOS lookups that are applicable under a givenshapePlan
.static Tag
otTagFromLanguage
(Language language) Deprecated.use hb_ot_tags_from_script_and_language() insteadstatic void
otTagsFromScript
(Script script, Tag scriptTag1, Tag scriptTag2) Deprecated.use hb_ot_tags_from_script_and_language() insteadstatic void
otTagsToScriptAndLanguage
(Tag scriptTag, Tag languageTag, @Nullable Out<Script> script, @Nullable Language language) Converts a script tag and a language tag to anhb_script_t
and anhb_language_t
.static Language
otTagToLanguage
(Tag tag) Converts a language tag to anhb_language_t
.static Script
otTagToScript
(Tag tag) Converts a script tag to anhb_script_t
.static Bool
otVarFindAxis
(Face face, Tag axisTag, MemorySegment axisIndex, OtVarAxis axisInfo) Deprecated.use hb_ot_var_find_axis_info() insteadstatic Bool
otVarFindAxisInfo
(Face face, Tag axisTag, OtVarAxisInfo axisInfo) Fetches the variation-axis information corresponding to the specified axis tag in the specified face.static int
otVarGetAxes
(Face face, int startOffset, Out<OtVarAxis[]> axesArray) Deprecated.use hb_ot_var_get_axis_infos() insteadstatic int
otVarGetAxisCount
(Face face) Fetches the number of OpenType variation axes included in the face.static int
otVarGetAxisInfos
(Face face, int startOffset, Out<OtVarAxisInfo[]> axesArray) Fetches a list of all variation axes in the specified face.static int
Fetches the number of named instances included in the face.static Bool
otVarHasData
(Face face) Tests whether a face includes any OpenType variation data in thefvar
table.static int
otVarNamedInstanceGetDesignCoords
(Face face, int instanceIndex, Out<float[]> coords) Fetches the design-space coordinates corresponding to the given named instance in the face.static OtNameId
otVarNamedInstanceGetPostscriptNameId
(Face face, int instanceIndex) Fetches thename
table Name ID that provides display names for the "PostScript name" defined for the given named instance in the face.static OtNameId
otVarNamedInstanceGetSubfamilyNameId
(Face face, int instanceIndex) Fetches thename
table Name ID that provides display names for the "Subfamily name" defined for the given named instance in the face.static void
otVarNormalizeCoords
(Face face, int coordsLength, MemorySegment designCoords, Out<Integer> normalizedCoords) Normalizes the given design-space coordinates.static void
otVarNormalizeVariations
(Face face, Variation variations, int variationsLength, Out<int[]> coords) Normalizes all of the coordinates in the given list of variation axes.static void
paintColor
(PaintFuncs funcs, @Nullable MemorySegment paintData, Bool isForeground, Color color) Perform a "color" paint operation.static Bool
paintColorGlyph
(PaintFuncs funcs, @Nullable MemorySegment paintData, Codepoint glyph, Font font) Perform a "color-glyph" paint operation.static Bool
paintCustomPaletteColor
(PaintFuncs funcs, @Nullable MemorySegment paintData, int colorIndex, Color color) Gets the custom palette color forcolorIndex
.static PaintFuncs
Creates a newhb_paint_funcs_t
structure of paint functions.static void
paintFuncsDestroy
(PaintFuncs funcs) Decreases the reference count on a paint-functions structure.static PaintFuncs
Fetches the singleton empty paint-functions structure.static MemorySegment
paintFuncsGetUserData
(PaintFuncs funcs, UserDataKey key) Fetches the user-data associated with the specified key, attached to the specified paint-functions structure.static Bool
paintFuncsIsImmutable
(PaintFuncs funcs) Tests whether a paint-functions structure is immutable.static void
Makes a paint-functions structure immutable.static PaintFuncs
paintFuncsReference
(PaintFuncs funcs) Increases the reference count on a paint-functions structure.static void
paintFuncsSetColorFunc
(PaintFuncs funcs, PaintColorFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the paint-color callback on the paint functions struct.static void
paintFuncsSetColorGlyphFunc
(PaintFuncs funcs, PaintColorGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the color-glyph callback on the paint functions struct.static void
paintFuncsSetCustomPaletteColorFunc
(PaintFuncs funcs, PaintCustomPaletteColorFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the custom-palette-color callback on the paint functions struct.static void
paintFuncsSetImageFunc
(PaintFuncs funcs, PaintImageFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the paint-image callback on the paint functions struct.static void
paintFuncsSetLinearGradientFunc
(PaintFuncs funcs, PaintLinearGradientFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the linear-gradient callback on the paint functions struct.static void
paintFuncsSetPopClipFunc
(PaintFuncs funcs, PaintPopClipFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the pop-clip callback on the paint functions struct.static void
paintFuncsSetPopGroupFunc
(PaintFuncs funcs, PaintPopGroupFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the pop-group callback on the paint functions struct.static void
paintFuncsSetPopTransformFunc
(PaintFuncs funcs, PaintPopTransformFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the pop-transform callback on the paint functions struct.static void
paintFuncsSetPushClipGlyphFunc
(PaintFuncs funcs, PaintPushClipGlyphFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the push-clip-glyph callback on the paint functions struct.static void
paintFuncsSetPushClipRectangleFunc
(PaintFuncs funcs, PaintPushClipRectangleFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the push-clip-rect callback on the paint functions struct.static void
paintFuncsSetPushGroupFunc
(PaintFuncs funcs, PaintPushGroupFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the push-group callback on the paint functions struct.static void
paintFuncsSetPushTransformFunc
(PaintFuncs funcs, PaintPushTransformFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the push-transform callback on the paint functions struct.static void
paintFuncsSetRadialGradientFunc
(PaintFuncs funcs, PaintRadialGradientFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the radial-gradient callback on the paint functions struct.static void
paintFuncsSetSweepGradientFunc
(PaintFuncs funcs, PaintSweepGradientFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the sweep-gradient callback on the paint functions struct.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.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.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.static void
paintPopClip
(PaintFuncs funcs, @Nullable MemorySegment paintData) Perform a "pop-clip" paint operation.static void
paintPopGroup
(PaintFuncs funcs, @Nullable MemorySegment paintData, PaintCompositeMode mode) Perform a "pop-group" paint operation.static void
paintPopTransform
(PaintFuncs funcs, @Nullable MemorySegment paintData) Perform a "pop-transform" paint operation.static void
paintPushClipGlyph
(PaintFuncs funcs, @Nullable MemorySegment paintData, Codepoint glyph, Font font) Perform a "push-clip-glyph" paint operation.static void
paintPushClipRectangle
(PaintFuncs funcs, @Nullable MemorySegment paintData, float xmin, float ymin, float xmax, float ymax) Perform a "push-clip-rect" paint operation.static void
paintPushGroup
(PaintFuncs funcs, @Nullable MemorySegment paintData) Perform a "push-group" paint operation.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.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.static void
paintSweepGradient
(PaintFuncs funcs, @Nullable MemorySegment paintData, ColorLine colorLine, float x0, float y0, float startAngle, float endAngle) Perform a "sweep-gradient" paint operation.static Script
scriptFromIso15924Tag
(Tag tag) Converts an ISO 15924 script tag to a correspondinghb_script_t
.static Script
scriptFromString
(byte[] str) Converts a stringstr
representing an ISO 15924 script tag to a correspondinghb_script_t
.static Direction
scriptGetHorizontalDirection
(Script script) Fetches thehb_direction_t
of a script when it is set horizontally.static Tag
scriptToIso15924Tag
(Script script) Converts anhb_script_t
to a corresponding ISOÂ 15924 script tag.static Bool
Checks the equality of twohb_segment_properties_t
's.static int
Creates a hash representingp
.static void
Fills in missing fields ofp
fromsrc
in a considered manner.static void
Addscodepoint
toset
.static void
setAddRange
(Set set, Codepoint first, Codepoint last) Adds all of the elements fromfirst
tolast
(inclusive) toset
.static void
setAddSortedArray
(Set set, Codepoint[] sortedCodepoints) AddsnumCodepoints
codepoints to a set at once.static Bool
Tests whether memory allocation for a set was successful.static void
Clears out the contents of a set.static Set
Allocate a copy ofset
.static Set
Creates a new, initially empty set.static void
Removescodepoint
fromset
.static void
setDelRange
(Set set, Codepoint first, Codepoint last) Removes all of the elements fromfirst
tolast
(inclusive) fromset
.static void
setDestroy
(Set set) Decreases the reference count on a set.static Set
Fetches the singleton emptyhb_set_t
.static Codepoint
Finds the largest element in the set.static Codepoint
Finds the smallest element in the set.static int
setGetPopulation
(Set set) Returns the number of elements in the set.static MemorySegment
setGetUserData
(Set set, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified set.static Bool
Tests whethercodepoint
belongs toset
.static int
Creates a hash representingset
.static void
setIntersect
(Set set, Set other) Makesset
the intersection ofset
andother
.static void
Inverts the contents ofset
.static Bool
setIsEmpty
(Set set) Tests whether a set is empty (contains no elements).static Bool
setIsEqual
(Set set, Set other) Tests whetherset
andother
are equal (contain the same elements).static Bool
setIsInverted
(Set set) Returns whether the set is inverted.static Bool
setIsSubset
(Set set, Set largerSet) Tests whetherset
is a subset oflargerSet
.static Bool
Fetches the next element inset
that is greater than current value ofcodepoint
.static int
setNextMany
(Set set, Codepoint codepoint, Codepoint[] out) Finds the next element inset
that is greater thancodepoint
.static Bool
setNextRange
(Set set, Codepoint first, Codepoint last) Fetches the next consecutive range of elements inset
that are greater than current value oflast
.static Bool
setPrevious
(Set set, Codepoint codepoint) Fetches the previous element inset
that is lower than current value ofcodepoint
.static Bool
setPreviousRange
(Set set, Codepoint first, Codepoint last) Fetches the previous consecutive range of elements inset
that are greater than current value oflast
.static Set
setReference
(Set set) Increases the reference count on a set.static void
Makes the contents ofset
equal to the contents ofother
.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.static void
setSubtract
(Set set, Set other) Subtracts the contents ofother
fromset
.static void
setSymmetricDifference
(Set set, Set other) Makesset
the symmetric difference ofset
andother
.static void
Makesset
the union ofset
andother
.static void
Shapesbuffer
usingfont
turning its Unicode characters content to positioned glyphs.static Bool
See hb_shape() for details.static Bool
shapeJustify
(Font font, Buffer buffer, @Nullable Feature[] features, @Nullable String[] shaperList, float minTargetAdvance, float maxTargetAdvance, Out<Float> advance, Tag varTag, Out<Float> varValue) See hb_shape_full() for basic details.static String[]
Retrieves the list of shapers supported by HarfBuzz.static ShapePlan
shapePlanCreate
(Face face, SegmentProperties props, Feature[] userFeatures, String[] shaperList) Constructs a shaping plan for a combination offace
,userFeatures
,props
, andshaperList
.static ShapePlan
shapePlanCreate2
(Face face, SegmentProperties props, Feature[] userFeatures, int[] coords, String[] shaperList) The variable-font version ofhb_shape_plan_create
.static ShapePlan
shapePlanCreateCached
(Face face, SegmentProperties props, Feature[] userFeatures, String[] shaperList) Creates a cached shaping plan suitable for reuse, for a combination offace
,userFeatures
,props
, andshaperList
.static ShapePlan
shapePlanCreateCached2
(Face face, SegmentProperties props, Feature[] userFeatures, int[] coords, String[] shaperList) The variable-font version ofhb_shape_plan_create_cached
.static void
shapePlanDestroy
(ShapePlan shapePlan) Decreases the reference count on the given shaping plan.static Bool
shapePlanExecute
(ShapePlan shapePlan, Font font, Buffer buffer, Feature[] features) Executes the given shaping plan on the specified buffer, using the givenfont
andfeatures
.static ShapePlan
Fetches the singleton empty shaping plan.static String
shapePlanGetShaper
(ShapePlan shapePlan) Fetches the shaper from a given shaping plan.static MemorySegment
shapePlanGetUserData
(ShapePlan shapePlan, UserDataKey key) Fetches the user data associated with the specified key, attached to the specified shaping plan.static ShapePlan
shapePlanReference
(ShapePlan shapePlan) Increases the reference count on the given shaping plan.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.static float
styleGetValue
(Font font, StyleTag styleTag) Searches variation axes of ahb_font_t
object for a specific axis first, if not set, then tries to get default style values from different tables of the font.static Tag
tagFromString
(byte[] str) Converts a string into anhb_tag_t
.static void
tagToString
(Tag tag, byte[] buf) Converts anhb_tag_t
to a string and returns it inbuf
.static UnicodeCombiningClass
unicodeCombiningClass
(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves the Canonical Combining Class (ccc) property of code pointunicode
.static Bool
unicodeCompose
(UnicodeFuncs ufuncs, Codepoint a, Codepoint b, Codepoint ab) Fetches the composition of a sequence of two Unicode code points.static Bool
unicodeDecompose
(UnicodeFuncs ufuncs, Codepoint ab, Codepoint a, Codepoint b) Fetches the decomposition of a Unicode code point.static int
unicodeDecomposeCompatibility
(UnicodeFuncs ufuncs, Codepoint u, Codepoint decomposed) Deprecated.static int
unicodeEastasianWidth
(UnicodeFuncs ufuncs, Codepoint unicode) Deprecated.static UnicodeFuncs
unicodeFuncsCreate
(@Nullable UnicodeFuncs parent) Creates a newhb_unicode_funcs_t
structure of Unicode functions.static void
unicodeFuncsDestroy
(UnicodeFuncs ufuncs) Decreases the reference count on a Unicode-functions structure.static UnicodeFuncs
Fetches a pointer to the default Unicode-functions structure that is used when no functions are explicitly set onhb_buffer_t
.static UnicodeFuncs
Fetches the singleton empty Unicode-functions structure.static UnicodeFuncs
unicodeFuncsGetParent
(UnicodeFuncs ufuncs) Fetches the parent of the Unicode-functions structureufuncs
.static MemorySegment
unicodeFuncsGetUserData
(UnicodeFuncs ufuncs, UserDataKey key) Fetches the user-data associated with the specified key, attached to the specified Unicode-functions structure.static Bool
unicodeFuncsIsImmutable
(UnicodeFuncs ufuncs) Tests whether the specified Unicode-functions structure is immutable.static void
Makes the specified Unicode-functions structure immutable.static UnicodeFuncs
unicodeFuncsReference
(UnicodeFuncs ufuncs) Increases the reference count on a Unicode-functions structure.static void
unicodeFuncsSetCombiningClassFunc
(UnicodeFuncs ufuncs, UnicodeCombiningClassFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_combining_class_func_t
.static void
unicodeFuncsSetComposeFunc
(UnicodeFuncs ufuncs, UnicodeComposeFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_compose_func_t
.static void
unicodeFuncsSetDecomposeCompatibilityFunc
(UnicodeFuncs ufuncs, UnicodeDecomposeCompatibilityFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Deprecated.static void
unicodeFuncsSetDecomposeFunc
(UnicodeFuncs ufuncs, UnicodeDecomposeFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_decompose_func_t
.static void
unicodeFuncsSetEastasianWidthFunc
(UnicodeFuncs ufuncs, UnicodeEastasianWidthFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Deprecated.static void
unicodeFuncsSetGeneralCategoryFunc
(UnicodeFuncs ufuncs, UnicodeGeneralCategoryFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_general_category_func_t
.static void
unicodeFuncsSetMirroringFunc
(UnicodeFuncs ufuncs, UnicodeMirroringFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_mirroring_func_t
.static void
unicodeFuncsSetScriptFunc
(UnicodeFuncs ufuncs, UnicodeScriptFunc func, @Nullable MemorySegment userData, @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_script_func_t
.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.static UnicodeGeneralCategory
unicodeGeneralCategory
(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves the General Category (gc) property of code pointunicode
.static Codepoint
unicodeMirroring
(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves the Bi-directional Mirroring Glyph code point defined for code pointunicode
.static Script
unicodeScript
(UnicodeFuncs ufuncs, Codepoint unicode) Retrieves thehb_script_t
script to which code pointunicode
belongs.static Bool
variationFromString
(byte[] str, Variation variation) Parses a string into ahb_variation_t
.static void
variationToString
(Variation variation, Out<String[]> buf) Converts anhb_variation_t
into 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.- See Also:
-
CODEPOINT_INVALID
Unusedhb_codepoint_t
value. -
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.- 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.- 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
.- 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
.- See Also:
-
OT_VAR_NO_AXIS_INDEX
public static final int OT_VAR_NO_AXIS_INDEXDo not use.- See Also:
-
UNICODE_COMBINING_CLASS_CCC133
public static final int UNICODE_COMBINING_CLASS_CCC133[Tibetan]- See Also:
-
UNICODE_MAX
public static final int UNICODE_MAXMaximum valid Unicode code point.- See Also:
-
UNICODE_MAX_DECOMPOSITION_LEN
public static final int UNICODE_MAX_DECOMPOSITION_LENSee 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'sname
table.- Parameters:
face
-hb_face_t
to work uponfeatureType
- Thehb_aat_layout_feature_type_t
of the requested feature type- Returns:
- Name identifier of the requested feature type
-
aatLayoutFeatureTypeGetSelectorInfos
public static int aatLayoutFeatureTypeGetSelectorInfos(Face face, AatLayoutFeatureType featureType, int startOffset, @Nullable @Nullable Out<AatLayoutFeatureSelectorInfo[]> selectors, @Nullable @Nullable Out<Integer> defaultIndex) Fetches a list of the selectors available for the specified feature in the given face.If upon return,
defaultIndex
is set toHB_AAT_LAYOUT_NO_SELECTOR_INDEX
, then the feature type is non-exclusive. Otherwise,defaultIndex
is the index of the selector that is selected by default.- Parameters:
face
-hb_face_t
to work uponfeatureType
- Thehb_aat_layout_feature_type_t
of 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
-
aatLayoutGetFeatureTypes
public static int aatLayoutGetFeatureTypes(Face face, int startOffset, Out<AatLayoutFeatureType[]> features) Fetches a list of the AAT feature types included in the specified face.- Parameters:
face
-hb_face_t
to work uponstartOffset
- offset of the first feature type to retrievefeatures
- Array of feature types found- Returns:
- Number of all available feature types.
-
aatLayoutHasPositioning
-
aatLayoutHasSubstitution
-
aatLayoutHasTracking
-
blobCopyWritableOrFail
-
blobCreate
public static Blob blobCreate(String data, int length, MemoryMode mode, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata
. Themode
parameter is used to negotiate ownership and lifecycle ofdata
.- Parameters:
data
- Pointer to blob data.length
- Length ofdata
in bytes.mode
- Memory mode fordata
.userData
- Data parameter to pass todestroy
.destroy
- Callback to call whendata
is not needed anymore.- Returns:
- New blob, or the empty blob if something failed or if
length
is zero. Destroy with hb_blob_destroy().
-
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_t
pointer with the content of the file, or hb_blob_get_empty() if failed.
-
blobCreateFromFileOrFail
Creates a new blob containing the data from the specified binary font file.The filename is passed directly to the system on all platforms, except on Windows, where the filename is interpreted as UTF-8. Only if the filename is not valid UTF-8, it will be interpreted according to the system codepage.
- Parameters:
fileName
- A font filename- Returns:
- An
hb_blob_t
pointer with the content of the file, orNULL
if failed.
-
blobCreateOrFail
public static Blob blobCreateOrFail(String data, int length, MemoryMode mode, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Creates a new "blob" object wrappingdata
. Themode
parameter is used to negotiate ownership and lifecycle ofdata
.Note that this function returns a freshly-allocated empty blob even if
length
is zero. This is in contrast to hb_blob_create(), which returns the singleton empty blob (as returned by hb_blob_get_empty()) iflength
is zero.- Parameters:
data
- Pointer to blob data.length
- Length ofdata
in bytes.mode
- Memory mode fordata
.userData
- Data parameter to pass todestroy
.destroy
- Callback to call whendata
is not needed anymore.- Returns:
- New blob, or
NULL
if failed. Destroy with hb_blob_destroy().
-
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
parent
immutable.- 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
length
is zero oroffset
is beyond the end ofparent
's data. Destroy with hb_blob_destroy().
-
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.
-
blobGetData
-
blobGetDataWritable
-
blobGetEmpty
Returns the singleton empty blob.See TODO:link object types for more information.
- Returns:
- The empty blob.
-
blobGetLength
Fetches the length of a blob's data.- Parameters:
blob
- a blob.- Returns:
- the length of
blob
data in bytes.
-
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
-
blobIsImmutable
-
blobMakeImmutable
-
blobReference
-
blobSetUserData
public static Bool blobSetUserData(Blob blob, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified blob.- Parameters:
blob
- Anhb_blob_t
key
- The user-data key to setdata
- A pointer to the user data to setdestroy
- A callback to call whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
bufferAdd
Appends a character with the Unicode value ofcodepoint
tobuffer
, 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_t
codepoint
- A Unicode code point.cluster
- The cluster value ofcodepoint
.
-
bufferAddCodepoints
public static void bufferAddCodepoints(Buffer buffer, Codepoint[] text, int itemOffset, int itemLength) Appends characters fromtext
array tobuffer
. TheitemOffset
is the position of the first character fromtext
that will be appended, anditemLength
is the number of character. When shaping part of a larger text (e.g. a run of text from a paragraph), instead of passing just the substring corresponding to the run, it is preferable to pass the whole paragraph and specify the run start and length asitemOffset
anditemLength
, 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_t
to append characters to.text
- an array of Unicode code points to append.itemOffset
- the offset of the first code point to add to thebuffer
.itemLength
- the number of code points to add to thebuffer
, or -1 for the end oftext
(assuming it isNULL
terminated).
-
bufferAddLatin1
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_t
text
- an array of UTF-8 characters to appenditemOffset
- 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 isNULL
terminated)
-
bufferAddUtf16
See hb_buffer_add_codepoints().Replaces invalid UTF-16 characters with the
buffer
replacement code point, see hb_buffer_set_replacement_codepoint().- Parameters:
buffer
- Anhb_buffer_t
text
- An array of UTF-16 characters to appenditemOffset
- 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 isNULL
terminated)
-
bufferAddUtf32
See hb_buffer_add_codepoints().Replaces invalid UTF-32 characters with the
buffer
replacement code point, see hb_buffer_set_replacement_codepoint().- Parameters:
buffer
- Anhb_buffer_t
text
- An array of UTF-32 characters to appenditemOffset
- 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 isNULL
terminated)
-
bufferAddUtf8
See hb_buffer_add_codepoints().Replaces invalid UTF-8 characters with the
buffer
replacement code point, see hb_buffer_set_replacement_codepoint().- Parameters:
buffer
- Anhb_buffer_t
text
- 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 isNULL
terminated).
-
bufferAllocationSuccessful
-
bufferAppend
Append (part of) contents of another buffer to this buffer.- Parameters:
buffer
- Anhb_buffer_t
source
- sourcehb_buffer_t
start
- start index into source buffer to copy. Use 0 to copy from start of buffer.end
- end index into source buffer to copy. UseHBFEATUREGLOBALEND
to copy to end of buffer.
-
bufferClearContents
Similar to hb_buffer_reset(), but does not clear the Unicode functions and the replacement code point.- Parameters:
buffer
- Anhb_buffer_t
-
bufferCreate
Creates a newhb_buffer_t
with all properties to defaults.- Returns:
- A newly allocated
hb_buffer_t
with a reference count of 1. The initial reference count should be released with hb_buffer_destroy() when you are done using thehb_buffer_t
. This function never returnsNULL
. If memory cannot be allocated, a specialhb_buffer_t
object will be returned on which hb_buffer_allocation_successful() returnsfalse
.
-
bufferCreateSimilar
-
bufferDeserializeGlyphs
public static Bool bufferDeserializeGlyphs(Buffer buffer, String[] buf, @Nullable @Nullable Out<String> endPtr, @Nullable @Nullable Font font, BufferSerializeFormat format) Deserializes glyphsbuffer
from textual representation in the format produced by hb_buffer_serialize_glyphs().- Parameters:
buffer
- anhb_buffer_t
buffer.buf
- string to deserializeendPtr
- output pointer to the character after last consumed one.font
- font for getting glyph IDsformat
- thehb_buffer_serialize_format_t
of the inputbuf
- Returns:
true
if parse was successful,false
if an error occurred.
-
bufferDeserializeUnicode
public static Bool bufferDeserializeUnicode(Buffer buffer, String[] buf, @Nullable @Nullable Out<String> endPtr, BufferSerializeFormat format) Deserializes Unicodebuffer
from textual representation in the format produced by hb_buffer_serialize_unicode().- Parameters:
buffer
- anhb_buffer_t
buffer.buf
- string to deserializeendPtr
- output pointer to the character after last consumed one.format
- thehb_buffer_serialize_format_t
of the inputbuf
- Returns:
true
if parse was successful,false
if an error occurred.
-
bufferDestroy
Deallocate thebuffer
. Decreases the reference count onbuffer
by one. If the result is zero, thenbuffer
and all associated resources are freed. See hb_buffer_reference().- Parameters:
buffer
- Anhb_buffer_t
-
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_PRESENT
andHB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT
are never returned. This should be used by most callers if just comparing two buffers is needed.- Parameters:
buffer
- a buffer.reference
- other buffer to compare to.dottedcircleGlyph
- glyph id of U+25CC DOTTED CIRCLE, or (hb_codepoint_t) -1.positionFuzz
- allowed absolute difference in position values.
-
bufferGetClusterLevel
Fetches the cluster level of a buffer. Thehb_buffer_cluster_level_t
dictates one aspect of how HarfBuzz will treat non-base characters during shaping.- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The cluster level of
buffer
-
bufferGetContentType
Fetches the type ofbuffer
contents. Buffers are either empty, contain characters (before shaping), or contain glyphs (the result of shaping).- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The type of
buffer
contents
-
bufferGetDirection
-
bufferGetEmpty
-
bufferGetFlags
Fetches thehb_buffer_flags_t
ofbuffer
.- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The
buffer
flags
-
bufferGetGlyphInfos
Returnsbuffer
glyph information array. Returned pointer is valid as long asbuffer
contents are not modified.- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The
buffer
glyph information array. The value valid as long as buffer has not been modified.
-
bufferGetGlyphPositions
Returnsbuffer
glyph position array. Returned pointer is valid as long asbuffer
contents are not modified.If buffer did not have positions before, the positions will be initialized to zeros, unless this function is called from within a buffer message callback (see hb_buffer_set_message_func()), in which case
NULL
is returned.- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The
buffer
glyph position array. The value valid as long as buffer has not been modified.
-
bufferGetInvisibleGlyph
-
bufferGetLanguage
-
bufferGetLength
Returns the number of items in the buffer.- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The
buffer
length. The value valid as long as buffer has not been modified.
-
bufferGetNotFoundGlyph
-
bufferGetRandomState
See hb_buffer_set_random_state().- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The
buffer
random state
-
bufferGetReplacementCodepoint
-
bufferGetScript
-
bufferGetSegmentProperties
Setsprops
to thehb_segment_properties_t
ofbuffer
.- Parameters:
buffer
- Anhb_buffer_t
props
- The outputhb_segment_properties_t
-
bufferGetUnicodeFuncs
Fetches the Unicode-functions structure of a buffer.- Parameters:
buffer
- Anhb_buffer_t
- Returns:
- The Unicode-functions structure
-
bufferGetUserData
Fetches the user data associated with the specified key, attached to the specified buffer.- Parameters:
buffer
- Anhb_buffer_t
key
- The user-data key to query- Returns:
- A pointer to the user data
-
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_LTR
is used.Finally, if buffer language is not set (ie. is
HB_LANGUAGE_INVALID
), it will be set to the process's default language as returned by hb_language_get_default(). This may change in the future by taking buffer script into consideration when choosing a language. Note that hb_language_get_default() is NOT threadsafe the first time it is called. See documentation for that function for details.- Parameters:
buffer
- Anhb_buffer_t
-
bufferHasPositions
Returns whetherbuffer
has glyph position data. A buffer gains position data when hb_buffer_get_glyph_positions() is called on it, and cleared of position data when hb_buffer_clear_contents() is called.- Parameters:
buffer
- anhb_buffer_t
.- Returns:
true
if thebuffer
has position array,false
otherwise.
-
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
-
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
-
bufferReverse
Reverses buffer contents.- Parameters:
buffer
- Anhb_buffer_t
-
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
-
bufferReverseRange
Reverses buffer contents betweenstart
andend
.- Parameters:
buffer
- Anhb_buffer_t
start
- start indexend
- end index
-
bufferSerialize
public static int bufferSerialize(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable @Nullable Out<Integer> bufConsumed, @Nullable @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbuffer
into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information. This is useful for showing the contents of the buffer, for example during debugging. See the documentation of hb_buffer_serialize_unicode() and hb_buffer_serialize_glyphs() for a description of the output format.- Parameters:
buffer
- anhb_buffer_t
buffer.start
- the first item inbuffer
to serialize.end
- the last item inbuffer
to 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_t
used to shape this buffer, needed to read glyph names and extents. IfNULL
, an empty font will be used.format
- thehb_buffer_serialize_format_t
to use for formatting the output.flags
- thehb_buffer_serialize_flags_t
that control what glyph properties to serialize.- Returns:
- The number of serialized items.
-
bufferSerialize
public static int bufferSerialize(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable @Nullable Out<Integer> bufConsumed, @Nullable @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbuffer
into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information. This is useful for showing the contents of the buffer, for example during debugging. See the documentation of hb_buffer_serialize_unicode() and hb_buffer_serialize_glyphs() for a description of the output format.- Parameters:
buffer
- anhb_buffer_t
buffer.start
- the first item inbuffer
to serialize.end
- the last item inbuffer
to 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_t
used to shape this buffer, needed to read glyph names and extents. IfNULL
, an empty font will be used.format
- thehb_buffer_serialize_format_t
to use for formatting the output.flags
- thehb_buffer_serialize_flags_t
that control what glyph properties to serialize.- Returns:
- The number of serialized items.
-
bufferSerializeFormatFromString
Parses a string into anhb_buffer_serialize_format_t
. Does not check ifstr
is a valid buffer serialization format, use hb_buffer_serialize_list_formats() to get the list of supported formats.- Parameters:
str
- a string to parse- Returns:
- The parsed
hb_buffer_serialize_format_t
.
-
bufferSerializeFormatToString
Convertsformat
to the string corresponding it, orNULL
if it is not a validhb_buffer_serialize_format_t
.- Parameters:
format
- anhb_buffer_serialize_format_t
to convert.- Returns:
- A
NULL
terminated string corresponding toformat
. Should not be freed.
-
bufferSerializeGlyphs
public static int bufferSerializeGlyphs(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable @Nullable Out<Integer> bufConsumed, @Nullable @Nullable Font font, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbuffer
into a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:text
A human-readable, plain text format. The serialized glyphs will look something like:[uni0651=0@518,0+0|uni0628=0+1897]
- The serialized glyphs are delimited with
[
and]
. - Glyphs are separated with
|
- Each glyph starts with glyph name, or glyph index if
HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES
flag is set. Then, - If
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS
is not set,=
thenhb_glyph_info_t
.cluster. - If
HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS
is not set, thehb_glyph_position_t
in 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_advance
ifhb_glyph_position_t
.y_advance is not 0. Then,- If
HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS
is set, thehb_glyph_extents_t
in the format<x_bearing,y_bearing,width,height>
json
A machine-readable, structured format. The serialized glyphs will look something like:[{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0}, {"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}]
Each glyph is a JSON object, with the following properties:
g
: the glyph name or glyph index ifHB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES
flag is set.cl
:hb_glyph_info_t
.cluster ifHB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS
is not set.dx
,dy
,ax
,ay
:hb_glyph_position_t
.x_offset,hb_glyph_position_t
.y_offset,hb_glyph_position_t
.x_advance andhb_glyph_position_t
.y_advance respectively, ifHB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS
is not set.xb
,yb
,w
,h
:hb_glyph_extents_t
.x_bearing,hb_glyph_extents_t
.y_bearing,hb_glyph_extents_t
.width andhb_glyph_extents_t
.height respectively ifHB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS
is set.
- Parameters:
buffer
- anhb_buffer_t
buffer.start
- the first item inbuffer
to serialize.end
- the last item inbuffer
to 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_t
used to shape this buffer, needed to read glyph names and extents. IfNULL
, an empty font will be used.format
- thehb_buffer_serialize_format_t
to use for formatting the output.flags
- thehb_buffer_serialize_flags_t
that control what glyph properties to serialize.- Returns:
- The number of serialized items.
- The serialized glyphs are delimited with
-
bufferSerializeGlyphs
public static int bufferSerializeGlyphs(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable @Nullable Out<Integer> bufConsumed, @Nullable @Nullable Font font, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbuffer
into a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:text
A human-readable, plain text format. The serialized glyphs will look something like:[uni0651=0@518,0+0|uni0628=0+1897]
- The serialized glyphs are delimited with
[
and]
. - Glyphs are separated with
|
- Each glyph starts with glyph name, or glyph index if
HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES
flag is set. Then, - If
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS
is not set,=
thenhb_glyph_info_t
.cluster. - If
HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS
is not set, thehb_glyph_position_t
in 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_advance
ifhb_glyph_position_t
.y_advance is not 0. Then,- If
HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS
is set, thehb_glyph_extents_t
in the format<x_bearing,y_bearing,width,height>
json
A machine-readable, structured format. The serialized glyphs will look something like:[{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0}, {"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}]
Each glyph is a JSON object, with the following properties:
g
: the glyph name or glyph index ifHB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES
flag is set.cl
:hb_glyph_info_t
.cluster ifHB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS
is not set.dx
,dy
,ax
,ay
:hb_glyph_position_t
.x_offset,hb_glyph_position_t
.y_offset,hb_glyph_position_t
.x_advance andhb_glyph_position_t
.y_advance respectively, ifHB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS
is not set.xb
,yb
,w
,h
:hb_glyph_extents_t
.x_bearing,hb_glyph_extents_t
.y_bearing,hb_glyph_extents_t
.width andhb_glyph_extents_t
.height respectively ifHB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS
is set.
- Parameters:
buffer
- anhb_buffer_t
buffer.start
- the first item inbuffer
to serialize.end
- the last item inbuffer
to 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_t
used to shape this buffer, needed to read glyph names and extents. IfNULL
, an empty font will be used.format
- thehb_buffer_serialize_format_t
to use for formatting the output.flags
- thehb_buffer_serialize_flags_t
that control what glyph properties to serialize.- Returns:
- The number of serialized items.
- 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.
-
bufferSerializeUnicode
public static int bufferSerializeUnicode(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, Set<BufferSerializeFlags> flags) Serializesbuffer
into a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping). This is useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:text
A human-readable, plain text format. The serialized codepoints will look something like:Â <U+0651=0|U+0628=1>
- Glyphs are separated with
|
- Unicode codepoints are expressed as zero-padded four (or more)
digit hexadecimal numbers preceded by
U+
- If
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS
is not set, the cluster will be indicated with a=
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_CLUSTERS
is not set.
For example:
[{u:1617,cl:0},{u:1576,cl:1}]
- Parameters:
buffer
- anhb_buffer_t
buffer.start
- the first item inbuffer
to serialize.end
- the last item inbuffer
to 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_t
to use for formatting the output.flags
- thehb_buffer_serialize_flags_t
that control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Glyphs are separated with
-
bufferSerializeUnicode
public static int bufferSerializeUnicode(Buffer buffer, int start, int end, Out<byte[]> buf, @Nullable @Nullable Out<Integer> bufConsumed, BufferSerializeFormat format, BufferSerializeFlags... flags) Serializesbuffer
into a textual representation of its content, when the buffer contains Unicode codepoints (i.e., before shaping). This is useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:text
A human-readable, plain text format. The serialized codepoints will look something like:Â <U+0651=0|U+0628=1>
- Glyphs are separated with
|
- Unicode codepoints are expressed as zero-padded four (or more)
digit hexadecimal numbers preceded by
U+
- If
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS
is not set, the cluster will be indicated with a=
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_CLUSTERS
is not set.
For example:
[{u:1617,cl:0},{u:1576,cl:1}]
- Parameters:
buffer
- anhb_buffer_t
buffer.start
- the first item inbuffer
to serialize.end
- the last item inbuffer
to 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_t
to use for formatting the output.flags
- thehb_buffer_serialize_flags_t
that control what glyph properties to serialize.- Returns:
- The number of serialized items.
- Glyphs are separated with
-
bufferSetClusterLevel
Sets the cluster level of a buffer. Thehb_buffer_cluster_level_t
dictates one aspect of how HarfBuzz will treat non-base characters during shaping.- Parameters:
buffer
- Anhb_buffer_t
clusterLevel
- The cluster level to set on the buffer
-
bufferSetContentType
Sets the type ofbuffer
contents. Buffers are either empty, contain characters (before shaping), or contain glyphs (the result of shaping).You rarely need to call this function, since a number of other functions transition the content type for you. Namely:
- A newly created buffer starts with content type
BufferContentType.INVALID
. Calling hb_buffer_reset(), hb_buffer_clear_contents(), as well as calling hb_buffer_set_length() with an argument of zero all set the buffer content type to invalid as well.
- Calling hb_buffer_add_utf8(), hb_buffer_add_utf16(),
hb_buffer_add_utf32(), hb_buffer_add_codepoints() and
hb_buffer_add_latin1() expect that buffer is either empty and
have a content type of invalid, or that buffer content type is
BufferContentType.UNICODE
, and they also set the content type to Unicode if they added anything to an empty buffer.
- Finally hb_shape() and hb_shape_full() expect that the buffer
is either empty and have content type of invalid, or that buffer
content type is
BufferContentType.UNICODE
, and upon success they set the buffer content type 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_t
contentType
- The type of buffer contents to set
- A newly created buffer starts with content type
-
bufferSetDirection
Set the text flow direction of the buffer. No shaping can happen without settingbuffer
direction, and it controls the visual direction for the output glyphs; for RTL direction the glyphs will be reversed. Many layout features depend on the proper setting of the direction, for example, reversing RTL text before shaping, then shaping with LTR direction is not the same as keeping the text in logical order and shaping with RTL direction.- Parameters:
buffer
- Anhb_buffer_t
direction
- thehb_direction_t
of thebuffer
-
bufferSetFlags
Setsbuffer
flags toflags
. Seehb_buffer_flags_t
.- Parameters:
buffer
- Anhb_buffer_t
flags
- The buffer flags to set
-
bufferSetFlags
Setsbuffer
flags toflags
. Seehb_buffer_flags_t
.- Parameters:
buffer
- Anhb_buffer_t
flags
- The buffer flags to set
-
bufferSetInvisibleGlyph
Sets thehb_codepoint_t
that replaces invisible characters in the shaping result. If set to zero (default), the glyph for the U+0020 SPACE character is used. Otherwise, this value is used verbatim.- Parameters:
buffer
- Anhb_buffer_t
invisible
- the invisiblehb_codepoint_t
-
bufferSetLanguage
Sets the language ofbuffer
tolanguage
.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_t
language
- An hb_language_t to set
-
bufferSetLength
-
bufferSetMessageFunc
public static void bufferSetMessageFunc(Buffer buffer, BufferMessageFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_buffer_message_func_t
.- Parameters:
buffer
- Anhb_buffer_t
func
- Callback functionuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
bufferSetNotFoundGlyph
Sets thehb_codepoint_t
that replaces characters not found in the font during shaping.The not-found glyph defaults to zero, sometimes known as the ".notdef" glyph. This API allows for differentiating the two.
- Parameters:
buffer
- Anhb_buffer_t
notFound
- the not-foundhb_codepoint_t
-
bufferSetRandomState
Sets the random state of the buffer. The state changes every time a glyph uses randomness (eg. therand
OpenType feature). This function together with hb_buffer_get_random_state() allow for transferring the current random state to a subsequent buffer, to get better randomness distribution.Defaults to 1 and when buffer contents are cleared. A value of 0 disables randomness during shaping.
- Parameters:
buffer
- Anhb_buffer_t
state
- the new random state
-
bufferSetReplacementCodepoint
Sets thehb_codepoint_t
that replaces invalid entries for a given encoding when adding text tobuffer
.Default is
HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT
.- Parameters:
buffer
- Anhb_buffer_t
replacement
- the replacementhb_codepoint_t
-
bufferSetScript
Sets the script ofbuffer
toscript
.Script is crucial for choosing the proper shaping behaviour for scripts that require it (e.g. Arabic) and the which OpenType features defined in the font to be applied.
You can pass one of the predefined
hb_script_t
values, or use hb_script_from_string() or hb_script_from_iso15924_tag() to get the corresponding script from an ISO 15924 script tag.- Parameters:
buffer
- Anhb_buffer_t
script
- Anhb_script_t
to set.
-
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_t
props
- Anhb_segment_properties_t
to use
-
bufferSetUnicodeFuncs
Sets the Unicode-functions structure of a buffer tounicodeFuncs
.- Parameters:
buffer
- Anhb_buffer_t
unicodeFuncs
- The Unicode-functions structure
-
bufferSetUserData
public static Bool bufferSetUserData(Buffer buffer, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified buffer.- Parameters:
buffer
- Anhb_buffer_t
key
- The user-data keydata
- A pointer to the user datadestroy
- A callback to call whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
colorGetAlpha
Fetches the alpha channel of the givencolor
.- Parameters:
color
- anhb_color_t
we are interested in its channels.- Returns:
- Alpha channel value
-
colorGetBlue
Fetches the blue channel of the givencolor
.- Parameters:
color
- anhb_color_t
we are interested in its channels.- Returns:
- Blue channel value
-
colorGetGreen
Fetches the green channel of the givencolor
.- Parameters:
color
- anhb_color_t
we are interested in its channels.- Returns:
- Green channel value
-
colorGetRed
Fetches the red channel of the givencolor
.- Parameters:
color
- anhb_color_t
we are interested in its channels.- Returns:
- Red channel value
-
colorLineGetColorStops
public static int colorLineGetColorStops(ColorLine colorLine, int start, @Nullable @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_t
objectstart
- the index of the first color stop to returncolorStops
- Array ofhb_color_stop_t
to populate- Returns:
- the total number of color stops in
colorLine
-
colorLineGetExtend
Fetches the extend mode of the color line object.- Parameters:
colorLine
- ahb_color_line_t
object- Returns:
- the extend mode of
colorLine
-
directionFromString
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_t
matchingstr
-
directionToString
-
drawClosePath
public static void drawClosePath(DrawFuncs dfuncs, @Nullable @Nullable MemorySegment drawData, DrawState st) Perform a "close-path" draw operation.- Parameters:
dfuncs
- draw functionsdrawData
- associated draw data passed by the callerst
- current draw state
-
drawCubicTo
public static void drawCubicTo(DrawFuncs dfuncs, @Nullable @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
-
drawFuncsCreate
Creates a new draw callbacks object.- Returns:
- A newly allocated
hb_draw_funcs_t
with a reference count of 1. The initial reference count should be released with hb_draw_funcs_destroy when you are done using thehb_draw_funcs_t
. This function never returnsNULL
. If memory cannot be allocated, a special singletonhb_draw_funcs_t
object will be returned.
-
drawFuncsDestroy
Deallocate thedfuncs
. Decreases the reference count ondfuncs
by one. If the result is zero, thendfuncs
and all associated resources are freed. See hb_draw_funcs_reference().- Parameters:
dfuncs
- draw functions
-
drawFuncsGetEmpty
Fetches the singleton empty draw-functions structure.- Returns:
- The empty draw-functions structure
-
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
-
drawFuncsIsImmutable
-
drawFuncsMakeImmutable
Makesdfuncs
object immutable.- Parameters:
dfuncs
- draw functions
-
drawFuncsReference
-
drawFuncsSetClosePathFunc
public static void drawFuncsSetClosePathFunc(DrawFuncs dfuncs, DrawClosePathFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets close-path callback to the draw functions object.- Parameters:
dfuncs
- draw functions objectfunc
- close-path callbackuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
drawFuncsSetCubicToFunc
public static void drawFuncsSetCubicToFunc(DrawFuncs dfuncs, DrawCubicToFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets cubic-to callback to the draw functions object.- Parameters:
dfuncs
- draw functionsfunc
- cubic-to callbackuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
drawFuncsSetLineToFunc
public static void drawFuncsSetLineToFunc(DrawFuncs dfuncs, DrawLineToFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets line-to callback to the draw functions object.- Parameters:
dfuncs
- draw functions objectfunc
- line-to callbackuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
drawFuncsSetMoveToFunc
public static void drawFuncsSetMoveToFunc(DrawFuncs dfuncs, DrawMoveToFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets move-to callback to the draw functions object.- Parameters:
dfuncs
- draw functions objectfunc
- move-to callbackuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
drawFuncsSetQuadraticToFunc
public static void drawFuncsSetQuadraticToFunc(DrawFuncs dfuncs, DrawQuadraticToFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets quadratic-to callback to the draw functions object.- Parameters:
dfuncs
- draw functions objectfunc
- quadratic-to callbackuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
drawFuncsSetUserData
public static Bool drawFuncsSetUserData(DrawFuncs dfuncs, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
drawLineTo
public static void drawLineTo(DrawFuncs dfuncs, @Nullable @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
-
drawMoveTo
public static void drawMoveTo(DrawFuncs dfuncs, @Nullable @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
-
drawQuadraticTo
public static void drawQuadraticTo(DrawFuncs dfuncs, @Nullable @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
-
faceBuilderAddTable
Add table fortag
with data provided byblob
to the face.face
must be created using hb_face_builder_create().- Parameters:
face
- A face object created with hb_face_builder_create()tag
- Thehb_tag_t
of the table to addblob
- The blob containing the table data to add
-
faceBuilderCreate
Creates ahb_face_t
that can be used with hb_face_builder_add_table(). After tables are added to the face, it can be compiled to a binary font file by calling hb_face_reference_blob().- Returns:
- New face.
-
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
-
faceCollectNominalGlyphMapping
public static void faceCollectNominalGlyphMapping(Face face, Map mapping, @Nullable @Nullable Set unicodes) 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
-
faceCollectUnicodes
-
faceCollectVariationSelectors
-
faceCollectVariationUnicodes
Collects all Unicode characters forvariationSelector
covered byface
and adds them to thehb_set_t
setout
.- Parameters:
face
- A face objectvariationSelector
- The Variation Selector to queryout
- The set to add Unicode characters to
-
faceCount
Fetches the number of faces in a blob.- Parameters:
blob
- a blob.- Returns:
- Number of faces in
blob
-
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,
index
is ignored. Otherwise, only the lower 16-bits ofindex
are used. The unmodifiedindex
can 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_t
to work uponindex
- The index of the face withinblob
- Returns:
- The new face object
-
faceCreateForTables
public static Face faceCreateForTables(ReferenceTableFunc referenceTableFunc, @Nullable @Nullable MemorySegment userData, @Nullable @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() does not currently work with faces created this way.Creates a new face object from the specified
userData
andreferenceTableFunc
, with thedestroy
callback.- Parameters:
referenceTableFunc
- Table-referencing functionuserData
- A pointer to the user datadestroy
- A callback to call whendata
is not needed anymore- Returns:
- The new face object
-
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
-
faceGetEmpty
Fetches the singleton empty face object.- Returns:
- The empty face object
-
faceGetGlyphCount
Fetches the glyph-count value of the specified face object.- Parameters:
face
- A face object- Returns:
- The glyph-count value of
face
-
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
.
-
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
-
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
-
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
-
faceIsImmutable
-
faceMakeImmutable
Makes the given face object immutable.- Parameters:
face
- A face object
-
faceReference
-
faceReferenceBlob
-
faceReferenceTable
-
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
-
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
-
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
-
faceSetUserData
public static Bool faceSetUserData(Face face, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
featureFromString
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_t
to initialize with the parsed values- Returns:
true
ifstr
is successfully parsed,false
otherwise
-
featureToString
Converts ahb_feature_t
into 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.- Parameters:
feature
- anhb_feature_t
to convertbuf
- output string
-
fontAddGlyphOriginForDirection
public static void fontAddGlyphOriginForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y) Adds the origin coordinates to an (X,Y) point coordinate, in the specified glyph ID in the specified font.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work 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
-
fontChanged
Notifies thefont
that underlying font data has changed. This has the effect of increasing the serial as returned by hb_font_get_serial(), which invalidates internal caches.- Parameters:
font
-hb_font_t
to work upon
-
fontCreate
Constructs a new font object from the specified face.<note>Note: If
face
's index value (as passed to hb_face_create() has non-zero top 16-bits, those bits minus one are passed to hb_font_set_var_named_instance(), effectively loading a named-instance of a variable font, instead of the default-instance. This allows specifying which named-instance to load by default when creating the face.</note>- Parameters:
face
- a face.- Returns:
- The new font object
-
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_t
to work upon
-
fontDrawGlyph
public static void fontDrawGlyph(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable @Nullable MemorySegment drawData) Draws the outline that corresponds to a glyph in the specifiedfont
.The outline is returned by way of calls to the callbacks of the
dfuncs
objects, withdrawData
passed to them.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph IDdfuncs
-hb_draw_funcs_t
to draw todrawData
- User data to pass to draw callbacks
-
fontFuncsCreate
Creates a newhb_font_funcs_t
structure of font functions.- Returns:
- The font-functions structure
-
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
-
fontFuncsGetEmpty
Fetches an empty font-functions structure.- Returns:
- The font-functions structure
-
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
-
fontFuncsIsImmutable
-
fontFuncsMakeImmutable
Makes a font-functions structure immutable.- Parameters:
ffuncs
- The font-functions structure
-
fontFuncsReference
-
fontFuncsSetDrawGlyphFunc
public static void fontFuncsSetDrawGlyphFunc(FontFuncs ffuncs, FontDrawGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_draw_glyph_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetFontHExtentsFunc
public static void fontFuncsSetFontHExtentsFunc(FontFuncs ffuncs, FontGetFontHExtentsFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetFontVExtentsFunc
public static void fontFuncsSetFontVExtentsFunc(FontFuncs ffuncs, FontGetFontVExtentsFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphContourPointFunc
public static void fontFuncsSetGlyphContourPointFunc(FontFuncs ffuncs, FontGetGlyphContourPointFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphExtentsFunc
public static void fontFuncsSetGlyphExtentsFunc(FontFuncs ffuncs, FontGetGlyphExtentsFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_extents_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphFromNameFunc
public static void fontFuncsSetGlyphFromNameFunc(FontFuncs ffuncs, FontGetGlyphFromNameFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphFunc
@Deprecated public static void fontFuncsSetGlyphFunc(FontFuncs ffuncs, FontGetGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 functionuserData
- data to pass tofunc
destroy
- function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphHAdvanceFunc
public static void fontFuncsSetGlyphHAdvanceFunc(FontFuncs ffuncs, FontGetGlyphHAdvanceFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphHAdvancesFunc
public static void fontFuncsSetGlyphHAdvancesFunc(FontFuncs ffuncs, FontGetGlyphHAdvancesFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphHKerningFunc
public static void fontFuncsSetGlyphHKerningFunc(FontFuncs ffuncs, FontGetGlyphHKerningFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphHOriginFunc
public static void fontFuncsSetGlyphHOriginFunc(FontFuncs ffuncs, FontGetGlyphHOriginFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphNameFunc
public static void fontFuncsSetGlyphNameFunc(FontFuncs ffuncs, FontGetGlyphNameFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_glyph_name_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphShapeFunc
@Deprecated public static void fontFuncsSetGlyphShapeFunc(FontFuncs ffuncs, FontGetGlyphShapeFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphVAdvanceFunc
public static void fontFuncsSetGlyphVAdvanceFunc(FontFuncs ffuncs, FontGetGlyphVAdvanceFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphVAdvancesFunc
public static void fontFuncsSetGlyphVAdvancesFunc(FontFuncs ffuncs, FontGetGlyphVAdvancesFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphVKerningFunc
@Deprecated public static void fontFuncsSetGlyphVKerningFunc(FontFuncs ffuncs, FontGetGlyphVKerningFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetGlyphVOriginFunc
public static void fontFuncsSetGlyphVOriginFunc(FontFuncs ffuncs, FontGetGlyphVOriginFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @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 tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetNominalGlyphFunc
public static void fontFuncsSetNominalGlyphFunc(FontFuncs ffuncs, FontGetNominalGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyph_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetNominalGlyphsFunc
public static void fontFuncsSetNominalGlyphsFunc(FontFuncs ffuncs, FontGetNominalGlyphsFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_nominal_glyphs_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontFuncsSetPaintGlyphFunc
public static void fontFuncsSetPaintGlyphFunc(FontFuncs ffuncs, FontPaintGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_paint_glyph_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is no longer needed
-
fontFuncsSetUserData
public static Bool fontFuncsSetUserData(FontFuncs ffuncs, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
fontFuncsSetVariationGlyphFunc
public static void fontFuncsSetVariationGlyphFunc(FontFuncs ffuncs, FontGetVariationGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_font_get_variation_glyph_func_t
.- Parameters:
ffuncs
- A font-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
fontGetEmpty
-
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_t
to work upondirection
- The direction of the text segmentextents
- Thehb_font_extents_t
retrieved
-
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
variationSelector
is 0, calls hb_font_get_nominal_glyph(); otherwise calls hb_font_get_variation_glyph().- Parameters:
font
-hb_font_t
to work uponunicode
- The Unicode code point to queryvariationSelector
- A variation-selector code pointglyph
- The glyph ID retrieved- Returns:
true
if data found,false
otherwise
-
fontGetGlyphAdvanceForDirection
public static void fontGetGlyphAdvanceForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y) Fetches the advance for a glyph ID from the specified font, in a text segment of the specified direction.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph ID to querydirection
- The direction of the text segmentx
- The horizontal advance retrievedy
- The vertical advance retrieved
-
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_t
to 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
-
fontGetGlyphContourPoint
public static Bool fontGetGlyphContourPoint(Font font, Codepoint glyph, int pointIndex, Position x, Position y) Fetches the (x,y) coordinates of a specified contour-point index in the specified glyph, within the specified font.- Parameters:
font
-hb_font_t
to work 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:
true
if data found,false
otherwise
-
fontGetGlyphContourPointForOrigin
public static Bool fontGetGlyphContourPointForOrigin(Font font, Codepoint glyph, int pointIndex, Direction direction, Position x, Position y) Fetches the (X,Y) coordinates of a specified contour-point index in the specified glyph ID in the specified font, with respect to the origin in a text segment in the specified direction.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work 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:
true
if data found,false
otherwise
-
fontGetGlyphExtents
Fetches thehb_glyph_extents_t
data for a glyph ID in the specified font.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph ID to queryextents
- Thehb_glyph_extents_t
retrieved- Returns:
true
if data found,false
otherwise
-
fontGetGlyphExtentsForOrigin
public static Bool fontGetGlyphExtentsForOrigin(Font font, Codepoint glyph, Direction direction, GlyphExtents extents) Fetches thehb_glyph_extents_t
data for a glyph ID in the specified font, with respect to the origin in a text segment in the specified direction.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph ID to querydirection
- The direction of the text segmentextents
- Thehb_glyph_extents_t
retrieved- Returns:
true
if data found,false
otherwise
-
fontGetGlyphFromName
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_t
to work uponname
- The name string to queryglyph
- The glyph ID retrieved- Returns:
true
if data found,false
otherwise
-
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_t
to 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
-
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_t
function).</note>- Parameters:
font
-hb_font_t
to 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
-
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_t
to work uponglyph
- The glyph ID to queryx
- The X coordinate of the originy
- The Y coordinate of the origin- Returns:
true
if data found,false
otherwise
-
fontGetGlyphKerningForDirection
public static void fontGetGlyphKerningForDirection(Font font, Codepoint firstGlyph, Codepoint secondGlyph, Direction direction, Position x, Position y) Fetches the kerning-adjustment value for a glyph-pair in the specified font.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work 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
-
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_t
to work uponglyph
- The glyph ID to queryname
- Name string retrieved for the glyph ID- Returns:
true
if data found,false
otherwise
-
fontGetGlyphOriginForDirection
public static void fontGetGlyphOriginForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y) Fetches the (X,Y) coordinates of the origin for a glyph in the specified font.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work 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
-
fontGetGlyphShape
@Deprecated public static void fontGetGlyphShape(Font font, Codepoint glyph, DrawFuncs dfuncs, @Nullable @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 thedfuncs
objects, withdrawData
passed to them.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph IDdfuncs
-hb_draw_funcs_t
to draw todrawData
- User data to pass to draw callbacks
-
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_t
to 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
-
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_t
function).</note>- Parameters:
font
-hb_font_t
to 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
-
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_t
to work uponglyph
- The glyph ID to queryx
- The X coordinate of the originy
- The Y coordinate of the origin- Returns:
true
if data found,false
otherwise
-
fontGetHExtents
Fetches the extents for a specified font, for horizontal text segments.- Parameters:
font
-hb_font_t
to work uponextents
- The font extents retrieved- Returns:
true
if data found,false
otherwise
-
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_t
to work uponunicode
- The Unicode code point to queryglyph
- The glyph ID retrieved- Returns:
true
if data found,false
otherwise
-
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_t
output parameter. Stops at the first unsupported glyph ID.- Parameters:
font
-hb_font_t
to 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
-
fontGetParent
-
fontGetPpem
-
fontGetPtem
Fetches the "point size" of a font. Used in CoreText to implement optical sizing.- Parameters:
font
-hb_font_t
to work upon- Returns:
- Point size. A value of zero means "not set."
-
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_t
to work upon- Returns:
- serial number
-
fontGetSyntheticBold
public static void fontGetSyntheticBold(Font font, Out<Float> xEmbolden, Out<Float> yEmbolden, Bool inPlace) Fetches the "synthetic boldness" parameters of a font.- Parameters:
font
-hb_font_t
to work uponxEmbolden
- return location for horizontal valueyEmbolden
- return location for vertical valueinPlace
- return location for in-place value
-
fontGetSyntheticSlant
Fetches the "synthetic slant" of a font.- Parameters:
font
-hb_font_t
to work upon- Returns:
- Synthetic slant. By default is zero.
-
fontGetUserData
Fetches the user-data object associated with the specified key, attached to the specified font object.- Parameters:
font
-hb_font_t
to work uponkey
- The user-data key to query- Returns:
- Pointer to the user data
-
fontGetVExtents
Fetches the extents for a specified font, for vertical text segments.- Parameters:
font
-hb_font_t
to work uponextents
- The font extents retrieved- Returns:
true
if data found,false
otherwise
-
fontGetVarCoordsDesign
Fetches the list of variation coordinates (in design-space units) currently set on a font.Note that this returned array may only contain values for some (or none) of the axes; omitted axes effectively have their default values.
Return value is valid as long as variation coordinates of the font are not modified.
- Parameters:
font
-hb_font_t
to work uponlength
- Number of coordinates retrieved- Returns:
- coordinates array
-
fontGetVarCoordsNormalized
Fetches the list of normalized variation coordinates currently set on a font.Note that this returned array may only contain values for some (or none) of the axes; omitted axes effectively have zero values.
Return value is valid as long as variation coordinates of the font are not modified.
- Parameters:
font
-hb_font_t
to work uponlength
- Number of coordinates retrieved- Returns:
- coordinates array
-
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
.
-
fontGetVariationGlyph
public static Bool fontGetVariationGlyph(Font font, Codepoint unicode, Codepoint variationSelector, Codepoint glyph) Fetches the glyph ID for a Unicode code point when followed by by the specified variation-selector code point, in the specified font.- Parameters:
font
-hb_font_t
to work uponunicode
- The Unicode code point to queryvariationSelector
- The variation-selector code point to queryglyph
- The glyph ID retrieved- Returns:
true
if data found,false
otherwise
-
fontGlyphFromString
Fetches the glyph ID fromfont
that matches the specified string. Strings of the formatgidDDD
oruniUUUU
are parsed automatically.<note>Note:
len
== -1 means the string is null-terminated.</note>- Parameters:
font
-hb_font_t
to work upons
- string to queryglyph
- The glyph ID corresponding to the string requested- Returns:
true
if data found,false
otherwise
-
fontGlyphToString
Fetches the name of the specified glyph ID infont
and returns it in strings
.If the glyph ID has no name in
font
, a string of the formgidDDD
is generated, withDDD
being the glyph ID.According to the OpenType specification, glyph names are limited to 63 characters and can only contain (a subset of) ASCII.
- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph ID to querys
- The string containing the glyph name
-
fontIsImmutable
-
fontMakeImmutable
Makesfont
immutable.- Parameters:
font
-hb_font_t
to work upon
-
fontPaintGlyph
public static void fontPaintGlyph(Font font, Codepoint glyph, PaintFuncs pfuncs, @Nullable @Nullable MemorySegment paintData, int paletteIndex, Color foreground) Paints the glyph.The painting instructions are returned by way of calls to the callbacks of the
funcs
object, withpaintData
passed to them.If the font has color palettes (see hb_ot_color_has_palettes()), then
paletteIndex
selects the palette to use. If the font only has one palette, this will be 0.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph IDpfuncs
-hb_paint_funcs_t
to paint withpaintData
- User data to pass to paint callbackspaletteIndex
- The index of the font's color palette to useforeground
- The foreground color, unpremultipled
-
fontReference
-
fontSetFace
-
fontSetFuncs
public static void fontSetFuncs(Font font, FontFuncs klass, @Nullable @Nullable MemorySegment fontData, @Nullable @Nullable DestroyFunc destroy) Replaces the font-functions structure attached to a font, updating the font's user-data withfont
-data and thedestroy
callback.- Parameters:
font
-hb_font_t
to work uponklass
- The font-functions structure.fontData
- Data to attach tofont
destroy
- The function to call whenfontData
is not needed anymore
-
fontSetFuncsData
public static void fontSetFuncsData(Font font, @Nullable @Nullable MemorySegment fontData, @Nullable @Nullable DestroyFunc destroy) Replaces the user data attached to a font, updating the font'sdestroy
callback.- Parameters:
font
-hb_font_t
to work uponfontData
- Data to attach tofont
destroy
- The function to call whenfontData
is not needed anymore
-
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_t
to work uponxPpem
- Horizontal ppem value to assignyPpem
- Vertical ppem value to assign
-
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_t
to work uponptem
- font size in points.
-
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_t
values are integer types and you need to leave room for fractional values in there.For example, to set the font size to 20, with 64 levels of fractional precision you would call
hb_font_set_scale(font, 20 * 64, 20 * 64)
.In the example above, even what font size 20 means is up to you. It might be 20 pixels, or 20 points, or 20 millimeters. HarfBuzz does not care about that. You can set the point size of the font using hb_font_set_ptem(), and the pixel size using hb_font_set_ppem().
The choice of scale is yours but needs to be consistent between what you set here, and what you expect out of
hb_position_t
as well has draw / paint API output values.Fonts default to a scale equal to the UPEM value of their face. A font with this setting is sometimes called an "unscaled" font.
- Parameters:
font
-hb_font_t
to work uponxScale
- Horizontal scale value to assignyScale
- Vertical scale value to assign
-
fontSetSyntheticBold
Sets the "synthetic boldness" of a font.Positive values for
xEmbolden
/yEmbolden
make a font bolder, negative values thinner. Typical values are in the 0.01 to 0.05 range. The default value is zero.Synthetic boldness is applied by offsetting the contour points of the glyph shape.
Synthetic boldness is applied when rendering a glyph via hb_font_draw_glyph().
If
inPlace
isfalse
, then glyph advance-widths are also adjusted, otherwise they are not. The in-place mode is useful for simulating font grading.- Parameters:
font
-hb_font_t
to work uponxEmbolden
- the amount to embolden horizontallyyEmbolden
- the amount to embolden verticallyinPlace
- whether to embolden glyphs in-place
-
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() 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_t
to work uponslant
- synthetic slant value.
-
fontSetUserData
public static Bool fontSetUserData(Font font, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @Nullable DestroyFunc destroy, Bool replace) Attaches a user-data key/data pair to the specified font object.- Parameters:
font
-hb_font_t
to work uponkey
- The user-data keydata
- A pointer to the user datadestroy
- A callback to call whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
fontSetVarCoordsDesign
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 incoords
will be effectively set to their default values.- Parameters:
font
-hb_font_t
to work uponcoords
- Array of variation coordinates to apply
-
fontSetVarCoordsNormalized
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 incoords
will be effectively set to their default values.<note>Note: Coordinates should be normalized to 2.14.</note>
- Parameters:
font
-hb_font_t
to work uponcoords
- Array of variation coordinates to apply
-
fontSetVarNamedInstance
Sets design coords of a font from a named-instance index.- Parameters:
font
- a font.instanceIndex
- named instance index.
-
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_t
to work upontag
- Thehb_tag_t
tag of the variation-axis namevalue
- The value of the variation axis
-
fontSetVariations
Applies a list of font-variation settings to a font.Note that this overrides all existing variations set on
font
. Axes not included invariations
will be effectively set to their default values.- Parameters:
font
-hb_font_t
to work uponvariations
- Array of variation settings to apply
-
fontSubtractGlyphOriginForDirection
public static void fontSubtractGlyphOriginForDirection(Font font, Codepoint glyph, Direction direction, Position x, Position y) Subtracts the origin coordinates from an (X,Y) point coordinate, in the specified glyph ID in the specified font.Calls the appropriate direction-specific variant (horizontal or vertical) depending on the value of
direction
.- Parameters:
font
-hb_font_t
to work 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
-
ftFaceCreate
public static Face ftFaceCreate(org.freedesktop.freetype.Face ftFace, @Nullable @Nullable DestroyFunc destroy) Creates anhb_face_t
face object from the specified FT_Face.Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned
hb_face_t
will use the native HarfBuzz font implementation, unless you call hb_ft_font_set_funcs() on them.This variant of the function does not provide any life-cycle management.
Most client programs should use hb_ft_face_create_referenced() (or, perhaps, hb_ft_face_create_cached()) instead.
If you know you have valid reasons not to use hb_ft_face_create_referenced(), then it is the client program's responsibility to destroy
ftFace
after thehb_face_t
face 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_t
face object
-
ftFaceCreateCached
Creates anhb_face_t
face object from the specified FT_Face.Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned
hb_face_t
will use the native HarfBuzz font implementation, unless you call hb_ft_font_set_funcs() on them.This variant of the function caches the newly created
hb_face_t
face object, using thegeneric
pointer offtFace
. Subsequent function calls that are passed the sameftFace
parameter will have the samehb_face_t
returned to them, and thathb_face_t
will be correctly reference counted.However, client programs are still responsible for destroying
ftFace
after the lasthb_face_t
face object has been destroyed.- Parameters:
ftFace
- FT_Face to work upon- Returns:
- the new
hb_face_t
face object
-
ftFaceCreateReferenced
Creates anhb_face_t
face object from the specified FT_Face.Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned
hb_face_t
will use the native HarfBuzz font implementation, unless you call hb_ft_font_set_funcs() on them.This is the preferred variant of the hb_ft_face_create* function family, because it calls FT_Reference_Face() on
ftFace
, ensuring thatftFace
remains alive as long as the resultinghb_face_t
face object remains alive. Also calls FT_Done_Face() when thehb_face_t
face object is destroyed.Use this version unless you know you have good reasons not to.
- Parameters:
ftFace
- FT_Face to work upon- Returns:
- the new
hb_face_t
face object
-
ftFontChanged
Refreshes the state offont
when the underlying FT_Face has changed. This function should be called after changing the size or variation-axis settings on the FT_Face.- Parameters:
font
-hb_font_t
to work upon
-
ftFontCreate
public static Font ftFontCreate(org.freedesktop.freetype.Face ftFace, @Nullable @Nullable DestroyFunc destroy) Creates anhb_font_t
font object from the specified FT_Face.<note>Note: You must set the face size on
ftFace
before calling hb_ft_font_create() on it. HarfBuzz assumes size is always set and will accesssize
member 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
ftFace
after thehb_font_t
font object has been destroyed.HarfBuzz will use the
destroy
callback on thehb_font_t
font object if it is supplied when you use this function. However, even ifdestroy
is provided, it is the client program's responsibility to destroyftFace
, and it is the client program's responsibility to ensure thatftFace
is destroyed only after thehb_font_t
font 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_t
font object
-
ftFontCreateReferenced
Creates anhb_font_t
font object from the specified FT_Face.<note>Note: You must set the face size on
ftFace
before calling hb_ft_font_create_referenced() on it. HarfBuzz assumes size is always set and will accesssize
member 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 thatftFace
remains alive as long as the resultinghb_font_t
font object remains alive.Use this version unless you know you have good reasons not to.
- Parameters:
ftFace
- FT_Face to work upon- Returns:
- the new
hb_font_t
font object
-
ftFontGetFace
Fetches the FT_Face associated with the specifiedhb_font_t
font object.This function works with
hb_font_t
objects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font
-hb_font_t
to work upon- Returns:
- the FT_Face found or
NULL
-
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_t
objects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font
-hb_font_t
to work upon- Returns:
- FT_Load_Glyph flags found, or 0
-
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_t
objects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font
-hb_font_t
to work upon- Returns:
- the FT_Face associated with
font
orNULL
-
ftFontSetFuncs
Configures the font-functions structure of the specifiedhb_font_t
font object to use FreeType font functions.In particular, you can use this function to configure an existing
hb_face_t
face object for use with FreeType font functions even if thathb_face_t
face object was initially created with hb_face_create(), and therefore was not initially configured to use FreeType font functions.An
hb_font_t
object created with hb_ft_font_create() is preconfigured for FreeType font functions and does not require this function to be used.Note that if you modify the underlying
hb_font_t
after calling this function, you need to call hb_ft_hb_font_changed() to update the underlying FT_Face.<note>Note: Internally, this function creates an FT_Face. </note>
- Parameters:
font
-hb_font_t
to work upon
-
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_t
objects created by hb_ft_font_create() or hb_ft_font_create_referenced().- Parameters:
font
-hb_font_t
to work uponloadFlags
- The FreeType load flags to set
-
ftFontUnlockFace
Releases an FT_Face previously obtained with hb_ft_font_lock_face().- Parameters:
font
-hb_font_t
to work upon
-
ftHbFontChanged
Refreshes the state of the underlying FT_Face offont
when the hb_font_tfont
has 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
.- Parameters:
font
-hb_font_t
to work upon- Returns:
- true if changed, false otherwise
-
glibBlobCreate
-
glibGetUnicodeFuncs
Fetches a Unicode-functions structure that is populated with the appropriate GLib function for each method.- Returns:
- a pointer to the
hb_unicode_funcs_t
Unicode-functions structure
-
glibScriptFromScript
Fetches the GUnicodeScript identifier that corresponds to the specifiedhb_script_t
script.- Parameters:
script
- Thehb_script_t
to query- Returns:
- the GUnicodeScript identifier found
-
glibScriptToScript
Fetches thehb_script_t
script that corresponds to the specified GUnicodeScript identifier.- Parameters:
script
- The GUnicodeScript identifier to query- Returns:
- the
hb_script_t
script found
-
glyphInfoGetGlyphFlags
Returns glyph flags encoded within ahb_glyph_info_t
.- Parameters:
info
- ahb_glyph_info_t
- Returns:
- The
hb_glyph_flags_t
encoded withininfo
-
languageFromString
Convertsstr
representing a BCP 47 language tag to the correspondinghb_language_t
.- Parameters:
str
- a string representing a BCP 47 language tag- Returns:
- The
hb_language_t
corresponding to the BCP 47 language tag.
-
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
-
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_t
to work onspecific
- Anotherhb_language_t
- Returns:
true
if languages match,false
otherwise.
-
languageToString
-
mapAllocationSuccessful
-
mapClear
-
mapCopy
-
mapCreate
-
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
-
mapGet
-
mapGetEmpty
-
mapGetPopulation
Returns the number of key-value pairs in the map.- Parameters:
map
- A map- Returns:
- The population of
map
-
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
-
mapHas
-
mapHash
Creates a hash representingmap
.- Parameters:
map
- A map- Returns:
- A hash of
map
.
-
mapIsEmpty
-
mapIsEqual
-
mapKeys
-
mapNext
Fetches the next key/value pair inmap
.Set
idx
to -1 to get started.If the map is modified during iteration, the behavior is undefined.
The order in which the key/values are returned is undefined.
- Parameters:
map
- A mapidx
- Iterator internal statekey
- Key retrievedvalue
- Value retrieved- Returns:
true
if there was a next value,false
otherwise
-
mapReference
-
mapSet
-
mapSetUserData
public static Bool mapSetUserData(Map map, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
mapUpdate
-
mapValues
-
otColorGlyphGetLayers
public static int otColorGlyphGetLayers(Face face, Codepoint glyph, int startOffset, @Nullable @Nullable Out<OtColorLayer[]> layers) Fetches a list of all color layers for the specified glyph index in the specified face. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work 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
-
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 thefont
object. If PPEM is unset, the blob returned will be the largest PNG available.If the glyph has no PNG image, the singleton empty blob is returned.
- Parameters:
font
-hb_font_t
to work uponglyph
- a glyph index- Returns:
- An
hb_blob_t
containing the PNG image for the glyph, if available
-
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_t
to work uponglyph
- a svg glyph index- Returns:
- An
hb_blob_t
containing the SVG document of the glyph, if available
-
otColorHasLayers
-
otColorHasPaint
-
otColorHasPalettes
-
otColorHasPng
-
otColorHasSvg
-
otColorPaletteColorGetNameId
Fetches thename
table Name ID that provides display names for the specified color in a face'sCPAL
color palette.Display names can be generic (e.g., "Background") or specific (e.g., "Eye color").
- Parameters:
face
-hb_face_t
to work uponcolorIndex
- The index of the color- Returns:
- the Name ID found for the color.
-
otColorPaletteGetColors
public static int otColorPaletteGetColors(Face face, int paletteIndex, int startOffset, @Nullable @Nullable Out<Color[]> colors) Fetches a list of the colors in a color palette.After calling this function,
colors
will be filled with the palette colors. Ifcolors
is NULL, the function will just return the number of total colors without storing any actual colors; this can be used for allocating a buffer of suitable size before calling hb_ot_color_palette_get_colors() a second time.The RGBA values in the palette are unpremultiplied. See the OpenType spec CPAL section for details.
- Parameters:
face
-hb_face_t
to work uponpaletteIndex
- the index of the color palette to querystartOffset
- offset of the first color to retrievecolors
- The array ofhb_color_t
records found- Returns:
- the total number of colors in the palette
-
otColorPaletteGetCount
Fetches the number of color palettes in a face.- Parameters:
face
-hb_face_t
to work upon- Returns:
- the number of palettes found
-
otColorPaletteGetFlags
Fetches the flags defined for a color palette.- Parameters:
face
-hb_face_t
to work uponpaletteIndex
- The index of the color palette- Returns:
- the
hb_ot_color_palette_flags_t
of the requested color palette
-
otColorPaletteGetNameId
Fetches thename
table Name ID that provides display names for aCPAL
color palette.Palette display names can be generic (e.g., "Default") or provide specific, themed names (e.g., "Spring", "Summer", "Fall", and "Winter").
- Parameters:
face
-hb_face_t
to work 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
.
-
otFontSetFuncs
Sets the font functions to use when working withfont
.- Parameters:
font
-hb_font_t
to work upon
-
otLayoutCollectFeatures
public static void otLayoutCollectFeatures(Face face, Tag tableTag, @Nullable @Nullable Tag[] scripts, @Nullable @Nullable Tag[] languages, @Nullable @Nullable Tag[] features, Set featureIndexes) Fetches a list of all feature indexes in the specified face's GSUB table or GPOS table, underneath the specified scripts, languages, and features. If no list of scripts is provided, all scripts will be queried. If no list of languages is provided, all languages will be queried. If no list of features is provided, all features will be queried.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scripts
- The array of scripts to collect features for, terminated byHB_TAG_NONE
languages
- The array of languages to collect features for, terminated byHB_TAG_NONE
features
- The array of features to collect, terminated byHB_TAG_NONE
featureIndexes
- The set of feature indexes found for the query
-
otLayoutCollectFeaturesMap
public static void otLayoutCollectFeaturesMap(Face face, Tag tableTag, int scriptIndex, int languageIndex, Map featureMap) Fetches the mapping from feature tags to feature indexes for the specified script and language.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- The index of the requested script taglanguageIndex
- The index of the requested language tagfeatureMap
- The map of feature tag to feature index.
-
otLayoutCollectLookups
public static void otLayoutCollectLookups(Face face, Tag tableTag, @Nullable @Nullable Tag[] scripts, @Nullable @Nullable Tag[] languages, @Nullable @Nullable Tag[] features, Set lookupIndexes) Fetches a list of all feature-lookup indexes in the specified face's GSUB table or GPOS table, underneath the specified scripts, languages, and features. If no list of scripts is provided, all scripts will be queried. If no list of languages is provided, all languages will be queried. If no list of features is provided, all features will be queried.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scripts
- The array of scripts to collect lookups for, terminated byHB_TAG_NONE
languages
- The array of languages to collect lookups for, terminated byHB_TAG_NONE
features
- The array of features to collect lookups for, terminated byHB_TAG_NONE
lookupIndexes
- The array of lookup indexes found for the query
-
otLayoutFeatureGetCharacters
public static int otLayoutFeatureGetCharacters(Face face, Tag tableTag, int featureIndex, int startOffset, Out<Codepoint[]> characters) Fetches a list of the characters defined as having a variant under the specified "Character Variant" ("cvXX") feature tag.- Parameters:
face
-hb_face_t
to work 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.
-
otLayoutFeatureGetLookups
public static int otLayoutFeatureGetLookups(Face face, Tag tableTag, int featureIndex, int startOffset, Out<int[]> lookupIndexes) Fetches a list of all lookups enumerated for the specified feature, in the specified face's GSUB table or GPOS table. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
featureIndex
- 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.
-
otLayoutFeatureGetNameIds
public static Bool otLayoutFeatureGetNameIds(Face face, Tag tableTag, int featureIndex, @Nullable @Nullable OtNameId labelId, @Nullable @Nullable OtNameId tooltipId, @Nullable @Nullable OtNameId sampleId, @Nullable @Nullable Out<Integer> numNamedParameters, @Nullable @Nullable OtNameId firstParamId) Fetches name indices from feature parameters for "Stylistic Set" ('ssXX') or "Character Variant" ('cvXX') features.- Parameters:
face
-hb_face_t
to work 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. (May be NULL.)tooltipId
- The ‘name’ table name ID that specifies a string that an application can use for tooltip text for this feature. (May be NULL.)sampleId
- The ‘name’ table name ID that specifies sample text that illustrates the effect of this feature. (May be NULL.)numNamedParameters
- Number of named parameters. (May be zero.)firstParamId
- The first ‘name’ table name ID used to specify strings for user-interface labels for the feature parameters. (Must be zero if numParameters is zero.)- Returns:
true
if data found,false
otherwise
-
otLayoutFeatureWithVariationsGetLookups
public static int otLayoutFeatureWithVariationsGetLookups(Face face, Tag tableTag, int featureIndex, int variationsIndex, int startOffset, Out<int[]> lookupIndexes) Fetches a list of all lookups enumerated for the specified feature, in the specified face's GSUB table or GPOS table, enabled at the specified variations index. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
featureIndex
- 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.
-
otLayoutGetAttachPoints
public static int otLayoutGetAttachPoints(Face face, Codepoint glyph, int startOffset, 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_t
to work onglyph
- Thehb_codepoint_t
code 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 @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:
true
if found baseline value in the font.
-
otLayoutGetBaseline2
public static Bool otLayoutGetBaseline2(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Script script, @Nullable @Nullable Language language, @Nullable @Nullable Position coord) Fetches a baseline value from the face.This function is like hb_ot_layout_get_baseline() but takes
hb_script_t
andhb_language_t
instead 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:
true
if found baseline value in the font.
-
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.
-
otLayoutGetBaselineWithFallback2
public static void otLayoutGetBaselineWithFallback2(Font font, OtLayoutBaselineTag baselineTag, Direction direction, Script script, @Nullable @Nullable Language language, Position coord) Fetches a baseline value from the face, and synthesizes it if the font does not have it.This function is like hb_ot_layout_get_baseline_with_fallback() but takes
hb_script_t
andhb_language_t
instead of OpenTypehb_tag_t
.- Parameters:
font
- a fontbaselineTag
- a baseline tagdirection
- text direction.script
- script.language
- language, currently unused.coord
- baseline value if found.
-
otLayoutGetFontExtents
public static Bool otLayoutGetFontExtents(Font font, Direction direction, Tag scriptTag, Tag languageTag, @Nullable @Nullable FontExtents extents) Fetches script/language-specific font extents. These values are looked up in theBASE
table'sMinMax
records.If no such extents are found, the default extents for the font are fetched. As such, the return value of this function can for the most part be ignored. Note that the per-script/language extents do not have a line-gap value, and the line-gap is set to zero in that case.
- Parameters:
font
- a fontdirection
- text direction.scriptTag
- script tag.languageTag
- language tag.extents
- font extents if found.- Returns:
true
if found script/language-specific font extents.
-
otLayoutGetFontExtents2
public static Bool otLayoutGetFontExtents2(Font font, Direction direction, Script script, @Nullable @Nullable Language language, @Nullable @Nullable FontExtents extents) Fetches script/language-specific font extents. These values are looked up in theBASE
table'sMinMax
records.If no such extents are found, the default extents for the font are fetched. As such, the return value of this function can for the most part be ignored. Note that the per-script/language extents do not have a line-gap value, and the line-gap is set to zero in that case.
This function is like hb_ot_layout_get_font_extents() but takes
hb_script_t
andhb_language_t
instead of OpenTypehb_tag_t
.- Parameters:
font
- a fontdirection
- text direction.script
- script.language
- language.extents
- font extents if found.- Returns:
true
if found script/language-specific font extents.
-
otLayoutGetGlyphClass
Fetches the GDEF class of the requested glyph in the specified face.- Parameters:
face
- Thehb_face_t
to work onglyph
- Thehb_codepoint_t
code point to query- Returns:
- The
hb_ot_layout_glyph_class_t
glyph class of the given code point in the GDEF table of the face.
-
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_t
to work onklass
- Thehb_ot_layout_glyph_class_t
GDEF class to retrieveglyphs
- Thehb_set_t
set of all glyphs belonging to the requested class.
-
otLayoutGetHorizontalBaselineTagForScript
Fetches the dominant horizontal baseline tag used byscript
.- Parameters:
script
- a script tag.- Returns:
- dominant baseline tag for the
script
.
-
otLayoutGetLigatureCarets
public static int otLayoutGetLigatureCarets(Font font, Direction direction, Codepoint glyph, int startOffset, 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_t
to work ondirection
- Thehb_direction_t
text direction to useglyph
- Thehb_codepoint_t
code 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., thesize
feature from GPOS). Note that the subfamily_id and the subfamily name string (accessible via the subfamily_name_id) as used here are defined as pertaining only to fonts within a font family that differ specifically in their respective size ranges; other ways to differentiate fonts within a subfamily are not covered by thesize
feature.For more information on this distinction, see the [
size
feature documentation]( https://docs.microsoft.com/en-us/typography/opentype/spec/features_ptinvalid @link
{@link .org.freedesktop.harfbuzz.Tag
- Parameters:
face
-hb_face_t
to 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:
true
if data found,false
otherwise
-
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_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- The index of the requested script taglanguageIndex
- The index of the requested language tagfeatureTag
-hb_tag_t
of the feature tag requestedfeatureIndex
- The index of the requested feature- Returns:
true
if the feature is found,false
otherwise
-
otLayoutLanguageGetFeatureIndexes
public static int otLayoutLanguageGetFeatureIndexes(Face face, Tag tableTag, int scriptIndex, int languageIndex, int startOffset, Out<int[]> featureIndexes) Fetches a list of all features in the specified face's GSUB table or GPOS table, underneath the specified script and language. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- 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.
-
otLayoutLanguageGetFeatureTags
public static int otLayoutLanguageGetFeatureTags(Face face, Tag tableTag, int scriptIndex, int languageIndex, int startOffset, Out<Tag[]> featureTags) Fetches a list of all features in the specified face's GSUB table or GPOS table, underneath the specified script and language. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- 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_t
feature tags found for the query- Returns:
- Total number of feature tags.
-
otLayoutLanguageGetRequiredFeature
public static Bool otLayoutLanguageGetRequiredFeature(Face face, Tag tableTag, int scriptIndex, int languageIndex, Out<Integer> featureIndex, Tag featureTag) Fetches the tag of a requested feature index in the given face's GSUB or GPOS table, underneath the specified script and language.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- The index of the requested script taglanguageIndex
- The index of the requested language tagfeatureIndex
- The index of the requested featurefeatureTag
- Thehb_tag_t
of the requested feature- Returns:
true
if the feature is found,false
otherwise
-
otLayoutLanguageGetRequiredFeatureIndex
public static Bool otLayoutLanguageGetRequiredFeatureIndex(Face face, Tag tableTag, int scriptIndex, int languageIndex, Out<Integer> featureIndex) Fetches the index of a requested feature in the given face's GSUB or GPOS table, underneath the specified script and language.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- The index of the requested script taglanguageIndex
- The index of the requested language tagfeatureIndex
- The index of the requested feature- Returns:
true
if the feature is found,false
otherwise
-
otLayoutLookupCollectGlyphs
public static void otLayoutLookupCollectGlyphs(Face face, Tag tableTag, int lookupIndex, Set glyphsBefore, Set glyphsInput, Set glyphsAfter, Set glyphsOutput) Fetches a list of all glyphs affected by the specified lookup in the specified face's GSUB table or GPOS table.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
lookupIndex
- 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
-
otLayoutLookupGetGlyphAlternates
public static int otLayoutLookupGetGlyphAlternates(Face face, int lookupIndex, Codepoint glyph, int startOffset, Out<Codepoint[]> alternateGlyphs) Fetches alternates of a glyph from a given GSUB lookup index.- 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.
-
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.
-
otLayoutLookupSubstituteClosure
Compute the transitive closure of glyphs needed for a specified lookup.- Parameters:
face
-hb_face_t
to work uponlookupIndex
- index of the feature lookup to queryglyphs
- Array of glyphs comprising the transitive closure of the lookup
-
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_t
to 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_t
indicating whether pre-/post-context are disallowed in substitutions- Returns:
true
if a substitution would be triggered,false
otherwise
-
otLayoutLookupsSubstituteClosure
Compute the transitive closure of glyphs needed for all of the provided lookups.- Parameters:
face
-hb_face_t
to work uponlookups
- The set of lookups to queryglyphs
- Array of glyphs comprising the transitive closure of the lookups
-
otLayoutScriptFindLanguage
@Deprecated public static Bool otLayoutScriptFindLanguage(Face face, Tag tableTag, int scriptIndex, Tag languageTag, MemorySegment languageIndex) Deprecated.Fetches the index of a given language tag in the specified face's GSUB table or GPOS table, underneath the specified script tag.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- The index of the requested script taglanguageTag
- Thehb_tag_t
of the requested languagelanguageIndex
- The index of the requested language- Returns:
true
if the language tag is found,false
otherwise
-
otLayoutScriptGetLanguageTags
public static int otLayoutScriptGetLanguageTags(Face face, Tag tableTag, int scriptIndex, int startOffset, Out<Tag[]> languageTags) Fetches a list of language tags in the given face's GSUB or GPOS table, underneath the specified script index. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- 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.
-
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 fomlanguageTags
that is present in the specified face's GSUB or GPOS table, underneath the specified script index.If none of the given language tags is found,
false
is returned andlanguageIndex
is set to the default language index.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- 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:
true
if one of the given language tags is found,false
otherwise
-
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 fomlanguageTags
that is present in the specified face's GSUB or GPOS table, underneath the specified script index.If none of the given language tags is found,
false
is returned andlanguageIndex
is set toHB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX
andchosenLanguage
is set toHB_TAG_NONE
.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptIndex
- 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_t
of the chosen language- Returns:
true
if one of the given language tags is found,false
otherwise
-
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_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptTags
- Array ofhb_tag_t
script tagsscriptIndex
- The index of the chosen scriptchosenScript
-hb_tag_t
of the chosen script
-
otLayoutTableFindFeatureVariations
public static Bool otLayoutTableFindFeatureVariations(Face face, Tag tableTag, MemorySegment coords, int numCoords, Out<Integer> variationsIndex) Fetches a list of feature variations in the specified face's GSUB table or GPOS table, at the specified variation coordinates.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
coords
- The variation coordinates to querynumCoords
- The number of variation coordinatesvariationsIndex
- The array of feature variations found for the query- Returns:
true
if feature variations were found,false
otherwise.
-
otLayoutTableFindScript
public static Bool otLayoutTableFindScript(Face face, Tag tableTag, Tag scriptTag, Out<Integer> scriptIndex) Fetches the index if a given script tag in the specified face's GSUB table or GPOS table.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptTag
-hb_tag_t
of the script tag requestedscriptIndex
- The index of the requested script tag- Returns:
true
if the script is found,false
otherwise
-
otLayoutTableGetFeatureTags
public static int otLayoutTableGetFeatureTags(Face face, Tag tableTag, int startOffset, Out<Tag[]> featureTags) Fetches a list of all feature tags in the given face's GSUB or GPOS table. Note that there might be duplicate feature tags, belonging to different script/language-system pairs of the table.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
startOffset
- offset of the first feature tag to retrievefeatureTags
- Array of feature tags found in the table- Returns:
- Total number of feature tags.
-
otLayoutTableGetLookupCount
-
otLayoutTableGetScriptTags
public static int otLayoutTableGetScriptTags(Face face, Tag tableTag, int startOffset, Out<Tag[]> scriptTags) Fetches a list of all scripts enumerated in the specified face's GSUB table or GPOS table. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
startOffset
- offset of the first script tag to retrievescriptTags
- The array ofhb_tag_t
script tags found for the query- Returns:
- Total number of script tags.
-
otLayoutTableSelectScript
public static Bool otLayoutTableSelectScript(Face face, Tag tableTag, int scriptCount, Tag scriptTags, @Nullable @Nullable Out<Integer> scriptIndex, @Nullable @Nullable Tag chosenScript) Selects an OpenType script fortableTag
from thescriptTags
array.If the table does not have any of the requested scripts, then
DFLT
,dflt
, andlatn
tags are tried in that order. If the table still does not have any of these scripts,scriptIndex
is set toHB_OT_LAYOUT_NO_SCRIPT_INDEX
andchosenScript
is set toHB_TAG_NONE
.- Parameters:
face
-hb_face_t
to work upontableTag
-HB_OT_TAG_GSUB
orHB_OT_TAG_GPOS
scriptCount
- Number of script tags in the arrayscriptTags
- Array ofhb_tag_t
script tagsscriptIndex
- The index of the requested scriptchosenScript
-hb_tag_t
of the requested script- Returns:
true
if one of the requested scripts is selected,false
if a fallback script is selected or if no scripts are selected.
-
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_DOWN
orHB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT
, then the return value is an integer between 0 and 100 representing that percentage.- Parameters:
font
-hb_font_t
to work uponconstant
-hb_ot_math_constant_t
the constant to retrieve- Returns:
- the requested constant or zero
-
otMathGetGlyphAssembly
public static int otMathGetGlyphAssembly(Font font, Codepoint glyph, Direction direction, int startOffset, 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_t
glyph parts that can be used to draw the glyph and an italics-correction value (if one is defined in the font).<note>The
direction
parameter is only used to select between horizontal or vertical directions for the construction. Even though allhb_direction_t
values are accepted, only the result ofHB_DIRECTION_IS_HORIZONTAL
is considered.</note>- Parameters:
font
-hb_font_t
to 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
-
otMathGetGlyphItalicsCorrection
Fetches an italics-correction value (if one exists) for the specified glyph index.- Parameters:
font
-hb_font_t
to work uponglyph
- The glyph index from which to retrieve the value- Returns:
- the italics correction of the glyph or zero
-
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_t
to work uponglyph
- The glyph index from which to retrieve the valuekern
- Thehb_ot_math_kern_t
from which to retrieve the valuecorrectionHeight
- the correction height to use to determine the kerning.- Returns:
- requested kerning value or zero
-
otMathGetGlyphKernings
public static int otMathGetGlyphKernings(Font font, Codepoint glyph, OtMathKern kern, int startOffset, 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_t
structs.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
n
defined kern values (wheren
> 0), there are onlyn
−1 defined 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_t
actually 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_t
to work uponglyph
- The glyph index from which to retrieve the kerningskern
- Thehb_ot_math_kern_t
from 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
-
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
MathTopAccentAttachment
table (or, whenfont
has noMathTopAccentAttachment
table or noMATH
table, any glyph) - the function synthesizes a value, returning the position at one-half the glyph's advance width.- Parameters:
font
-hb_font_t
to work 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
-
otMathGetGlyphVariants
public static int otMathGetGlyphVariants(Font font, Codepoint glyph, Direction direction, int startOffset, 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_t
structs.<note>The
direction
parameter is only used to select between horizontal or vertical directions for the construction. Even though allhb_direction_t
values are accepted, only the result ofHB_DIRECTION_IS_HORIZONTAL
is considered.</note>- Parameters:
font
-hb_font_t
to 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
-
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
direction
parameter is only used to select between horizontal or vertical directions for the construction. Even though allhb_direction_t
values are accepted, only the result ofHB_DIRECTION_IS_HORIZONTAL
is considered.</note>- Parameters:
font
-hb_font_t
to work upondirection
- direction of the stretching (horizontal or vertical)- Returns:
- requested minimum connector overlap or zero
-
otMathHasData
-
otMathIsGlyphExtendedShape
-
otMetaGetEntryTags
-
otMetaReferenceEntry
-
otMetricsGetPosition
public static Bool otMetricsGetPosition(Font font, OtMetricsTag metricsTag, @Nullable @Nullable Position position) Fetches metrics value corresponding tometricsTag
fromfont
.- Parameters:
font
- anhb_font_t
object.metricsTag
- tag of metrics value you like to fetch.position
- result of metrics value from the font.- Returns:
- Whether found the requested metrics in the font.
-
otMetricsGetPositionWithFallback
public static void otMetricsGetPositionWithFallback(Font font, OtMetricsTag metricsTag, @Nullable @Nullable Position position) Fetches metrics value corresponding tometricsTag
fromfont
, and synthesizes a value if it the value is missing in the font.- Parameters:
font
- anhb_font_t
object.metricsTag
- tag of metrics value you like to fetch.position
- result of metrics value from the font.
-
otMetricsGetVariation
Fetches metrics value corresponding tometricsTag
fromfont
with the current font variation settings applied.- Parameters:
font
- anhb_font_t
object.metricsTag
- tag of metrics value you like to fetch.- Returns:
- The requested metric value.
-
otMetricsGetXVariation
Fetches horizontal metrics value corresponding tometricsTag
fromfont
with the current font variation settings applied.- Parameters:
font
- anhb_font_t
object.metricsTag
- tag of metrics value you like to fetch.- Returns:
- The requested metric value.
-
otMetricsGetYVariation
Fetches vertical metrics value corresponding tometricsTag
fromfont
with the current font variation settings applied.- Parameters:
font
- anhb_font_t
object.metricsTag
- tag of metrics value you like to fetch.- Returns:
- The requested metric value.
-
otNameGetUtf16
Fetches a font name from the OpenType 'name' table. Iflanguage
isHB_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.
-
otNameGetUtf32
Fetches a font name from the OpenType 'name' table. Iflanguage
isHB_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.
-
otNameGetUtf8
Fetches a font name from the OpenType 'name' table. Iflanguage
isHB_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.
-
otShapeGlyphsClosure
Computes the transitive closure of glyphs needed for a specified input buffer under the given font and feature list. The closure is computed as a set, not as a list.- Parameters:
font
-hb_font_t
to work uponbuffer
- The input buffer to compute fromfeatures
- The features enabled on the bufferglyphs
- Thehb_set_t
set of glyphs comprising the transitive closure of the query
-
otShapePlanCollectLookups
Computes the complete set of GSUB or GPOS lookups that are applicable under a givenshapePlan
.- Parameters:
shapePlan
-hb_shape_plan_t
to querytableTag
- GSUB or GPOSlookupIndexes
- Thehb_set_t
set of lookups returned
-
otTagFromLanguage
Deprecated.use hb_ot_tags_from_script_and_language() insteadConverts anhb_language_t
to anhb_tag_t
.- Parameters:
language
- anhb_language_t
to convert.
-
otTagToLanguage
-
otTagToScript
-
otTagsFromScript
Deprecated.use hb_ot_tags_from_script_and_language() insteadConverts anhb_script_t
to script tags.- Parameters:
script
- anhb_script_t
to convert.scriptTag1
- outputhb_tag_t
.scriptTag2
- outputhb_tag_t
.
-
otTagsToScriptAndLanguage
public static void otTagsToScriptAndLanguage(Tag scriptTag, Tag languageTag, @Nullable @Nullable Out<Script> script, @Nullable @Nullable Language language) Converts a script tag and a language tag to anhb_script_t
and anhb_language_t
.- Parameters:
scriptTag
- a script taglanguageTag
- a language tagscript
- thehb_script_t
corresponding toscriptTag
.language
- thehb_language_t
corresponding toscriptTag
andlanguageTag
.
-
otVarFindAxis
@Deprecated public static Bool otVarFindAxis(Face face, Tag axisTag, MemorySegment axisIndex, OtVarAxis axisInfo) Deprecated.- use hb_ot_var_find_axis_info() instead
Fetches the variation-axis information corresponding to the specified axis tag in the specified face.- Parameters:
face
-hb_face_t
to work uponaxisTag
- Thehb_tag_t
of the variation axis to queryaxisIndex
- The index of the variation axisaxisInfo
- Thehb_ot_var_axis_info_t
of the axis tag queried
-
otVarFindAxisInfo
Fetches the variation-axis information corresponding to the specified axis tag in the specified face.- Parameters:
face
-hb_face_t
to work uponaxisTag
- Thehb_tag_t
of the variation axis to queryaxisInfo
- Thehb_ot_var_axis_info_t
of the axis tag queried- Returns:
true
if data found,false
otherwise
-
otVarGetAxes
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_t
to work uponstartOffset
- offset of the first lookup to retrieveaxesArray
- The array of variation axes found
-
otVarGetAxisCount
Fetches the number of OpenType variation axes included in the face.- Parameters:
face
- Thehb_face_t
to work on- Returns:
- the number of variation axes defined
-
otVarGetAxisInfos
Fetches a list of all variation axes in the specified face. The list returned will begin at the offset provided.- Parameters:
face
-hb_face_t
to work uponstartOffset
- offset of the first lookup to retrieveaxesArray
- The array of variation axes found- Returns:
- the number of variation axes in the face
-
otVarGetNamedInstanceCount
Fetches the number of named instances included in the face.- Parameters:
face
- Thehb_face_t
to work on- Returns:
- the number of named instances defined
-
otVarHasData
-
otVarNamedInstanceGetDesignCoords
public static int otVarNamedInstanceGetDesignCoords(Face face, int instanceIndex, Out<float[]> coords) Fetches the design-space coordinates corresponding to the given named instance in the face.- Parameters:
face
- Thehb_face_t
to 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
-
otVarNamedInstanceGetPostscriptNameId
Fetches thename
table Name ID that provides display names for the "PostScript name" defined for the given named instance in the face.- Parameters:
face
- Thehb_face_t
to work oninstanceIndex
- The index of the named instance to query- Returns:
- the Name ID found for the PostScript name
-
otVarNamedInstanceGetSubfamilyNameId
Fetches thename
table Name ID that provides display names for the "Subfamily name" defined for the given named instance in the face.- Parameters:
face
- Thehb_face_t
to work oninstanceIndex
- The index of the named instance to query- Returns:
- the Name ID found for the Subfamily name
-
otVarNormalizeCoords
public static void otVarNormalizeCoords(Face face, int coordsLength, MemorySegment designCoords, Out<Integer> normalizedCoords) Normalizes the given design-space coordinates. The minimum and maximum values for the axis are mapped to the interval [-1,1], with the default axis value mapped to 0.The normalized values have 14 bits of fixed-point sub-integer precision as per OpenType specification.
Any additional scaling defined in the face's
avar
table is also applied, as described at https://docs.microsoft.com/en-us/typography/opentype/spec/avar- Parameters:
face
- Thehb_face_t
to work oncoordsLength
- The length of the coordinate arraydesignCoords
- The design-space coordinates to normalizenormalizedCoords
- The normalized coordinates
-
otVarNormalizeVariations
public static void otVarNormalizeVariations(Face face, Variation variations, int variationsLength, Out<int[]> coords) Normalizes all of the coordinates in the given list of variation axes.- Parameters:
face
- Thehb_face_t
to work onvariations
- The array of variations to normalizevariationsLength
- The number of variations to normalizecoords
- The array of normalized coordinates
-
paintColor
public static void paintColor(PaintFuncs funcs, @Nullable @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
-
paintColorGlyph
public static Bool paintColorGlyph(PaintFuncs funcs, @Nullable @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
-
paintCustomPaletteColor
public static Bool paintCustomPaletteColor(PaintFuncs funcs, @Nullable @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:
true
if found,false
otherwise
-
paintFuncsCreate
Creates a newhb_paint_funcs_t
structure of paint functions.The initial reference count of 1 should be released with hb_paint_funcs_destroy() when you are done using the
hb_paint_funcs_t
. This function never returnsNULL
. If memory cannot be allocated, a special singletonhb_paint_funcs_t
object will be returned.- Returns:
- the paint-functions structure
-
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
-
paintFuncsGetEmpty
Fetches the singleton empty paint-functions structure.- Returns:
- The empty paint-functions structure
-
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
-
paintFuncsIsImmutable
Tests whether a paint-functions structure is immutable.- Parameters:
funcs
- The paint-functions structure- Returns:
true
iffuncs
is immutable,false
otherwise
-
paintFuncsMakeImmutable
Makes a paint-functions structure immutable.After this call, all attempts to set one of the callbacks on
funcs
will fail.- Parameters:
funcs
- The paint-functions structure
-
paintFuncsReference
Increases the reference count on a paint-functions structure.This prevents
funcs
from being destroyed until a matching call to hb_paint_funcs_destroy() is made.- Parameters:
funcs
- The paint-functions structure- Returns:
- The paint-functions structure
-
paintFuncsSetColorFunc
public static void paintFuncsSetColorFunc(PaintFuncs funcs, PaintColorFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the paint-color callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The paint-color callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetColorGlyphFunc
public static void paintFuncsSetColorGlyphFunc(PaintFuncs funcs, PaintColorGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the color-glyph callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The color-glyph callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetCustomPaletteColorFunc
public static void paintFuncsSetCustomPaletteColorFunc(PaintFuncs funcs, PaintCustomPaletteColorFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the custom-palette-color callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The custom-palette-color callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetImageFunc
public static void paintFuncsSetImageFunc(PaintFuncs funcs, PaintImageFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the paint-image callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The paint-image callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetLinearGradientFunc
public static void paintFuncsSetLinearGradientFunc(PaintFuncs funcs, PaintLinearGradientFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the linear-gradient callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The linear-gradient callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPopClipFunc
public static void paintFuncsSetPopClipFunc(PaintFuncs funcs, PaintPopClipFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the pop-clip callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The pop-clip callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPopGroupFunc
public static void paintFuncsSetPopGroupFunc(PaintFuncs funcs, PaintPopGroupFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the pop-group callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The pop-group callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPopTransformFunc
public static void paintFuncsSetPopTransformFunc(PaintFuncs funcs, PaintPopTransformFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the pop-transform callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The pop-transform callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPushClipGlyphFunc
public static void paintFuncsSetPushClipGlyphFunc(PaintFuncs funcs, PaintPushClipGlyphFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the push-clip-glyph callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The push-clip-glyph callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPushClipRectangleFunc
public static void paintFuncsSetPushClipRectangleFunc(PaintFuncs funcs, PaintPushClipRectangleFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the push-clip-rect callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The push-clip-rectangle callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPushGroupFunc
public static void paintFuncsSetPushGroupFunc(PaintFuncs funcs, PaintPushGroupFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the push-group callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The push-group callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetPushTransformFunc
public static void paintFuncsSetPushTransformFunc(PaintFuncs funcs, PaintPushTransformFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the push-transform callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The push-transform callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetRadialGradientFunc
public static void paintFuncsSetRadialGradientFunc(PaintFuncs funcs, PaintRadialGradientFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the radial-gradient callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The radial-gradient callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetSweepGradientFunc
public static void paintFuncsSetSweepGradientFunc(PaintFuncs funcs, PaintSweepGradientFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the sweep-gradient callback on the paint functions struct.- Parameters:
funcs
- A paint functions structfunc
- The sweep-gradient callbackuserData
- Data to pass tofunc
destroy
- Function to call whenuserData
is no longer needed
-
paintFuncsSetUserData
public static Bool paintFuncsSetUserData(PaintFuncs funcs, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
paintImage
public static void paintImage(PaintFuncs funcs, @Nullable @Nullable MemorySegment paintData, Blob image, int width, int height, Tag format, float slant, @Nullable @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
- the synthetic slant ratio to be applied to the image during renderingextents
- the extents of the glyph
-
paintLinearGradient
public static void paintLinearGradient(PaintFuncs funcs, @Nullable @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
-
paintPopClip
Perform a "pop-clip" paint operation.- Parameters:
funcs
- paint functionspaintData
- associated data passed by the caller
-
paintPopGroup
public static void paintPopGroup(PaintFuncs funcs, @Nullable @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
-
paintPopTransform
Perform a "pop-transform" paint operation.- Parameters:
funcs
- paint functionspaintData
- associated data passed by the caller
-
paintPushClipGlyph
public static void paintPushClipGlyph(PaintFuncs funcs, @Nullable @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
-
paintPushClipRectangle
public static void paintPushClipRectangle(PaintFuncs funcs, @Nullable @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
-
paintPushGroup
Perform a "push-group" paint operation.- Parameters:
funcs
- paint functionspaintData
- associated data passed by the caller
-
paintPushTransform
public static void paintPushTransform(PaintFuncs funcs, @Nullable @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
-
paintRadialGradient
public static void paintRadialGradient(PaintFuncs funcs, @Nullable @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
-
paintSweepGradient
public static void paintSweepGradient(PaintFuncs funcs, @Nullable @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
-
scriptFromIso15924Tag
-
scriptFromString
Converts a stringstr
representing 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_t
corresponding to the ISO 15924 tag.
-
scriptGetHorizontalDirection
Fetches thehb_direction_t
of 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 horizontally or vertically will returnHB_DIRECTION_INVALID
. Unknown scripts will returnHB_DIRECTION_LTR
.- Parameters:
script
- Thehb_script_t
to query- Returns:
- The horizontal
hb_direction_t
ofscript
-
scriptToIso15924Tag
-
segmentPropertiesEqual
Checks the equality of twohb_segment_properties_t
's.- Parameters:
a
- firsthb_segment_properties_t
to compare.b
- secondhb_segment_properties_t
to compare.- Returns:
true
if all properties ofa
equal those ofb
,false
otherwise.
-
segmentPropertiesHash
Creates a hash representingp
.- Parameters:
p
-hb_segment_properties_t
to hash.- Returns:
- A hash of
p
.
-
segmentPropertiesOverlay
Fills in missing fields ofp
fromsrc
in a considered manner.First, if
p
does not have direction set, direction is copied fromsrc
.Next, if
p
andsrc
have the same direction (which can be unset), ifp
does not have script set, script is copied fromsrc
.Finally, if
p
andsrc
have the same direction and script (which either can be unset), ifp
does not have language set, language is copied fromsrc
.- Parameters:
p
-hb_segment_properties_t
to fill in.src
-hb_segment_properties_t
to fill in from.
-
setAdd
-
setAddRange
-
setAddSortedArray
-
setAllocationSuccessful
-
setClear
-
setCopy
-
setCreate
-
setDel
-
setDelRange
Removes all of the elements fromfirst
tolast
(inclusive) fromset
.If
last
isHB_SET_VALUE_INVALID
, then all values greater than or equal tofirst
are removed.- Parameters:
set
- A setfirst
- The first element to remove fromset
last
- The final element to remove fromset
-
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
-
setGetEmpty
-
setGetMax
-
setGetMin
-
setGetPopulation
Returns the number of elements in the set.- Parameters:
set
- A set- Returns:
- The population of
set
-
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
-
setHas
-
setHash
Creates a hash representingset
.- Parameters:
set
- A set- Returns:
- A hash of
set
.
-
setIntersect
-
setInvert
-
setIsEmpty
-
setIsEqual
-
setIsInverted
-
setIsSubset
-
setNext
Fetches the next element inset
that is greater than current value ofcodepoint
.Set
codepoint
toHB_SET_VALUE_INVALID
to get started.- Parameters:
set
- A setcodepoint
- Input = Code point to query Output = Code point retrieved- Returns:
true
if there was a next value,false
otherwise
-
setNextMany
Finds the next element inset
that is greater thancodepoint
. Writes out codepoints toout
, until either the set runs out of elements, orsize
codepoints are written, whichever comes first.- Parameters:
set
- A setcodepoint
- Outputting codepoints starting after this one. UseHB_SET_VALUE_INVALID
to get started.out
- An array of codepoints to write to.- Returns:
- the number of values written.
-
setNextRange
Fetches the next consecutive range of elements inset
that are greater than current value oflast
.Set
last
toHB_SET_VALUE_INVALID
to 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:
true
if there was a next range,false
otherwise
-
setPrevious
Fetches the previous element inset
that is lower than current value ofcodepoint
.Set
codepoint
toHB_SET_VALUE_INVALID
to get started.- Parameters:
set
- A setcodepoint
- Input = Code point to query Output = Code point retrieved- Returns:
true
if there was a previous value,false
otherwise
-
setPreviousRange
Fetches the previous consecutive range of elements inset
that are greater than current value oflast
.Set
first
toHB_SET_VALUE_INVALID
to 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:
true
if there was a previous range,false
otherwise
-
setReference
-
setSet
-
setSetUserData
public static Bool setSetUserData(Set set, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
setSubtract
-
setSymmetricDifference
-
setUnion
-
shape
Shapesbuffer
usingfont
turning its Unicode characters content to positioned glyphs. Iffeatures
is notNULL
, it will be used to control the features applied during shaping. If twofeatures
have the same tag but overlapping ranges the value of the feature with the higher index takes precedence.- Parameters:
font
- anhb_font_t
to use for shapingbuffer
- anhb_buffer_t
to shapefeatures
- an array of user specifiedhb_feature_t
orNULL
-
shapeFull
public static Bool shapeFull(Font font, Buffer buffer, @Nullable @Nullable Feature[] features, @Nullable @Nullable String[] shaperList) See hb_shape() for details. IfshaperList
is notNULL
, the specified shapers will be used in the given order, otherwise the default shapers list will be used.- Parameters:
font
- anhb_font_t
to use for shapingbuffer
- anhb_buffer_t
to shapefeatures
- an array of user specifiedhb_feature_t
orNULL
shaperList
- aNULL
-terminated array of shapers to use orNULL
- Returns:
- false if all shapers failed, true otherwise
-
shapeJustify
public static Bool shapeJustify(Font font, Buffer buffer, @Nullable @Nullable Feature[] features, @Nullable @Nullable String[] shaperList, float minTargetAdvance, float maxTargetAdvance, Out<Float> advance, Tag varTag, Out<Float> varValue) See hb_shape_full() for basic details. IfshaperList
is notNULL
, the specified shapers will be used in the given order, otherwise the default shapers list will be used.In addition, justify the shaping results such that the shaping results reach the target advance width/height, depending on the buffer direction.
If the advance of the buffer shaped with hb_shape_full() is already known, put that in *advance. Otherwise set *advance to zero.
This API is currently experimental and will probably change in the future.
- Parameters:
font
- a mutablehb_font_t
to use for shapingbuffer
- anhb_buffer_t
to shapefeatures
- an array of user specifiedhb_feature_t
orNULL
shaperList
- aNULL
-terminated array of shapers to use orNULL
minTargetAdvance
- Minimum advance width/height to aim for.maxTargetAdvance
- Maximum advance width/height to aim for.advance
- Input/output advance width/height of the buffer.varTag
- Variation-axis tag used for justification.varValue
- Variation-axis value used to reach target justification.- Returns:
- false if all shapers failed, true otherwise
XSince: EXPERIMENTAL
-
shapeListShapers
Retrieves the list of shapers supported by HarfBuzz.- Returns:
- an array of constant strings
-
shapePlanCreate
public static ShapePlan shapePlanCreate(Face face, SegmentProperties props, Feature[] userFeatures, String[] shaperList) Constructs a shaping plan for a combination offace
,userFeatures
,props
, andshaperList
.- Parameters:
face
-hb_face_t
to useprops
- Thehb_segment_properties_t
of the segmentuserFeatures
- The list of user-selected featuresshaperList
- List of shapers to try- Returns:
- The shaping plan
-
shapePlanCreate2
public static ShapePlan shapePlanCreate2(Face face, SegmentProperties props, Feature[] userFeatures, int[] coords, String[] 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_t
to useprops
- Thehb_segment_properties_t
of the segmentuserFeatures
- The list of user-selected featurescoords
- The list of variation-space coordinatesshaperList
- List of shapers to try- Returns:
- The shaping plan
-
shapePlanCreateCached
public static ShapePlan shapePlanCreateCached(Face face, SegmentProperties props, Feature[] userFeatures, String[] shaperList) Creates a cached shaping plan suitable for reuse, for a combination offace
,userFeatures
,props
, andshaperList
.- Parameters:
face
-hb_face_t
to useprops
- Thehb_segment_properties_t
of the segmentuserFeatures
- The list of user-selected featuresshaperList
- List of shapers to try- Returns:
- The shaping plan
-
shapePlanCreateCached2
public static ShapePlan shapePlanCreateCached2(Face face, SegmentProperties props, Feature[] userFeatures, int[] coords, String[] 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_t
to useprops
- Thehb_segment_properties_t
of the segmentuserFeatures
- The list of user-selected featurescoords
- The list of variation-space coordinatesshaperList
- List of shapers to try- Returns:
- The shaping plan
-
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
-
shapePlanExecute
public static Bool shapePlanExecute(ShapePlan shapePlan, Font font, Buffer buffer, Feature[] features) Executes the given shaping plan on the specified buffer, using the givenfont
andfeatures
.- Parameters:
shapePlan
- A shaping planfont
- Thehb_font_t
to usebuffer
- Thehb_buffer_t
to work uponfeatures
- Features to enable- Returns:
true
if success,false
otherwise.
-
shapePlanGetEmpty
Fetches the singleton empty shaping plan.- Returns:
- The empty shaping plan
-
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
-
shapePlanReference
-
shapePlanSetUserData
public static Bool shapePlanSetUserData(ShapePlan shapePlan, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise.
-
styleGetValue
Searches variation axes of ahb_font_t
object for a specific axis first, if not set, then tries to get default style values from different tables of the font.- Parameters:
font
- ahb_font_t
object.styleTag
- a style tag.- Returns:
- Corresponding axis or default value to a style tag.
-
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_t
corresponding tostr
-
tagToString
Converts anhb_tag_t
to a string and returns it inbuf
. Strings will be four characters long.- Parameters:
tag
-hb_tag_t
to convertbuf
- Converted string
-
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_t
ofunicode
-
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:
true
ifa
andb
composed,false
otherwise
-
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 ofab
b
- The second code point of the decomposition ofab
- Returns:
true
ifab
was decomposed,false
otherwise
-
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
.
-
unicodeEastasianWidth
Deprecated.Don't use. Not used by HarfBuzz.- Parameters:
ufuncs
- a Unicode-function structureunicode
- The code point to query
-
unicodeFuncsCreate
Creates a newhb_unicode_funcs_t
structure of Unicode functions.- Parameters:
parent
- Parent Unicode-functions structure- Returns:
- The Unicode-functions structure
-
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
-
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_t
Unicode-functions structure
-
unicodeFuncsGetEmpty
Fetches the singleton empty Unicode-functions structure.- Returns:
- The empty Unicode-functions structure
-
unicodeFuncsGetParent
Fetches the parent of the Unicode-functions structureufuncs
.- Parameters:
ufuncs
- The Unicode-functions structure- Returns:
- The parent Unicode-functions structure
-
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
-
unicodeFuncsIsImmutable
Tests whether the specified Unicode-functions structure is immutable.- Parameters:
ufuncs
- The Unicode-functions structure- Returns:
true
ifufuncs
is immutable,false
otherwise
-
unicodeFuncsMakeImmutable
Makes the specified Unicode-functions structure immutable.- Parameters:
ufuncs
- The Unicode-functions structure
-
unicodeFuncsReference
Increases the reference count on a Unicode-functions structure.- Parameters:
ufuncs
- The Unicode-functions structure- Returns:
- The Unicode-functions structure
-
unicodeFuncsSetCombiningClassFunc
public static void unicodeFuncsSetCombiningClassFunc(UnicodeFuncs ufuncs, UnicodeCombiningClassFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_combining_class_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetComposeFunc
public static void unicodeFuncsSetComposeFunc(UnicodeFuncs ufuncs, UnicodeComposeFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_compose_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetDecomposeCompatibilityFunc
@Deprecated public static void unicodeFuncsSetDecomposeCompatibilityFunc(UnicodeFuncs ufuncs, UnicodeDecomposeCompatibilityFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Deprecated.Sets the implementation function forhb_unicode_decompose_compatibility_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetDecomposeFunc
public static void unicodeFuncsSetDecomposeFunc(UnicodeFuncs ufuncs, UnicodeDecomposeFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_decompose_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetEastasianWidthFunc
@Deprecated public static void unicodeFuncsSetEastasianWidthFunc(UnicodeFuncs ufuncs, UnicodeEastasianWidthFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Deprecated.Sets the implementation function forhb_unicode_eastasian_width_func_t
.- Parameters:
ufuncs
- a Unicode-function structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetGeneralCategoryFunc
public static void unicodeFuncsSetGeneralCategoryFunc(UnicodeFuncs ufuncs, UnicodeGeneralCategoryFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_general_category_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetMirroringFunc
public static void unicodeFuncsSetMirroringFunc(UnicodeFuncs ufuncs, UnicodeMirroringFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_mirroring_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetScriptFunc
public static void unicodeFuncsSetScriptFunc(UnicodeFuncs ufuncs, UnicodeScriptFunc func, @Nullable @Nullable MemorySegment userData, @Nullable @Nullable DestroyFunc destroy) Sets the implementation function forhb_unicode_script_func_t
.- Parameters:
ufuncs
- A Unicode-functions structurefunc
- The callback function to assignuserData
- Data to pass tofunc
destroy
- The function to call whenuserData
is not needed anymore
-
unicodeFuncsSetUserData
public static Bool unicodeFuncsSetUserData(UnicodeFuncs ufuncs, UserDataKey key, @Nullable @Nullable MemorySegment data, @Nullable @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 whendata
is not needed anymorereplace
- Whether to replace an existing data with the same key- Returns:
true
if success,false
otherwise
-
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_t
ofunicode
-
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_t
of the Mirroring Glyph forunicode
-
unicodeScript
Retrieves thehb_script_t
script to which code pointunicode
belongs.- Parameters:
ufuncs
- The Unicode-functions structureunicode
- The code point to query- Returns:
- The
hb_script_t
ofunicode
-
variationFromString
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_t
to initialize with the parsed values- Returns:
true
ifstr
is successfully parsed,false
otherwise
-
variationToString
Converts anhb_variation_t
into 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.- Parameters:
variation
- anhb_variation_t
to convertbuf
- output string
-