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

Chinese characters cannot rendered in PDF even if dedicated font command #146

Open
DrClairvoyant opened this issue Nov 13, 2021 · 7 comments
Labels
bug Something isn't working pdfkit bug A bug that results from an issue in pdfkit

Comments

@DrClairvoyant
Copy link

Hello, I met with some problems when exporting my script written in Chinese into PDF. I wrote the script entirely in Chinese, and the preview shows all the Chinese characters, but they just turned to blank when I exported a PDF copy.

I've looked into some other issue page and tried the Font: header command, and it works in the preview (all the characters in the preview mode are changed to the specified font), but the PDF only shows the non-Chinese characters in it, such as the numbers and alphabets.

I attached my original .fountain script file and the PDF copy of it below so you can have a check on it.

The issued PDF.pdf

Really hope that this bug could be fixed real soon 🙏🙏🙏

@piersdeseilligny
Copy link
Owner

Hi @DrClairvoyant Thanks for reporting this - could you just attach the .fountain document too (I think you forgot to attach it, there's only the PDF :p ) and i'il try and get it fixed asap

@piersdeseilligny piersdeseilligny added the bug Something isn't working label Nov 13, 2021
@DrClairvoyant
Copy link
Author

Hi @piersdeseilligny I tried to submit the .fountain file together with the PDF, but it seems that GitHub doesn't support the upload of this kind of file. I will tried to find an alternative solution to it.

@DrClairvoyant
Copy link
Author

https://1drv.ms/u/s!AoWOjyNwjo2Ag_1GXVc9hENLQjzagQ?e=9cQ71Q

I'm using OneDrive to share the .fountain file, see if you can download it 😉

@DrClairvoyant
Copy link
Author

Btw I actually found a free fountain app called "Writer for Mac", which can actually export the non-latin characters in PDF successfully! Anyways I found an alternative for export, so I don't really need the internal export function for now, but good luck with the future developing and debugging! 😆 Hope you could really solve this problem in future 🙏

@piersdeseilligny
Copy link
Owner

So the issue is that most Chinese fonts are .ttc, rather than .ttf, which isn't a format supported by font-finder, the library I use to detect and index all the fonts on a machine. I've started working on adding ttc support to font-finder, but it might take a bit of time.

@piersdeseilligny
Copy link
Owner

I've submitted a pull request on the font-finder repo which adds support for Chinese fonts (and other TTC ones, such as Cambria). As soon as it's approved, i'il be able to publish a new version of betterfountain which will fix this issue!

If my PR isn't merged by the end of the month, I'il just include my fork of font-finder straight into betterfountain.

@piersdeseilligny
Copy link
Owner

So I've tried directly including the font-finder fork into betterfountain, but a bunch of ttc fonts are mysteriously incompatible with pdfkit for some reason... Additionally, the few that do work have a bunch of other issues, resulting from the fact that the characters are about double the width of most western fonts.

Unfortunately, I think this will have to go on the backburner. That said, I promise the next big rewrite of betterfountain (whenever that happens..) will be a lot more friendly to international alphabets. I really don't want it to be as western-centric as it currently is.

@piersdeseilligny piersdeseilligny added the pdfkit bug A bug that results from an issue in pdfkit label Jan 9, 2022
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