9.0.0.2
5 Pict Renderer
| (require uni-table/pict) | package: uni-table |
Use this module to output the result in DrRacket REPL or under similar environment.
Converts given table to pict? using table->pict.
5.1 ECMA-48 SGR Pict
| (require uni-table/private/sgr-pict) | package: uni-table |
This module handles rendering strings with ECMA SGR sequences into a picture. It is intended mainly for usage with DrRacket and for rendering colored output to documentation.
parameter
(sgr-pict-font font) → void? font : symbol?
A parameter? determining which font to use for converting
sgr-lines? to a pict?. Defaults to 'modern.
parameter
(get-sgr-pict-font-size proc) → void? proc : (-> exact-nonnegative-integer?)
A procedure? which returns the font size used for
converting sgr-lines? to a pict?.
Defaults to: (λ () ((get-current-code-font-size)))
procedure
color :
(or/c (integer-in 0 255) sgr-rgb?)
Converts a given SGR color specification - either an index to 8,
16, or 256 color palette or sgr-rgb? value - to a list of
three byte? values representing the red, green, and blue
channels respectively. This value can be used with colorize
directly.
Converts a given string? to a pict? using
provided sgr-state? for specifying graphic rendering
properties.
Converts a given string? to a pair of pict?s
using provided sgr-state? for specifying graphic rendering
properties. The first returned value represents the foreground and the
second one is the background image.
Converts a given sgr-list? to a pict?. Starts
with empty-sgr-state - therefore any styling must be part of
the given list. As ecma-csi-sgr-parse-lines produces the
lists with prepended sgr-state?, it is used as a basic block
for rendering sgr-lines?.
Converts a given sgr-list? to a pair of
pict?s. Starts with empty-sgr-state - therefore any
styling must be part of the given list. As
ecma-csi-sgr-parse-lines produces the lists with prepended
sgr-state?, it is used as a basic block for rendering
sgr-lines?. The first returned value represents the
foreground and the second one is the background image.
Converts a block of sgr-list? lines into a pict?.
5.2 Pict Conversion
| (require uni-table/private/table-pict) | package: uni-table |
This module performs all the transformation and prerendering like the printing module but instead of producing output to a output-port? or string?, it creates a pict? which can be displayed in DrRacket or rendered into a scribble document.
procedure
(table->pict tbl [ #:cell-borders cell-borders-spec #:row-borders rows-borders-spec #:column-borders columns-borders-spec #:border-style border-style-spec #:cell-align cell-align-spec #:row-align row-align-spec #:column-align column-align-spec #:cell-style cell-style-spec #:row-style row-style-spec #:column-style column-style-spec #:table-border table-borders-spec #:column-widths column-widths]) → pict? tbl : table/c cell-borders-spec : borders-spec/c = '() rows-borders-spec : (spec-template-of borders-spec/c) = '() columns-borders-spec : (spec-template-of borders-spec/c) = '() border-style-spec : sgr-style-spec/c = '() cell-align-spec : alignment-spec/c = '() row-align-spec : (spec-template-of alignment-spec/c) = '() column-align-spec : (spec-template-of alignment-spec/c) = '() cell-style-spec : sgr-style-spec/c = '() row-style-spec : (spec-template-of sgr-style-spec/c) = '() column-style-spec : (spec-template-of sgr-style-spec/c) = '() table-borders-spec : borders-spec/c = '() column-widths : column-widths-spec/c = '()
Like print-table and table->string but converts
the resulting table into a pict?.