NAME
wordwrap – wrap text at word boundaries in a window |
SYNOPSIS
#include <u.h> #include <libc.h> #include <draw.h> #include wordwrap.h |
DESCRIPTION
The function wordwrap takes the input text m and displays it in
the font font within the Image screen, which must already be defined
as a global, as performed by initdraw(2). Wordwrap will wrap the
text at a word boundary, leaving margin pixels on the perimiter
of the screen when performing the layout.
|
SOURCE
http://a.9srv.net/src/wordwrap.c, http://a.9srv.net/src/wordwrap.h |
BUGS
Since wordwrap uses getields(2) to split input lines on newline
and words with lines on spaces, either of those characters on
the beginning or end of the input are lost. See fixsep() in http://a.9srv.net/src/litclock.c
for an example of how to deal with this. This should probably
be integrated into wordwrap.
|