Template copies that come out right, and you only pay for those
Seshat now moves the words after a filled placeholder along their line, reads InDesign fonts correctly, and charges only for template copies that came out right.
Filling a template with names, courses and dates now works the way it looks on paper: the text after a placeholder makes room for what goes in it.
What changes for you
- The rest of the line moves along. Programs such as InDesign and dompdf place every word of a line on its own. A course name longer than its placeholder used to print over the words after it. Now those words move by exactly the difference, so "the course Prepress basics with grade A" reads as one sentence. Text in a column further along, like a date in a second language, only moves when it would otherwise be overprinted, so columns stay aligned wherever there is room.
- Overflow is reported. When a long text would push its line past the edge of the page, the copy is reported as
overflowinstead of "done", so you see it before it is printed. - Templates from InDesign are read correctly. Fonts that InDesign embeds with a two-byte letter table are now read one letter at a time, so their placeholders are found.
- Centring only where it belongs.
align: 'center'centres a placeholder that is its whole line, such as a name; a placeholder in the middle of a sentence keeps its start.
You pay for copies that came out right
A copy is charged when every placeholder was set and fits the page. A copy that could only be set partly, for instance a name with a letter the template's font does not have, is free, up to a tenth of the copies in a job. When more than a tenth of a job comes out partly, the template or the data is the cause, so those copies are charged and the job says so. A copy where nothing could be set is never charged.
Nothing changes in your code: rekhu/core and @rekhu/core 0.8.0 already use all of this. Examples are on the Seshat docs.