From a309537fdc8d86131522d43f9a9b2a0f58d9bda9 Mon Sep 17 00:00:00 2001 From: Tobias Heinicke Date: Wed, 6 Sep 2017 14:30:17 +0200 Subject: paint: add drawing program from 9front (#112) Paint first appeared in 9front. The 9front license is reproduced in the related source files - the original repository is located at https://code.9front.org/hg/plan9front. --- man/man1/paint.1 | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 man/man1/paint.1 (limited to 'man') diff --git a/man/man1/paint.1 b/man/man1/paint.1 new file mode 100644 index 00000000..2bcbf245 --- /dev/null +++ b/man/man1/paint.1 @@ -0,0 +1,85 @@ +.TH PAINT 1 +.CT 1 graphics +.SH NAME +paint \- create image files by drawing with a mouse or other pointing device +.SH SYNOPSIS +.B paint +[ +.I file +] +.SH DESCRIPTION +.I Paint +displays a canvas upon which can be drawn lines using the mouse holding +down buttons 1 or 2 for foreground or background color. The canvas +may be moved with button 3. Colors and brush sizes may be selected by +clicking on the palette at the bottom of the screen with buttons 1 or 2. +.PP +If the optional +.I file +argument is specified, then it is read and used as the canvas. +.I Paint +only recognizes Plan 9 bitmap format (see +.IR image (6)). +.PP +A number of immediate keyboard commands are recognized: +.TP +.B u +Undos the previous action. +.TP +.B c +Clears the canvas with the background color. +.TP +.B 1-9 +Select brush size. +.TP +.B f +Select flood fill brush. +.TP +.B + +Doubles magnification. +.TP +.B - +Halves magnification. +.TP +.B esc +Centers the canvas and resets magnification. +.PP +Hitting any other key on the keyboard shows a command prompt +where the following commands may be entered: +.TP +.BI r file +Reads the canvas from +.I file. +.TP +.BI w file +Writes the canvas to +.I file. +.TP +.BI < command +Executes +.I command +and reads the canvas from its standard output. +.TP +.BI > command +Executes +.I command +and writes the canvas to its standard input. +.TP +.BI | command +Transforms the canvas by piping it thru +.I command. +.TP +.B q +Quits the program. +.SH SOURCE +.B /sys/src/cmd/paint.c +.SH "SEE ALSO" +.IR resample (1), +.IR rotate (1), +.IR crop (1), +.IR jpg (1), +.IR page (1), +.IR image (6) +.SH HISTORY +.I Paint +first appeared in 9front (October, 2011). -- cgit v1.2.3 From 16d00819899260085ee10949012b07bf1c203db6 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 15 Nov 2018 23:52:05 -0500 Subject: libdraw: redo default font construction to be hidpi-safe If $font is not set, the default font is constructed from font data linked into every libdraw binary. That process was different from the usual openfont code, and so it was not hidpi-aware, resulting in very tiny fonts out of the box on hidpi systems, until users set $font. Fix this by using openfont to construct the default font, by recognizing the name *default* when looking for font and subfont file contents. Then all the hidpi scaling applies automatically. As a side effect, the concept of a 'default subfont' is gone, as are display->defaultsubfont, getdefont, and memgetdefont. --- man/man3/graphics.3 | 11 ++--------- man/man3/memdraw.3 | 3 --- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'man') diff --git a/man/man3/graphics.3 b/man/man3/graphics.3 index a2b2d848..4f58451a 100644 --- a/man/man3/graphics.3 +++ b/man/man3/graphics.3 @@ -1,6 +1,6 @@ .TH GRAPHICS 3 .SH NAME -Display, Point, Rectangle, Cursor, initdraw, geninitdraw, drawerror, initdisplay, closedisplay, getdefont, getwindow, gengetwindow, flushimage, bufimage, lockdisplay, unlockdisplay, cursorswitch, cursorset, openfont, buildfont, freefont, Pfmt, Rfmt, strtochan, chantostr, chantodepth \- interactive graphics +Display, Point, Rectangle, Cursor, initdraw, geninitdraw, drawerror, initdisplay, closedisplay, getwindow, gengetwindow, flushimage, bufimage, lockdisplay, unlockdisplay, cursorswitch, cursorset, openfont, buildfont, freefont, Pfmt, Rfmt, strtochan, chantostr, chantodepth \- interactive graphics .SH SYNOPSIS .nf .PP @@ -38,9 +38,6 @@ Display* initdisplay(char *devdir, char *win, void(*errfun)(Display*, char*)) void closedisplay(Display *d) .PP .B -Font* getdefont(Display *d) -.PP -.B int flushimage(Display *d, int vis) .PP .B @@ -398,11 +395,7 @@ names the directory, default in which the files associated with the window reside. .I Closedisplay disconnects the display and frees the associated data structures. -.I Getdefont -builds a -.B Font -structure from in-core data describing a default font. -None of these routines is needed by most programs, since +Neither of these routines is needed by most programs, since .I initdraw calls them as needed. .PP diff --git a/man/man3/memdraw.3 b/man/man3/memdraw.3 index 3f6c483e..16a5cd79 100644 --- a/man/man3/memdraw.3 +++ b/man/man3/memdraw.3 @@ -152,7 +152,6 @@ Memsubfont* allocmemsubfont(char *name, int n, int height, Memsubfont* openmemsubfont(char *name) void freememsubfont(Memsubfont *f) Point memsubfontwidth(Memsubfont *f, char *s) -Memsubfont* getmemdefont(void) Point memimagestring(Memimage *dst, Point p, Memimage *color, Point cp, Memsubfont *f, char *cs, Drawop op) .PP @@ -354,7 +353,6 @@ Similarly, .IR openmemsubfont , .IR freememsubfont , .IR memsubfontwidth , -.IR getmemdefont , and .I memimagestring are the @@ -364,7 +362,6 @@ analogues of .IR openfont , .IR freesubfont , .IR strsubfontwidth , -.IR getdefont , and .B string (see -- cgit v1.2.3