I'm designing a movie script editing text editor for fun, and to try learn something about low level UI design. The format of a screenplay is quite simple, and is by long-standing standard written solely in 12pt courier. So I get the impression that designing an editor would be fairly straightforward, having only one font and font size, and no special formatting.
I'm keen on preserving semantic information -- eg, I want the scene header to be stored as a scene header, not just as text formatted as a scene header.
The application is further complicated by the change tracking required in scripts. Additional pages should have revision information at the top, therefore the document needs to be stored as a set of pages, with appropriate information identifying revisions.
It seems to make sense to keep the document as a separate object from the view, then call methods on a document object to add text etc, based on input in the view. However, which object is responsible for the pagination? At first guess I would have said the document, but pagination seems like a presentation thing. It would also not make sense for the document to use the graphics text API to measure strings and work out how much space they take up. However, if it was up to the view, this is in theory liable to conflict with how it has been stored in the document. So what would be the best solution?
I have plenty of experience in programming, but have had very little to do with the nitty gritty of drawing my own user controls from scratch. I've also deliberately avoided tying this to a specific language, but I'd most likely be writing in C# or C++.
Thanks for your time.