2 unstable releases
0.1.0 | Apr 14, 2023 |
---|---|
0.0.1 | Nov 21, 2022 |
#50 in #cldr
1MB
12K
SLoC
icu_harfbuzz 
Using ICU4X as the Unicode Database back end for HarfBuzz.
Examples
use harfbuzz::{Buffer, Direction, sys};
use icu_harfbuzz::new_hb_unicode_funcs_unstable;
let mut b = Buffer::with("مساء الخير");
let unicode_funcs = new_hb_unicode_funcs_unstable(&icu_testdata::unstable()).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};
use icu_harfbuzz::new_hb_unicode_funcs_unstable;
let mut b = Buffer::with("مساء الخير");
let unicode_funcs = new_hb_unicode_funcs_unstable(&icu_testdata::unstable()).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
~11MB
~105K SLoC