working on the slide material
This commit is contained in:
parent
f9a710c398
commit
b4f498131a
|
@ -79,6 +79,12 @@ var checkReal = plt.baselib.check.checkReal;
|
||||||
var checkBoolean = plt.baselib.check.checkBoolean;
|
var checkBoolean = plt.baselib.check.checkBoolean;
|
||||||
|
|
||||||
var checkNatural = plt.baselib.check.checkNatural;
|
var checkNatural = plt.baselib.check.checkNatural;
|
||||||
|
|
||||||
|
var checkPositiveInteger = plt.baselib.check.makeCheckArgumentType(
|
||||||
|
function(x) { return plt.baselib.numbers.isInteger(x) &&
|
||||||
|
plt.baselib.numbers.greaterThan(x, 0);},
|
||||||
|
"positive integer");
|
||||||
|
|
||||||
var checkNonNegativeReal = plt.baselib.check.checkNonNegativeReal;
|
var checkNonNegativeReal = plt.baselib.check.checkNonNegativeReal;
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,7 +242,8 @@ EXPORTS['text'] =
|
||||||
3,
|
3,
|
||||||
function(MACHINE) {
|
function(MACHINE) {
|
||||||
var aString = checkString(MACHINE,'text', 0);
|
var aString = checkString(MACHINE,'text', 0);
|
||||||
var aSize = checkByte(MACHINE, 'text', 1);
|
// Unlike 2htdp, we'll allow this to be a positive integer
|
||||||
|
var aSize = checkPositiveInteger(MACHINE, 'text', 1);
|
||||||
var aColor = checkColor(MACHINE, 'text', 2);
|
var aColor = checkColor(MACHINE, 'text', 2);
|
||||||
return makeTextImage(aString.toString(),
|
return makeTextImage(aString.toString(),
|
||||||
jsnums.toFixnum(aSize),
|
jsnums.toFixnum(aSize),
|
||||||
|
|
BIN
racketcon/plt-logo.png
Normal file
BIN
racketcon/plt-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
|
@ -5,9 +5,17 @@
|
||||||
|
|
||||||
;; A slide is either a simple string or an image.
|
;; A slide is either a simple string or an image.
|
||||||
|
|
||||||
|
(define font-size 50)
|
||||||
|
|
||||||
|
|
||||||
|
(define-struct label (id slide))
|
||||||
|
|
||||||
(define slides
|
(define slides
|
||||||
(list "Whalesong: a Racket to JavaScript Compiler"
|
(list
|
||||||
|
(above
|
||||||
|
(text "Whalesong:" 100 "black")
|
||||||
|
(text "a Racket to JavaScript Compiler" 80 "black")
|
||||||
|
(image-url "file:///home/dyoo/work/whalesong/racketcon/plt-logo.png"))
|
||||||
"Why Whalesong?"
|
"Why Whalesong?"
|
||||||
"World programs on the web"
|
"World programs on the web"
|
||||||
"Reusing Racket..."
|
"Reusing Racket..."
|
||||||
|
@ -33,7 +41,7 @@
|
||||||
[(key=? a-key "left")
|
[(key=? a-key "left")
|
||||||
(my-max (sub1 w) 0)]
|
(my-max (sub1 w) 0)]
|
||||||
[(key=? a-key "right")
|
[(key=? a-key "right")
|
||||||
(my-min (sub1 w) (length slides))]
|
(my-min (add1 w) (sub1 (length slides)))]
|
||||||
[else w]))
|
[else w]))
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +50,7 @@
|
||||||
[bg (BACKGROUND)])
|
[bg (BACKGROUND)])
|
||||||
(cond
|
(cond
|
||||||
[(string? a-slide)
|
[(string? a-slide)
|
||||||
(place-image (text a-slide 300 "black")
|
(place-image (text a-slide font-size "black")
|
||||||
(quotient (image-width bg) 2)
|
(quotient (image-width bg) 2)
|
||||||
(quotient (image-height bg) 2)
|
(quotient (image-height bg) 2)
|
||||||
bg)]
|
bg)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user