Skip to content

CFF2 fonts with no vstore are rejected #275

Open

Description

@plokmijnuhby

If a font using CFF2 has no variation data, according to the OTF spec, it should not reference a vstore in its top DICT. However, if it doesn't reference a vstore, OTS will reject it, with the message "Failed to parse Top DICT Data".
This happens because the code to check the top DICT (here) assumes that a vstore is present, reads the entire dict looking for it, gets to the end of the dict and can't read any more bytes, and complains.

Activity

  1. jfkthame commented on Mar 27, 2024

    @jfkthame
    Collaborator

    @plokmijnuhby Could you attach an example of such a font (or point to a freely-available one)? I'd be reluctant to try fixing without a testcase on hand.

  2. plokmijnuhby commented on Mar 27, 2024

    @plokmijnuhby
    Author

    I don't have a fully complete file available unfortunately (and I couldn't find one online). This file has no vstore and triggers the message, although it has other issues which are nothing to do with this bug.
    font.zip

  3. behdad commented on Oct 25, 2024

    @behdad
    Collaborator

    We should fix this. I don't immediately see where the error comes from. Can you please paste the error output at least? A test font would be best.

  4. plokmijnuhby commented on Oct 27, 2024

    @plokmijnuhby
    Author

    The only errors are these:
    image

  5. behdad commented on Oct 29, 2024

    @behdad
    Collaborator

    I don't have a fully complete file available unfortunately (and I couldn't find one online). This file has no vstore and triggers the message, although it has other issues which are nothing to do with this bug.

    When I debug the failure with this font, it's using operator byte 11 in TopDICT. There's no such operation in the CFF2 spec, so OTS fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions