.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "PLOT_WRITESTRINGROT" "3" "26 May 2003" "" ""
.SH NAME
plot_writestringrot \- write a string onto the bitmap, with the text being rotated by the given angle
.SH SYNOPSIS
.nf
#include<libmplot.h>
int plot_writestringrot(plot_state *state, char *string, float angle);
.fi
.SH "DESCRIPTION"
.PP
This function writes a string onto the specified bitmap. Note that the function does not implement any form of word wrap. This is the responsibility of the caller of the function. Have a look at the example below for a suggested technique for implementing word wrap.
Note that the angle is in degrees.
.SH "RETURNS"
.PP
0 on success, -1 otherwise
.SH "EXAMPLE"
.nf
#include<libmplot.h>
plot_state *graph;
char *words[] = {"This", "is", "a", "string", "which", "is", "quite", "long.",
"It", "demonstrates", "how", "to", "do", "word", "wrap", NULL};
if((graph = plot_newplot(400, 300)) == NULL){
... error ...
}
plot_setfontcolor(graph, 26, 22, 249);
plot_setfont(graph, "/usr/share/fonts/default/Type1/n021004l.pfb", 12);
plot_settextlocation(graph, 20, 70);
count = 0;
while(words[count] != NULL){
plot_gettextlocation(graph, &textx, &texty);
if((textx + plot_stringwidth(graph, words[count])) > 380){
if(texty + 70 > 150)
break;
plot_settextlocation(graph, 20, texty + 20);
}
plot_writestringrot(graph, words[count], 45);
plot_writestringrot(graph, " ", 45);
count++;
}
.fi
.SH "VERSION"
.PP
This documentation was generated for \fBlibplot\fR 0.3 by \fBautodocbook\fR (http://www.stillhq.com).
.SH "AUTHOR"
.PP
\fBlibplot\fR is under development by Michael Still (mikal@stillhq.com). All code is Copyright Michael Still 2002, and is released under the GNU GPL. Code submissions are welcomed. Contact Michael at the address above if you have something you would like to contribute.
.SH "BUGS"
.PP
There are no known bugs in \fBlibplot\fR. If you find one, please contact mikal@stillhq.com and let me know.