Support for custom fonts in OpenType .otf format
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 31.3k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
This is a feature request. As of today jsPDF (v1.5.3) can work with custom fonts in the .ttf format,
but not the .otf format.
Some fonts are only available in the .otf and a conversion maybe lossy.
An example is https://github.com/libertinus-fonts/libertinus
So it would be cool if jsPDF would support custom fonts in .otf format directly. There is other javascript code under a Free Software license that could be inspected like https://github.com/foliojs/fontkit .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating jsPDF's existing custom-font handling for .ttf files and identify how font data is parsed and embedded. Inspect fontkit as a possible reference for OpenType support, then define tests using a representative .otf font such as Libertinus that demonstrate successful custom-font output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100