Pdf-lib: Space issue in Embedding Hindi (Mangal Based) Font

Created on 4 Aug 2020  路  1Comment  路  Source: Hopding/pdf-lib

Code used to embed the font

const ourFont = await fetch(path_to_font).then((res) => res.arrayBuffer())
pdfDoc.registerFontkit(fontkit)
const font = await pdfDoc.embedFont(ourFont)

Results

| In Generated PDF | In Word |
|---|---|
| image | image |

There is unwanted space in half-characters with Mangal type fonts, the meanwhile same font works perfectly in MS Word, Is there something I'm missing while embedding this font?
Thanks in Advance.

Most helpful comment

I was able to fix this by adding {subset: true} while embedding font.

>All comments

I was able to fix this by adding {subset: true} while embedding font.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielJackson-Oslo picture DanielJackson-Oslo  路  3Comments

jboxxx picture jboxxx  路  4Comments

keyhoffman picture keyhoffman  路  4Comments

lepidotteri picture lepidotteri  路  3Comments

MarcGodard picture MarcGodard  路  3Comments