parallax/jsPDF

mongolian font support

Opened this issue · 0 comments

Description

I'm using jspdf v2.5.1, and faced the mongolian font error problem:
here is how i create the instance :

    this.doc = new jsPDF({
      orientation: 'p',
      unit: 'px',
      format: [width, height],
      hotfixes: ['px_scaling'],
      compress: true,
    })

and i'm using canvas context to draw text, like this:

    this.ctx = this.doc.context2d
    this.ctx.font = '24px NotoSansMongolian-Regular'
    this.ctx.fillText(' ᠬᠦ ᠲᠦ ᠳᠠᠨᠠᠢᠨ᠎ᠠ',100,100)

the test font is downloaded on google font NotoSansMongolian-Regular, and i've followed the readme instruction and convert the font to js module and import it on the html like this:

<script  type="module" src="/public/NotoSansMongolian-Regular-normal.js"></script>

and it is using the mongolian font fine, but the thing is the font should looked like this(each character group together to show the whole word):
image

but it just displayed each character alone:
image

since it looks fine on browser when using this specific font, i think maybe there need a specific procession on the low level font process?