When I create the Glyf and Loca tables using
let (table_glyf, table_loca, loca_format) = glyf_loca_builder.build();
the docs say This method also returns the loca format; the caller is responsible for setting this field in the head table.
Ok. But how? The returned type is different from Head.index_to_loc_format.
Currently, I'm doing the following:
table_head.index_to_loc_format = loca_format as _;
As a normal caller I can only guess that this is
- the correct field
- the correct type conversion
Adding a function set_loca_format and then calling table_head.set_loca_format(loca_format) would make it clear.
When I create the
GlyfandLocatables usingthe docs say
This method also returns the loca format; the caller is responsible for setting this field in the head table.Ok. But how? The returned type is different from
Head.index_to_loc_format.Currently, I'm doing the following:
As a normal caller I can only guess that this is
Adding a function
set_loca_formatand then callingtable_head.set_loca_format(loca_format)would make it clear.