Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongolian font support #3792

Open
daria2023 opened this issue Nov 13, 2024 · 0 comments
Open

mongolian font support #3792

daria2023 opened this issue Nov 13, 2024 · 0 comments

Comments

@daria2023
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant