1 cfa37a7b 2004-04-10 devnull .TH STRINGSIZE 3
3 cfa37a7b 2004-04-10 devnull stringsize, stringwidth, stringnwidth, runestringsize, runestringwidth, runestringnwidth \- graphical size of strings
4 cfa37a7b 2004-04-10 devnull .SH SYNOPSIS
8 cfa37a7b 2004-04-10 devnull #include <u.h>
9 cfa37a7b 2004-04-10 devnull #include <libc.h>
10 cfa37a7b 2004-04-10 devnull #include <draw.h>
12 cfa37a7b 2004-04-10 devnull .ta \w'\fLPoint 'u
15 cfa37a7b 2004-04-10 devnull Point stringsize(Font *f, char *s)
18 cfa37a7b 2004-04-10 devnull int stringwidth(Font *f, char *s)
21 cfa37a7b 2004-04-10 devnull int stringnwidth(Font *f, char *s, int n)
24 cfa37a7b 2004-04-10 devnull Point runestringsize(Font *f, Rune *s)
27 cfa37a7b 2004-04-10 devnull int runestringwidth(Font *f, Rune *s)
30 cfa37a7b 2004-04-10 devnull int runestringnwidth(Font *f, Rune *s, int n)
31 cfa37a7b 2004-04-10 devnull .SH DESCRIPTION
32 cfa37a7b 2004-04-10 devnull These routines compute the geometrical extent of character strings when drawn on the display. The most straightforward,
33 cfa37a7b 2004-04-10 devnull .BR stringsize ,
34 cfa37a7b 2004-04-10 devnull returns a
36 cfa37a7b 2004-04-10 devnull representing the vector from upper left to lower right of the NUL-terminated string
38 cfa37a7b 2004-04-10 devnull drawn in font
40 cfa37a7b 2004-04-10 devnull .B Stringwidth
41 cfa37a7b 2004-04-10 devnull returns just the
43 cfa37a7b 2004-04-10 devnull component.
44 cfa37a7b 2004-04-10 devnull .B Stringnwidth
45 cfa37a7b 2004-04-10 devnull returns the width of the first
47 cfa37a7b 2004-04-10 devnull characters of
50 cfa37a7b 2004-04-10 devnull The routines beginning with
52 cfa37a7b 2004-04-10 devnull are analogous, but accept an array of runes rather than
53 cfa37a7b 2004-04-10 devnull .SM UTF\c
54 cfa37a7b 2004-04-10 devnull -encoded bytes.
55 cfa37a7b 2004-04-10 devnull .SH FILES
56 cfa37a7b 2004-04-10 devnull .BR /lib/font/bit " directory of fonts
57 cfa37a7b 2004-04-10 devnull .SH SOURCE
58 b5fdffee 2004-04-19 devnull .B /usr/local/plan9/src/libdraw
59 cfa37a7b 2004-04-10 devnull .SH "SEE ALSO"
60 bf8a59fa 2004-04-11 devnull .IR addpt (3),
61 bf8a59fa 2004-04-11 devnull .IR cachechars (3),
62 bf8a59fa 2004-04-11 devnull .IR subfont (3),
63 cfa37a7b 2004-04-10 devnull .IR draw (3),
64 bf8a59fa 2004-04-11 devnull .IR draw (3),
65 cfa37a7b 2004-04-10 devnull .IR image (6),
66 cfa37a7b 2004-04-10 devnull .IR font (6)
67 cfa37a7b 2004-04-10 devnull .SH DIAGNOSTICS
68 cfa37a7b 2004-04-10 devnull Because strings are loaded dynamically, these routines may generate I/O
69 cfa37a7b 2004-04-10 devnull to the server and produce calls to the graphics error function.