mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[fontations] Use a slice
This commit is contained in:
parent
3f57f76e99
commit
024e9356eb
1 changed files with 2 additions and 1 deletions
|
@ -358,10 +358,11 @@ pub extern "C" fn hb_fontations_font_set_funcs(font: *mut hb_font_t) {
|
|||
|
||||
let mut num_coords: u32 = 0;
|
||||
let coords = unsafe { hb_font_get_var_coords_normalized(font, &mut num_coords) };
|
||||
let coords = unsafe { std::slice::from_raw_parts(coords, num_coords as usize) };
|
||||
let mut location = Location::new(num_coords as usize);
|
||||
let coords_mut = location.coords_mut();
|
||||
for i in 0..num_coords as usize {
|
||||
coords_mut[i] = NormalizedCoord::from_bits(unsafe { *coords.offset(i as isize) } as i16);
|
||||
coords_mut[i] = NormalizedCoord::from_bits(coords[i] as i16);
|
||||
}
|
||||
|
||||
let outline_glyphs = font_ref.outline_glyphs();
|
||||
|
|
Loading…
Add table
Reference in a new issue