|
|
1.1 ! root 1: .ds ZZ DEVELOPMENT PACKAGE ! 2: .TH STRWIDTH 3R "630 MTG" ! 3: .XE "strwidth()" ! 4: .XE "jstrwidth()" ! 5: .SH NAME ! 6: strwidth, jstrwidth \- width of character string ! 7: .SH SYNOPSIS ! 8: .ft B ! 9: #include <dmd.h> ! 10: .br ! 11: #include <font.h> ! 12: .sp ! 13: int strwidth (f, s) ! 14: .sp ! 15: int jstrwidth (s) ! 16: .sp ! 17: Font \(**f; ! 18: .br ! 19: char \(**s; ! 20: .SH DESCRIPTION ! 21: The ! 22: .I strwidth ! 23: function ! 24: returns the width in screen coordinates (pixels) ! 25: of the null-terminated string ! 26: .IR s , ! 27: interpreted in the Font ! 28: .IR *f . ! 29: The height of a character string is simply ! 30: .IR f->height . ! 31: .PP ! 32: The call, ! 33: .IR jstrwidth(s) , ! 34: is equivalent to ! 35: .IR "strwidth (&mediumfont, s)" . ! 36: .SH EXAMPLE ! 37: The following code fragment places the width of a string ! 38: that uses the resident font ! 39: .I largefont ! 40: into a variable called width. ! 41: .PP ! 42: .RS 3 ! 43: .nf ! 44: .ft CM ! 45: \s-1 ! 46: #include <dmd.h> ! 47: #include <font.h> ! 48: ! 49: . ! 50: . ! 51: ! 52: int width; ! 53: Font *f = &largefont; ! 54: ! 55: width = strwidth (f, "hello world"); ! 56: ! 57: . ! 58: . ! 59: ! 60: .fi ! 61: .RE ! 62: .SH SEE ALSO ! 63: infont(3L), string(3R), structures(3R).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.