UNPKG

@girs/harfbuzz-0.0

Version:

GJS TypeScript type definitions for HarfBuzz-0.0, generated from library version 13.2.1

1,717 lines (1,621 loc) 375 kB
/** * Type Definitions for Gjs (https://gjs.guide/) * * These type definitions are automatically generated, do not edit them by hand. * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir * * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... */ import '@girs/gjs'; // Module dependencies import type freetype2 from '@girs/freetype2-2.0'; import type GObject from '@girs/gobject-2.0'; import type GLib from '@girs/glib-2.0'; export namespace HarfBuzz { /** * HarfBuzz-0.0 */ /** * Data type for holding HarfBuzz's clustering behavior options. The cluster level * dictates one aspect of how HarfBuzz will treat non-base characters * during shaping. * * In `HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES`, non-base * characters are merged into the cluster of the base character that precedes them. * There is also cluster merging every time the clusters will otherwise become non-monotone. * * In `HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS`, non-base characters are initially * assigned their own cluster values, which are not merged into preceding base * clusters. This allows HarfBuzz to perform additional operations like reorder * sequences of adjacent marks. The output is still monotone, but the cluster * values are more granular. * * In `HB_BUFFER_CLUSTER_LEVEL_CHARACTERS`, non-base characters are assigned their * own cluster values, which are not merged into preceding base clusters. Moreover, * the cluster values are not merged into monotone order. This is the most granular * cluster level, and it is useful for clients that need to know the exact cluster * values of each character, but is harder to use for clients, since clusters * might appear in any order. * * In `HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES`, non-base characters are merged into the * cluster of the base character that precedes them. This is similar to the Unicode * Grapheme Cluster algorithm, but it is not exactly the same. The output is * not forced to be monotone. This is useful for clients that want to use HarfBuzz * as a cheap implementation of the Unicode Grapheme Cluster algorithm. * * `HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES` is the default, because it maintains * backward compatibility with older versions of HarfBuzz. New client programs that * do not need to maintain such backward compatibility are recommended to use * `HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS` instead of the default. * @gir-type Enum * @since 0.9.42 */ enum buffer_cluster_level_t { /** * Return cluster values grouped by graphemes into * monotone order. */ MONOTONE_GRAPHEMES, /** * Return cluster values grouped into monotone order. */ MONOTONE_CHARACTERS, /** * Don't group cluster values. */ CHARACTERS, /** * Only group clusters, but don't enforce monotone order. */ GRAPHEMES, /** * Default cluster level, * equal to `HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES`. */ DEFAULT, } /** * The type of {@link HarfBuzz.buffer_t} contents. * @gir-type Enum */ enum buffer_content_type_t { /** * Initial value for new buffer. */ INVALID, /** * The buffer contains input characters (before shaping). */ UNICODE, /** * The buffer contains output glyphs (after shaping). */ GLYPHS, } /** * The direction of a text segment or buffer. * * A segment can also be tested for horizontal or vertical * orientation (irrespective of specific direction) with * HB_DIRECTION_IS_HORIZONTAL() or HB_DIRECTION_IS_VERTICAL(). * @gir-type Enum */ enum direction_t { /** * Initial, unset direction. */ INVALID, /** * Text is set horizontally from left to right. */ LTR, /** * Text is set horizontally from right to left. */ RTL, /** * Text is set vertically from top to bottom. */ TTB, /** * Text is set vertically from bottom to top. */ BTT, } /** * Data type holding the memory modes available to * client programs. * * Regarding these various memory-modes: * * - In no case shall the HarfBuzz client modify memory * that is passed to HarfBuzz in a blob. If there is * any such possibility, `HB_MEMORY_MODE_DUPLICATE` should be used * such that HarfBuzz makes a copy immediately, * * - Use `HB_MEMORY_MODE_READONLY` otherwise, unless you really really * really know what you are doing, * * - `HB_MEMORY_MODE_WRITABLE` is appropriate if you really made a * copy of data solely for the purpose of passing to * HarfBuzz and doing that just once (no reuse!), * * - If the font is `mmap()`ed, it's okay to use * `HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE`, however, using that mode * correctly is very tricky. Use `HB_MEMORY_MODE_READONLY` instead. * @gir-type Enum */ enum memory_mode_t { /** * HarfBuzz immediately makes a copy of the data. */ DUPLICATE, /** * HarfBuzz client will never modify the data, * and HarfBuzz will never modify the data. */ READONLY, /** * HarfBuzz client made a copy of the data solely * for HarfBuzz, so HarfBuzz may modify the data. */ WRITABLE, /** * See above */ READONLY_MAY_MAKE_WRITABLE, } /** * The GDEF classes defined for glyphs. * @gir-type Enum */ enum ot_layout_glyph_class_t { /** * Glyphs not matching the other classifications */ UNCLASSIFIED, /** * Spacing, single characters, capable of accepting marks */ BASE_GLYPH, /** * Glyphs that represent ligation of multiple characters */ LIGATURE, /** * Non-spacing, combining glyphs that represent marks */ MARK, /** * Spacing glyphs that represent part of a single character */ COMPONENT, } /** * The 'MATH' table constants, refer to * [OpenType documentation](https://docs.microsoft.com/en-us/typography/opentype/spec/math#mathconstants-table) * For more explanations. * @gir-type Enum * @since 1.3.3 */ enum ot_math_constant_t { /** * scriptPercentScaleDown */ SCRIPT_PERCENT_SCALE_DOWN, /** * scriptScriptPercentScaleDown */ SCRIPT_SCRIPT_PERCENT_SCALE_DOWN, /** * delimitedSubFormulaMinHeight */ DELIMITED_SUB_FORMULA_MIN_HEIGHT, /** * displayOperatorMinHeight */ DISPLAY_OPERATOR_MIN_HEIGHT, /** * mathLeading */ MATH_LEADING, /** * axisHeight */ AXIS_HEIGHT, /** * accentBaseHeight */ ACCENT_BASE_HEIGHT, /** * flattenedAccentBaseHeight */ FLATTENED_ACCENT_BASE_HEIGHT, /** * subscriptShiftDown */ SUBSCRIPT_SHIFT_DOWN, /** * subscriptTopMax */ SUBSCRIPT_TOP_MAX, /** * subscriptBaselineDropMin */ SUBSCRIPT_BASELINE_DROP_MIN, /** * superscriptShiftUp */ SUPERSCRIPT_SHIFT_UP, /** * superscriptShiftUpCramped */ SUPERSCRIPT_SHIFT_UP_CRAMPED, /** * superscriptBottomMin */ SUPERSCRIPT_BOTTOM_MIN, /** * superscriptBaselineDropMax */ SUPERSCRIPT_BASELINE_DROP_MAX, /** * subSuperscriptGapMin */ SUB_SUPERSCRIPT_GAP_MIN, /** * superscriptBottomMaxWithSubscript */ SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT, /** * spaceAfterScript */ SPACE_AFTER_SCRIPT, /** * upperLimitGapMin */ UPPER_LIMIT_GAP_MIN, /** * upperLimitBaselineRiseMin */ UPPER_LIMIT_BASELINE_RISE_MIN, /** * lowerLimitGapMin */ LOWER_LIMIT_GAP_MIN, /** * lowerLimitBaselineDropMin */ LOWER_LIMIT_BASELINE_DROP_MIN, /** * stackTopShiftUp */ STACK_TOP_SHIFT_UP, /** * stackTopDisplayStyleShiftUp */ STACK_TOP_DISPLAY_STYLE_SHIFT_UP, /** * stackBottomShiftDown */ STACK_BOTTOM_SHIFT_DOWN, /** * stackBottomDisplayStyleShiftDown */ STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN, /** * stackGapMin */ STACK_GAP_MIN, /** * stackDisplayStyleGapMin */ STACK_DISPLAY_STYLE_GAP_MIN, /** * stretchStackTopShiftUp */ STRETCH_STACK_TOP_SHIFT_UP, /** * stretchStackBottomShiftDown */ STRETCH_STACK_BOTTOM_SHIFT_DOWN, /** * stretchStackGapAboveMin */ STRETCH_STACK_GAP_ABOVE_MIN, /** * stretchStackGapBelowMin */ STRETCH_STACK_GAP_BELOW_MIN, /** * fractionNumeratorShiftUp */ FRACTION_NUMERATOR_SHIFT_UP, /** * fractionNumeratorDisplayStyleShiftUp */ FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP, /** * fractionDenominatorShiftDown */ FRACTION_DENOMINATOR_SHIFT_DOWN, /** * fractionDenominatorDisplayStyleShiftDown */ FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN, /** * fractionNumeratorGapMin */ FRACTION_NUMERATOR_GAP_MIN, /** * fractionNumDisplayStyleGapMin */ FRACTION_NUM_DISPLAY_STYLE_GAP_MIN, /** * fractionRuleThickness */ FRACTION_RULE_THICKNESS, /** * fractionDenominatorGapMin */ FRACTION_DENOMINATOR_GAP_MIN, /** * fractionDenomDisplayStyleGapMin */ FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN, /** * skewedFractionHorizontalGap */ SKEWED_FRACTION_HORIZONTAL_GAP, /** * skewedFractionVerticalGap */ SKEWED_FRACTION_VERTICAL_GAP, /** * overbarVerticalGap */ OVERBAR_VERTICAL_GAP, /** * overbarRuleThickness */ OVERBAR_RULE_THICKNESS, /** * overbarExtraAscender */ OVERBAR_EXTRA_ASCENDER, /** * underbarVerticalGap */ UNDERBAR_VERTICAL_GAP, /** * underbarRuleThickness */ UNDERBAR_RULE_THICKNESS, /** * underbarExtraDescender */ UNDERBAR_EXTRA_DESCENDER, /** * radicalVerticalGap */ RADICAL_VERTICAL_GAP, /** * radicalDisplayStyleVerticalGap */ RADICAL_DISPLAY_STYLE_VERTICAL_GAP, /** * radicalRuleThickness */ RADICAL_RULE_THICKNESS, /** * radicalExtraAscender */ RADICAL_EXTRA_ASCENDER, /** * radicalKernBeforeDegree */ RADICAL_KERN_BEFORE_DEGREE, /** * radicalKernAfterDegree */ RADICAL_KERN_AFTER_DEGREE, /** * radicalDegreeBottomRaisePercent */ RADICAL_DEGREE_BOTTOM_RAISE_PERCENT, } /** * The math kerning-table types defined for the four corners * of a glyph. * @gir-type Enum * @since 1.3.3 */ enum ot_math_kern_t { /** * The top right corner of the glyph. */ TOP_RIGHT, /** * The top left corner of the glyph. */ TOP_LEFT, /** * The bottom right corner of the glyph. */ BOTTOM_RIGHT, /** * The bottom left corner of the glyph. */ BOTTOM_LEFT, } /** * An enum type representing the pre-defined name IDs. * * For more information on these fields, see the * [OpenType spec](https://docs.microsoft.com/en-us/typography/opentype/spec/name#name-ids). * @gir-type Enum * @since 7.0.0 */ enum ot_name_id_predefined_t { /** * Copyright notice */ COPYRIGHT, /** * Font Family name */ FONT_FAMILY, /** * Font Subfamily name */ FONT_SUBFAMILY, /** * Unique font identifier */ UNIQUE_ID, /** * Full font name that reflects * all family and relevant subfamily descriptors */ FULL_NAME, /** * Version string */ VERSION_STRING, /** * PostScript name for the font */ POSTSCRIPT_NAME, /** * Trademark */ TRADEMARK, /** * Manufacturer Name */ MANUFACTURER, /** * Designer */ DESIGNER, /** * Description */ DESCRIPTION, /** * URL of font vendor */ VENDOR_URL, /** * URL of typeface designer */ DESIGNER_URL, /** * License Description */ LICENSE, /** * URL where additional licensing * information can be found */ LICENSE_URL, /** * Typographic Family name */ TYPOGRAPHIC_FAMILY, /** * Typographic Subfamily name */ TYPOGRAPHIC_SUBFAMILY, /** * Compatible Full Name for MacOS */ MAC_FULL_NAME, /** * Sample text */ SAMPLE_TEXT, /** * PostScript CID findfont name */ CID_FINDFONT_NAME, /** * WWS Family Name */ WWS_FAMILY, /** * WWS Subfamily Name */ WWS_SUBFAMILY, /** * Light Background Palette */ LIGHT_BACKGROUND, /** * Dark Background Palette */ DARK_BACKGROUND, /** * Variations PostScript Name Prefix */ VARIATIONS_PS_PREFIX, /** * Value to represent a nonexistent name ID. */ INVALID, } /** * The values of this enumeration describe the compositing modes * that can be used when combining temporary redirected drawing * with the backdrop. * * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) * section for details. * @gir-type Enum * @since 7.0.0 */ enum paint_composite_mode_t { /** * clear destination layer (bounded) */ CLEAR, /** * replace destination layer (bounded) */ SRC, /** * ignore the source */ DEST, /** * draw source layer on top of destination layer * (bounded) */ SRC_OVER, /** * draw destination on top of source */ DEST_OVER, /** * draw source where there was destination content * (unbounded) */ SRC_IN, /** * leave destination only where there was * source content (unbounded) */ DEST_IN, /** * draw source where there was no destination * content (unbounded) */ SRC_OUT, /** * leave destination only where there was no * source content */ DEST_OUT, /** * draw source on top of destination content and * only there */ SRC_ATOP, /** * leave destination on top of source content * and only there (unbounded) */ DEST_ATOP, /** * source and destination are shown where there is only * one of them */ XOR, /** * source and destination layers are accumulated */ PLUS, /** * source and destination are complemented and * multiplied. This causes the result to be at least as light as the lighter * inputs. */ SCREEN, /** * multiplies or screens, depending on the * lightness of the destination color. */ OVERLAY, /** * replaces the destination with the source if it * is darker, otherwise keeps the source. */ DARKEN, /** * replaces the destination with the source if it * is lighter, otherwise keeps the source. */ LIGHTEN, /** * brightens the destination color to reflect * the source color. */ COLOR_DODGE, /** * darkens the destination color to reflect * the source color. */ COLOR_BURN, /** * Multiplies or screens, dependent on source * color. */ HARD_LIGHT, /** * Darkens or lightens, dependent on source * color. */ SOFT_LIGHT, /** * Takes the difference of the source and * destination color. */ DIFFERENCE, /** * Produces an effect similar to difference, but * with lower contrast. */ EXCLUSION, /** * source and destination layers are multiplied. * This causes the result to be at least as dark as the darker inputs. */ MULTIPLY, /** * Creates a color with the hue of the source * and the saturation and luminosity of the target. */ HSL_HUE, /** * Creates a color with the saturation * of the source and the hue and luminosity of the target. Painting with * this mode onto a gray area produces no change. */ HSL_SATURATION, /** * Creates a color with the hue and saturation * of the source and the luminosity of the target. This preserves the gray * levels of the target and is useful for coloring monochrome images or * tinting color images. */ HSL_COLOR, /** * Creates a color with the luminosity of * the source and the hue and saturation of the target. This produces an * inverse effect to `HB_PAINT_COMPOSITE_MODE_HSL_COLOR`. */ HSL_LUMINOSITY, } /** * The values of this enumeration determine how color values * outside the minimum and maximum defined offset on a {@link HarfBuzz.color_line_t} * are determined. * * See the OpenType spec [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) * section for details. * @gir-type Enum * @since 7.0.0 */ enum paint_extend_t { /** * Outside the defined interval, * the color of the closest color stop is used. */ PAD, /** * The color line is repeated over * repeated multiples of the defined interval */ REPEAT, /** * The color line is repeated over * repeated intervals, as for the repeat mode. * However, in each repeated interval, the ordering of * color stops is the reverse of the adjacent interval. */ REFLECT, } /** * Data type for the Canonical_Combining_Class (ccc) property * from the Unicode Character Database. * * <note>Note: newer versions of Unicode may add new values. * Client programs should be ready to handle any value in the 0..254 range * being returned from `hb_unicode_combining_class()`.</note> * @gir-type Enum */ enum unicode_combining_class_t { /** * Spacing and enclosing marks; also many vowel and consonant signs, even if nonspacing */ NOT_REORDERED, /** * Marks which overlay a base letter or symbol */ OVERLAY, /** * Diacritic nukta marks in Brahmi-derived scripts */ NUKTA, /** * Hiragana/Katakana voicing marks */ KANA_VOICING, /** * Viramas */ VIRAMA, /** * [Hebrew] */ CCC10, /** * [Hebrew] */ CCC11, /** * [Hebrew] */ CCC12, /** * [Hebrew] */ CCC13, /** * [Hebrew] */ CCC14, /** * [Hebrew] */ CCC15, /** * [Hebrew] */ CCC16, /** * [Hebrew] */ CCC17, /** * [Hebrew] */ CCC18, /** * [Hebrew] */ CCC19, /** * [Hebrew] */ CCC20, /** * [Hebrew] */ CCC21, /** * [Hebrew] */ CCC22, /** * [Hebrew] */ CCC23, /** * [Hebrew] */ CCC24, /** * [Hebrew] */ CCC25, /** * [Hebrew] */ CCC26, /** * [Arabic] */ CCC27, /** * [Arabic] */ CCC28, /** * [Arabic] */ CCC29, /** * [Arabic] */ CCC30, /** * [Arabic] */ CCC31, /** * [Arabic] */ CCC32, /** * [Arabic] */ CCC33, /** * [Arabic] */ CCC34, /** * [Arabic] */ CCC35, /** * [Syriac] */ CCC36, /** * [Telugu] */ CCC84, /** * [Telugu] */ CCC91, /** * [Thai] */ CCC103, /** * [Thai] */ CCC107, /** * [Lao] */ CCC118, /** * [Lao] */ CCC122, /** * [Tibetan] */ CCC129, /** * [Tibetan] */ CCC130, /** * [Tibetan] Since: 7.2.0 */ CCC132, /** * Marks attached at the bottom left */ ATTACHED_BELOW_LEFT, /** * Marks attached directly below */ ATTACHED_BELOW, /** * Marks attached directly above */ ATTACHED_ABOVE, /** * Marks attached at the top right */ ATTACHED_ABOVE_RIGHT, /** * Distinct marks at the bottom left */ BELOW_LEFT, /** * Distinct marks directly below */ BELOW, /** * Distinct marks at the bottom right */ BELOW_RIGHT, /** * Distinct marks to the left */ LEFT, /** * Distinct marks to the right */ RIGHT, /** * Distinct marks at the top left */ ABOVE_LEFT, /** * Distinct marks directly above */ ABOVE, /** * Distinct marks at the top right */ ABOVE_RIGHT, /** * Distinct marks subtending two bases */ DOUBLE_BELOW, /** * Distinct marks extending above two bases */ DOUBLE_ABOVE, /** * Greek iota subscript only */ IOTA_SUBSCRIPT, /** * Invalid combining class */ INVALID, } /** * Data type for the "General_Category" (gc) property from * the Unicode Character Database. * @gir-type Enum */ enum unicode_general_category_t { /** * [Cc] */ CONTROL, /** * [Cf] */ FORMAT, /** * [Cn] */ UNASSIGNED, /** * [Co] */ PRIVATE_USE, /** * [Cs] */ SURROGATE, /** * [Ll] */ LOWERCASE_LETTER, /** * [Lm] */ MODIFIER_LETTER, /** * [Lo] */ OTHER_LETTER, /** * [Lt] */ TITLECASE_LETTER, /** * [Lu] */ UPPERCASE_LETTER, /** * [Mc] */ SPACING_MARK, /** * [Me] */ ENCLOSING_MARK, /** * [Mn] */ NON_SPACING_MARK, /** * [Nd] */ DECIMAL_NUMBER, /** * [Nl] */ LETTER_NUMBER, /** * [No] */ OTHER_NUMBER, /** * [Pc] */ CONNECT_PUNCTUATION, /** * [Pd] */ DASH_PUNCTUATION, /** * [Pe] */ CLOSE_PUNCTUATION, /** * [Pf] */ FINAL_PUNCTUATION, /** * [Pi] */ INITIAL_PUNCTUATION, /** * [Po] */ OTHER_PUNCTUATION, /** * [Ps] */ OPEN_PUNCTUATION, /** * [Sc] */ CURRENCY_SYMBOL, /** * [Sk] */ MODIFIER_SYMBOL, /** * [Sm] */ MATH_SYMBOL, /** * [So] */ OTHER_SYMBOL, /** * [Zl] */ LINE_SEPARATOR, /** * [Zp] */ PARAGRAPH_SEPARATOR, /** * [Zs] */ SPACE_SEPARATOR, } /** * Used when getting or setting AAT feature selectors. Indicates that * there is no selector index corresponding to the selector of interest. */ const AAT_LAYOUT_NO_SELECTOR_INDEX: number; /** * The default code point for replacing invalid characters in a given encoding. * Set to U+FFFD REPLACEMENT CHARACTER. * @since 0.9.31 */ const BUFFER_REPLACEMENT_CODEPOINT_DEFAULT: number; /** * Unused {@link HarfBuzz.codepoint_t} value. * @since 8.0.0 */ const CODEPOINT_INVALID: codepoint_t; /** * Special setting for {@link HarfBuzz.feature_t}.start to apply the feature from the start * of the buffer. * @since 2.0.0 */ const FEATURE_GLOBAL_START: number; /** * Constant signifying that a font does not have any * named-instance index set. This is the default of * a font. * @since 7.0.0 */ const FONT_NO_VAR_NAMED_INSTANCE: number; /** * An unset {@link HarfBuzz.language_t}. * @since 0.6.0 */ const LANGUAGE_INVALID: language_t; /** * Special value for language index indicating default or unsupported language. */ const OT_LAYOUT_DEFAULT_LANGUAGE_INDEX: number; /** * Special value for feature index indicating unsupported feature. */ const OT_LAYOUT_NO_FEATURE_INDEX: number; /** * Special value for script index indicating unsupported script. */ const OT_LAYOUT_NO_SCRIPT_INDEX: number; /** * Special value for variations index indicating unsupported variation. */ const OT_LAYOUT_NO_VARIATIONS_INDEX: number; /** * Maximum number of OpenType tags that can correspond to a give {@link HarfBuzz.language_t}. * @since 2.0.0 */ const OT_MAX_TAGS_PER_LANGUAGE: number; /** * Maximum number of OpenType tags that can correspond to a give {@link HarfBuzz.script_t}. * @since 2.0.0 */ const OT_MAX_TAGS_PER_SCRIPT: number; /** * The serial number of the current internal buffer format. * * The serial number will increase when internal {@link HarfBuzz.glyph_info_t} and * {@link HarfBuzz.glyph_position_t} members change their format. * @since 13.2.0 */ const OT_SHAPE_BUFFER_FORMAT_SERIAL: number; /** * Do not use. * @since 1.4.2 * @deprecated since 2.2.0 */ const OT_VAR_NO_AXIS_INDEX: number; /** * [Tibetan] * @deprecated since 7.2.0 */ const UNICODE_COMBINING_CLASS_CCC133: number; /** * Maximum valid Unicode code point. * @since 1.9.0 */ const UNICODE_MAX: number; /** * See Unicode 6.1 for details on the maximum decomposition length. * @deprecated since 2.0.0 */ const UNICODE_MAX_DECOMPOSITION_LEN: number; const VERSION_MAJOR: number; const VERSION_MICRO: number; const VERSION_MINOR: number; const VERSION_STRING: string; /** * Fetches the name identifier of the specified feature type in the face's `name` table. * @param face {@link HarfBuzz.face_t} to work upon * @param feature_type The {@link HarfBuzz.aat_layout_feature_type_t} of the requested feature type * @returns Name identifier of the requested feature type * @since 2.2.0 */ function aat_layout_feature_type_get_name_id(face: face_t, feature_type: aat_layout_feature_type_t): ot_name_id_t; /** * Fetches a list of the selectors available for the specified feature in the given face. * * If upon return, `default_index` is set to #HB_AAT_LAYOUT_NO_SELECTOR_INDEX, then * the feature type is non-exclusive. Otherwise, `default_index` is the index of * the selector that is selected by default. * @param face {@link HarfBuzz.face_t} to work upon * @param feature_type The {@link HarfBuzz.aat_layout_feature_type_t} of the requested feature type * @param start_offset offset of the first feature type to retrieve * @returns Number of all available feature selectors * @since 2.2.0 */ function aat_layout_feature_type_get_selector_infos(face: face_t, feature_type: aat_layout_feature_type_t, start_offset: number): [number, aat_layout_feature_selector_info_t[] | null, number]; /** * Fetches a list of the AAT feature types included in the specified face. * @param face {@link HarfBuzz.face_t} to work upon * @param start_offset offset of the first feature type to retrieve * @returns Number of all available feature types. * @since 2.2.0 */ function aat_layout_get_feature_types(face: face_t, start_offset: number): [number, aat_layout_feature_type_t[]]; /** * Tests whether the specified face includes any positioning information * in the `kerx` table. * * <note>Note: does not examine the `GPOS` table.</note> * @param face {@link HarfBuzz.face_t} to work upon * @returns `true` if data found, `false` otherwise * @since 2.3.0 */ function aat_layout_has_positioning(face: face_t): bool_t; /** * Tests whether the specified face includes any substitutions in the * `morx` or `mort` tables. * * <note>Note: does not examine the `GSUB` table.</note> * @param face {@link HarfBuzz.face_t} to work upon * @returns `true` if data found, `false` otherwise * @since 2.3.0 */ function aat_layout_has_substitution(face: face_t): bool_t; /** * Tests whether the specified face includes any tracking information * in the `trak` table. * @param face {@link HarfBuzz.face_t} to work upon * @returns `true` if data found, `false` otherwise * @since 2.3.0 */ function aat_layout_has_tracking(face: face_t): bool_t; /** * Makes a writable copy of `blob`. * @param blob A blob. * @returns The new blob, or nullptr if allocation failed * @since 1.8.0 */ function blob_copy_writable_or_fail(blob: blob_t): blob_t; /** * Creates a new blob containing the data from the * specified binary font file. * * The filename is passed directly to the system on all platforms, * except on Windows, where the filename is interpreted as UTF-8. * Only if the filename is not valid UTF-8, it will be interpreted * according to the system codepage. * @param file_name A font filename * @returns An {@link HarfBuzz.blob_t} pointer with the content of the file, or `hb_blob_get_empty()` if failed. * @since 1.7.7 */ function blob_create_from_file(file_name: string): blob_t; /** * Creates a new blob containing the data from the specified file. * * The filename is passed directly to the system on all platforms, * except on Windows, where the filename is interpreted as UTF-8. * Only if the filename is not valid UTF-8, it will be interpreted * according to the system codepage. * @param file_name A filename * @returns An {@link HarfBuzz.blob_t} pointer with the content of the file, or `NULL` if failed. * @since 2.8.2 */ function blob_create_from_file_or_fail(file_name: string): 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. * @param parent Parent blob. * @param offset Start offset of sub-blob within `parent`, in bytes. * @param length Length of sub-blob. * @returns New blob, or the empty blob if something failed or if `length` is zero or `offset` is beyond the end of `parent`'s data. Destroy with `hb_blob_destroy()`. * @since 0.9.2 */ function blob_create_sub_blob(parent: blob_t, offset: number, length: number): blob_t; /** * Fetches the data from a blob. * @param blob a blob. * @returns the byte data of `blob`. * @since 0.9.2 */ function blob_get_data(blob: blob_t): string[] | null; /** * 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. * @param blob a blob. * @returns Writable blob data, or `NULL` if failed. * @since 0.9.2 */ function blob_get_data_writable(blob: blob_t): string[]; /** * Returns the singleton empty blob. * * See TODO:link object types for more information. * @returns The empty blob. * @since 0.9.2 */ function blob_get_empty(): blob_t; /** * Fetches the length of a blob's data. * @param blob a blob. * @returns the length of `blob` data in bytes. * @since 0.9.2 */ function blob_get_length(blob: blob_t): number; /** * Tests whether a blob is immutable. * @param blob a blob. * @returns `true` if `blob` is immutable, `false` otherwise * @since 0.9.2 */ function blob_is_immutable(blob: blob_t): bool_t; /** * Makes a blob immutable. * @param blob a blob * @since 0.9.2 */ function blob_make_immutable(blob: blob_t): 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 * {@link HarfBuzz.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. * @param buffer An {@link HarfBuzz.buffer_t} * @param codepoint A Unicode code point. * @param cluster The cluster value of `codepoint`. * @since 0.9.7 */ function buffer_add(buffer: buffer_t, codepoint: codepoint_t, cluster: 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 scalar values. In contrast, * `hb_buffer_add_utf32()` can be used that takes similar input but performs * sanity-check on the input. * @param buffer a {@link HarfBuzz.buffer_t} to append characters to. * @param text an array of Unicode code points to append. * @param item_offset the offset of the first code point to add to the `buffer`. * @param item_length the number of code points to add to the `buffer`, or -1 for the end of `text` (assuming it is `NULL` terminated). * @since 0.9.31 */ function buffer_add_codepoints(buffer: buffer_t, text: codepoint_t[], 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. * * <note>Has nothing to do with non-Unicode Latin-1 encoding.</note> * @param buffer An {@link HarfBuzz.buffer_t} * @param text an array of UTF-8 characters to append * @param item_offset the offset of the first character to add to the `buffer` * @param item_length the number of characters to add to the `buffer`, or -1 for the end of `text` (assuming it is `NULL` terminated) * @since 0.9.39 */ function buffer_add_latin1(buffer: buffer_t, text: Uint8Array | string, 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()`. * @param buffer An {@link HarfBuzz.buffer_t} * @param text An array of UTF-16 characters to append * @param item_offset The offset of the first character to add to the `buffer` * @param item_length The number of characters to add to the `buffer`, or -1 for the end of `text` (assuming it is `NULL` terminated) * @since 0.9.2 */ function buffer_add_utf16(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()`. * @param buffer An {@link HarfBuzz.buffer_t} * @param text An array of UTF-32 characters to append * @param item_offset The offset of the first character to add to the `buffer` * @param item_length The number of characters to add to the `buffer`, or -1 for the end of `text` (assuming it is `NULL` terminated) * @since 0.9.2 */ function buffer_add_utf32(buffer: buffer_t, text: number[], 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()`. * @param buffer An {@link HarfBuzz.buffer_t} * @param text An array of UTF-8 characters to append. * @param item_offset The offset of the first character to add to the `buffer`. * @param item_length The number of characters to add to the `buffer`, or -1 for the end of `text` (assuming it is `NULL` terminated). * @since 0.9.2 */ function buffer_add_utf8(buffer: buffer_t, text: Uint8Array | string, item_offset: number, item_length: number): void; /** * Check if allocating memory for the buffer succeeded. * @param buffer An {@link HarfBuzz.buffer_t} * @returns `true` if `buffer` memory allocation succeeded, `false` otherwise. * @since 0.9.2 */ function buffer_allocation_successful(buffer: buffer_t): bool_t; /** * Append (part of) contents of another buffer to this buffer. * @param buffer An {@link HarfBuzz.buffer_t} * @param source source {@link HarfBuzz.buffer_t} * @param start start index into source buffer to copy. Use 0 to copy from start of buffer. * @param end end index into source buffer to copy. Use `UINT_MAX` (or ((unsigned int) -1)) to copy to end of buffer. * @since 1.5.0 */ function buffer_append(buffer: buffer_t, source: buffer_t, start: number, end: number): void; /** * Called by a message callback after modifying buffer glyph indices, * to update internal caches. * * If not called from inside a message callback, does nothing. * @param buffer An {@link HarfBuzz.buffer_t} * @since 13.0.0 */ function buffer_changed(buffer: buffer_t): void; /** * Similar to `hb_buffer_reset()`, but does not clear the Unicode functions and * the replacement code point. * @param buffer An {@link HarfBuzz.buffer_t} * @since 0.9.11 */ function buffer_clear_contents(buffer: buffer_t): void; /** * Creates a new {@link HarfBuzz.buffer_t} with all properties to defaults. * @returns A newly allocated {@link HarfBuzz.buffer_t} with a reference count of 1. The initial reference count should be released with `hb_buffer_destroy()` when you are done using the {@link HarfBuzz.buffer_t}. This function never returns `NULL`. If memory cannot be allocated, a special {@link HarfBuzz.buffer_t} object will be returned on which `hb_buffer_allocation_successful()` returns `false`. * @since 0.9.2 */ function buffer_create(): buffer_t; /** * Creates a new {@link HarfBuzz.buffer_t}, similar to `hb_buffer_create()`. The only * difference is that the buffer is configured similarly to `src`. * @param src An {@link HarfBuzz.buffer_t} * @returns A newly allocated {@link HarfBuzz.buffer_t}, similar to `hb_buffer_create()`. * @since 3.3.0 */ function buffer_create_similar(src: buffer_t): buffer_t; /** * Deserializes glyphs `buffer` from textual representation in the format * produced by `hb_buffer_serialize_glyphs()`. * @param buffer an {@link HarfBuzz.buffer_t} buffer. * @param buf string to deserialize * @param font font for getting glyph IDs * @param format the {@link HarfBuzz.buffer_serialize_format_t} of the input `buf` * @returns `true` if the full string was parsed, `false` otherwise. * @since 0.9.7 */ function buffer_deserialize_glyphs(buffer: buffer_t, buf: string[], font: font_t | null, format: buffer_serialize_format_t): [bool_t, string]; /** * Deserializes Unicode `buffer` from textual representation in the format * produced by `hb_buffer_serialize_unicode()`. * @param buffer an {@link HarfBuzz.buffer_t} buffer. * @param buf string to deserialize * @param format the {@link HarfBuzz.buffer_serialize_format_t} of the input `buf` * @returns `true` if the full string was parsed, `false` otherwise. * @since 2.7.3 */ function buffer_deserialize_unicode(buffer: buffer_t, buf: string[], format: buffer_serialize_format_t): [bool_t, string]; /** * 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. * @param buffer a buffer. * @param reference other buffer to compare to. * @param dottedcircle_glyph glyph id of U+25CC DOTTED CIRCLE, or (hb_codepoint_t) -1. * @param position_fuzz allowed absolute difference in position values. * @since 1.5.0 */ function buffer_diff(buffer: buffer_t, reference: buffer_t, dottedcircle_glyph: codepoint_t, position_fuzz: number): buffer_diff_flags_t; /** * Fetches the cluster level of a buffer. The {@link HarfBuzz.buffer_cluster_level_t} * dictates one aspect of how HarfBuzz will treat non-base characters * during shaping. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The cluster level of `buffer` * @since 0.9.42 */ function buffer_get_cluster_level(buffer: buffer_t): buffer_cluster_level_t; /** * Fetches the type of `buffer` contents. Buffers are either empty, contain * characters (before shaping), or contain glyphs (the result of shaping). * @param buffer An {@link HarfBuzz.buffer_t} * @returns The type of `buffer` contents * @since 0.9.5 */ function buffer_get_content_type(buffer: buffer_t): buffer_content_type_t; /** * See `hb_buffer_set_direction()` * @param buffer An {@link HarfBuzz.buffer_t} * @returns The direction of the `buffer`. * @since 0.9.2 */ function buffer_get_direction(buffer: buffer_t): direction_t; /** * Fetches an empty {@link HarfBuzz.buffer_t}. * @returns The empty buffer * @since 0.9.2 */ function buffer_get_empty(): buffer_t; /** * Fetches the {@link HarfBuzz.buffer_flags_t} of `buffer`. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` flags * @since 0.9.7 */ function buffer_get_flags(buffer: buffer_t): buffer_flags_t; /** * Returns `buffer` glyph information array. Returned pointer * is valid as long as `buffer` contents are not modified. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` glyph information array. The value valid as long as buffer has not been modified. * @since 0.9.2 */ function buffer_get_glyph_infos(buffer: buffer_t): glyph_info_t[]; /** * Returns `buffer` glyph position array. Returned pointer * is valid as long as `buffer` contents are not modified. * * If buffer did not have positions before, the positions will be * initialized to zeros, unless this function is called from * within a buffer message callback (see `hb_buffer_set_message_func()`), * in which case `NULL` is returned. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` glyph position array. The value valid as long as buffer has not been modified. * @since 0.9.2 */ function buffer_get_glyph_positions(buffer: buffer_t): glyph_position_t[]; /** * See `hb_buffer_set_invisible_glyph()`. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` invisible {@link HarfBuzz.codepoint_t} * @since 2.0.0 */ function buffer_get_invisible_glyph(buffer: buffer_t): codepoint_t; /** * See `hb_buffer_set_language()`. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The {@link HarfBuzz.language_t} of the buffer. Must not be freed by the caller. * @since 0.9.2 */ function buffer_get_language(buffer: buffer_t): language_t; /** * Returns the number of items in the buffer. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` length. The value valid as long as buffer has not been modified. * @since 0.9.2 */ function buffer_get_length(buffer: buffer_t): number; /** * See `hb_buffer_set_not_found_glyph()`. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` not-found {@link HarfBuzz.codepoint_t} * @since 3.1.0 */ function buffer_get_not_found_glyph(buffer: buffer_t): codepoint_t; /** * See `hb_buffer_set_not_found_variation_selector_glyph()`. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` not-found-variation-selector {@link HarfBuzz.codepoint_t} * @since 10.0.0 */ function buffer_get_not_found_variation_selector_glyph(buffer: buffer_t): codepoint_t; /** * See `hb_buffer_set_random_state()`. * @param buffer An {@link HarfBuzz.buffer_t} * @returns The `buffer` random state * @since 8.4.0 */ function buffer_get_random_state(buffer: buffer_t): number; /** * Fetches the