1
1
mirror of https://github.com/wez/wezterm.git synced 2025-01-03 11:11:43 +03:00

harfbuzz: revise build and bindings

More recent versions of harfbuzz conveniently generate harfbuzz.cc
which has the full list of source files, so point our build to
that instead of chasing the evolving list of files: much easier!

Fixup some of the predefined symbols, and include opentype functions
in bindings.h so that we can pick those up in the bindgen output.
This commit is contained in:
Wez Furlong 2022-09-03 08:19:17 -07:00
parent 5f7738899b
commit 53c6de956f
3 changed files with 875 additions and 57 deletions

View File

@ -1,2 +1,3 @@
#include <hb.h>
#include <hb-ft.h>
#include <hb-ot.h>

View File

@ -25,64 +25,8 @@ fn harfbuzz() {
let target = env::var("TARGET").unwrap();
for f in [
"hb-aat-layout.cc",
"hb-aat-map.cc",
"hb-blob.cc",
"hb-buffer-serialize.cc",
"hb-buffer-verify.cc",
"hb-buffer.cc",
"hb-common.cc",
"hb-face.cc",
"hb-fallback-shape.cc",
"hb-font.cc",
"hb-ft.cc",
"hb-map.cc",
"hb-number.cc",
"hb-ot-cff1-table.cc",
"hb-ot-cff2-table.cc",
"hb-ot-color.cc",
"hb-ot-face.cc",
"hb-ot-font.cc",
"hb-ot-layout.cc",
"hb-ot-map.cc",
"hb-ot-math.cc",
"hb-ot-metrics.cc",
"hb-ot-name.cc",
"hb-ot-shaper-arabic.cc",
"hb-ot-shaper-default.cc",
"hb-ot-shaper-hangul.cc",
"hb-ot-shaper-hebrew.cc",
"hb-ot-shaper-indic-table.cc",
"hb-ot-shaper-indic.cc",
"hb-ot-shaper-khmer.cc",
"hb-ot-shaper-myanmar.cc",
"hb-ot-shaper-syllabic.cc",
"hb-ot-shaper-thai.cc",
"hb-ot-shaper-use.cc",
"hb-ot-shaper-vowel-constraints.cc",
"hb-ot-shape-fallback.cc",
"hb-ot-shape-normalize.cc",
"hb-ot-shape.cc",
"hb-ot-tag.cc",
"hb-ot-var.cc",
"hb-set.cc",
"hb-shape-plan.cc",
"hb-shape.cc",
"hb-shaper.cc",
"hb-static.cc",
"hb-ucd.cc",
"hb-unicode.cc",
]
.iter()
{
cfg.file(format!("harfbuzz/src/{}", f));
}
cfg.file("harfbuzz/src/harfbuzz.cc");
cfg.define("HB_NO_MT", None);
cfg.define("HAVE_FALLBACK", None);
cfg.define("HAVE_UCDN", None);
cfg.include("harfbuzz/src/hb-ucdn");
if !target.contains("windows") {
cfg.define("HAVE_UNISTD_H", None);
@ -95,6 +39,7 @@ fn harfbuzz() {
cfg.define("HAVE_FT_GET_VAR_BLEND_COORDINATES", Some("1"));
cfg.define("HAVE_FT_SET_VAR_BLEND_COORDINATES", Some("1"));
cfg.define("HAVE_FT_DONE_MM_VAR", Some("1"));
cfg.define("HAVE_FT_GET_TRANSFORM", Some("1"));
// Import the include dirs exported from deps/freetype/build.rs
for inc in std::env::var("DEP_FREETYPE_INCLUDE").unwrap().split(';') {

View File

@ -2943,3 +2943,875 @@ extern "C" {
extern "C" {
pub fn hb_ft_font_set_funcs(font: *mut hb_font_t);
}
pub type hb_ot_name_id_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct hb_ot_name_entry_t {
pub name_id: hb_ot_name_id_t,
pub var: hb_var_int_t,
pub language: hb_language_t,
}
extern "C" {
pub fn hb_ot_name_list_names(
face: *mut hb_face_t,
num_entries: *mut ::std::os::raw::c_uint,
) -> *const hb_ot_name_entry_t;
}
extern "C" {
pub fn hb_ot_name_get_utf8(
face: *mut hb_face_t,
name_id: hb_ot_name_id_t,
language: hb_language_t,
text_size: *mut ::std::os::raw::c_uint,
text: *mut ::std::os::raw::c_char,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_name_get_utf16(
face: *mut hb_face_t,
name_id: hb_ot_name_id_t,
language: hb_language_t,
text_size: *mut ::std::os::raw::c_uint,
text: *mut u16,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_name_get_utf32(
face: *mut hb_face_t,
name_id: hb_ot_name_id_t,
language: hb_language_t,
text_size: *mut ::std::os::raw::c_uint,
text: *mut u32,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_color_has_palettes(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_color_palette_get_count(face: *mut hb_face_t) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_color_palette_get_name_id(
face: *mut hb_face_t,
palette_index: ::std::os::raw::c_uint,
) -> hb_ot_name_id_t;
}
extern "C" {
pub fn hb_ot_color_palette_color_get_name_id(
face: *mut hb_face_t,
color_index: ::std::os::raw::c_uint,
) -> hb_ot_name_id_t;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_color_palette_flags_t {
HB_OT_COLOR_PALETTE_FLAG_DEFAULT = 0,
HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND = 1,
HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND = 2,
}
extern "C" {
pub fn hb_ot_color_palette_get_flags(
face: *mut hb_face_t,
palette_index: ::std::os::raw::c_uint,
) -> hb_ot_color_palette_flags_t;
}
extern "C" {
pub fn hb_ot_color_palette_get_colors(
face: *mut hb_face_t,
palette_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
color_count: *mut ::std::os::raw::c_uint,
colors: *mut hb_color_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_color_has_layers(face: *mut hb_face_t) -> hb_bool_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hb_ot_color_layer_t {
pub glyph: hb_codepoint_t,
pub color_index: ::std::os::raw::c_uint,
}
extern "C" {
pub fn hb_ot_color_glyph_get_layers(
face: *mut hb_face_t,
glyph: hb_codepoint_t,
start_offset: ::std::os::raw::c_uint,
layer_count: *mut ::std::os::raw::c_uint,
layers: *mut hb_ot_color_layer_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_color_has_svg(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_color_glyph_reference_svg(
face: *mut hb_face_t,
glyph: hb_codepoint_t,
) -> *mut hb_blob_t;
}
extern "C" {
pub fn hb_ot_color_has_png(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_color_glyph_reference_png(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
) -> *mut hb_blob_t;
}
extern "C" {
pub fn hb_ot_layout_table_choose_script(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_tags: *const hb_tag_t,
script_index: *mut ::std::os::raw::c_uint,
chosen_script: *mut hb_tag_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_script_find_language(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_tag: hb_tag_t,
language_index: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_tags_from_script(
script: hb_script_t,
script_tag_1: *mut hb_tag_t,
script_tag_2: *mut hb_tag_t,
);
}
extern "C" {
pub fn hb_ot_tag_from_language(language: hb_language_t) -> hb_tag_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hb_ot_var_axis_t {
pub tag: hb_tag_t,
pub name_id: hb_ot_name_id_t,
pub min_value: f32,
pub default_value: f32,
pub max_value: f32,
}
extern "C" {
pub fn hb_ot_var_get_axes(
face: *mut hb_face_t,
start_offset: ::std::os::raw::c_uint,
axes_count: *mut ::std::os::raw::c_uint,
axes_array: *mut hb_ot_var_axis_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_var_find_axis(
face: *mut hb_face_t,
axis_tag: hb_tag_t,
axis_index: *mut ::std::os::raw::c_uint,
axis_info: *mut hb_ot_var_axis_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_font_set_funcs(font: *mut hb_font_t);
}
extern "C" {
pub fn hb_ot_tags_from_script_and_language(
script: hb_script_t,
language: hb_language_t,
script_count: *mut ::std::os::raw::c_uint,
script_tags: *mut hb_tag_t,
language_count: *mut ::std::os::raw::c_uint,
language_tags: *mut hb_tag_t,
);
}
extern "C" {
pub fn hb_ot_tag_to_script(tag: hb_tag_t) -> hb_script_t;
}
extern "C" {
pub fn hb_ot_tag_to_language(tag: hb_tag_t) -> hb_language_t;
}
extern "C" {
pub fn hb_ot_tags_to_script_and_language(
script_tag: hb_tag_t,
language_tag: hb_tag_t,
script: *mut hb_script_t,
language: *mut hb_language_t,
);
}
extern "C" {
pub fn hb_ot_layout_has_glyph_classes(face: *mut hb_face_t) -> hb_bool_t;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_layout_glyph_class_t {
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0,
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1,
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2,
HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3,
HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4,
}
extern "C" {
pub fn hb_ot_layout_get_glyph_class(
face: *mut hb_face_t,
glyph: hb_codepoint_t,
) -> hb_ot_layout_glyph_class_t;
}
extern "C" {
pub fn hb_ot_layout_get_glyphs_in_class(
face: *mut hb_face_t,
klass: hb_ot_layout_glyph_class_t,
glyphs: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_layout_get_attach_points(
face: *mut hb_face_t,
glyph: hb_codepoint_t,
start_offset: ::std::os::raw::c_uint,
point_count: *mut ::std::os::raw::c_uint,
point_array: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_get_ligature_carets(
font: *mut hb_font_t,
direction: hb_direction_t,
glyph: hb_codepoint_t,
start_offset: ::std::os::raw::c_uint,
caret_count: *mut ::std::os::raw::c_uint,
caret_array: *mut hb_position_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_table_get_script_tags(
face: *mut hb_face_t,
table_tag: hb_tag_t,
start_offset: ::std::os::raw::c_uint,
script_count: *mut ::std::os::raw::c_uint,
script_tags: *mut hb_tag_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_table_find_script(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_tag: hb_tag_t,
script_index: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_table_select_script(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_count: ::std::os::raw::c_uint,
script_tags: *const hb_tag_t,
script_index: *mut ::std::os::raw::c_uint,
chosen_script: *mut hb_tag_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_table_get_feature_tags(
face: *mut hb_face_t,
table_tag: hb_tag_t,
start_offset: ::std::os::raw::c_uint,
feature_count: *mut ::std::os::raw::c_uint,
feature_tags: *mut hb_tag_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_script_get_language_tags(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
language_count: *mut ::std::os::raw::c_uint,
language_tags: *mut hb_tag_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_script_select_language(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_count: ::std::os::raw::c_uint,
language_tags: *const hb_tag_t,
language_index: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_language_get_required_feature_index(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_index: ::std::os::raw::c_uint,
feature_index: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_language_get_required_feature(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_index: ::std::os::raw::c_uint,
feature_index: *mut ::std::os::raw::c_uint,
feature_tag: *mut hb_tag_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_language_get_feature_indexes(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
feature_count: *mut ::std::os::raw::c_uint,
feature_indexes: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_language_get_feature_tags(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
feature_count: *mut ::std::os::raw::c_uint,
feature_tags: *mut hb_tag_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_language_find_feature(
face: *mut hb_face_t,
table_tag: hb_tag_t,
script_index: ::std::os::raw::c_uint,
language_index: ::std::os::raw::c_uint,
feature_tag: hb_tag_t,
feature_index: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_feature_get_lookups(
face: *mut hb_face_t,
table_tag: hb_tag_t,
feature_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
lookup_count: *mut ::std::os::raw::c_uint,
lookup_indexes: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_table_get_lookup_count(
face: *mut hb_face_t,
table_tag: hb_tag_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_collect_features(
face: *mut hb_face_t,
table_tag: hb_tag_t,
scripts: *const hb_tag_t,
languages: *const hb_tag_t,
features: *const hb_tag_t,
feature_indexes: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_layout_collect_lookups(
face: *mut hb_face_t,
table_tag: hb_tag_t,
scripts: *const hb_tag_t,
languages: *const hb_tag_t,
features: *const hb_tag_t,
lookup_indexes: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_layout_lookup_collect_glyphs(
face: *mut hb_face_t,
table_tag: hb_tag_t,
lookup_index: ::std::os::raw::c_uint,
glyphs_before: *mut hb_set_t,
glyphs_input: *mut hb_set_t,
glyphs_after: *mut hb_set_t,
glyphs_output: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_layout_table_find_feature_variations(
face: *mut hb_face_t,
table_tag: hb_tag_t,
coords: *const ::std::os::raw::c_int,
num_coords: ::std::os::raw::c_uint,
variations_index: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_feature_with_variations_get_lookups(
face: *mut hb_face_t,
table_tag: hb_tag_t,
feature_index: ::std::os::raw::c_uint,
variations_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
lookup_count: *mut ::std::os::raw::c_uint,
lookup_indexes: *mut ::std::os::raw::c_uint,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_has_substitution(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_lookup_get_glyph_alternates(
face: *mut hb_face_t,
lookup_index: ::std::os::raw::c_uint,
glyph: hb_codepoint_t,
start_offset: ::std::os::raw::c_uint,
alternate_count: *mut ::std::os::raw::c_uint,
alternate_glyphs: *mut hb_codepoint_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_layout_lookup_would_substitute(
face: *mut hb_face_t,
lookup_index: ::std::os::raw::c_uint,
glyphs: *const hb_codepoint_t,
glyphs_length: ::std::os::raw::c_uint,
zero_context: hb_bool_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_lookup_substitute_closure(
face: *mut hb_face_t,
lookup_index: ::std::os::raw::c_uint,
glyphs: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_layout_lookups_substitute_closure(
face: *mut hb_face_t,
lookups: *const hb_set_t,
glyphs: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_layout_has_positioning(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_get_size_params(
face: *mut hb_face_t,
design_size: *mut ::std::os::raw::c_uint,
subfamily_id: *mut ::std::os::raw::c_uint,
subfamily_name_id: *mut hb_ot_name_id_t,
range_start: *mut ::std::os::raw::c_uint,
range_end: *mut ::std::os::raw::c_uint,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_feature_get_name_ids(
face: *mut hb_face_t,
table_tag: hb_tag_t,
feature_index: ::std::os::raw::c_uint,
label_id: *mut hb_ot_name_id_t,
tooltip_id: *mut hb_ot_name_id_t,
sample_id: *mut hb_ot_name_id_t,
num_named_parameters: *mut ::std::os::raw::c_uint,
first_param_id: *mut hb_ot_name_id_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_feature_get_characters(
face: *mut hb_face_t,
table_tag: hb_tag_t,
feature_index: ::std::os::raw::c_uint,
start_offset: ::std::os::raw::c_uint,
char_count: *mut ::std::os::raw::c_uint,
characters: *mut hb_codepoint_t,
) -> ::std::os::raw::c_uint;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_layout_baseline_tag_t {
HB_OT_LAYOUT_BASELINE_TAG_ROMAN = 1919905134,
HB_OT_LAYOUT_BASELINE_TAG_HANGING = 1751215719,
HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT = 1768121954,
HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT = 1768121972,
HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_CENTRAL = 1231251043,
HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT = 1768187247,
HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT = 1768191088,
HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_CENTRAL = 1231315813,
HB_OT_LAYOUT_BASELINE_TAG_MATH = 1835103336,
_HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE = 2147483647,
}
extern "C" {
pub fn hb_ot_layout_get_horizontal_baseline_tag_for_script(
script: hb_script_t,
) -> hb_ot_layout_baseline_tag_t;
}
extern "C" {
pub fn hb_ot_layout_get_baseline(
font: *mut hb_font_t,
baseline_tag: hb_ot_layout_baseline_tag_t,
direction: hb_direction_t,
script_tag: hb_tag_t,
language_tag: hb_tag_t,
coord: *mut hb_position_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_layout_get_baseline_with_fallback(
font: *mut hb_font_t,
baseline_tag: hb_ot_layout_baseline_tag_t,
direction: hb_direction_t,
script_tag: hb_tag_t,
language_tag: hb_tag_t,
coord: *mut hb_position_t,
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_math_constant_t {
HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN = 0,
HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN = 1,
HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT = 2,
HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT = 3,
HB_OT_MATH_CONSTANT_MATH_LEADING = 4,
HB_OT_MATH_CONSTANT_AXIS_HEIGHT = 5,
HB_OT_MATH_CONSTANT_ACCENT_BASE_HEIGHT = 6,
HB_OT_MATH_CONSTANT_FLATTENED_ACCENT_BASE_HEIGHT = 7,
HB_OT_MATH_CONSTANT_SUBSCRIPT_SHIFT_DOWN = 8,
HB_OT_MATH_CONSTANT_SUBSCRIPT_TOP_MAX = 9,
HB_OT_MATH_CONSTANT_SUBSCRIPT_BASELINE_DROP_MIN = 10,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP = 11,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP_CRAMPED = 12,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MIN = 13,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_BASELINE_DROP_MAX = 14,
HB_OT_MATH_CONSTANT_SUB_SUPERSCRIPT_GAP_MIN = 15,
HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT = 16,
HB_OT_MATH_CONSTANT_SPACE_AFTER_SCRIPT = 17,
HB_OT_MATH_CONSTANT_UPPER_LIMIT_GAP_MIN = 18,
HB_OT_MATH_CONSTANT_UPPER_LIMIT_BASELINE_RISE_MIN = 19,
HB_OT_MATH_CONSTANT_LOWER_LIMIT_GAP_MIN = 20,
HB_OT_MATH_CONSTANT_LOWER_LIMIT_BASELINE_DROP_MIN = 21,
HB_OT_MATH_CONSTANT_STACK_TOP_SHIFT_UP = 22,
HB_OT_MATH_CONSTANT_STACK_TOP_DISPLAY_STYLE_SHIFT_UP = 23,
HB_OT_MATH_CONSTANT_STACK_BOTTOM_SHIFT_DOWN = 24,
HB_OT_MATH_CONSTANT_STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN = 25,
HB_OT_MATH_CONSTANT_STACK_GAP_MIN = 26,
HB_OT_MATH_CONSTANT_STACK_DISPLAY_STYLE_GAP_MIN = 27,
HB_OT_MATH_CONSTANT_STRETCH_STACK_TOP_SHIFT_UP = 28,
HB_OT_MATH_CONSTANT_STRETCH_STACK_BOTTOM_SHIFT_DOWN = 29,
HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_ABOVE_MIN = 30,
HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_BELOW_MIN = 31,
HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_SHIFT_UP = 32,
HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP = 33,
HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_SHIFT_DOWN = 34,
HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN = 35,
HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_GAP_MIN = 36,
HB_OT_MATH_CONSTANT_FRACTION_NUM_DISPLAY_STYLE_GAP_MIN = 37,
HB_OT_MATH_CONSTANT_FRACTION_RULE_THICKNESS = 38,
HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_GAP_MIN = 39,
HB_OT_MATH_CONSTANT_FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN = 40,
HB_OT_MATH_CONSTANT_SKEWED_FRACTION_HORIZONTAL_GAP = 41,
HB_OT_MATH_CONSTANT_SKEWED_FRACTION_VERTICAL_GAP = 42,
HB_OT_MATH_CONSTANT_OVERBAR_VERTICAL_GAP = 43,
HB_OT_MATH_CONSTANT_OVERBAR_RULE_THICKNESS = 44,
HB_OT_MATH_CONSTANT_OVERBAR_EXTRA_ASCENDER = 45,
HB_OT_MATH_CONSTANT_UNDERBAR_VERTICAL_GAP = 46,
HB_OT_MATH_CONSTANT_UNDERBAR_RULE_THICKNESS = 47,
HB_OT_MATH_CONSTANT_UNDERBAR_EXTRA_DESCENDER = 48,
HB_OT_MATH_CONSTANT_RADICAL_VERTICAL_GAP = 49,
HB_OT_MATH_CONSTANT_RADICAL_DISPLAY_STYLE_VERTICAL_GAP = 50,
HB_OT_MATH_CONSTANT_RADICAL_RULE_THICKNESS = 51,
HB_OT_MATH_CONSTANT_RADICAL_EXTRA_ASCENDER = 52,
HB_OT_MATH_CONSTANT_RADICAL_KERN_BEFORE_DEGREE = 53,
HB_OT_MATH_CONSTANT_RADICAL_KERN_AFTER_DEGREE = 54,
HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT = 55,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_math_kern_t {
HB_OT_MATH_KERN_TOP_RIGHT = 0,
HB_OT_MATH_KERN_TOP_LEFT = 1,
HB_OT_MATH_KERN_BOTTOM_RIGHT = 2,
HB_OT_MATH_KERN_BOTTOM_LEFT = 3,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hb_ot_math_kern_entry_t {
pub max_correction_height: hb_position_t,
pub kern_value: hb_position_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hb_ot_math_glyph_variant_t {
pub glyph: hb_codepoint_t,
pub advance: hb_position_t,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_math_glyph_part_flags_t {
HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER = 1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hb_ot_math_glyph_part_t {
pub glyph: hb_codepoint_t,
pub start_connector_length: hb_position_t,
pub end_connector_length: hb_position_t,
pub full_advance: hb_position_t,
pub flags: hb_ot_math_glyph_part_flags_t,
}
extern "C" {
pub fn hb_ot_math_has_data(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_math_get_constant(
font: *mut hb_font_t,
constant: hb_ot_math_constant_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_math_get_glyph_italics_correction(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_math_get_glyph_top_accent_attachment(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_math_is_glyph_extended_shape(
face: *mut hb_face_t,
glyph: hb_codepoint_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_math_get_glyph_kerning(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
kern: hb_ot_math_kern_t,
correction_height: hb_position_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_math_get_glyph_kernings(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
kern: hb_ot_math_kern_t,
start_offset: ::std::os::raw::c_uint,
entries_count: *mut ::std::os::raw::c_uint,
kern_entries: *mut hb_ot_math_kern_entry_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_math_get_glyph_variants(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
direction: hb_direction_t,
start_offset: ::std::os::raw::c_uint,
variants_count: *mut ::std::os::raw::c_uint,
variants: *mut hb_ot_math_glyph_variant_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_math_get_min_connector_overlap(
font: *mut hb_font_t,
direction: hb_direction_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_math_get_glyph_assembly(
font: *mut hb_font_t,
glyph: hb_codepoint_t,
direction: hb_direction_t,
start_offset: ::std::os::raw::c_uint,
parts_count: *mut ::std::os::raw::c_uint,
parts: *mut hb_ot_math_glyph_part_t,
italics_correction: *mut hb_position_t,
) -> ::std::os::raw::c_uint;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_meta_tag_t {
HB_OT_META_TAG_DESIGN_LANGUAGES = 1684827751,
HB_OT_META_TAG_SUPPORTED_LANGUAGES = 1936485991,
_HB_OT_META_TAG_MAX_VALUE = 2147483647,
}
extern "C" {
pub fn hb_ot_meta_get_entry_tags(
face: *mut hb_face_t,
start_offset: ::std::os::raw::c_uint,
entries_count: *mut ::std::os::raw::c_uint,
entries: *mut hb_ot_meta_tag_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_meta_reference_entry(
face: *mut hb_face_t,
meta_tag: hb_ot_meta_tag_t,
) -> *mut hb_blob_t;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_metrics_tag_t {
HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER = 1751216995,
HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER = 1751413603,
HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP = 1751934832,
HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_ASCENT = 1751346273,
HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_DESCENT = 1751346276,
HB_OT_METRICS_TAG_VERTICAL_ASCENDER = 1986098019,
HB_OT_METRICS_TAG_VERTICAL_DESCENDER = 1986294627,
HB_OT_METRICS_TAG_VERTICAL_LINE_GAP = 1986815856,
HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE = 1751347827,
HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN = 1751347822,
HB_OT_METRICS_TAG_HORIZONTAL_CARET_OFFSET = 1751347046,
HB_OT_METRICS_TAG_VERTICAL_CARET_RISE = 1986228851,
HB_OT_METRICS_TAG_VERTICAL_CARET_RUN = 1986228846,
HB_OT_METRICS_TAG_VERTICAL_CARET_OFFSET = 1986228070,
HB_OT_METRICS_TAG_X_HEIGHT = 2020108148,
HB_OT_METRICS_TAG_CAP_HEIGHT = 1668311156,
HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_SIZE = 1935833203,
HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_SIZE = 1935833459,
HB_OT_METRICS_TAG_SUBSCRIPT_EM_X_OFFSET = 1935833199,
HB_OT_METRICS_TAG_SUBSCRIPT_EM_Y_OFFSET = 1935833455,
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_SIZE = 1936750707,
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_SIZE = 1936750963,
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_X_OFFSET = 1936750703,
HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET = 1936750959,
HB_OT_METRICS_TAG_STRIKEOUT_SIZE = 1937011315,
HB_OT_METRICS_TAG_STRIKEOUT_OFFSET = 1937011311,
HB_OT_METRICS_TAG_UNDERLINE_SIZE = 1970168947,
HB_OT_METRICS_TAG_UNDERLINE_OFFSET = 1970168943,
_HB_OT_METRICS_TAG_MAX_VALUE = 2147483647,
}
extern "C" {
pub fn hb_ot_metrics_get_position(
font: *mut hb_font_t,
metrics_tag: hb_ot_metrics_tag_t,
position: *mut hb_position_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_metrics_get_position_with_fallback(
font: *mut hb_font_t,
metrics_tag: hb_ot_metrics_tag_t,
position: *mut hb_position_t,
);
}
extern "C" {
pub fn hb_ot_metrics_get_variation(
font: *mut hb_font_t,
metrics_tag: hb_ot_metrics_tag_t,
) -> f32;
}
extern "C" {
pub fn hb_ot_metrics_get_x_variation(
font: *mut hb_font_t,
metrics_tag: hb_ot_metrics_tag_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_metrics_get_y_variation(
font: *mut hb_font_t,
metrics_tag: hb_ot_metrics_tag_t,
) -> hb_position_t;
}
extern "C" {
pub fn hb_ot_shape_glyphs_closure(
font: *mut hb_font_t,
buffer: *mut hb_buffer_t,
features: *const hb_feature_t,
num_features: ::std::os::raw::c_uint,
glyphs: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_shape_plan_collect_lookups(
shape_plan: *mut hb_shape_plan_t,
table_tag: hb_tag_t,
lookup_indexes: *mut hb_set_t,
);
}
extern "C" {
pub fn hb_ot_var_has_data(face: *mut hb_face_t) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_var_get_axis_count(face: *mut hb_face_t) -> ::std::os::raw::c_uint;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum hb_ot_var_axis_flags_t {
HB_OT_VAR_AXIS_FLAG_HIDDEN = 1,
_HB_OT_VAR_AXIS_FLAG_MAX_VALUE = 2147483647,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct hb_ot_var_axis_info_t {
pub axis_index: ::std::os::raw::c_uint,
pub tag: hb_tag_t,
pub name_id: hb_ot_name_id_t,
pub flags: hb_ot_var_axis_flags_t,
pub min_value: f32,
pub default_value: f32,
pub max_value: f32,
pub reserved: ::std::os::raw::c_uint,
}
extern "C" {
pub fn hb_ot_var_get_axis_infos(
face: *mut hb_face_t,
start_offset: ::std::os::raw::c_uint,
axes_count: *mut ::std::os::raw::c_uint,
axes_array: *mut hb_ot_var_axis_info_t,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_var_find_axis_info(
face: *mut hb_face_t,
axis_tag: hb_tag_t,
axis_info: *mut hb_ot_var_axis_info_t,
) -> hb_bool_t;
}
extern "C" {
pub fn hb_ot_var_get_named_instance_count(face: *mut hb_face_t) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_var_named_instance_get_subfamily_name_id(
face: *mut hb_face_t,
instance_index: ::std::os::raw::c_uint,
) -> hb_ot_name_id_t;
}
extern "C" {
pub fn hb_ot_var_named_instance_get_postscript_name_id(
face: *mut hb_face_t,
instance_index: ::std::os::raw::c_uint,
) -> hb_ot_name_id_t;
}
extern "C" {
pub fn hb_ot_var_named_instance_get_design_coords(
face: *mut hb_face_t,
instance_index: ::std::os::raw::c_uint,
coords_length: *mut ::std::os::raw::c_uint,
coords: *mut f32,
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn hb_ot_var_normalize_variations(
face: *mut hb_face_t,
variations: *const hb_variation_t,
variations_length: ::std::os::raw::c_uint,
coords: *mut ::std::os::raw::c_int,
coords_length: ::std::os::raw::c_uint,
);
}
extern "C" {
pub fn hb_ot_var_normalize_coords(
face: *mut hb_face_t,
coords_length: ::std::os::raw::c_uint,
design_coords: *const f32,
normalized_coords: *mut ::std::os::raw::c_int,
);
}