From 665668e5a11d86448ed3cdcef7cffe14989f40f2 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 11 Feb 2014 21:03:20 -0500 Subject: 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. --- 2d/font.scm | 7 ++++++- Makefile.am | 1 + configure.ac | 2 +- data/Makefile.am | 2 ++ data/fonts/AUTHORS | 2 ++ data/fonts/DejaVuSans.ttf | Bin 0 -> 741536 bytes 6 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 data/Makefile.am create mode 100644 data/fonts/AUTHORS create mode 100644 data/fonts/DejaVuSans.ttf 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 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 Binary files /dev/null and b/data/fonts/DejaVuSans.ttf differ -- cgit v1.2.3