summaryrefslogtreecommitdiff
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
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.
-rw-r--r--2d/font.scm7
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac2
-rw-r--r--data/Makefile.am2
-rw-r--r--data/fonts/AUTHORS2
-rw-r--r--data/fonts/DejaVuSans.ttfbin0 -> 741536 bytes
6 files changed, 12 insertions, 2 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
diff --git a/Makefile.am b/Makefile.am
index c13bf1c..0bc83eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,5 +46,6 @@ WRAPPER_SOURCES = \
EXTRA_DIST += env.in
SUBDIRS = \
+ data \
doc \
examples
diff --git a/configure.ac b/configure.ac
index 061e208..93b3922 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@ else
AC_MSG_ERROR([Guile 2.0 required.])
fi
-AC_CONFIG_FILES([Makefile doc/Makefile examples/Makefile])
+AC_CONFIG_FILES([Makefile doc/Makefile examples/Makefile data/Makefile])
AC_CONFIG_FILES([env], [chmod +x env])
PKG_CHECK_MODULES([SDL], [sdl <= 1.3 sdl >= 1.2])
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..552da87
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,2 @@
+fontsdir = $(pkgdatadir)/fonts
+fonts_DATA = fonts/DejaVuSans.ttf
diff --git a/data/fonts/AUTHORS b/data/fonts/AUTHORS
new file mode 100644
index 0000000..3367e7d
--- /dev/null
+++ b/data/fonts/AUTHORS
@@ -0,0 +1,2 @@
+DejaVu font by http://dejavu-fonts.org/wiki/Authors
+License details available at http://dejavu-fonts.org/wiki/License \ No newline at end of file
diff --git a/data/fonts/DejaVuSans.ttf b/data/fonts/DejaVuSans.ttf
new file mode 100644
index 0000000..9d40c32
--- /dev/null
+++ b/data/fonts/DejaVuSans.ttf
Binary files differ