piersdeseilligny / betterfountain

A screenwriting app integrated into visual studio code
https://marketplace.visualstudio.com/items?itemName=piersdeseilligny.betterfountain
MIT License
356 stars 54 forks source link

Add full support for UTF-8 characters #112

Open HughxDev opened 3 years ago

HughxDev commented 3 years ago

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

piersdeseilligny commented 3 years ago

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)

HughxDev commented 3 years ago

@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.

geueds commented 3 years ago

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

piersdeseilligny commented 3 years ago

@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 :)

geueds commented 3 years ago

@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 :)