anotherTypesetter/text.lisp

39 lines
924 B
Common Lisp
Raw Normal View History

2024-04-11 22:47:42 +08:00
(letrec (
(defaultFontFormat
'(("fontFamily" "Gentium")
("color" "#000000")
("size" 12)
)
)
(map (lambda (f l)
2024-04-10 22:56:29 +08:00
(if (!= l '())
(cons (f (car l)) (map f (cdr l)))
2024-04-11 22:47:42 +08:00
'())))
(emptyDict '())
(extendDict (lambda (dict var data) (cons (cons var (cons data '())) dict)))
(dictRef (lambda (dict key)
(if (= dict '()) false
(if (= key (car (car dict))) (car (cdr (car dict))) (dictRef (cdr dict) key))
)))
)
2024-04-10 22:56:29 +08:00
(begin
(addPDFPage '())
2024-04-11 22:47:42 +08:00
(drawText
(dictRef defaultFontFormat "fontFamily")
(dictRef defaultFontFormat "size")
(dictRef defaultFontFormat "color")
40.0
50.0
"blah"
)
2024-04-10 22:56:29 +08:00
(addPDFPage '())
2024-04-11 22:47:42 +08:00
(map (lambda (x) (+ x 2)) '(8 9 10))
(let ((dict emptyDict))
(let ((dictExtended
(extendDict
(extendDict emptyDict 1 2) 2 4)))
(dictRef dictExtended 2)
))))