Skip to content

Directory::searchRange, Directory::entrySelector and Direcoty::rangeShift computation are incorrect #160

@be5invis

Description

@be5invis

https://github.com/devongovett/fontkit/blob/master/src/tables/directory.js#L47

Per OTS it should be:

this.searchRange = Math.pow(2, Math.floor(Math.log(this.numTables) / Math.LN2)) * 16;
this.entrySelector = Math.floor(Math.log(this.numTables) / Math.LN2);
this.rangeShift = this.numTables * 16 - this.searchRange;

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