STRWIDTH(3R)

NAME
strwidth, jstrwidth - width of character string

SYNOPSIS
#include <dmd.h>
#include <font.h>

int strwidth (f, s)

int jstrwidth (s)

Font *f;
char *s;

DESCRIPTION
The strwidth function returns the width in screen coordinates (pixels) of the null-terminated string s, interpreted in the Font *f. The height of a character string is simply f->height.

The call, jstrwidth(s), is equivalent to strwidth (&mediumfont, s).

EXAMPLE
The following code fragment places the width of a string that uses the resident font largefont into a variable called width.

    #include <dmd.h>
    #include <font.h>
       .
       .
       int	width;
       Font *f = &largefont;
       width = strwidth (f, "hello world");
       .
       .

SEE ALSO
infont(3L), string(3R), structures(3R).