|
|
1.1 ! root 1: .TH TWEAK 1 ! 2: .CT 1 graphics ! 3: .SH NAME ! 4: tweak \- edit bitmap files, subfont files, face files, etc. ! 5: .SH SYNOPSIS ! 6: .B tweak ! 7: [ ! 8: .I file ... ! 9: ] ! 10: .SH DESCRIPTION ! 11: .I Tweak ! 12: edits existing files holding various forms of bitmap images. ! 13: To create original images, use ! 14: .IR art (1) ! 15: or start from an existing bitmap, subfont, etc. ! 16: .PP ! 17: .I Tweak ! 18: reads its argument ! 19: .I files ! 20: and displays the resulting bitmaps in a vertical column. ! 21: If the bitmap is too wide to fit across the display, it ! 22: is folded much like a long line of text in an ! 23: .IR 8½ ! 24: window. ! 25: Under each bitmap is displayed one or two lines of text ! 26: presenting parameters of the image. ! 27: The first line shows the bitmap's ! 28: .BR ldepth , ! 29: the log base 2 of the number ! 30: of bits per pixel; ! 31: .BR r , ! 32: the rectangle covered by the image; ! 33: and the name of the ! 34: .B file ! 35: from which it was read. ! 36: If the file is a subfont, a second line presents a hexadecimal 16-bit ! 37: .B offset ! 38: to be applied to character values from the subfont ! 39: (typically as stored in a font file; see ! 40: .IR font (6)); ! 41: and the subfont's ! 42: .BR n , ! 43: .BR height , ! 44: and ! 45: .B ascent ! 46: as defined in ! 47: .IR cachechars (2). ! 48: .PP ! 49: By means described below, magnified views of portions of the bitmaps ! 50: may be displayed. ! 51: The text associated with such a view includes ! 52: .BR mag , ! 53: the magnification. ! 54: If the view is of a single character from a subfont, the second ! 55: line of text shows the character's value (including the subfont's offset) ! 56: in hexadecimal and as a character in ! 57: .I tweak's ! 58: default font; the character's ! 59: .BR x , ! 60: .BR top , ! 61: .BR bottom , ! 62: .BR left , ! 63: and ! 64: .BR width ! 65: as defined in ! 66: .IR cachechars (2); ! 67: and ! 68: .BR iwidth , ! 69: the physical width of the image in the subfont's bitmap. ! 70: .PP ! 71: There are two methods to obtain a magnified view of a character from a ! 72: subfont. ! 73: The first is to click mouse button 1 over the image of the character in ! 74: the subfont. The second is to select the ! 75: .B char ! 76: entry on the button 3 menu, ! 77: point the resulting gunsight cursor at the desired subfont and click button 3, ! 78: and then type at the text prompt at the bottom of the screen the ! 79: character value, either as a multi-digit hexadecimal number or as a single ! 80: rune representing the character. ! 81: .PP ! 82: To magnify a portion of other types of bitmap files, ! 83: click button 1 over the unmagnified file. ! 84: The cursor will switch to a cross. ! 85: Still with button 1, sweep a rectangle, as in ! 86: .BR 8½ , ! 87: that encloses the portion of the image to be magnified. ! 88: (If the file is 16×16 or smaller, ! 89: .I tweak ! 90: will just magnify the entire file; no sweeping is necessary.) ! 91: .PP ! 92: Depressing buttons 1 and 2 within magnified images changes pixel values. ! 93: By default, button 1 sets the pixel to all ones and button 2 sets the pixel ! 94: to all zeros. ! 95: .PP ! 96: Across the top of the screen is a textual display of global parameters. ! 97: These values, as well as many of the textual values associated with ! 98: the images, may be edited by clicking button 1 on the displayed ! 99: value and typing a new value. ! 100: The values along the top of the screen are: ! 101: .TP ! 102: .B mag ! 103: Default magnification. ! 104: .TP ! 105: .B val(hex) ! 106: The value used to modify pixels within magnified images. ! 107: The value must be in hexadecimal, optionally preceded by a ! 108: tilde for bitwise negation. ! 109: .TP ! 110: .B but1 ! 111: .TP ! 112: .B but2 ! 113: The boolean function used by the named button to set pixel values. ! 114: The function may be specified either by name as defined in ! 115: .BR <libg.h> , ! 116: e.g. ! 117: .BR DorS , ! 118: or by simple boolean expression, e.g. ! 119: .BR S|D . ! 120: In these expressions, ! 121: .B S ! 122: is the pixel value defined above and ! 123: .B D ! 124: is the pixel being modified. ! 125: .TP ! 126: .B copy ! 127: The boolean function used in the ! 128: .B copy ! 129: menu item. ! 130: .PP ! 131: Under button 3 is a menu holding a variety of functions. ! 132: Many of these functions prompt for the image upon which to act ! 133: by switching to a gunsight cursor; click button 3 over the ! 134: selection, or click a different button to cancel the action. ! 135: .TP ! 136: .B open ! 137: Read and display a file. The name of the file is typed to the prompt ! 138: on the bottom line. ! 139: .TP ! 140: .B read ! 141: Reread a file. ! 142: .TP ! 143: .B write ! 144: Write a file. ! 145: .TP ! 146: .B copy ! 147: Use the copy function, default ! 148: .BR S , ! 149: to transfer a rectangle of pixels from one image to another. ! 150: The program prompts with a cross cursor; sweep out a rectangle in ! 151: one image or just click button 3 to select the whole image. ! 152: The program will leave that rectangle in place and ! 153: attach another one to the cursor. Move that rectangle to the desired ! 154: place in any image and click button 3, or another button to cancel the action. ! 155: .TP ! 156: .B char ! 157: As described above, open a magnified view of a character image in a subfont. ! 158: .TP ! 159: .B close ! 160: Close the specified image. ! 161: If the image is the unmagnified file, also close any magnified views of that file. ! 162: .TP ! 163: .B exit ! 164: Quit ! 165: .IR tweak . ! 166: The program will complain once about modified but unwritten files. ! 167: .PP ! 168: To clear blocks of pixels, use ! 169: .B copy ! 170: with function ! 171: .BR 0 . ! 172: .SH SOURCE ! 173: .B /sys/src/cmd/tweak.c ! 174: .SH "SEE ALSO" ! 175: .IR art (1), ! 176: .IR cachechars (2), ! 177: .IR bitmap (6), ! 178: .IR font (6)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.