Paste: Sprint stuff
Author: | Nah |
Mode: | postscript |
Date: | Mon, 25 Jun 2012 00:09:12 |
Plain Text |
<<
/GenericResourceDir (./Resource/)
% You might also want to add paths to fonts and other stuff.
>> setsystemparams
/sprint /ProcSet findresource { def } forall
sprint!
/h1 /corbelb.ttf 15 pfont
/h2 /corbelb.ttf 13 pfont
/p /constan.ttf 11 pfont
/code /consola.ttf 11 pfont
/h2 { font:h2 justify newline } bind def
[ << /width 26 /height 38 /left 7 /bottom 7 >> ] setlayout!
/layout2 {
[ << /width 16 /height 16 /left 03 /bottom 31 >>
<< /width 16 /height 16 /left 21 /bottom 31 >>
<< /width 16 /height 16 /left 03 /bottom 05 >>
<< /width 16 /height 16 /left 21 /bottom 05 >>
] setlayout!
/layout2 load /page:pre off
} bind def
/drawstuff {
/drawstuff load /page off
gsave
<< /w 16 /h 16 /x 03 /y 31 >> gridshow
<< /w 16 /h 16 /x 21 /y 31 >> gridshow
<< /w 16 /h 16 /x 03 /y 05 >> gridshow
<< /w 16 /h 16 /x 21 /y 05 >> gridshow
0.50 0.10 0 0 setcmykcolor font:h2
{ cvroman dup stringwidth pop 2 div neg 0 rmoveto show }
165 720 moveto 1 1 index exec
435 720 moveto 2 1 index exec
165 330 moveto 3 1 index exec
435 330 moveto 4 1 index exec pop
-6 grid /y get 24.5 mul
translate
15 setlinewidth
0 1 3 {
0 0 0 1 4 index 4
exch roll setcmykcolor
0 1 index 15 mul
moveto 612 0 rlineto
stroke pop
} for
grestore
} bind def
doc:
(Sprint, a PostScript Typesetting Library)
h1
(PostScript is probably best known as a device-independent page description language, or maybe for its use in computer font files, such as OpenType fonts. It's also a general purpose programming language; a deceptively simple one.)
p+
(It provides various drawing commands, facilitating creation of sophisticated graphics. However, it has no built-in typesetting tools. That's where Sprint comes in, by providing basic typesetting capabilities, including:)
p+
list:
(Full justification, automatic line breaking, as well as page breaking.)
item
(Customizable grid layout, allowing any number of rows and columns.)
item
(Some formatting tools: unordered lists, numbered lists (either Hindu- Arabic or Roman numerals), tables and more.)
item
(An event system for running custom procedures when something inte- resting happens, like a page break.)
item
.
br
(Design Rationale and Roadmap)
h1
(Sprint trades the mostly automagic behavior of LaTeX for more control and a full-fledged programming language. However, I do want to get closer to the automation sweet spot. Some features that are under development:)
p+
list:
(Automatic sectioning and numbering.)
item
(Direct input of text, by reading plain text from the current file, possibly with some embedded code.)
item
(Automatic generation of table of contents, likely as a separate step.)
item
(Tools that simplify typesetting mathematical formulae.)
item
.
/layout2 load /page:pre on
/drawstuff load /page on
(Of course, you can use any PostScript code at any point, when you need something more. More more more more more more more more more more mor.)
p
(The Sprint Layout System)
h2
(Sprint comes with a basic layout system, where a page consists of one or more boxes. For a standard single-column layout, use a single, centered box. For a double-column layout, simply place two boxes side by side.)
p+
(This page uses a layout consisting of four boxes, with numbers and grids printed to help visualize what's going on. When this box gets full, the text continues in the next one.)
p+
(Urgh dunno what to type type type type. My justification looks like ass in these narrow columns, how to de-ass? Automatic hyphenation would probably help. More text so that it goes into the next box boxy boxy box, but then I shall have to resort to lorem ipsum.)
p+
(Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.)
p+
(Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.)
p
(In third box now? Another one to go? Oh well, you get the idea, it goes to the last one eventually. Test some crap.)
p+
list: /arabic style
(One up here.)
item
(Two is next.)
item
list:
(Then one in here because nest.)
item
(Two too.)
item
.
(Then back to three and order.)
item
.
.
New Annotation