ifrost / afterwriting-labs

Post-processing for Fountain screenplays
http://www.afterwriting.com
226 stars 38 forks source link

EXT. weird issue #104

Closed AnthonyTschirhard closed 3 years ago

AnthonyTschirhard commented 5 years ago

Hello,

First I'd like to thank you for your work on afterwriting-labs. I'm very glad to be able to convert my fountains files into pdf on Linux in a single command line.

I'm sending you this message because I've had a very weird bug today that took me forever to understand. At some point, I noticed that on my lines EXT. PLACE - DAY All my uppercase "X" were replaced by random letters: V, K, sometimes even Ç or white spaces. Example: EVT. PLACE - DAY EÇT. PLACE - DAY E T. PLACE - DAY

But, the funny thing is, if I added a "EXT. PLACE - DAY" at the beginning of my text, then all the occurrences of this line, even at the end of the text, were fine.

After a few hours of investigations, I noticed that I had to remove some special characters from my text in order to make it work: After all the Ü, Û and ï and œ were removed, it worked just fine again.

I was able to duplicate this bug on a dummy example, see attached fountain and pdf document (check the last "EXT. TERRAIN VAGUE - NUIT" replaced by EST. TERRAIN VAGUE - NUIT Even more weird, if I display the pdf on another viewer than Ubuntu Document Viewer, it's fine... Unbelievable.

Don't know if that can be useful for you or not, but again, thanks a lot for your work!

dummy.pdf Screenshot from 2019-03-12 15-30-05 dummy_fountain.txt

Ptrph commented 5 years ago

Hello,

I'm struggling with similar issues here. With "X" too, but not in the sluglines ("EXT."). Everywhere in action lines the capital X are replaced by "É" except when in bold or italic ! For instance, I have some occurences of the words "VIEUX" and "DEUX" in all caps (I write in french), they appear as "VIEUÉ" and "DEUÉ" in the pdf. If I write "VIEUX" or "VIEUX", the bold or italic X works fine… Following your « funny thing », I've just wrote "DEUX VIEUX" in the beginning of my script, and all are then correctly exported ! (But I can't really write "DEUX VIEUX" in the beginning of my script…). That's really weird…

I've had way more issues with some capitals letters (a lot were missing or swapped with random letters), after removing every “,”,«,» (english and french quotes) and every unbreakable spaces, it seems that I've only this issue with the capital X.

I've tried with Afterwriting locally in my computer and online. This issue happens with the CourierPrime font, I've still to check thoroughly, but it seems OK with the Courier font. I've tried with the fountain package for Atom, and the issues appears with every fonts available there (CourierPrime, CourierCode… unfortunately, Courier isn't there to compare).

I would prefer using CourierPrime, but I don't know where to start to look after this issue…

Edit : And another weird thing, if I search for "VIEUX" in the pdf file, "VIEUÉ" is underlined !

ifrost commented 4 years ago

It could be a problem with JS PDF viewer which is used by default when you open "preview" in 'afterwriting. Could you try switching off JS PDF viewer in "settings"?

Screenshot_2

It seems like everything is fine with the PDF itself but it's not rendered correctly by JS PDF Viewer library. By default this library is enabled in "settings". When you disable it, PDF preview will fallback to your browser built-in PDF plugin. It's a bit slower, but at least it should create the correct result.

ifrost commented 3 years ago

I've updated PDF library. The attached example seems to be rendering fine now, but please let me know if you still have any issues with it.