harfbuzz / harfbuzz/harfbuzz_rs
Using the master branch as a dependency and running the example is broken on M2.
- Dominant language
- Rust
- Stars
- 64
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Hello.
My machine is a MacBook Air M2.
I am on the latest Rust release (1.75.0).
This is my `dependencies` section in `Cargo.toml`
```toml
[dependencies]
harfbuzz_rs = { git = "https://github.com/harfbuzz/harfbuzz_rs.git" }
```
I am using the example code given in the crate. Regardless, this is my code:
```rust
use std::error::Error;
use harfbuzz_rs::*;
fn main() -> Result<(), Box> {
let path =
"/Users/abdulrahmansibahi/Documents/rust/mimiron/mimiron/fonts/YanoneKaffeesatz-Medium.ttf";
let index = 0; //< face index in the font file
let face = Face::from_file(path, index)?;
let font = Font::new(face);
let buffer = UnicodeBuffer::new().add_str("Hello World!");
let output = shape(&font, buffer, &[]);
let positions = output.get_glyph_positions();
let infos = output.get_glyph_infos();
for (position, info) in positions.iter().zip(infos) {
let gid = info.codepoint;
let cluster = info.cluster;
let x_advance = position.x_advance;
let x_offset = position.x_offset;
let y_offset = position.y_offset;
println!(
"gid: {:?}. cluster: {:?}. x_advance: {:?}, x_offset: {:?} y_offset: {:?}",
gid, cluster, x_advance, x_offset, y_offset
);
}
Ok(())
}
```
And this is the error I get :
[error.txt](https://github.com/harfbuzz/harfbuzz_rs/files/13846166/error.txt)
I asked in the Rust Community Discord server and it apparently works on other, non-Apple, systems. I haven't tried myself as I .. don't have other systems.
This same code works on the Crates.io version.
Edit: This is the last good commit that works for me : https://github.com/harfbuzz/harfbuzz_rs/commit/15d1c2a7b661c3a9f5f72132177f56ea19d2abdf , pre removing the `harfbuzz_sys` crate as a dependency.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.