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

Allow to set text features to support rtl #89

Open
moshfeu opened this issue Feb 15, 2024 · 0 comments · May be fixed by #90
Open

Allow to set text features to support rtl #89

moshfeu opened this issue Feb 15, 2024 · 0 comments · May be fixed by #90

Comments

@moshfeu
Copy link

moshfeu commented Feb 15, 2024

The way rtl is supported in pdfkit is by passing features prop to the text function

foliojs/pdfkit#219 (comment)

Please allow to pass the features props to the table function. Something like

const table = {
  title: "כותרת",
  subtitle: "Subtitle",
  headers: [ "Country", "Conversion rate", "Trend" ],
  rows: [
    [ "Switzerland", "12%", "+1.12%" ],
    [ "France", "67%", "-0.98%" ],
    [ "England", "33%", "+4.44%" ],
  ],
  textFeatures: ['rtla']
}

And pass it here

pdfkit-table/index.js

Lines 555 to 560 in 707a191

this.text(header,
lastPositionX + (cellPadding.left),
startY, {
width: Number(columnSizes[i]) - (cellPadding.left + cellPadding.right),
align: 'left',
});

When I think about it, allowing setting align is also a good idea

@moshfeu moshfeu linked a pull request Feb 17, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant