From f412c817c6aa6a16f2d41583ac6284821e5b3eb8 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 17 May 2025 06:44:31 -0700 Subject: [PATCH] update harfbuzz to 11.2.1 --- deps/harfbuzz/harfbuzz | 2 +- deps/harfbuzz/src/lib.rs | 145 +++++++++++++++++++++++++++++++++++---- docs/changelog.md | 2 +- 3 files changed, 134 insertions(+), 15 deletions(-) diff --git a/deps/harfbuzz/harfbuzz b/deps/harfbuzz/harfbuzz index 3ef870982..33a3f8de6 160000 --- a/deps/harfbuzz/harfbuzz +++ b/deps/harfbuzz/harfbuzz @@ -1 +1 @@ -Subproject commit 3ef8709829a5884517ad91a97b32b9435b2f20d1 +Subproject commit 33a3f8de60dcad7535f14f07d6710144548853ac diff --git a/deps/harfbuzz/src/lib.rs b/deps/harfbuzz/src/lib.rs index b3b79a661..80bfe12cd 100644 --- a/deps/harfbuzz/src/lib.rs +++ b/deps/harfbuzz/src/lib.rs @@ -353,6 +353,19 @@ pub struct hb_glyph_extents_t { pub struct hb_font_t { _unused: [u8; 0], } +unsafe extern "C" { + pub fn hb_malloc(size: usize) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + pub fn hb_calloc(nmemb: usize, size: usize) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + pub fn hb_realloc(ptr: *mut ::std::os::raw::c_void, size: usize) + -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + pub fn hb_free(ptr: *mut ::std::os::raw::c_void); +} #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum hb_memory_mode_t { @@ -952,12 +965,29 @@ unsafe extern "C" { index: ::std::os::raw::c_uint, ) -> *mut hb_face_t; } +unsafe extern "C" { + pub fn hb_face_create_or_fail_using( + blob: *mut hb_blob_t, + index: ::std::os::raw::c_uint, + loader_name: *const ::std::os::raw::c_char, + ) -> *mut hb_face_t; +} unsafe extern "C" { pub fn hb_face_create_from_file_or_fail( file_name: *const ::std::os::raw::c_char, index: ::std::os::raw::c_uint, ) -> *mut hb_face_t; } +unsafe extern "C" { + pub fn hb_face_create_from_file_or_fail_using( + file_name: *const ::std::os::raw::c_char, + index: ::std::os::raw::c_uint, + loader_name: *const ::std::os::raw::c_char, + ) -> *mut hb_face_t; +} +unsafe extern "C" { + pub fn hb_face_list_loaders() -> *mut *const ::std::os::raw::c_char; +} pub type hb_reference_table_func_t = ::std::option::Option< unsafe extern "C" fn( face: *mut hb_face_t, @@ -1000,7 +1030,7 @@ unsafe extern "C" { pub fn hb_face_make_immutable(face: *mut hb_face_t); } unsafe extern "C" { - pub fn hb_face_is_immutable(face: *const hb_face_t) -> hb_bool_t; + pub fn hb_face_is_immutable(face: *mut hb_face_t) -> hb_bool_t; } unsafe extern "C" { pub fn hb_face_reference_table(face: *const hb_face_t, tag: hb_tag_t) -> *mut hb_blob_t; @@ -1676,6 +1706,20 @@ unsafe extern "C" { dy: f32, ); } +unsafe extern "C" { + pub fn hb_paint_push_font_transform( + funcs: *mut hb_paint_funcs_t, + paint_data: *mut ::std::os::raw::c_void, + font: *const hb_font_t, + ); +} +unsafe extern "C" { + pub fn hb_paint_push_inverse_font_transform( + funcs: *mut hb_paint_funcs_t, + paint_data: *mut ::std::os::raw::c_void, + font: *const hb_font_t, + ); +} unsafe extern "C" { pub fn hb_paint_pop_transform( funcs: *mut hb_paint_funcs_t, @@ -1970,7 +2014,7 @@ pub type hb_font_get_glyph_from_name_func_t = ::std::option::Option< user_data: *mut ::std::os::raw::c_void, ) -> hb_bool_t, >; -pub type hb_font_draw_glyph_func_t = ::std::option::Option< +pub type hb_font_draw_glyph_or_fail_func_t = ::std::option::Option< unsafe extern "C" fn( font: *mut hb_font_t, font_data: *mut ::std::os::raw::c_void, @@ -1978,9 +2022,9 @@ pub type hb_font_draw_glyph_func_t = ::std::option::Option< draw_funcs: *mut hb_draw_funcs_t, draw_data: *mut ::std::os::raw::c_void, user_data: *mut ::std::os::raw::c_void, - ), + ) -> hb_bool_t, >; -pub type hb_font_paint_glyph_func_t = ::std::option::Option< +pub type hb_font_paint_glyph_or_fail_func_t = ::std::option::Option< unsafe extern "C" fn( font: *mut hb_font_t, font_data: *mut ::std::os::raw::c_void, @@ -1990,7 +2034,7 @@ pub type hb_font_paint_glyph_func_t = ::std::option::Option< palette_index: ::std::os::raw::c_uint, foreground: hb_color_t, user_data: *mut ::std::os::raw::c_void, - ), + ) -> hb_bool_t, >; unsafe extern "C" { pub fn hb_font_funcs_set_font_h_extents_func( @@ -2121,17 +2165,17 @@ unsafe extern "C" { ); } unsafe extern "C" { - pub fn hb_font_funcs_set_draw_glyph_func( + pub fn hb_font_funcs_set_draw_glyph_or_fail_func( ffuncs: *mut hb_font_funcs_t, - func: hb_font_draw_glyph_func_t, + func: hb_font_draw_glyph_or_fail_func_t, user_data: *mut ::std::os::raw::c_void, destroy: hb_destroy_func_t, ); } unsafe extern "C" { - pub fn hb_font_funcs_set_paint_glyph_func( + pub fn hb_font_funcs_set_paint_glyph_or_fail_func( ffuncs: *mut hb_font_funcs_t, - func: hb_font_paint_glyph_func_t, + func: hb_font_paint_glyph_or_fail_func_t, user_data: *mut ::std::os::raw::c_void, destroy: hb_destroy_func_t, ); @@ -2261,22 +2305,22 @@ unsafe extern "C" { ) -> hb_bool_t; } unsafe extern "C" { - pub fn hb_font_draw_glyph( + pub fn hb_font_draw_glyph_or_fail( font: *mut hb_font_t, glyph: hb_codepoint_t, dfuncs: *mut hb_draw_funcs_t, draw_data: *mut ::std::os::raw::c_void, - ); + ) -> hb_bool_t; } unsafe extern "C" { - pub fn hb_font_paint_glyph( + pub fn hb_font_paint_glyph_or_fail( font: *mut hb_font_t, glyph: hb_codepoint_t, pfuncs: *mut hb_paint_funcs_t, paint_data: *mut ::std::os::raw::c_void, palette_index: ::std::os::raw::c_uint, foreground: hb_color_t, - ); + ) -> hb_bool_t; } unsafe extern "C" { pub fn hb_font_get_glyph( @@ -2384,6 +2428,24 @@ unsafe extern "C" { glyph: *mut hb_codepoint_t, ) -> hb_bool_t; } +unsafe extern "C" { + pub fn hb_font_draw_glyph( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + dfuncs: *mut hb_draw_funcs_t, + draw_data: *mut ::std::os::raw::c_void, + ); +} +unsafe extern "C" { + pub fn hb_font_paint_glyph( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + pfuncs: *mut hb_paint_funcs_t, + paint_data: *mut ::std::os::raw::c_void, + palette_index: ::std::os::raw::c_uint, + foreground: hb_color_t, + ); +} unsafe extern "C" { pub fn hb_font_create(face: *mut hb_face_t) -> *mut hb_font_t; } @@ -2453,6 +2515,15 @@ unsafe extern "C" { destroy: hb_destroy_func_t, ); } +unsafe extern "C" { + pub fn hb_font_set_funcs_using( + font: *mut hb_font_t, + name: *const ::std::os::raw::c_char, + ) -> hb_bool_t; +} +unsafe extern "C" { + pub fn hb_font_list_funcs() -> *mut *const ::std::os::raw::c_char; +} unsafe extern "C" { pub fn hb_font_set_scale( font: *mut hb_font_t, @@ -2487,6 +2558,9 @@ unsafe extern "C" { unsafe extern "C" { pub fn hb_font_get_ptem(font: *mut hb_font_t) -> f32; } +unsafe extern "C" { + pub fn hb_font_is_synthetic(font: *mut hb_font_t) -> hb_bool_t; +} unsafe extern "C" { pub fn hb_font_set_synthetic_bold( font: *mut hb_font_t, @@ -2733,6 +2807,7 @@ pub enum hb_buffer_cluster_level_t { HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1, HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2, + HB_BUFFER_CLUSTER_LEVEL_GRAPHEMES = 3, } unsafe extern "C" { pub fn hb_buffer_set_cluster_level( @@ -3108,6 +3183,28 @@ pub type hb_font_get_glyph_shape_func_t = ::std::option::Option< user_data: *mut ::std::os::raw::c_void, ), >; +pub type hb_font_draw_glyph_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + draw_funcs: *mut hb_draw_funcs_t, + draw_data: *mut ::std::os::raw::c_void, + user_data: *mut ::std::os::raw::c_void, + ), +>; +pub type hb_font_paint_glyph_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + paint_funcs: *mut hb_paint_funcs_t, + paint_data: *mut ::std::os::raw::c_void, + palette_index: ::std::os::raw::c_uint, + foreground: hb_color_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; unsafe extern "C" { pub fn hb_font_funcs_set_glyph_shape_func( ffuncs: *mut hb_font_funcs_t, @@ -3116,6 +3213,22 @@ unsafe extern "C" { destroy: hb_destroy_func_t, ); } +unsafe extern "C" { + pub fn hb_font_funcs_set_draw_glyph_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_draw_glyph_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +unsafe extern "C" { + pub fn hb_font_funcs_set_paint_glyph_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_paint_glyph_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} unsafe extern "C" { pub fn hb_font_get_glyph_shape( font: *mut hb_font_t, @@ -3603,6 +3716,12 @@ unsafe extern "C" { index: ::std::os::raw::c_uint, ) -> *mut hb_face_t; } +unsafe extern "C" { + pub fn hb_ft_face_create_from_blob_or_fail( + blob: *mut hb_blob_t, + index: ::std::os::raw::c_uint, + ) -> *mut hb_face_t; +} unsafe extern "C" { pub fn hb_ft_font_create(ft_face: FT_Face, destroy: hb_destroy_func_t) -> *mut hb_font_t; } diff --git a/docs/changelog.md b/docs/changelog.md index 2e29aa30f..1601e37b7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -244,7 +244,7 @@ As features stabilize some brief notes about them will accumulate here. #### Updated * Bundled conpty.dll and OpenConsole.exe to build 1.22.250204002.nupkg -* Bundled harfbuzz to 10.4.0 +* Bundled harfbuzz to 11.2.1 * Bundled libssh to 0.11.1 * Bundled freetype to 2.13.3 * Bundled Nerd Font Symbols font to v3.3.0 -- 2.51.2