bb94
bb94

Reputation: 1304

Units used by hb_position_t in HarfBuzz

I've been looking at this page, as well as this code example and I've noticed that the x_advance, y_advance, x_offset and y_offset fields in hb_glyph_position_t are of the type hb_position_t, which is an alias to int32_t. I haven't found any documentation about which units are used for these fields. The examples above suggest that they're 64ths of something, but that's all I can infer.

Does anyone else know the exact unit implied by hb_position_t?

Upvotes: 4

Views: 967

Answers (1)

Ebrahim Byagowi
Ebrahim Byagowi

Reputation: 11228

It is in input font size units (say pixels).

The idea there is you multiply the input font size by 64 then you divide the position by 64 after the shaping so you will be in control of how much sub pixel precision you need.

Upvotes: 3

Related Questions