1 /*! 2 `rustybuzz` is an attempt to incrementally port [harfbuzz](https://github.com/harfbuzz/harfbuzz) to Rust. 3 */ 4 5 // The current API is a heavily modified version of https://github.com/manuel-rhdt/harfbuzz_rs 6 7 #![doc(html_root_url = "https://docs.rs/rustybuzz/0.1.1")] 8 #![warn(missing_docs)] 9 10 mod buffer; 11 mod common; 12 mod ffi; 13 mod font; 14 15 pub use crate::buffer::*; 16 pub use crate::common::*; 17 pub use crate::font::*; 18 19 20 /// Shapes the buffer content using provided font and features. 21 /// 22 /// Consumes the buffer. You can then run `GlyphBuffer::clear` to get the `UnicodeBuffer` back 23 /// without allocating a new one. shape(font: &Font<'_>, features: &[Feature], mut buffer: UnicodeBuffer) -> GlyphBuffer24pub fn shape(font: &Font<'_>, features: &[Feature], mut buffer: UnicodeBuffer) -> GlyphBuffer { 25 buffer.guess_segment_properties(); 26 unsafe { 27 ffi::hb_shape_full( 28 font.as_ptr(), 29 buffer.0.as_ptr(), 30 features.as_ptr() as *mut _, 31 features.len() as u32, 32 std::ptr::null(), 33 ) 34 }; 35 36 GlyphBuffer(buffer.0) 37 } 38