Gjsify LogoGjsify Logo

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

bool_t: number
codepoint_t: number
color_t: number
font_get_font_h_extents_func_t: font_get_font_extents_func_t
font_get_font_v_extents_func_t: font_get_font_extents_func_t
font_get_glyph_h_advance_func_t: font_get_glyph_advance_func_t
font_get_glyph_h_advances_func_t: font_get_glyph_advances_func_t
font_get_glyph_h_kerning_func_t: font_get_glyph_kerning_func_t
font_get_glyph_h_origin_func_t: font_get_glyph_origin_func_t
font_get_glyph_v_advance_func_t: font_get_glyph_advance_func_t
font_get_glyph_v_advances_func_t: font_get_glyph_advances_func_t
font_get_glyph_v_kerning_func_t: font_get_glyph_kerning_func_t
font_get_glyph_v_origin_func_t: font_get_glyph_origin_func_t
mask_t: number
ot_name_id_t: number
position_t: number
tag_t: number

Variables

AAT_LAYOUT_NO_SELECTOR_INDEX: number

Used when getting or setting AAT feature selectors. Indicates that there is no selector index corresponding to the selector of interest.

BUFFER_REPLACEMENT_CODEPOINT_DEFAULT: number

The default code point for replacing invalid characters in a given encoding. Set to U+FFFD REPLACEMENT CHARACTER.

FEATURE_GLOBAL_START: number
LANGUAGE_INVALID: language_t
MAP_VALUE_INVALID: codepoint_t
OT_LAYOUT_DEFAULT_LANGUAGE_INDEX: number
OT_LAYOUT_NO_FEATURE_INDEX: number
OT_LAYOUT_NO_SCRIPT_INDEX: number
OT_LAYOUT_NO_VARIATIONS_INDEX: number
OT_MAX_TAGS_PER_LANGUAGE: number
OT_MAX_TAGS_PER_SCRIPT: number
OT_VAR_NO_AXIS_INDEX: number
SET_VALUE_INVALID: codepoint_t
UNICODE_MAX: number
UNICODE_MAX_DECOMPOSITION_LEN: number

See Unicode 6.1 for details on the maximum decomposition length.

VERSION_MAJOR: number
VERSION_MICRO: number
VERSION_MINOR: number
VERSION_STRING: string

