vinit(3f) - [M_draw:DEVICE] Initialise device (LICENSE:PD)
Synopsis
Description
Notes
Examples
subroutine vinit(device)
character(len=*),intent(in) :: device
Initialise the device.
Note 1 : Currently available devices are:
INTERACTIVE DEVICES
PC - native MSW PC driver; only tested from CygWin X11 - X11 windows (Black background) x11 - X11 windows (White background) tek - tektronix 4010 and compatibles xtek - X11 xterm Tektronix 4010 emulator
PostScript: [p]psm or [p]postscript - monochrome PostScript [p]psg - grayscale PostScript [p]psc - color PostScript HPGL: hpgl - HP Graphics language and compatibles [p]hpgl2 - HPGL level 2 (obeys prefsize calls) PCL:
[p]pclland - monochrome PCL5 (obeys prefsize calls) [p]pclport - monochrome PCL5 (obeys prefsize calls) pcl5land (color PCL5 landscape) pcl5port (color PCL5 portrait)
PIXMAPS (COLOR) AND BITMAPS (MONOCHROME)
char An ASCII file that can be displayed to most xterm(1) terminal emulators that support color p1/pbm Poskanzer (pbmplus/netplus) portable ASCII bitmap file p3/ppm Poskanzer portable ASCII pixmap file p4 Poskanzer portable binary bitmap file p6 Poskanzer portable binary pixmap file xbm X11 bitmap file bm bitmap format for atobm(1)
mif FrameMaker Interchange Format 3.0 (MIF) files (16 colors) mif4 FrameMaker Interchange Format 4.0 (MIF) files (user-definable colors, but breaks a MIF rule) xfig X11 xfig(1) figure utility METAFILES WITH POST_PROCESSORS/CONVERTERS cgmt a clear-text CGM (Computer Graphics Metafile) gnu GNU plot(1) metafile Adobe Public Document Format unixplot Unix plot(1) metafile
canvas HTML5 CANVAS graphics element file svg Scalable Vector Graphics usemap HTML image map vml Microsoft Vector Markup Language
vog M_draw low level call record (debug)
fti SGI vector-based icons null no output
:- Drivers Ive dropped but code is there for ---------------------------------------------
grwin - (minGW GRwin PC interface) decX11 - the decstation window manager dxy - roland DXY plotter language sun - Sun workstations running sunview next - NeXTStep and other NeXT platforms apollo - Apollo workstations:- Drivers Ive dropped but are in the original distribution ------------------------------------------------------------
hercules - IBM PC hercules graphics card cga - IBM PC cga graphics card ega - IBM PC ega graphics card vga - IBM PC vga graphics card sigma - IBM PC sigma graphics card. mswin - IBM PC Microsoft Windows.Note 2 : If device is a NULL or a null string the value of the environment variable "M_DRAW_DEVICE" is taken as the device type to be opened. The format of the variable is
M_DRAW_DEVICE [ xsize [ ysize [ xoffset [ yoffset ] ] ]That is, if present xsize and ysize will be used in a call to prefsize(3c), and xoffset and yoffset will be used in a call to preposition(3c).
Note 3 : after vinit() it is wise to explicitly clear the screen. e.g.:
call color(D_BLACK) call clear()
gnu
The GNU plotutils package includes a program called plot(1) that can read in the gnu metafile and render images on an X11 display, PNG (Portable Network Graphics) format, portable anymap format (PBM/PGM/PPM), a pseudo-GIF format that does not use LZW encoding, the new XML-based Scalable Vector Graphics format, the format used by Adobe Illustrator, Postscript or Encapsulated Postscript (EPS) that can be edited with idraw(1), CGM format (by default, confirming to the WebCGM profile), the format used by the xfig(1) drawing editor, the Hewlett-Packard PCL 5 printer language, the Hewlett-Packard Graphics Language, ReGIS graphics format (which can be displayed by the dxterm(1) terminal emulator or by a VT330 or VT340 terminal), Tektronix format (which can be displayed by the xterm(1) terminal emulator), and device-independent GNU metafile format itself.pdf
Popular PDF readers are the Adobe PDF viewer, which is often callable from Web browsers; the GhostScript-based gv(1) utility; or the xpdf program.cgmtThe xpdf(1) software , related utilities ( pdftops(1), pdftotext(1), pdfinfo(1), pdffonts(1), pdftoppm(1), pdfimages(1), xpdfrc (5)) and documentation are copyright 1996-2004 Glyph & Cog, LLC. at http://www.foolabs.com/xpdf/
The GhostScript-based tools can convert PDF files to PostScript as well as view the files.
The ralcgm(1) and gplot(1) packages are two very complete CGM viewers.HTML:ppm,pbm (and p1,p3,p4,p6)
* p1/pbm - Poskanzer (pbmplus/netplus) portable ASCII bitmap file * p3/ppm - Poskanzer portable ASCII pixmap file * p4 - Poskanzer portable binary bitmap file * p6 - Poskanzer portable binary pixmap file
The NetPBM package is available for almost every platform and lets you convert the Poskanzer portable pixmap (PPM) files to just about any pixmap or bitmap format, including PNG, JPEG, GIF/PseudoGIF, BPM, ..... Other popular pixmap products such as ImageMagick, gv, ... can read PPM files, convert them, and often edit them.
The vml, canvas, svg, and usemap drivers are primarily used to generate graphics for inclusion in HTML documents. Browsers such as Opera, Safari, Foxfire, and Chrome can easily incorporate graphics generated using the SVG (Scalable Vector Graphics) format or the HTML5 CANVAS element.usemap
This driver writes out the edges of any polygon in a format that can be used with an HTML image map; if the same sizes are used a plot generated with the ppm driver; you will have clickable regions in your pixmap when converted to a GIF image.vmlIf the polygons overlap you need to reverse the order of the polygon definitions in the output file. The numeric field in the<AREA> titles should help.
The VML format can be read in by any MicroSoft Office 2000+ product and MicroSofts web browser Internet Explorer. If the plots contain more than about 9766 vectors MicroSoft Word starts choking (still true in 2005), but otherwise this is a very nice way to generate input for MicroSoft products.xfigI generally use this on a machine running MicroSoft Windows by installing CygWin with the X11 options (and ralcgm, the GhostScript software, the GNU plotutils packages and netpbm).
The xfig(1) command can be used to edit graphics generated with the M_draw graphics library; and to convert the xfig(1)-format file to many other output formats. If you are generating pixmaps with the PPM driver and want to use them as image maps in your HTML documents the usemap driver can be used.If you have xfig(1) installed, you will find that calling fig2dev(1) allows you to generate many output formats from a single file, including LaTex and encapsulated PostScript.
xfig(1) is an X11 Windows application that can be used to interactively edit figures. The HELP utility of xfig(1) provides a description of the xfig(1) file format (as well as a user guide and many other documents).
Unfortunately, the manual indicates the user defined colors must be defined before any other Fig objects. By default, 16 colors are defined. If undefined colors are used they are assigned a dash pattern or a fill pattern to help distinguish them. Use of hardware dash and M_draw software dash could get confusing.
Also, in the current driver version all lines are drawn as a series of move-draw vectors, which can make the files relatively very large.
multiple pages appear to only work with the PostScript and PDF drivers of xfig(1); and even then pages must be all positive numbers from left to right and top to bottom, printing all pages in a rectangular area.
Alternatively, could use depth to keep up to 999 pages separate
Sample program:
program demo_vinit use M_draw use ISO_C_BINDING implicit none integer :: ios, idum character(len=50) :: device! read in device name and start graphics mode print*,Enter output device: read(*,(a),iostat=ios)device if(ios.ne.0)device= call vinit(device) ! by default the drawing surface is ! a square ranging from -1 to 1 in both ! the X and Y axis
! set font to large hardware font call font(large)
! set current color to black call color(D_BLACK)
! clear to current color call clear()
! we want to draw in green call color(D_GREEN)
! draw a horizontal line at y = 0 call move2(-1.0, 0.0) call draw2(1.0, 0.0)
! pause for some input idum=getkey()
! draw a line along x = 0 call move2(0.0, 0.0) call draw2(0.0, 1.0)
! move to the middle of the screen call move2(0.0, 0.0)
! draw Hello starting at the origin call drawstr(Hello)
! pause again idum=getkey()
! wrap up and exit graphics mode call vexit()
end program demo_vinit
Nemo Release 3.1 | vinit (3) | February 23, 2025 |