summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-12-14 20:19:55 -0500
committerDavid Thompson <dthompson2@worcester.edu>2018-12-14 20:19:55 -0500
commit0436ff21bca02e382a980ba7a436878eebebd4a3 (patch)
treefc6532d8fbe152e38542b9628f3a95b84dab6ea8
parent6701c32e136f50d722e04dce3c725441e94918ed (diff)
render: font: Export a default-font procedure.
* chickadee/render/font.scm (default-font): Change from variable to procedure.
-rw-r--r--chickadee/render/font.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/chickadee/render/font.scm b/chickadee/render/font.scm
index 6136849..55b282c 100644
--- a/chickadee/render/font.scm
+++ b/chickadee/render/font.scm
@@ -46,6 +46,7 @@
font-line-width
font-bold?
font-italic?
+ default-font
draw-text*
draw-text))
@@ -335,15 +336,16 @@ extension must be either .xml or .fnt."
(define %null-vec2 (vec2 0.0 0.0))
(define default-font
- (delay
- (load-font (scope-datadir "fonts/good-neighbors.fnt"))))
+ (let ((font (delay (load-font (scope-datadir "fonts/good-neighbors.fnt")))))
+ (lambda ()
+ (force font))))
(define draw-text
(let ((matrix (make-null-matrix4)))
(lambda* (text
position
#:key
- (font (force default-font))
+ (font (default-font))
(origin %null-vec2)
(rotation 0)
(scale %default-scale)