Functions

  • blobCreateFromFile(fileName: string): blob_t
  • blobCreateSubBlob(parent: blob_t, offset: number, length: number): blob_t
  • Returns a blob that represents a range of bytes in parent. The new blob is always created with %HB_MEMORY_MODE_READONLY, meaning that it will never modify data in the parent blob. The parent data is not expected to be modified, and will result in undefined behavior if it is.

    Makes parent immutable.

    Parameters

    • parent: blob_t

      Parent blob.

    • offset: number

      Start offset of sub-blob within parent, in bytes.

    • length: number

      Length of sub-blob.

    Returns blob_t

  • blobGetData(blob: blob_t): string[]
  • blobGetDataWritable(blob: blob_t): string[]
  • Tries to make blob data writable (possibly copying it) and return pointer to data.

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

    Parameters

    Returns string[]

  • blobGetLength(blob: blob_t): number
  • blobMakeImmutable(blob: blob_t): void
  • bufferAdd(buffer: buffer_t, codepoint: number, cluster: number): void
  • Appends a character with the Unicode value of codepoint to buffer, and gives it the initial cluster value of cluster. Clusters can be any thing the client wants, they are usually used to refer to the index of the character in the input text stream and are output in #hb_glyph_info_t.cluster field.

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

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • codepoint: number

      a Unicode code point.

    • cluster: number

      the cluster value of codepoint.

    Returns void

  • bufferAddCodepoints(buffer: buffer_t, text: number[], itemOffset: number, itemLength: number): void
  • Appends characters from text array to buffer. The item_offset is the position of the first character from text that will be appended, and item_length is the number of character. When shaping part of a larger text (e.g. a run of text from a paragraph), instead of passing just the substring corresponding to the run, it is preferable to pass the whole paragraph and specify the run start and length as item_offset and item_length, 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 code points.

    Parameters

    • buffer: buffer_t

      a #hb_buffer_t to append characters to.

    • text: number[]

      an array of Unicode code points to append.

    • itemOffset: number

      the offset of the first code point to add to the buffer.

    • itemLength: number

      the number of code points to add to the buffer, or -1 for the end of text (assuming it is %NULL terminated).

    Returns void

  • bufferAddLatin1(buffer: buffer_t, text: Uint8Array, itemOffset: number, itemLength: number): void
  • Similar to hb_buffer_add_codepoints(), but allows only access to first 256 Unicode code points that can fit in 8-bit strings.

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

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • text: Uint8Array

      an array of UTF-8 characters to append.

    • itemOffset: number

      the offset of the first character to add to the buffer.

    • itemLength: number

      the number of characters to add to the buffer, or -1 for the end of text (assuming it is %NULL terminated).

    Returns void

  • bufferAddUtf16(buffer: buffer_t, text: number[], itemOffset: number, itemLength: number): void
  • See hb_buffer_add_codepoints().

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

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • text: number[]

      an array of UTF-16 characters to append.

    • itemOffset: number

      the offset of the first character to add to the buffer.

    • itemLength: number

      the number of characters to add to the buffer, or -1 for the end of text (assuming it is %NULL terminated).

    Returns void

  • bufferAddUtf32(buffer: buffer_t, text: number[], itemOffset: number, itemLength: number): void
  • See hb_buffer_add_codepoints().

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

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • text: number[]

      an array of UTF-32 characters to append.

    • itemOffset: number

      the offset of the first character to add to the buffer.

    • itemLength: number

      the number of characters to add to the buffer, or -1 for the end of text (assuming it is %NULL terminated).

    Returns void

  • bufferAddUtf8(buffer: buffer_t, text: Uint8Array, itemOffset: number, itemLength: number): void
  • See hb_buffer_add_codepoints().

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

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • text: Uint8Array

      an array of UTF-8 characters to append.

    • itemOffset: number

      the offset of the first character to add to the buffer.

    • itemLength: number

      the number of characters to add to the buffer, or -1 for the end of text (assuming it is %NULL terminated).

    Returns void

  • bufferAppend(buffer: buffer_t, source: buffer_t, start: number, end: number): void
  • Append (part of) contents of another buffer to this buffer.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • source: buffer_t

      source #hb_buffer_t.

    • start: number

      start index into source buffer to copy. Use 0 to copy from start of buffer.

    • end: number

      end index into source buffer to copy. Use HB_FEATURE_GLOBAL_END to copy to end of buffer.

    Returns void

  • bufferClearContents(buffer: buffer_t): void
  • Similar to hb_buffer_reset(), but does not clear the Unicode functions and the replacement code point.

    Parameters

    Returns void

  • If dottedcircle_glyph is (hb_codepoint_t) -1 then %HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT and %HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT are never returned. This should be used by most callers if just comparing two buffers is needed.

    Parameters

    • buffer: buffer_t

      a buffer.

    • reference: buffer_t

      other buffer to compare to.

    • dottedcircleGlyph: number

      glyph id of U+25CC DOTTED CIRCLE, or (hb_codepont_t) -1.

    • positionFuzz: number

      allowed absolute difference in position values.

    Returns buffer_diff_flags_t

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

    Parameters

    Returns glyph_info_t[]

  • bufferGetLength(buffer: buffer_t): number
  • bufferGuessSegmentProperties(buffer: buffer_t): void
  • Sets unset buffer segment properties based on buffer Unicode contents. If buffer is not empty, it must have content type %HB_BUFFER_CONTENT_TYPE_UNICODE.

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

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

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

    Parameters

    Returns void

  • Returns whether buffer has glyph position data. A buffer gains position data when hb_buffer_get_glyph_positions() is called on it, and cleared of position data when hb_buffer_clear_contents() is called.

    Parameters

    Returns bool_t

  • bufferNormalizeGlyphs(buffer: buffer_t): void
  • Reorders a glyph buffer to have canonical in-cluster glyph order / position. The resulting clusters should behave identical to pre-reordering clusters.

    This has nothing to do with Unicode normalization.

    Parameters

    Returns void

  • Pre allocates memory for buffer to fit at least size number of items.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • size: number

      number of items to pre allocate.

    Returns bool_t

  • Resets the buffer to its initial status, as if it was just newly created with hb_buffer_create().

    Parameters

    Returns void

  • bufferReverseClusters(buffer: buffer_t): void
  • Reverses buffer clusters. That is, the buffer contents are reversed, then each cluster (consecutive items having the same cluster number) are reversed again.

    Parameters

    Returns void

  • bufferReverseRange(buffer: buffer_t, start: number, end: number): void
  • Reverses buffer contents between start to end.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • start: number

      start index.

    • end: number

      end index.

    Returns void

  • Serializes buffer into a textual representation of its content, whether Unicode codepoints or glyph identifiers and positioning information. This is useful for showing the contents of the buffer, for example during debugging. See the documentation of hb_buffer_serialize_unicode() and hb_buffer_serialize_glyphs() for a description of the output format.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t buffer.

    • start: number

      the first item in buffer to serialize.

    • end: number

      the last item in buffer to serialize.

    • font: font_t

      the #hb_font_t used to shape this buffer, needed to read glyph names and extents. If %NULL, and empty font will be used.

    • format: buffer_serialize_format_t

      the #hb_buffer_serialize_format_t to use for formatting the output.

    • flags: buffer_serialize_flags_t

      the #hb_buffer_serialize_flags_t that control what glyph properties to serialize.

    Returns [number, Uint8Array, number]

  • Parses a string into an #hb_buffer_serialize_format_t. Does not check if str is a valid buffer serialization format, use hb_buffer_serialize_list_formats() to get the list of supported formats.

    Parameters

    • str: Uint8Array

      a string to parse

    Returns buffer_serialize_format_t

  • Converts format to the string corresponding it, or %NULL if it is not a valid #hb_buffer_serialize_format_t.

    Parameters

    Returns string

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

    text

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

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

    json

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

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

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

    • g: the glyph name or glyph index if #HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set.
    • cl: #hb_glyph_info_t.cluster if #HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set.
    • dx,dy,ax,ay: #hb_glyph_position_t.x_offset, #hb_glyph_position_t.y_offset, #hb_glyph_position_t.x_advance and #hb_glyph_position_t.y_advance respectively, if #HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set.
    • xb,yb,w,h: #hb_glyph_extents_t.x_bearing, #hb_glyph_extents_t.y_bearing, #hb_glyph_extents_t.width and #hb_glyph_extents_t.height respectively if #HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t buffer.

    • start: number

      the first item in buffer to serialize.

    • end: number

      the last item in buffer to serialize.

    • font: font_t

      the #hb_font_t used to shape this buffer, needed to read glyph names and extents. If %NULL, and empty font will be used.

    • format: buffer_serialize_format_t

      the #hb_buffer_serialize_format_t to use for formatting the output.

    • flags: buffer_serialize_flags_t

      the #hb_buffer_serialize_flags_t that control what glyph properties to serialize.

    Returns [number, Uint8Array, number]

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

    text

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

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

    json

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

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

    For example:

    [{u:1617,cl:0},{u:1576,cl:1}]
    

    Parameters

    Returns [number, Uint8Array, number]

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

    Parameters

    Returns void

  • Set the text flow direction of the buffer. No shaping can happen without setting buffer direction, and it controls the visual direction for the output glyphs; for RTL direction the glyphs will be reversed. Many layout features depend on the proper setting of the direction, for example, reversing RTL text before shaping, then shaping with LTR direction is not the same as keeping the text in logical order and shaping with RTL direction.

    Parameters

    Returns void

  • bufferSetInvisibleGlyph(buffer: buffer_t, invisible: number): void
  • Sets the #hb_codepoint_t that replaces invisible characters in the shaping result. If set to zero (default), the glyph for the U+0020 SPACE character is used. Otherwise, this value is used verbatim.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • invisible: number

      the invisible #hb_codepoint_t

    Returns void

  • Sets the language of buffer to language.

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

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

    Parameters

    Returns void

  • Similar to hb_buffer_pre_allocate(), but clears any new items added at the end.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • length: number

      the new length of buffer.

    Returns bool_t

  • bufferSetReplacementCodepoint(buffer: buffer_t, replacement: number): void
  • Sets the #hb_codepoint_t that replaces invalid entries for a given encoding when adding text to buffer.

    Default is %HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT.

    Parameters

    • buffer: buffer_t

      an #hb_buffer_t.

    • replacement: number

      the replacement #hb_codepoint_t

    Returns void

  • Sets the script of buffer to script.

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

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

    Parameters

    Returns void

  • 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

    Returns void

  • colorGetAlpha(color: number): number
  • color: a #hb_color_t we are interested in its channels.

    Parameters

    • color: number

    Returns number

  • colorGetBlue(color: number): number
  • color: a #hb_color_t we are interested in its channels.

    Parameters

    • color: number

    Returns number

  • colorGetGreen(color: number): number
  • color: a #hb_color_t we are interested in its channels.

    Parameters

    • color: number

    Returns number

  • colorGetRed(color: number): number
  • color: a #hb_color_t we are interested in its channels.

    Parameters

    • color: number

    Returns number

  • Add table for tag with data provided by blob to the face. face must be created using hb_face_builder_create().

    Parameters

    • face: face_t

      A face object created with hb_face_builder_create()

    • tag: number

      The #hb_tag_t of the table to add

    • blob: blob_t

      The blob containing the table data to add

    Returns bool_t

  • Creates a #hb_face_t that can be used with hb_face_builder_add_table(). After tables are added to the face, it can be compiled to a binary font file by calling hb_face_reference_blob().

    Returns face_t

  • Collects all of the Unicode characters covered by face and adds them to the #hb_set_t set out.

    Parameters

    • face: face_t

      A face object

    • out: set_t

      The set to add Unicode characters to

    Returns void

  • faceCollectVariationSelectors(face: face_t, out: set_t): void
  • Collects all Unicode "Variation Selector" characters covered by face and adds them to the #hb_set_t set out.

    Parameters

    • face: face_t

      A face object

    • out: set_t

      The set to add Variation Selector characters to

    Returns void

  • faceCollectVariationUnicodes(face: face_t, variationSelector: number, out: set_t): void
  • Collects all Unicode characters for variation_selector covered by face and adds them to the #hb_set_t set out.

    Parameters

    • face: face_t

      A face object

    • variationSelector: number

      The Variation Selector to query

    • out: set_t

      The set to add Unicode characters to

    Returns void

  • faceCount(blob: blob_t): number
  • Constructs a new face object from the specified blob and a face index into that blob. This is used for blobs of file formats such as Dfont and TTC that can contain more than one face.

    Parameters

    • blob: blob_t

      #hb_blob_t to work upon

    • index: number

      The index of the face within blob

    Returns face_t

  • 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 user_data and reference_table_func, with the destroy callback.

    Parameters

    Returns face_t

  • faceGetGlyphCount(face: face_t): number
  • Fetches the glyph-count value of the specified face object.

    Parameters

    Returns number

  • faceGetIndex(face: face_t): number
  • Fetches the face-index corresponding to the given face.

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

    Parameters

    Returns number

  • faceGetTableTags(face: face_t, startOffset: number): [number, tag_t[]]
  • Fetches a list of all table tags for a face, if possible. The list returned will begin at the offset provided

    Parameters

    • face: face_t

      A face object

    • startOffset: number

      The index of first table tag to retrieve

    Returns [number, tag_t[]]

  • faceGetUpem(face: face_t): number
  • Fetches the units-per-em (upem) value of the specified face object.

    Parameters

    Returns number

  • faceMakeImmutable(face: face_t): void
  • Fetches a pointer to the binary blob that contains the specified face. Returns an empty blob if referencing face data is not possible.

    Parameters

    Returns blob_t

  • Fetches a reference to the specified table within the specified face.

    Parameters

    • face: face_t

      A face object

    • tag: number

      The #hb_tag_t of the table to query

    Returns blob_t

  • faceSetGlyphCount(face: face_t, glyphCount: number): void
  • Sets the glyph count for a face object to the specified value.

    Parameters

    • face: face_t

      A face object

    • glyphCount: number

      The glyph-count value to assign

    Returns void

  • faceSetIndex(face: face_t, index: number): void
  • Assigns the specified face-index to face. Fails if the face is immutable.

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

    Parameters

    • face: face_t

      A face object

    • index: number

      The index to assign

    Returns void

  • faceSetUpem(face: face_t, upem: number): void
  • Sets the units-per-em (upem) for a face object to the specified value.

    Parameters

    • face: face_t

      A face object

    • upem: number

      The units-per-em value to assign

    Returns void

  • Parses a string into a #hb_feature_t.

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

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

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

    Syntax Value Start End Setting value: kern 1 0 ∞ Turn feature on +kern 1 0 ∞ Turn feature on -kern 0 0 ∞ Turn feature off kern=0 0 0 ∞ Turn feature off kern=1 1 0 ∞ Turn feature on aalt=2 2 0 ∞ Choose 2nd alternate Setting index: kern[] 1 0 ∞ Turn feature on kern[:] 1 0 ∞ Turn feature on kern[5:] 1 5 ∞ Turn feature on, partial kern[:5] 1 0 5 Turn feature on, partial kern[3:5] 1 3 5 Turn feature on, range kern[3] 1 3 3+1 Turn feature on, single char Mixing it all: aalt[3:5]=2 2 3 5 Turn 2nd alternate on for range

    Parameters

    • str: Uint8Array

      a string to parse

    Returns [bool_t, feature_t]

  • featureToString(feature: feature_t): string[]
  • Converts a #hb_feature_t into a %NULL-terminated string in the format understood by hb_feature_from_string(). The client in responsible for allocating big enough size for buf, 128 bytes is more than enough.

    Parameters

    • feature: feature_t

      an #hb_feature_t to convert

    Returns string[]

  • fontGetGlyphAdvancesForDirection(font: font_t, direction: direction_t, count: number, firstGlyph: number, glyphStride: number, firstAdvance: number, advanceStride: number): void
  • fontGetGlyphHAdvances(font: font_t, count: number, firstGlyph: number, glyphStride: number, firstAdvance: number, advanceStride: number): void
  • Parameters

    • font: font_t
    • count: number
    • firstGlyph: number
    • glyphStride: number
    • firstAdvance: number
    • advanceStride: number

    Returns void

  • fontGetGlyphHKerning(font: font_t, leftGlyph: number, rightGlyph: number): position_t
  • fontGetGlyphName(font: font_t, glyph: number, name: string[]): bool_t
  • fontGetGlyphVAdvances(font: font_t, count: number, firstGlyph: number, glyphStride: number, firstAdvance: number, advanceStride: number): void
  • Parameters

    • font: font_t
    • count: number
    • firstGlyph: number
    • glyphStride: number
    • firstAdvance: number
    • advanceStride: number

    Returns void

  • fontGetGlyphVKerning(font: font_t, topGlyph: number, bottomGlyph: number): position_t
  • fontGetNominalGlyphs(font: font_t, count: number, firstUnicode: number, unicodeStride: number, firstGlyph: number, glyphStride: number): number
  • Parameters

    • font: font_t
    • count: number
    • firstUnicode: number
    • unicodeStride: number
    • firstGlyph: number
    • glyphStride: number

    Returns number

  • fontGetPpem(font: font_t): [number, number]
  • fontGetPtem(font: font_t): number
  • Gets the "point size" of the font. A value of 0 means unset.

    Parameters

    Returns number

  • fontGetScale(font: font_t): [number, number]
  • fontGetVarCoordsNormalized(font: font_t, length: number): number
  • Return value is valid as long as variation coordinates of the font are not modified.

    Parameters

    Returns number

  • fontGlyphToString(font: font_t, glyph: number, s: string[]): void
  • fontMakeImmutable(font: font_t): void
  • fontSetFuncsData(font: font_t, fontData: object): void
  • fontSetPpem(font: font_t, xPpem: number, yPpem: number): void
  • fontSetPtem(font: font_t, ptem: number): void
  • Sets "point size" of the font. Set to 0 to unset.

    There are 72 points in an inch.

    Parameters

    • font: font_t

      a font.

    • ptem: number

      font size in points.

    Returns void

  • fontSetScale(font: font_t, xScale: number, yScale: number): void
  • fontSetVarCoordsDesign(font: font_t, coords: number, coordsLength: number): void
  • fontSetVarCoordsNormalized(font: font_t, coords: number, coordsLength: number): void
  • fontSetVarNamedInstance(font: font_t, instanceIndex: number): void
  • Sets design coords of a font from a named instance index.

    Parameters

    • font: font_t

      a font.

    • instanceIndex: number

      named instance index.

    Returns void

  • fontSetVariations(font: font_t, variations: variation_t, variationsLength: number): void
  • ftFontChanged(font: font_t): void
  • ftFontGetLoadFlags(font: font_t): number
  • ftFontSetFuncs(font: font_t): void
  • Configures the font-functions structure of the specified #hb_font_t font object to use FreeType font functions.

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

    An #hb_face_t face object created with hb_ft_face_create() is preconfigured for FreeType font functions and does not require this function to be used.

    Note: Internally, this function creates an FT_Face.

    Parameters

    • font: font_t

      #hb_font_t to work upon

    Returns void

  • ftFontSetLoadFlags(font: font_t, loadFlags: number): void
  • ftFontUnlockFace(font: font_t): void
  • glibBlobCreate(gbytes: any): blob_t
  • Creates an #hb_blob_t blob from the specified GBytes data structure.

    Parameters

    • gbytes: any

      the GBytes structure to work upon

    Returns blob_t

  • Converts str representing a BCP 47 language tag to the corresponding #hb_language_t.

    Parameters

    • str: Uint8Array

      a string representing a BCP 47 language tag

    Returns language_t

  • Get default language from current locale.

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

    Returns language_t

  • mapClear(map: map_t): void
  • mapDel(map: map_t, key: number): void
  • mapGetPopulation(map: map_t): number
  • mapSet(map: map_t, key: number, value: number): void
  • 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: face_t

      #hb_face_t to work upon

    • glyph: number

      The glyph index to query

    • startOffset: number

      offset of the first layer to retrieve

    Returns [number, ot_color_layer_t[] | null]

  • otColorGlyphReferencePng(font: font_t, glyph: number): blob_t
  • 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 UPEM value must be set on the font object. If UPEM is unset, the blob returned will be the largest PNG available.

    Parameters

    • font: font_t

      #hb_font_t to work upon

    • glyph: number

      a glyph index

    Returns blob_t

  • otColorGlyphReferenceSvg(face: face_t, glyph: number): blob_t
  • Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • glyph: number

      a svg glyph index

    Returns blob_t

  • Tests whether a face has PNG glyph images (either in CBDT or sbix tables).

    Parameters

    • face: face_t

      #hb_face_t to work upon

    Returns bool_t

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

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

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • colorIndex: number

      The index of the color

    Returns ot_name_id_t

  • otColorPaletteGetColors(face: face_t, paletteIndex: number, startOffset: number): [number, color_t[] | null]
  • Fetches a list of the colors in a color palette.

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

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • paletteIndex: number

      the index of the color palette to query

    • startOffset: number

      offset of the first color to retrieve

    Returns [number, color_t[] | null]

  • otColorPaletteGetCount(face: face_t): number
  • Fetches the number of color palettes in a face.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    Returns number

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

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

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • paletteIndex: number

      The index of the color palette

    Returns ot_name_id_t

  • otFontSetFuncs(font: font_t): void
  • Sets the font functions to use when working with font.

    Parameters

    • font: font_t

      #hb_font_t to work upon

    Returns void

  • otLayoutCollectFeatures(face: face_t, tableTag: number, scripts: number, languages: number, features: number): set_t
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scripts: number

      The array of scripts to collect features for

    • languages: number

      The array of languages to collect features for

    • features: number

      The array of features to collect

    Returns set_t

  • otLayoutCollectLookups(face: face_t, tableTag: number, scripts: number, languages: number, features: number): set_t
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scripts: number

      The array of scripts to collect lookups for

    • languages: number

      The array of languages to collect lookups for

    • features: number

      The array of features to collect lookups for

    Returns set_t

  • otLayoutFeatureGetCharacters(face: face_t, tableTag: number, featureIndex: number, startOffset: number): [number, codepoint_t[]]
  • Fetches a list of the characters defined as having a variant under the specified "Character Variant" ("cvXX") feature tag.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      table tag to query, "GSUB" or "GPOS".

    • featureIndex: number

      index of feature to query.

    • startOffset: number

      offset of the first character to retrieve

    Returns [number, codepoint_t[]]

  • otLayoutFeatureGetLookups(face: face_t, tableTag: number, featureIndex: number, startOffset: number): [number, number[]]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • featureIndex: number

      The index of the requested feature

    • startOffset: number

      offset of the first lookup to retrieve

    Returns [number, number[]]

  • otLayoutFeatureWithVariationsGetLookups(face: face_t, tableTag: number, featureIndex: number, variationsIndex: number, startOffset: number): [number, number[]]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • featureIndex: number

      The index of the feature to query

    • variationsIndex: number

      The index of the feature variation to query

    • startOffset: number

      offset of the first lookup to retrieve

    Returns [number, number[]]

  • otLayoutGetAttachPoints(face: face_t, glyph: number, startOffset: number): [number, number[]]
  • 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: face_t

      The #hb_face_t to work on

    • glyph: number

      The #hb_codepoint_t code point to query

    • startOffset: number

      offset of the first attachment point to retrieve

    Returns [number, number[]]

  • Retrieves the set of all glyphs from the face that belong to the requested glyph class in the face's GDEF table.

    Parameters

    Returns set_t

  • 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.

    Parameters

    • font: font_t

      The #hb_font_t to work on

    • direction: direction_t

      The #hb_direction_t text direction to use

    • glyph: number

      The #hb_codepoint_t code point to query

    • startOffset: number

      offset of the first caret position to retrieve

    Returns [number, position_t[]]

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

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

    Parameters

    • face: face_t

      #hb_face_t to work upon

    Returns [bool_t, number, number, ot_name_id_t, number, number]

  • otLayoutLanguageFindFeature(face: face_t, tableTag: number, scriptIndex: number, languageIndex: number, featureTag: number): [bool_t, number]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageIndex: number

      The index of the requested language tag

    • featureTag: number

      #hb_tag_t of the feature tag requested

    Returns [bool_t, number]

  • otLayoutLanguageGetFeatureIndexes(face: face_t, tableTag: number, scriptIndex: number, languageIndex: number, startOffset: number): [number, number[]]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageIndex: number

      The index of the requested language tag

    • startOffset: number

      offset of the first feature tag to retrieve

    Returns [number, number[]]

  • otLayoutLanguageGetFeatureTags(face: face_t, tableTag: number, scriptIndex: number, languageIndex: number, startOffset: number): [number, tag_t[]]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageIndex: number

      The index of the requested language tag

    • startOffset: number

      offset of the first feature tag to retrieve

    Returns [number, tag_t[]]

  • otLayoutLanguageGetRequiredFeature(face: face_t, tableTag: number, scriptIndex: number, languageIndex: number): [bool_t, number, tag_t]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageIndex: number

      The index of the requested language tag

    Returns [bool_t, number, tag_t]

  • otLayoutLanguageGetRequiredFeatureIndex(face: face_t, tableTag: number, scriptIndex: number, languageIndex: number): [bool_t, number]
  • Fetches the index of a requested feature in the given face's GSUB or GPOS table, underneath the specified script and language.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageIndex: number

      The index of the requested language tag

    Returns [bool_t, number]

  • Fetches a list of all glyphs affected by the specified lookup in the specified face's GSUB table or GPOS table.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • lookupIndex: number

      The index of the feature lookup to query

    Returns [set_t, set_t, set_t, set_t]

  • otLayoutLookupGetGlyphAlternates(face: face_t, lookupIndex: number, glyph: number, startOffset: number): [number, codepoint_t[]]
  • Fetches alternates of a glyph from a given GSUB lookup index.

    Parameters

    • face: face_t

      a face.

    • lookupIndex: number

      index of the feature lookup to query.

    • glyph: number

      a glyph id.

    • startOffset: number

      starting offset.

    Returns [number, codepoint_t[]]

  • otLayoutLookupSubstituteClosure(face: face_t, lookupIndex: number): set_t
  • Compute the transitive closure of glyphs needed for a specified lookup.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • lookupIndex: number

      index of the feature lookup to query

    Returns set_t

  • otLayoutLookupWouldSubstitute(face: face_t, lookupIndex: number, glyphs: number, glyphsLength: number, zeroContext: number): bool_t
  • Tests whether a specified lookup in the specified face would trigger a substitution on the given glyph sequence.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • lookupIndex: number

      The index of the lookup to query

    • glyphs: number

      The sequence of glyphs to query for substitution

    • glyphsLength: number

      The length of the glyph sequence

    • zeroContext: number

      #hb_bool_t indicating whether substitutions should be context-free

    Returns bool_t

  • Compute the transitive closure of glyphs needed for all of the provided lookups.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • lookups: set_t

      The set of lookups to query

    Returns set_t

  • otLayoutScriptFindLanguage(face: face_t, tableTag: number, scriptIndex: number, languageTag: number, languageIndex: number): bool_t
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageTag: number

      The #hb_tag_t of the requested language

    • languageIndex: number

      The index of the requested language

    Returns bool_t

  • otLayoutScriptGetLanguageTags(face: face_t, tableTag: number, scriptIndex: number, startOffset: number): [number, tag_t[]]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • startOffset: number

      offset of the first language tag to retrieve

    Returns [number, tag_t[]]

  • otLayoutScriptSelectLanguage(face: face_t, tableTag: number, scriptIndex: number, languageCount: number, languageTags: number): [bool_t, number]
  • Fetches the index of a given language tag in the specified face's GSUB table or GPOS table, underneath the specified script index.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptIndex: number

      The index of the requested script tag

    • languageCount: number

      The number of languages in the specified script

    • languageTags: number

      The array of language tags

    Returns [bool_t, number]

  • otLayoutTableChooseScript(face: face_t, tableTag: number, scriptTags: number): [bool_t, number, tag_t]
  • Deprecated since 2.0.0

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptTags: number

      Array of #hb_tag_t script tags

    Returns [bool_t, number, tag_t]

  • otLayoutTableFindFeatureVariations(face: face_t, tableTag: number, coords: number, numCoords: number): [bool_t, number]
  • Fetches a list of feature variations in the specified face's GSUB table or GPOS table, at the specified variation coordinates.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • coords: number

      The variation coordinates to query

    • numCoords: number

      The number of variation coordinates

    Returns [bool_t, number]

  • otLayoutTableFindScript(face: face_t, tableTag: number, scriptTag: number): [bool_t, number]
  • Fetches the index if a given script tag in the specified face's GSUB table or GPOS table.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • scriptTag: number

      #hb_tag_t of the script tag requested

    Returns [bool_t, number]

  • otLayoutTableGetFeatureTags(face: face_t, tableTag: number, startOffset: number): [number, tag_t[]]
  • Fetches a list of all feature tags in the given face's GSUB or GPOS table.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • startOffset: number

      offset of the first feature tag to retrieve

    Returns [number, tag_t[]]

  • otLayoutTableGetLookupCount(face: face_t, tableTag: number): number
  • Fetches the total number of lookups enumerated in the specified face's GSUB table or GPOS table.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    Returns number

  • otLayoutTableGetScriptTags(face: face_t, tableTag: number, startOffset: number): [number, tag_t[]]
  • 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: face_t

      #hb_face_t to work upon

    • tableTag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • startOffset: number

      offset of the first script tag to retrieve

    Returns [number, tag_t[]]

  • otLayoutTableSelectScript(face: face_t, tableTag: number, scriptCount: number, scriptTags: number): [bool_t, number, tag_t]
  • Fetches the specified math constant. For most constants, the value returned is an #hb_position_t.

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

    Parameters

    Returns position_t

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

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

    Parameters

    • font: font_t

      #hb_font_t to work upon

    • glyph: number

      The index of the glyph to stretch

    • direction: direction_t

      direction of the stretching (horizontal or vertical)

    • startOffset: number

      offset of the first glyph part to retrieve

    Returns [number, ot_math_glyph_part_t[], position_t]

  • Fetches an italics-correction value (if one exists) for the specified glyph index.

    Parameters

    • font: font_t

      #hb_font_t to work upon

    • glyph: number

      The glyph index from which to retrieve the value

    Returns position_t

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

    If the MathKern table is found, the function examines it to find a height value that is greater or equal to correction_height. 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: font_t

      #hb_font_t to work upon

    • glyph: number

      The glyph index from which to retrieve the value

    • kern: ot_math_kern_t

      The #hb_ot_math_kern_t from which to retrieve the value

    • correctionHeight: number

      the correction height to use to determine the kerning.

    Returns position_t

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

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

    Parameters

    • font: font_t

      #hb_font_t to work upon

    • glyph: number

      The glyph index from which to retrieve the value

    Returns position_t

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

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

    Parameters

    • font: font_t

      #hb_font_t to work upon

    • glyph: number

      The index of the glyph to stretch

    • direction: direction_t

      The direction of the stretching (horizontal or vertical)

    • startOffset: number

      offset of the first variant to retrieve

    Returns [number, ot_math_glyph_variant_t[]]

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

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

    Parameters

    • font: font_t

      #hb_font_t to work upon

    • direction: direction_t

      direction of the stretching (horizontal or vertical)

    Returns position_t

  • otMathIsGlyphExtendedShape(face: face_t, glyph: number): bool_t
  • Tests whether the given glyph index is an extended shape in the face.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • glyph: number

      The glyph index to test

    Returns bool_t

  • otNameGetUtf16(face: face_t, nameId: number, language: language_t): [number, number[]]
  • Fetches a font name from the OpenType 'name' table. If language is #HB_LANGUAGE_INVALID, English ("en") is assumed. Returns string in UTF-16 encoding.

    Parameters

    • face: face_t

      font face.

    • nameId: number

      OpenType name identifier to fetch.

    • language: language_t

      language to fetch the name for.

    Returns [number, number[]]

  • otNameGetUtf32(face: face_t, nameId: number, language: language_t): [number, number[]]
  • Fetches a font name from the OpenType 'name' table. If language is #HB_LANGUAGE_INVALID, English ("en") is assumed. Returns string in UTF-32 encoding.

    Parameters

    • face: face_t

      font face.

    • nameId: number

      OpenType name identifier to fetch.

    • language: language_t

      language to fetch the name for.

    Returns [number, number[]]

  • otNameGetUtf8(face: face_t, nameId: number, language: language_t): [number, string[]]
  • Fetches a font name from the OpenType 'name' table. If language is #HB_LANGUAGE_INVALID, English ("en") is assumed. Returns string in UTF-8 encoding.

    Parameters

    • face: face_t

      font face.

    • nameId: number

      OpenType name identifier to fetch.

    • language: language_t

      language to fetch the name for.

    Returns [number, string[]]

  • Enumerates all available name IDs and language combinations. Returned array is owned by the face and should not be modified. It can be used as long as face is alive.

    Parameters

    Returns ot_name_entry_t[]

  • 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: font_t

      #hb_font_t to work upon

    • buffer: buffer_t

      The input buffer to compute from

    • features: feature_t[]

      The features enabled on the buffer

    Returns set_t

  • otTagsFromScript(script: script_t, scriptTag1: number, scriptTag2: number): void
  • Converts an #hb_script_t and an #hb_language_t to script and language tags.

    Parameters

    • script: script_t

      an #hb_script_t to convert.

    • language: language_t

      an #hb_language_t to convert.

    • scriptCount: number

      maximum number of script tags to retrieve (IN) and actual number of script tags retrieved (OUT)

    • languageCount: number

      maximum number of language tags to retrieve (IN) and actual number of language tags retrieved (OUT)

    Returns [tag_t, tag_t]

  • otTagsToScriptAndLanguage(scriptTag: number, languageTag: number, script: script_t, language: language_t): void
  • Converts a script tag and a language tag to an #hb_script_t and an #hb_language_t.

    Parameters

    • scriptTag: number

      a script tag

    • languageTag: number

      a language tag

    • script: script_t

      the #hb_script_t corresponding to script_tag (OUT).

    • language: language_t

      the #hb_language_t corresponding to script_tag and language_tag (OUT).

    Returns void

  • Fetches the variation-axis information corresponding to the specified axis tag in the specified face.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • axisTag: number

      The #hb_tag_t of the variation axis to query

    • axisIndex: number

      The index of the variation axis

    Returns [bool_t, ot_var_axis_t]

  • Fetches the variation-axis information corresponding to the specified axis tag in the specified face.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • axisTag: number

      The #hb_tag_t of the variation axis to query

    Returns [bool_t, ot_var_axis_info_t]

  • Fetches a list of all variation axes in the specified face. The list returned will begin at the offset provided.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • startOffset: number

      offset of the first lookup to retrieve

    Returns [number, ot_var_axis_t[]]

  • otVarGetAxisCount(face: face_t): number
  • Fetches the number of OpenType variation axes included in the face.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    Returns number

  • Fetches a list of all variation axes in the specified face. The list returned will begin at the offset provided.

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • startOffset: number

      offset of the first lookup to retrieve

    Returns [number, ot_var_axis_info_t[]]

  • otVarGetNamedInstanceCount(face: face_t): number
  • Fetches the number of named instances included in the face.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    Returns number

  • Tests whether a face includes any OpenType variation data in the fvar table.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    Returns bool_t

  • otVarNamedInstanceGetDesignCoords(face: face_t, instanceIndex: number): [number, number[]]
  • Fetches the design-space coordinates corresponding to the given named instance in the face.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    • instanceIndex: number

      The index of the named instance to query

    Returns [number, number[]]

  • Fetches the name table Name ID that provides display names for the "PostScript name" defined for the given named instance in the face.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    • instanceIndex: number

      The index of the named instance to query

    Returns ot_name_id_t

  • Fetches the name table Name ID that provides display names for the "Subfamily name" defined for the given named instance in the face.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    • instanceIndex: number

      The index of the named instance to query

    Returns ot_name_id_t

  • otVarNormalizeCoords(face: face_t, coordsLength: number, designCoords: number): number
  • 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.

    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: face_t

      The #hb_face_t to work on

    • coordsLength: number

      The length of the coordinate array

    • designCoords: number

      The design-space coordinates to normalize

    Returns number

  • otVarNormalizeVariations(face: face_t, variations: variation_t, variationsLength: number): number[]
  • Normalizes all of the coordinates in the given list of variation axes.

    Parameters

    • face: face_t

      The #hb_face_t to work on

    • variations: variation_t

      The array of variations to normalize

    • variationsLength: number

      The number of variations to normalize

    Returns number[]

  • scriptFromIso15924Tag(tag: number): script_t
  • Converts an ISO 15924 script tag to a corresponding #hb_script_t.

    Parameters

    • tag: number

      an #hb_tag_t representing an ISO 15924 tag.

    Returns script_t

  • scriptFromString(str: Uint8Array): script_t
  • Converts a string str representing an ISO 15924 script tag to a corresponding #hb_script_t. Shorthand for hb_tag_from_string() then hb_script_from_iso15924_tag().

    Parameters

    • str: Uint8Array

      a string representing an ISO 15924 tag.

    Returns script_t

  • setAdd(set: set_t, codepoint: number): void
  • setAddRange(set: set_t, first: number, last: number): void
  • setClear(set: set_t): void
  • setDel(set: set_t, codepoint: number): void
  • setDelRange(set: set_t, first: number, last: number): void
  • setGetPopulation(set: set_t): number
  • setInvert(set: set_t): void
  • Gets the next number in set that is greater than current value of codepoint.

    Set codepoint to %HB_SET_VALUE_INVALID to get started.

    Parameters

    • set: set_t

      a set.

    • codepoint: number

    Returns [bool_t, codepoint_t]

  • Gets the next consecutive range of numbers in set that are greater than current value of last.

    Set last to %HB_SET_VALUE_INVALID to get started.

    Parameters

    • set: set_t

      a set.

    • last: number

      input current last and output last codepoint in the range.

    Returns [bool_t, codepoint_t, codepoint_t]

  • Gets the previous number in set that is lower than current value of codepoint.

    Set codepoint to %HB_SET_VALUE_INVALID to get started.

    Parameters

    • set: set_t

      a set.

    • codepoint: number

    Returns [bool_t, codepoint_t]

  • Gets the previous consecutive range of numbers in set that are less than current value of first.

    Set first to %HB_SET_VALUE_INVALID to get started.

    Parameters

    • set: set_t

      a set.

    • first: number

      input current first and output first codepoint in the range.

    Returns [bool_t, codepoint_t, codepoint_t]

  • setSymmetricDifference(set: set_t, other: set_t): void
  • Shapes buffer using font turning its Unicode characters content to positioned glyphs. If features is not %NULL, it will be used to control the features applied during shaping. If two features have the same tag but overlapping ranges the value of the feature with the higher index takes precedence.

    Parameters

    • font: font_t

      an #hb_font_t to use for shaping

    • buffer: buffer_t

      an #hb_buffer_t to shape

    • features: feature_t[]

      an array of user specified #hb_feature_t or %NULL

    Returns void

  • See hb_shape() for details. If shaper_list is not %NULL, the specified shapers will be used in the given order, otherwise the default shapers list will be used.

    Parameters

    • font: font_t

      an #hb_font_t to use for shaping

    • buffer: buffer_t

      an #hb_buffer_t to shape

    • features: feature_t[]

      an array of user specified #hb_feature_t or %NULL

    • shaperList: string[]

      a %NULL-terminated array of shapers to use or %NULL

    Returns bool_t

  • shapeListShapers(): string[]
  • Constructs a shaping plan for a combination of face, user_features, props, and shaper_list.

    Parameters

    • face: face_t

      #hb_face_t to use

    • props: segment_properties_t

      The #hb_segment_properties_t of the segment

    • userFeatures: feature_t[]

      The list of user-selected features

    • shaperList: string[]

      List of shapers to try

    Returns shape_plan_t

  • The variable-font version of #hb_shape_plan_create. Constructs a shaping plan for a combination of face, user_features, props, and shaper_list, plus the variation-space coordinates coords.

    Parameters

    • face: face_t

      #hb_face_t to use

    • props: segment_properties_t

      The #hb_segment_properties_t of the segment

    • userFeatures: feature_t[]

      The list of user-selected features

    • coords: number[]

      The list of variation-space coordinates

    • shaperList: string[]

      List of shapers to try

    Returns shape_plan_t

  • Creates a cached shaping plan suitable for reuse, for a combination of face, user_features, props, and shaper_list.

    Parameters

    • face: face_t

      #hb_face_t to use

    • props: segment_properties_t

      The #hb_segment_properties_t of the segment

    • userFeatures: feature_t[]

      The list of user-selected features

    • shaperList: string[]

      List of shapers to try

    Returns shape_plan_t

  • The variable-font version of #hb_shape_plan_create_cached. Creates a cached shaping plan suitable for reuse, for a combination of face, user_features, props, and shaper_list, plus the variation-space coordinates coords.

    Parameters

    • face: face_t

      #hb_face_t to use

    • props: segment_properties_t

      The #hb_segment_properties_t of the segment

    • userFeatures: feature_t[]

      The list of user-selected features

    • coords: number[]

      The list of variation-space coordinates

    • shaperList: string[]

      List of shapers to try

    Returns shape_plan_t

  • tagFromString(str: Uint8Array): tag_t
  • tagToString(tag: number): Uint8Array
  • Composes the code point sequence a,``b by canonical equivalence into code point ab.

    Parameters

    • ufuncs: unicode_funcs_t

      The Unicode-functions structure

    • a: number

      The first code point to compose

    • b: number

      The second code point to compose

    Returns [bool_t, codepoint_t]

  • Fetches the compatibility decomposition of a Unicode code point. Deprecated.

    Parameters

    • ufuncs: unicode_funcs_t

      The Unicode-functions structure

    • u: number

      Code point to decompose

    Returns [number, codepoint_t]

  • Fetches a pointer to the default Unicode-functions structure that is used when no functions are explicitly set on #hb_buffer_t.

    Returns unicode_funcs_t

  • Retrieves the Bi-directional Mirroring Glyph code point defined for code point unicode.

    Parameters

    • ufuncs: unicode_funcs_t

      The Unicode-functions structure

    • unicode: number

      The code point to query

    Returns codepoint_t

  • Retrieves the #hb_script_t script to which code point unicode belongs.

    Parameters

    • ufuncs: unicode_funcs_t

      The Unicode-functions structure

    • unicode: number

      The code point to query

    Returns script_t

  • variationToString(variation: variation_t, buf: string, size: number): void
  • version(): [number, number, number]
  • Returns library version as three integer components.

    Returns [number, number, number]

  • versionAtleast(major: number, minor: number, micro: number): bool_t
  • versionString(): string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method