Skip to content

Undefined is not an object (evaluationg 'cff.topDict') #135

@howedeng

Description

@howedeng

It was throw exception TypeError:Undefined is not an object (evaluationg 'cff.topDict') when i loaded Apple PingFang Font and called fontData.glyphForCodePoint(120)

code:

fontData = fontkit.create(toBuffer(fontBase64Str));
xheight = getFontXHeight(fontData);

function toBuffer(base64data) {
var buffer = new Buffer(base64data,'base64');
return buffer
}
function getFontXHeight(fontData) {
fontData = fontData.glyphForCodePoint(120);
if (0 != fontData.id) {
return fontData = fontData.bbox;
} else {
return fontData.maxY - fontData.minY;
}
}
it was word well when loaded other font

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