piersdeseilligny / betterfountain

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

Feature Request: PDF Formatting Using Layout Language (maybe FDXT?) #181

Open anthonyjoeseph opened 2 years ago

anthonyjoeseph commented 2 years ago

I'm a huge fan of this project and I use it constantly!

I'd like to be able to export a pdf laid out as a stage play rather than a screenplay

After some googling, I came across this blog explaining how to do this in Final Draft - blog post

This uses a file called DramatistsGuildModernStageplay.fdxt, a layout encoded as xml

Final Draft has a library of these .fdxt layouts, which are downloadable - docs

Maybe it'd be possible to extend betterfountain's custom font support to support more layout features like margins, sizes, positioning etc via FDXT

My day gig is typescript development, would a PR for something like this be welcome?

P.S. maybe rather than something proprietary like FDXT, some open-source layout language already exists? An analog where .fdx:.fountain :: .fdxt:fountaint maybe? Maybe this should be developed?

piersdeseilligny commented 1 year ago

@anthonyjoeseph thanks for opening this issue, and apologies for the late response!

BetterFountain defines the PDF layout in the print.ts file (that's how the differences in printing layout for a4 and letter formats are defined), so that might be a good place to start a potential PR on this.

I'm open to translating fdxt layouts, but I doubt complete interoperability would ever be possible, so it might make more sense (and especially be clearer) to use a JSON file, that could extend/inherit the PrintProfile already selected in the settings (a4 or letter).

Then the question is what the best way of doing this is... My first guess would be something like having a JSON file sit alongside the .fountain, maybe with a .bflayout extension or something, and then we can define a set of rules defining when this sidecar file is used and when it's not (based on filename). But there might be better ways of doing this, let me know what you think!