Skip to content

CFF glyph parsing doesn’t work with WOFF #199

@mbutterick

Description

@mbutterick

The problem is here. This sets up stream to be this._font, which is a stream representing the whole font file. In a regular OTF, this works because the offsets in cff.topDict.CharStrings are global (that is, relative to the beginning of the font file).

However this is apparently not true in WOFF — the offsets in cff.topDict.CharStrings are relative to the beginning of the CFF table.

The fix is to check if this._font is a WOFF font, and if so, use the CFF table stream as the value for stream (instead of this._font itself).

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