servo / font-kit

A cross-platform font loading library written in Rust
Apache License 2.0
660 stars 98 forks source link

How to get the path of a character? #210

Closed yk0n9 closed 1 year ago

yk0n9 commented 1 year ago

I now use the following code

let mut builder = OutlineBuilder::new();
let c = f.glyph_for_char(c).unwrap();
font.outline(c, HintingOptions::None, &mut builder).unwrap();
for i in builder.into_outline().contours {
    ...
}

I can only get the coordinate points of all the outlines by doing this. I want to get the coordinate points of the internal path of the font. How should I do it?