diff options
author | David Thompson <dthompson@member.fsf.org> | 2013-09-15 22:29:55 -0400 |
---|---|---|
committer | David Thompson <dthompson@member.fsf.org> | 2013-09-15 22:29:55 -0400 |
commit | 26d2866d23fbe9a9d1b877df1c046113f3cd8a0b (patch) | |
tree | bdd38bb385736ab2024edd00ae82ee4b711000ec /2d | |
parent | 068134e3a9c09851e0c1cbf17c28dcbd7dc51437 (diff) |
Clean up docstrings in font module.
Diffstat (limited to '2d')
-rw-r--r-- | 2d/font.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/2d/font.scm b/2d/font.scm index cb83b1d..c33c310 100644 --- a/2d/font.scm +++ b/2d/font.scm @@ -41,14 +41,14 @@ (size font-size)) (define (load-font filename size) - "Loads a font from a file with a given size in points." + "Load a font from FILENAME with the given SIZE in points." (let ((ftgl-font (ftgl-create-texture-font filename))) ;; Hardcoded 72 dpi for now. (ftgl-set-font-face-size ftgl-font size 72) (make-font ftgl-font size))) (define (flip-text font) - "Flips current GL matrix about the x-axis and translates by the + "Flip current GL matrix about the x-axis and translates by the negative font ascender value. This is necessary before rendering text because guile-2d flips the y-axis so that the origin is in the upper-left corner rather than the bottom-left." @@ -88,6 +88,8 @@ upper-left corner rather than the bottom-left." (layout textbox-layout)) (define (make-textbox font text position color alignment line-length) + "Create a textbox that will draw TEXT with the given FONT, at vector +POSITION, with ALIGNMENT, and a maximum LINE-LENGTH." (let ((layout (ftgl-create-layout))) (ftgl-set-layout-font layout (font-ftgl-font font)) ;; (ftgl-set-layout-alignment layout (ftgl-text-alignment alignment)) @@ -95,6 +97,7 @@ upper-left corner rather than the bottom-left." (%make-textbox font text position color alignment line-length layout))) (define (draw-textbox textbox) + "Draw TEXTBOX." (with-gl-push-matrix (vector2-translate (textbox-position textbox)) (flip-text (textbox-font textbox)) |