added a contract to 'text'
svn: r6571
This commit is contained in:
parent
6683f05889
commit
0d69b92c79
|
@ -223,6 +223,10 @@ Basic Constructors:
|
||||||
are specified, the first one takes precedence
|
are specified, the first one takes precedence
|
||||||
[MrEd only]
|
[MrEd only]
|
||||||
|
|
||||||
|
> text-style/c :: contract?
|
||||||
|
|
||||||
|
This is a contract that matches the second argument of `text'.
|
||||||
|
|
||||||
> (caps-text string [text-style null] [size 12] [angle 0]) -> pict
|
> (caps-text string [text-style null] [size 12] [angle 0]) -> pict
|
||||||
|
|
||||||
Same as `text', but use small caps:
|
Same as `text', but use small caps:
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
(module mrpict mzscheme
|
(module mrpict mzscheme
|
||||||
(require (lib "unit.ss"))
|
(require (lib "unit.ss")
|
||||||
|
(lib "contract.ss")
|
||||||
|
(lib "mred.ss" "mred"))
|
||||||
|
|
||||||
(require (lib "mred-sig.ss" "mred")
|
(require (lib "mred-sig.ss" "mred")
|
||||||
(lib "mred-unit.ss" "mred"))
|
(lib "mred-unit.ss" "mred"))
|
||||||
|
@ -16,4 +18,32 @@
|
||||||
|
|
||||||
(define-values/invoke-unit/infer mrpict+mred@)
|
(define-values/invoke-unit/infer mrpict+mred@)
|
||||||
|
|
||||||
(provide-signature-elements texpict-common^ mrpict-extra^))
|
(provide-signature-elements texpict-common^)
|
||||||
|
(provide
|
||||||
|
dc-for-text-size
|
||||||
|
show-pict
|
||||||
|
caps-text current-expected-text-scale
|
||||||
|
dc
|
||||||
|
linewidth
|
||||||
|
|
||||||
|
draw-pict
|
||||||
|
make-pict-drawer)
|
||||||
|
|
||||||
|
(define text-style/c
|
||||||
|
(flat-rec-contract
|
||||||
|
text-style/c
|
||||||
|
(or/c null?
|
||||||
|
(is-a?/c font%)
|
||||||
|
(symbols 'base 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system)
|
||||||
|
string? ;; could be more specific, I guess.
|
||||||
|
(cons/c (symbols 'bold 'italic 'superscript 'subscript 'combine 'no-combine)
|
||||||
|
text-style/c))))
|
||||||
|
|
||||||
|
(provide/contract
|
||||||
|
[text (opt-> (string?)
|
||||||
|
(text-style/c
|
||||||
|
(and/c (between/c 1 255) integer?)
|
||||||
|
number?)
|
||||||
|
pict?)])
|
||||||
|
|
||||||
|
(provide text-style/c))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user