From 1560e460223f89ea61537e13b499d70792d3f3b1 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 30 Sep 2020 23:25:46 -0400 Subject: Add OTF/TTF font support via freetype. --- doc/api.texi | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/api.texi b/doc/api.texi index 446460e..84bcaed 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -2274,16 +2274,25 @@ Printing text to the screen is quite easy: (draw-text "Hello, world" (vec2 100.0 100.0)) @end example -Chickadee loads and renders bitmap fonts in the -@url{http://www.angelcode.com/products/bmfont/doc/file_format.html, -Angel Code format}. A default font named ``Good Neighbors'' is -built-in to Chickadee and is used for all text rendering operations -where a font is not specified, as is the case in the above example. +Chickadee supports OpenType/TrueType fonts (via the FreeType library), +bitmap fonts in Angel Code bmfont format, and simple sprite sheet +bitmap fonts. A default font named Inconsolata is used for all text +rendering operations where a font is not specified, as is the case in +the above example. The following procedures can be found in the @code{(chickadee render font)} module: -@deffn {Procedure} load-font file +@deffn {Procedure} load-font file-name point-size [#:char-set] +Load the scalable (OpenType, TrueType, etc.) font in the file +@var{file-name} and display it at the given @var{point-size}. By +default, all the characters in the ASCII character set are loaded. +This can be changed by passing a different character set +(@pxref{Character Sets,,, guile, GNU Guile Reference Manual}) using +the @var{char-set} keyword argument. +@end deffn + +@deffn {Procedure} load-bitmap-font file Load the Angel Code font (in either XML or FNT format) in @var{file} and return a new font object. @end deffn -- cgit v1.2.3