summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-02-11 21:03:20 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-02-11 21:03:20 -0500
commit665668e5a11d86448ed3cdcef7cffe14989f40f2 (patch)
treeee81908f2b2d8f4320d4e2313372d3556104b336 /2d
parentd2d6ccfeb77711eed7e48bf958b76168bdfd0621 (diff)
Add a convenient default font.
* data/fonts/DejaVuSans.ttf: New file. * data/fonts/AUTHORS: New file. * data/Makefile.am: New file. * configure.ac (AC_CONFIG_FILES): Add 'data/Makefile'. * Makefile.am (SUBDIRS): Add 'data'. * 2d/font.scm (default-font): New variable.
Diffstat (limited to '2d')
-rw-r--r--2d/font.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/2d/font.scm b/2d/font.scm
index 688f9e9..1e5f6ef 100644
--- a/2d/font.scm
+++ b/2d/font.scm
@@ -27,6 +27,7 @@
#:use-module (system foreign)
#:use-module (2d wrappers ftgl)
#:use-module (2d color)
+ #:use-module (2d config)
#:use-module (2d vector2))
;;;
@@ -63,12 +64,16 @@ upper-left corner rather than the bottom-left."
text
(ftgl-render-mode all))))
+(define default-font
+ (load-font (string-append %pkgdatadir "/fonts/DejaVuSans.ttf") 12))
+
(export <font>
make-font
font?
font-size
load-font
- draw-font)
+ draw-font
+ default-font)
;;;
;;; Textbox