freetype-rs icon indicating copy to clipboard operation
freetype-rs copied to clipboard

sample single_glyph problem for j

Open joyhope opened this issue 3 years ago • 0 comments

run command cargo run --example single_glyph examples/assets/FiraSans-Regular.ttf j

The problem meets.

bitmap_left() is possible <0

let x = if glyph.bitmap_left() > 0 {glyph.bitmap_left() as usize } else {(-glyph.bitmap_left()) as usize};

j is a little special case. But I did not know how to make the sample better for get correct gylyph height and width. It seems bitmap_xxx api is not get the outline of the character. bbox may be helpful.

joyhope avatar May 04 '22 11:05 joyhope