servo / font-kit

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

'load_font_table' returns None for BASE table #182

Open kevinyang372 opened 3 years ago

kevinyang372 commented 3 years ago

I am trying to use the 'BASE' table in OpenType font and the following code returns None for some reason:

let BASE_TABLE_TAG = 0x62736c6e; // The hex code for BASE
println!("{:?}", font.load_font_table(BASE_TABLE_TAG)); // prints None

I am also curious if font_kit supports a better way to determine the baseline for multiple fonts on the same line. Currently I am using the ascent value in font metrics as the shift from the top to the baseline but different fonts have different ascents and I couldn't figure out a way to align these fonts uniformly.