racket/collects/texpict/mrpict.rkt
Matthew Flatt 351e82735b move and rename pict `convert' support
Renamed `convert' to `pict-convert', etc., to avoid confusion
with `file/convert' bindings.

Moved out of `slideshow/pict' to `slideshow/pict-convert', because
most `slideshow/pict' clients do not need it.
2012-04-06 18:51:10 -06:00

55 lines
1.3 KiB
Racket

#lang racket/base
(require mzlib/unit
racket/contract
racket/class
racket/draw)
(require racket/draw/draw-sig
racket/draw/draw-unit
"private/mrpict-sig.rkt"
"private/common-sig.rkt"
"mrpict-sig.rkt"
"mrpict-unit.rkt")
(define-compound-unit/infer mrpict+mred@
(import)
(export texpict-common^ mrpict-extra^)
(link draw@ mrpict@))
(define-values/invoke-unit/infer mrpict+mred@)
(provide-signature-elements texpict-common^)
(provide
dc-for-text-size
show-pict
caps-text current-expected-text-scale
dc
linewidth
linestyle
draw-pict
make-pict-drawer)
(define family/c
(or/c 'base 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system))
(define text-style/c
(flat-rec-contract
text-style/c
(or/c null?
(is-a?/c font%)
family/c
string? ;; could be more specific, I guess.
(cons/c string? family/c)
(cons/c (symbols 'bold 'italic 'superscript 'subscript 'combine 'no-combine 'caps)
text-style/c))))
(provide/contract
[text (->* (string?)
(text-style/c
(and/c (between/c 1 1024) integer?)
number?)
pict?)])
(provide text-style/c)