Skip to content

How to get units_per_em of a font #83

Answered by wezm
floppyhammer asked this question in Q&A
Discussion options

You must be logged in to vote

units_per_em is in the head table. If you have a Font you can do something like this:

    let head = font.head_table()
        .expect("unable to parse head table")
        .expect("font lacks a head table");
    println!("units per em: {}", head.units_per_em);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@floppyhammer
Comment options

Answer selected by floppyhammer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants