|
|
1.1 ! root 1: .NH ! 2: Text Operations ! 3: .XS ! 4: Text Operations ! 5: .XE ! 6: .PP ! 7: .IN "Definitions" "Font" ! 8: .IN "Fonts" ! 9: All of the subroutines in this section make use of fonts. ! 10: A font is a ! 11: graphical description of a set of characters, used to increase efficiency ! 12: whenever a set of small, similar-sized patterns are repeatedly used. ! 13: .PP ! 14: While most fonts contain descriptions of alphanumeric characters, fonts ! 15: and the subroutines in this section are not restricted to that purpose ! 16: .IN "XText" ! 17: .IN "XTextWidth" ! 18: (despite suggestive subroutine names such as \fIXText\fP and \fIXTextWidth\fP). ! 19: .FD ! 20: .IN "Definitions" "XText" ! 21: .IN "XText" ! 22: .IN "XTextPad" ! 23: .IN "Definitions" "XTextPad" ! 24: XText (w, x, y, str, len, font, foreground, background) ! 25: ! 26: XTextPad (w, x, y, str, len, font, charpad, spacepad, foreground, background, func, planes) ! 27: Window w; ! 28: int x, y; ! 29: int len; /* string length */ ! 30: char *str; /* NOT necessarily null-terminated */ ! 31: Font font; ! 32: int charpad; ! 33: int spacepad; ! 34: int foreground, background; ! 35: int func; /* display function */ ! 36: int planes; ! 37: .FN ! 38: \fIXTextPad\fP draws text into a window, ! 39: using the specified \fIfont\fP and display function ! 40: \fIfunc\fP. ! 41: It modifies the specified planes of the display memory, ! 42: painting in the foreground ! 43: color. ! 44: The number of characters to be drawn must be specified in the ! 45: \fIlen\fP parameter; ! 46: \fIXText\fP does NOT assume that \fIstr\fP is null-terminated. ! 47: .PP ! 48: The \fIx\fP and \fIy\fP ! 49: coordinates represent the upper left corner of the first ! 50: character. ! 51: .PP ! 52: For each character drawn, a rectangular bitmap is transferred onto the ! 53: display. ! 54: \fIBackground\fP and \fIforeground\fP pixels will be set to the specified ! 55: pixel values (colors). ! 56: .PP ! 57: .IN "Character Padding" ! 58: .IN "Space Padding" ! 59: .IN "Padding" "Space" ! 60: .IN "Padding" "Character" ! 61: The character padding \fIcharpad\fP defines how much space will be ! 62: left between each character. ! 63: The space padding \fIspacepad\fP defines how much additional padding ! 64: will occur when a space character is painted. ! 65: Padded pixels are NOT modified. ! 66: All pixels in a character cell are modified to either the \fIforeground\fP or ! 67: \fIbackground\fP pixel value. ! 68: .PP ! 69: .IN "XText" ! 70: \fIXText\fP defaults the function to \fIGXcopy\fP, modifies all planes, ! 71: and does no padding. ! 72: .FD ! 73: .IN "Definitions" "XTextMask" ! 74: .IN "XTextMask" ! 75: .IN "Definitions" "XTextMaskPad" ! 76: .IN "XTextMaskPad" ! 77: XTextMask (w, x, y, str, len, font, foreground ) ! 78: ! 79: XTextMaskPad (w, x, y, str, len, font, charpad, spacepad, foreground, func, planes) ! 80: Window w; ! 81: int x, y; ! 82: int len; /* string length */ ! 83: char *str; /* NOT necessarily null-terminated */ ! 84: Font font; ! 85: int charpad, spacepad; ! 86: int foreground; ! 87: int func; /* display function */ ! 88: int planes; /* plane masks */ ! 89: .FN ! 90: \fIXTextMaskPad\fP draws text into a window, ! 91: using the specified \fIfont\fP and display function ! 92: \fIfunc\fP. ! 93: It modifies the specified \fIplanes\fP of the display, ! 94: only modifying bits specified by the font. ! 95: .IN "Mask Font" ! 96: (The font bits are used as a ``mask'', so only bits set to one in the font ! 97: cause pixels to be modified on the display). ! 98: The number of characters to be drawn must be specified in the ! 99: \fIlen\fP parameter; ! 100: these calls do NOT assume that \fIstr\fP is null-terminated. ! 101: .PP ! 102: The \fIx\fP and \fIy\fP coordinates represent the upper left corner of the first ! 103: character. ! 104: .PP ! 105: \fICharpad\fP and \fIspacepad\fP can be used for intercharacter and space padding. ! 106: Padded pixels are NOT modified. ! 107: .PP ! 108: .IN XTextMask ! 109: \fIXTextMask\fP defaults the function to \fIGXcopy\fP, modifies all planes, ! 110: and does not do padding.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.