Skip to content

[write-fonts] Table Head should have a function set_loca_format #1784

Description

@jqwv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions