4 releases

0.1.2 Nov 17, 2023
0.1.1 Oct 6, 2023
0.1.0 Apr 14, 2023
0.0.1 Nov 21, 2022

#3 in #harfbuzz

26 downloads per month

Custom license

1MB
12K SLoC

icu_harfbuzz crates.io

Using ICU4X as the Unicode Database back end for HarfBuzz.

Examples

use harfbuzz::{Buffer, Direction, sys};

let mut b = Buffer::with("مساء الخير");

let unicode_funcs = icu_harfbuzz::new_hb_unicode_funcs().unwrap();

// NOTE: This currently requires `unsafe` code. For progress toward a safe abstraction, see:
// <https://github.com/servo/rust-harfbuzz/pull/197>
unsafe {
    harfbuzz::sys::hb_buffer_set_unicode_funcs(b.as_ptr(), unicode_funcs.as_ptr());
}

b.guess_segment_properties();
assert_eq!(b.get_direction(), Direction::RTL);
assert_eq!(b.get_script(), sys::HB_SCRIPT_ARABIC);

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.


lib.rs:

Using ICU4X as the Unicode Database back end for HarfBuzz.

Examples

use harfbuzz::{Buffer, Direction, sys};

let mut b = Buffer::with("مساء الخير");

let unicode_funcs = icu_harfbuzz::new_hb_unicode_funcs().unwrap();

// NOTE: This currently requires `unsafe` code. For progress toward a safe abstraction, see:
// <https://github.com/servo/rust-harfbuzz/pull/197>
unsafe {
    harfbuzz::sys::hb_buffer_set_unicode_funcs(b.as_ptr(), unicode_funcs.as_ptr());
}

b.guess_segment_properties();
assert_eq!(b.get_direction(), Direction::RTL);
assert_eq!(b.get_script(), sys::HB_SCRIPT_ARABIC);

Dependencies

~2.3–3MB
~57K SLoC