Skip to content

Arabic/Persian or Different languages Font Problem #3924

@alixvastark

Description

@alixvastark

i loaded my arabic/persian font but some character's won't show or show wrong :

var doc = new jsPDF();
doc.addFont("test/reference/fonts/IranNastaliq-Web.ttf", "IranNastaliq", "normal");

doc.setFont("IranNastaliq"); // Set font
doc.setFontSize(150);

var persianText = "نگار شکار";

doc.text(persianText, 10, 60);

Live problem view :
https://evenz.ir/pdf/js/

Problem Image :
http://evenz.ir/pdf/1.jpg

Here is an article about arabic font to show it true :
https://learn.microsoft.com/en-us/typography/script-development/arabic

How to set some of this below tags in jsPDF or edit codes to fix this problem ?
I'm sure some of this parameter should set in jsPDF to show text true for special font's.

Cursive positioning
Feature Tag: "curs"

Contextual swash
Feature Tag: "cswh"

Kerning
Feature Tag: "kern"

Thank you ❤

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions