Skip to content

Font has no name table throw TypeError: Cannot read property 'compression' of undefined #458

@i2534

Description

@i2534

Expected Behavior

skip parse name table

Current Behavior

When open an embed font, who's tables like (ttfdump):
Offset Table


sfnt version: 1.0
numTables = 9
searchRange = 128
entrySelector = 3
rangeShift = 16

  1. 'cvt ' - chksm = 0x74E2F99D, off = 0x0000009C, len = 2092
  2. 'fpgm' - chksm = 0x379E7810, off = 0x000008C8, len = 1599
  3. 'glyf' - chksm = 0xABC33A52, off = 0x00000F08, len = 4246
  4. 'head' - chksm = 0xE3ACEF64, off = 0x00001FA0, len = 54
  5. 'hhea' - chksm = 0x13041853, off = 0x00001FD8, len = 36
  6. 'hmtx' - chksm = 0xBA6A7548, off = 0x00001FFC, len = 16392
  7. 'loca' - chksm = 0x01068764, off = 0x00006004, len = 16396
  8. 'maxp' - chksm = 0x194B065D, off = 0x0000A010, len = 32
  9. 'prep' - chksm = 0x025F6028, off = 0x0000A030, len = 4968

so nameTableEntry is undefined,
opentype.js line 311: const nameTable = uncompressTable(data, nameTableEntry);
cause TypeError: Cannot read property 'compression' of undefined

Possible Solution

check nameTableEntry is undefined

Steps to Reproduce (for bugs)

  1. load font.zip as ArrayBuffer
  2. invoke Font.parse(buffer)

Context

Your Environment

  • Version used: 1.3.3
  • Font used:
  • Browser Name and version: Google Chrome 87.0.4280.88 x64
  • Operating System and version (desktop or mobile): Windows 10 1909
  • Link to your project:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions