glmap MM_DEFAULTglclear n ; initialize graphics state. If n is '' or 0, then an InvalidateRect is done, If n is 1, then it is not done.
glzmap twips
glbkcolor white
glwindowext 1000 1000
glplaymap anisotropic
glplayextent 1000 1000
glextent 1
attribute set: pen, brush, text, font, align, edit, 8 unused valuesglgridborder borders ; a border is specified as 20 integers:
pen, brush, and text are 3 integers with RGB values
font: _1 selects font based on first character (-, _ , and digit select font 1); 0 selects font 0, 1 selects font 1
align: _1 selects left or right based on first character (-, _, and digit selects right), 0 selects right, 1 selects left, 2 selects center.
edit: 0 not editable, 1 editable
The layout (rasterization) of text is quite complicated and the final length of text is not simply the sum of the lengths of the individual characters. For this reason, calculations based on character widths are not very useful.glqpixels x y w h; return pixeldata as integer per pixel with RGB values
In addition, the length of text depends on the device. Drawing "testing 1 2 3" with an arial 240 font in a twips mapping will have different lengths on the screen, on a 150dpi printer, and on a 300dpi printer. Calculations such as line breaks, page breaks, and positioning stuff at the end of text are sensitive to the actual device.
glqtextmetrics '' ; return font information. The context (screen or printer) is selected by glextent and the font is selected by glextentfont. The values are: Height, Ascent, Descent, InternalLeading, ExternalLeading, AverageCharWidth, MaxCharWidth
horzsize width in millimeters vertsize height in millimeters horzres width in pixels Vertres height in raster lines (pixels) logpixelsx horizontal pixels per logical inch logpixelsy vertical pixels per logical inch bitspixel number of color bits per pixel. planes number of color planes numcolors number of entries in the device's color table (_1 if > 8) aspectx relative width of a pixel aspecty relative height of a pixel aspectxy diagonal width of a pixel physicalwidth width of the physical page. A 600 dpi printer on 8.5"x11" paper could have a physical width of 5100. The physical page is almost always greater than the printable area of the page, and never smaller. physicalheight height of the physical page physicaloffsetx distance from the left edge of the physical page to the left edge of the printable area. A 600 dpi printer on 8.5"x11" paper, that cannot print on the leftmost 0.25" of paper, has a horizontal physical offset of 150. physicaloffsety distance from the top edge of the physical page to the top edge of the printable area
flip 0 has J orientation of 0 0 as lower left corner.glsavebmp width height ; (only win32) save drawing as bitmap (24bit color) to glfile filename. Save to clipboard if filename is empty.
flip 1 flips for applications like Word with 0 0 as upper left corner.
w h are suggested clipboard width and height in 0.01 millimeters.
The wmf file is saved without a "placeable metafile header". Some applications require this 22 byte header at the front of a wmf file. The utility addwmfheader from script system\main\winutil.js adds a header to a wmf file so that it is suitable for use by WORD and similar applications.
TA_LEFT TA_CENTER TA_RIGHTgltextcolor '' ; glrgb color is set as color of text for gtext
TA_TOP TA_BASELINE TA_BOTTOM
TA_NOUPDATECP TA_UPDATECP
The first option in each group is the default. TA_NOUPDATECP causes gltext to use the position set by gltextxy. TA_UPDATECP causes gltext to use and update the current position.
Values from each of the 3 groups can be combined:
gltextalign TA_BOTTOM + TA_UPDATEDCP
gltext commands painted with glshow after gltextjustify commands have been processed will not be justified unless the entire control is repainted. glpaint forces a repaint.gltextxy x y ; position for gltext with gltexalign of TA_NOUPDATECP
The Macintosh runs the gltextjustify command without error, but text justification is not supported and the text is displayed without justification.
The Macintosh does not support glzdevmode and printer properties can not be changed.glzenddoc '' ; (only win32) ends a document.
The information returned is: orientation, papersize, paperlength, paperwidth, scale, copies, source, quality, color, duplex, yresolution, truetype