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

  • blob_create_from_file(file_name: string): blob_t
  • blob_create_sub_blob(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

  • blob_get_data(blob: blob_t): string[]
  • blob_get_data_writable(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[]

  • blob_get_length(blob: blob_t): number
  • blob_make_immutable(blob: blob_t): void
  • buffer_add(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

  • buffer_add_codepoints(buffer: buffer_t, text: number[], item_offset: number, item_length: 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.

    • item_offset: number

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

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

  • buffer_add_latin1(buffer: buffer_t, text: Uint8Array, item_offset: number, item_length: 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.

    • item_offset: number

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

    • item_length: number

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

    Returns void

  • buffer_add_utf16(buffer: buffer_t, text: number[], item_offset: number, item_length: 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.

    • item_offset: number

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

    • item_length: number

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

    Returns void

  • buffer_add_utf32(buffer: buffer_t, text: number[], item_offset: number, item_length: 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.

    • item_offset: number

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

    • item_length: number

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

    Returns void

  • buffer_add_utf8(buffer: buffer_t, text: Uint8Array, item_offset: number, item_length: 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.

    • item_offset: number

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

    • item_length: number

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

    Returns void

  • buffer_append(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

  • buffer_clear_contents(buffer: buffer_t): 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.

    • dottedcircle_glyph: number

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

    • position_fuzz: number

      allowed absolute difference in position values.

    Returns buffer_diff_flags_t

  • buffer_get_length(buffer: buffer_t): number
  • buffer_guess_segment_properties(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

  • buffer_normalize_glyphs(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

  • buffer_reverse_clusters(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

  • buffer_reverse_range(buffer: buffer_t, start: number, end: number): 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

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

  • buffer_serialize_list_formats(): 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]

  • 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

  • buffer_set_invisible_glyph(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

  • buffer_set_replacement_codepoint(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

  • color_get_alpha(color: number): number
  • color_get_blue(color: number): number
  • color_get_green(color: number): number
  • color_get_red(color: number): 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

  • face_collect_variation_selectors(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

  • face_collect_variation_unicodes(face: face_t, variation_selector: 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

    • variation_selector: number

      The Variation Selector to query

    • out: set_t

      The set to add Unicode characters to

    Returns void

  • face_count(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

  • face_get_glyph_count(face: face_t): number
  • face_get_index(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

  • face_get_table_tags(face: face_t, start_offset: 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

    • start_offset: number

      The index of first table tag to retrieve

    Returns [number, tag_t[]]

  • face_get_upem(face: face_t): number
  • face_make_immutable(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

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

    Parameters

    • face: face_t

      A face object

    • glyph_count: number

      The glyph-count value to assign

    Returns void

  • face_set_index(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

  • face_set_upem(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]

  • feature_to_string(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[]

  • font_get_glyph_advances_for_direction(font: font_t, direction: direction_t, count: number, first_glyph: number, glyph_stride: number, first_advance: number, advance_stride: number): void
  • font_get_glyph_h_advances(font: font_t, count: number, first_glyph: number, glyph_stride: number, first_advance: number, advance_stride: number): void
  • font_get_glyph_h_kerning(font: font_t, left_glyph: number, right_glyph: number): position_t
  • font_get_glyph_name(font: font_t, glyph: number, name: string[]): bool_t
  • font_get_glyph_v_advances(font: font_t, count: number, first_glyph: number, glyph_stride: number, first_advance: number, advance_stride: number): void
  • font_get_glyph_v_kerning(font: font_t, top_glyph: number, bottom_glyph: number): position_t
  • font_get_nominal_glyphs(font: font_t, count: number, first_unicode: number, unicode_stride: number, first_glyph: number, glyph_stride: number): number
  • font_get_ppem(font: font_t): [number, number]
  • font_get_ptem(font: font_t): number
  • font_get_scale(font: font_t): [number, number]
  • font_get_var_coords_normalized(font: font_t, length: number): number
  • font_glyph_to_string(font: font_t, glyph: number, s: string[]): void
  • font_make_immutable(font: font_t): void
  • font_set_funcs_data(font: font_t, font_data: object): void
  • font_set_ppem(font: font_t, x_ppem: number, y_ppem: number): void
  • font_set_ptem(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

  • font_set_scale(font: font_t, x_scale: number, y_scale: number): void
  • font_set_var_coords_design(font: font_t, coords: number, coords_length: number): void
  • font_set_var_coords_normalized(font: font_t, coords: number, coords_length: number): void
  • font_set_var_named_instance(font: font_t, instance_index: number): void
  • font_set_variations(font: font_t, variations: variation_t, variations_length: number): void
  • ft_font_changed(font: font_t): void
  • ft_font_get_load_flags(font: font_t): number
  • ft_font_set_funcs(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

  • ft_font_set_load_flags(font: font_t, load_flags: number): void
  • ft_font_unlock_face(font: font_t): void
  • 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

  • map_clear(map: map_t): void
  • map_del(map: map_t, key: number): void
  • map_get_population(map: map_t): number
  • map_set(map: map_t, key: number, value: number): void
  • ot_color_glyph_get_layers(face: face_t, glyph: number, start_offset: number): [number, ot_color_layer_t[] | null]
  • 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

    • start_offset: number

      offset of the first layer to retrieve

    Returns [number, ot_color_layer_t[] | null]

  • ot_color_glyph_reference_png(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

  • ot_color_glyph_reference_svg(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

  • 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

    • color_index: number

      The index of the color

    Returns ot_name_id_t

  • ot_color_palette_get_colors(face: face_t, palette_index: number, start_offset: 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

    • palette_index: number

      the index of the color palette to query

    • start_offset: number

      offset of the first color to retrieve

    Returns [number, color_t[] | null]

  • ot_color_palette_get_count(face: face_t): 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

    • palette_index: number

      The index of the color palette

    Returns ot_name_id_t

  • ot_font_set_funcs(font: font_t): void
  • ot_layout_collect_features(face: face_t, table_tag: 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

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

  • ot_layout_collect_lookups(face: face_t, table_tag: 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

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

  • ot_layout_feature_get_characters(face: face_t, table_tag: number, feature_index: number, start_offset: 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

    • table_tag: number

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

    • feature_index: number

      index of feature to query.

    • start_offset: number

      offset of the first character to retrieve

    Returns [number, codepoint_t[]]

  • ot_layout_feature_get_lookups(face: face_t, table_tag: number, feature_index: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • feature_index: number

      The index of the requested feature

    • start_offset: number

      offset of the first lookup to retrieve

    Returns [number, number[]]

  • ot_layout_feature_with_variations_get_lookups(face: face_t, table_tag: number, feature_index: number, variations_index: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • feature_index: number

      The index of the feature to query

    • variations_index: number

      The index of the feature variation to query

    • start_offset: number

      offset of the first lookup to retrieve

    Returns [number, number[]]

  • ot_layout_get_attach_points(face: face_t, glyph: number, start_offset: 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

    • start_offset: number

      offset of the first attachment point to retrieve

    Returns [number, number[]]

  • 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

    • start_offset: 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]

  • ot_layout_language_find_feature(face: face_t, table_tag: number, script_index: number, language_index: number, feature_tag: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • language_index: number

      The index of the requested language tag

    • feature_tag: number

      #hb_tag_t of the feature tag requested

    Returns [bool_t, number]

  • ot_layout_language_get_feature_indexes(face: face_t, table_tag: number, script_index: number, language_index: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • language_index: number

      The index of the requested language tag

    • start_offset: number

      offset of the first feature tag to retrieve

    Returns [number, number[]]

  • ot_layout_language_get_feature_tags(face: face_t, table_tag: number, script_index: number, language_index: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • language_index: number

      The index of the requested language tag

    • start_offset: number

      offset of the first feature tag to retrieve

    Returns [number, tag_t[]]

  • ot_layout_language_get_required_feature(face: face_t, table_tag: number, script_index: number, language_index: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • language_index: number

      The index of the requested language tag

    Returns [bool_t, number, tag_t]

  • ot_layout_language_get_required_feature_index(face: face_t, table_tag: number, script_index: number, language_index: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • lookup_index: number

      The index of the feature lookup to query

    Returns [set_t, set_t, set_t, set_t]

  • ot_layout_lookup_get_glyph_alternates(face: face_t, lookup_index: number, glyph: number, start_offset: number): [number, codepoint_t[]]
  • Fetches alternates of a glyph from a given GSUB lookup index.

    Parameters

    • face: face_t

      a face.

    • lookup_index: number

      index of the feature lookup to query.

    • glyph: number

      a glyph id.

    • start_offset: number

      starting offset.

    Returns [number, codepoint_t[]]

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

    Parameters

    • face: face_t

      #hb_face_t to work upon

    • lookup_index: number

      index of the feature lookup to query

    Returns set_t

  • ot_layout_lookup_would_substitute(face: face_t, lookup_index: number, glyphs: number, glyphs_length: number, zero_context: 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

    • lookup_index: number

      The index of the lookup to query

    • glyphs: number

      The sequence of glyphs to query for substitution

    • glyphs_length: number

      The length of the glyph sequence

    • zero_context: number

      #hb_bool_t indicating whether substitutions should be context-free

    Returns bool_t

  • ot_layout_script_find_language(face: face_t, table_tag: number, script_index: number, language_tag: number, language_index: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • language_tag: number

      The #hb_tag_t of the requested language

    • language_index: number

      The index of the requested language

    Returns bool_t

  • ot_layout_script_get_language_tags(face: face_t, table_tag: number, script_index: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • start_offset: number

      offset of the first language tag to retrieve

    Returns [number, tag_t[]]

  • ot_layout_script_select_language(face: face_t, table_tag: number, script_index: number, language_count: number, language_tags: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_index: number

      The index of the requested script tag

    • language_count: number

      The number of languages in the specified script

    • language_tags: number

      The array of language tags

    Returns [bool_t, number]

  • ot_layout_table_choose_script(face: face_t, table_tag: number, script_tags: number): [bool_t, number, tag_t]
  • ot_layout_table_find_feature_variations(face: face_t, table_tag: number, coords: number, num_coords: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • coords: number

      The variation coordinates to query

    • num_coords: number

      The number of variation coordinates

    Returns [bool_t, number]

  • ot_layout_table_find_script(face: face_t, table_tag: number, script_tag: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • script_tag: number

      #hb_tag_t of the script tag requested

    Returns [bool_t, number]

  • ot_layout_table_get_feature_tags(face: face_t, table_tag: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • start_offset: number

      offset of the first feature tag to retrieve

    Returns [number, tag_t[]]

  • ot_layout_table_get_lookup_count(face: face_t, table_tag: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    Returns number

  • ot_layout_table_get_script_tags(face: face_t, table_tag: number, start_offset: 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

    • table_tag: number

      HB_OT_TAG_GSUB or HB_OT_TAG_GPOS

    • start_offset: number

      offset of the first script tag to retrieve

    Returns [number, tag_t[]]

  • ot_layout_table_select_script(face: face_t, table_tag: number, script_count: number, script_tags: 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)

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

    • correction_height: number

      the correction height to use to determine the kerning.

    Returns position_t

  • ot_math_get_glyph_top_accent_attachment(font: font_t, glyph: number): 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)

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

  • ot_math_is_glyph_extended_shape(face: face_t, glyph: number): bool_t
  • ot_name_get_utf16(face: face_t, name_id: 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.

    • name_id: number

      OpenType name identifier to fetch.

    • language: language_t

      language to fetch the name for.

    Returns [number, number[]]

  • ot_name_get_utf32(face: face_t, name_id: 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.

    • name_id: number

      OpenType name identifier to fetch.

    • language: language_t

      language to fetch the name for.

    Returns [number, number[]]

  • ot_name_get_utf8(face: face_t, name_id: 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.

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

  • ot_tags_from_script(script: script_t, script_tag_1: number, script_tag_2: 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.

    • script_count: number

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

    • language_count: number

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

    Returns [tag_t, tag_t]

  • ot_tags_to_script_and_language(script_tag: number, language_tag: 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

    • script_tag: number

      a script tag

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

    • axis_tag: number

      The #hb_tag_t of the variation axis to query

    • axis_index: number

      The index of the variation axis

    Returns [bool_t, ot_var_axis_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

    • start_offset: number

      offset of the first lookup to retrieve

    Returns [number, ot_var_axis_t[]]

  • ot_var_get_axis_count(face: face_t): 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

    • start_offset: number

      offset of the first lookup to retrieve

    Returns [number, ot_var_axis_info_t[]]

  • ot_var_get_named_instance_count(face: face_t): number
  • ot_var_named_instance_get_design_coords(face: face_t, instance_index: 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

    • instance_index: number

      The index of the named instance to query

    Returns [number, number[]]

  • ot_var_named_instance_get_postscript_name_id(face: face_t, instance_index: number): ot_name_id_t
  • 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

    • instance_index: number

      The index of the named instance to query

    Returns ot_name_id_t

  • ot_var_named_instance_get_subfamily_name_id(face: face_t, instance_index: number): 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

    • instance_index: number

      The index of the named instance to query

    Returns ot_name_id_t

  • ot_var_normalize_coords(face: face_t, coords_length: number, design_coords: 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

    • coords_length: number

      The length of the coordinate array

    • design_coords: number

      The design-space coordinates to normalize

    Returns number

  • ot_var_normalize_variations(face: face_t, variations: variation_t, variations_length: 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

    • variations_length: number

      The number of variations to normalize

    Returns number[]

  • script_from_iso15924_tag(tag: number): script_t
  • script_from_string(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

  • set_add(set: set_t, codepoint: number): void
  • set_add_range(set: set_t, first: number, last: number): void
  • set_clear(set: set_t): void
  • set_del(set: set_t, codepoint: number): void
  • set_del_range(set: set_t, first: number, last: number): void
  • set_get_population(set: set_t): number
  • set_invert(set: set_t): void
  • 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 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]

  • set_symmetric_difference(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

    • shaper_list: string[]

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

    Returns bool_t

  • shape_list_shapers(): string[]
  • 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

    • user_features: feature_t[]

      The list of user-selected features

    • coords: number[]

      The list of variation-space coordinates

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

    • user_features: feature_t[]

      The list of user-selected features

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

    • user_features: feature_t[]

      The list of user-selected features

    • coords: number[]

      The list of variation-space coordinates

    • shaper_list: string[]

      List of shapers to try

    Returns shape_plan_t

  • tag_from_string(str: Uint8Array): tag_t
  • tag_to_string(tag: number): Uint8Array
  • variation_to_string(variation: variation_t, buf: string, size: number): void
  • version(): [number, number, number]
  • version_atleast(major: number, minor: number, micro: number): bool_t
  • version_string(): 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