foliojs / fontkit

An advanced font engine for Node and the browser
1.44k stars 210 forks source link

Empty _table object #333

Open EhsanParsania opened 2 months ago

EhsanParsania commented 2 months ago

When I try to read the _table object that includes the fontFamily and fontSubfamily and some other information, the _table object is empty until I write this line const obtain_tableObject = font.familyName , it triggers like a function and then I can see the _table object is full with data

 const fontBuffer = await Parse.Cloud.httpRequest({ url: fontUrl, followRedirects: true })
      .then(response => response.buffer);

    const font = fontkit.create(fontBuffer);

    const obtain_tableObject = font.familyName;  // WARNING: This line is necessary to be, otherwise "_table" will be empty

    let fontFamily = font._tables.name.records.fontFamily.en
    let fontSubfamily = font._tables.name.records.fontSubfamily.en