summaryrefslogtreecommitdiff
path: root/doc/api.texi
diff options
context:
space:
mode:
authorGerry Agbobada <gagbobada@gmail.com>2020-05-24 14:03:34 +0200
committerDavid Thompson <dthompson2@worcester.edu>2020-10-09 09:19:01 -0400
commitdf05f9d1494d3a62a5b301f6f2db3410f21be458 (patch)
tree845643fa8202c2bae567a19eb5c74c8ddef5c655 /doc/api.texi
parent1054cbd906ced5cb38476b00700aa8c279f6e1c8 (diff)
ttf: Add more bindings.
Bindings added: * TTF_FontAscent * TTF_FontDescent * TTF_FontLineSkip * TTF_SizeUTF8 * TTF_GlyphIsProvided * TTF_GetFontStyle * TTF_SetFontStyle
Diffstat (limited to 'doc/api.texi')
-rw-r--r--doc/api.texi56
1 files changed, 56 insertions, 0 deletions
diff --git a/doc/api.texi b/doc/api.texi
index 20c7e20..9620f87 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -1477,12 +1477,68 @@ Delete the memory allocated for @var{font}.
Return the maximum height of @var{font}.
@end deffn
+@deffn {Procedure} font-ascent font
+Return the maximum pixel ascent of all glyphs in @var{font}. This can
+also be interpreted as the distance from the top of the font to the
+baseline.
+@end deffn
+
+@deffn {Procedure} font-descent font
+Return the maximum pixel descent of all glyphs in @var{font}. This
+can also be interpreted as the distance from the baseline to the
+bottom of the font.
+@end deffn
+
+@deffn {Procedure} font-line-skip font
+Return the recommended pixel height of a line of text using
+@var{font}.
+@end deffn
+
+@deffn {Procedure} font-size-text font text
+Return a 2-element list containing the resulting surface size of the
+string @var{text} using @var{font} in the following format:
+@code{(width height)}.
+@end deffn
+
+@deffn {Procedure} font-glyph-index font char
+Return the index of the glyph for @var{char} in @var{font}, or
+@code{#f} if @var{char} is not present.
+@end deffn
+
@deffn {Procedure} font-glyph-metrics font char
Return a 5-element list containing the metrics of @var{char} in
@var{font} in the following format: @code{(minx maxx miny maxy
advance)}
@end deffn
+@deffn font-style font
+Return the rendering style of @var{font} as a list that may contain
+any of the following symbols:
+
+@itemize
+@item @code{bold}
+@item @code{italic}
+@item @code{underline}
+@item @code{strikethrough}
+@end itemize
+
+The empty list is returned if none of the above styles are applied.
+@end deffn
+
+@deffn font-set-style! font style
+Set the rendering style of @var{font} to @var{style}, a list that may
+contain any of the following symbols:
+
+@itemize
+@item @code{bold}
+@item @code{italic}
+@item @code{underline}
+@item @code{strikethrough}
+@end itemize
+
+The empty list means that none of the above stylings will be used.
+@end deffn
+
@deffn {Procedure} render-font-solid font text color
Render @var{text}, a UTF-8 encoded string, using @var{font} and @var{color}, the
foreground color, and return a surface containing the results.