main
Matthew Butterick 9 years ago
parent 591d19580c
commit 6020b13ca1

@ -26,17 +26,14 @@ http://pkg-build.racket-lang.org/doc/tools/drracket_module-language-tools.html#%
(define fn (send (send drr-frame get-definitions-text) get-filename))
(define pdfn (path-replace-suffix fn #".pdf"))
(define fn-out (parameterize ([current-namespace (make-base-namespace)])
(namespace-attach-module (namespace-anchor->namespace cache-module-ns) 'quad)
(namespace-attach-module (namespace-anchor->namespace cache-module-ns) 'quad/typeset)
(dynamic-require `(submod ,fn outy) 'out)))
(when fn-out
(define-values (fn-dir name dir?) (split-path fn))
(parameterize ([current-directory fn-dir])
(local-require "render.rkt" racket/class profile sugar/debug quad/logger quad/world)
(activate-logger quad-logger)
(parameterize ([world:quality-default world:max-quality]
[world:paper-width-default 600]
[world:paper-height-default 700])
(send (new pdf-renderer%) render-to-file (typeset fn-out) pdfn)))
(send (new pdf-renderer%) render-to-file (typeset fn-out) pdfn))
(parameterize ([current-input-port (open-input-string "")])
(system (format "open \"~a\"" (path->string pdfn))))))]
[number 99])

@ -174,7 +174,7 @@
(for/list ([page-cols (in-list (slice-at cols columns-per-page))])
(define-values (last-x cols)
(for/fold ([current-x (/ (- (world:paper-width-default) width-of-printed-area) 2)][cols empty]) ([col (in-list page-cols)][idx (in-naturals)])
(values (+ current-x column-width column-gutter) (cons (quad-attr-set* col 'x current-x 'y 40 world:column-index-key idx) cols))))
(values (+ current-x column-width column-gutter) (cons (quad-attr-set* col 'x current-x 'y world:top-page-margin world:column-index-key idx) cols))))
(reverse cols))))
result-pages)

@ -94,4 +94,6 @@
(define min-last-lines 2)
(define default-lines-per-column 36)
(define top-page-margin 100)
(define-parameter logging-level 'debug)
Loading…
Cancel
Save