betterfountain icon indicating copy to clipboard operation
betterfountain copied to clipboard

Add full support for UTF-8 characters

Open HughxDev opened this issue 4 years ago • 5 comments

I can’t export Japanese text to PDF, even though it shows up fine in the preview.

While editing: Screenplay preview: Japanese text and subtitles in dual dialog format

After exporting: Screenplay export: Dual dialog with missing text on the right side

HughxDev avatar Jan 31 '21 20:01 HughxDev

I believe that's a font issue, because Courier Prime doesn't include those characters - definitely something that I'm going to look at fixing though.

In the meantime though, the good news is that it should hopefully work if you change the font (with the Font: title page key)

piersdeseilligny avatar Jan 31 '21 20:01 piersdeseilligny

@piersdeseilligny Thanks. My suggestion for the full fix would be to implement something similar to CSS’s font-family, where fallback fonts can be specified in a comma-separated list in the Font: key. I.e. use the first font for everything if possible, but for any glyph that is missing, try rendering it in the next font in the stack, and repeat that process if necessary.

HughxDev avatar Jan 31 '21 21:01 HughxDev

@hguiney What font are you using for editing (I mean, the vscode font itself)?

geueds avatar Mar 08 '21 07:03 geueds

@piersdeseilligny Thanks. My suggestion for the full fix would be to implement something similar to CSS’s font-family, where fallback fonts can be specified in a comma-separated list in the Font: key. I.e. use the first font for everything if possible, but for any glyph that is missing, try rendering it in the next font in the stack, and repeat that process if necessary.

So unfortunately pdfkit doesn't support that (see https://github.com/foliojs/pdfkit/issues/201) even though it really should. However @at-guedesnt is working on merging a bunch of courier-type fonts, so that'll hopefully fix the issue :)

piersdeseilligny avatar Mar 08 '21 12:03 piersdeseilligny

@piersdeseilligny Thanks. My suggestion for the full fix would be to implement something similar to CSS’s font-family, where fallback fonts can be specified in a comma-separated list in the Font: key. I.e. use the first font for everything if possible, but for any glyph that is missing, try rendering it in the next font in the stack, and repeat that process if necessary.

So unfortunately pdfkit doesn't support that (see foliojs/pdfkit#201) even though it really should. However @at-guedesnt is working on merging a bunch of courier-type fonts, so that'll hopefully fix the issue :)

Sure! Please check the Courier Plus project :)

geueds avatar Mar 08 '21 13:03 geueds