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

Non-English Characters: Shown in live-preview, but do not rendered in PDF #133

Open
vaibhavbshete opened this issue May 27, 2021 · 2 comments
Labels
bug Something isn't working pdfkit bug A bug that results from an issue in pdfkit

Comments

@vaibhavbshete
Copy link

vaibhavbshete commented May 27, 2021

I am from India and I want to be able to write script in my language which is in Devanagari Script.
I can write it, it shows up well in live preview, but when a PDF is exported, those words are not there. There are blank spaces. First I thought it was just because fonts were missing. But then when I copied that part from the PDF and pasted it in notepad, it showed missing characters (rectangles with question marks). So not just the fonts are missing, those characters are having trouble being encoded in the PDF too.
Now I understand it would be difficult to figure out a mono-spaced font for every language in the world and have it as that language's default, but instead is there a way to give us control over the character encoding and fonts while exporting (or whatever makes this problem go away)?

Preview works well:
image

PDF shows blanks:
image
When copied from PDF to Notepad:
image

@piersdeseilligny
Copy link
Owner

Hi @vaibhavbshete, sorry for the delay in getting back to you. The problem is actually that pdfkit (the PDF Library BetterFountain uses) does not support fallback fonts. It's an issue that's plagued the library since 2014, but there's still no real solution to it...

The alternative is to use a font which supports Devanagari characters, which you can do by adding the Font: title page key. So for example:

Title: Hello
Font: Arial

I wish there was a better solution, but it's not really under my control :/

@piersdeseilligny piersdeseilligny added pdfkit bug A bug that results from an issue in pdfkit bug Something isn't working labels May 30, 2021
@vaibhavbshete
Copy link
Author

Thank you very much. This is a great alternative that I hadn't considered. Sorry you had to repeat what is already in the the Readme.md, I found out now.. (I had come from fountain.io and had only read the syntax over there). Let's hope PDFKit makes fallback fonts a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pdfkit bug A bug that results from an issue in pdfkit
Projects
None yet
Development

No branches or pull requests

2 participants