This driver allows generating an AutoCAD image exchange file. The file name usually has an extension .DXF. This driver supports only AutoCAD version 10.0 or later. The format's copyrights are property of Autodesk.
The file is created and opened by calling function cdCreateCanvas(CD_DXF, Data), in which Data contains the file name and canvas dimensions. This function opens the file and writes its header. Then, other functions in the CD library can be called as usual. The Data parameter string has the following format:
"filename [widthxheight] [resolution]" or in C "%s %gx%g %g"
Only the parameter filename is required. The filename must be inside double quotes (") if it has spaces. Width and height are provided in millimeters (note the lowercase "x" between them), and their default value in pixels is INT_MAX for both dimensions. Resolution is the number of pixels per millimeter; its default value is "3.78 pixels/mm" (96 DPI). Width, height and resolution are given in real values and are used only by cdCanvasGetSize and in pixel-millimeter conversion.
Any amount of such canvases may exist simultaneously. It is important to note that a call to function cdKillCanvas is required to close the DXF file properly.
Images - The DXF format does not support client or server images and works with an indexed-color format (color quality is limited to 256 fixed colors).
Precision of Coordinates - The primitives use coordinates in real numbers.
Layers - The format can work with several layers. It is necessary to draw the primitives of layer '0' first, then layer '1' and so on. Use functions Flush to change the current layer.
CD Fonts | AutoCAD Fonts |
---|---|
System | STANDARD (sem arquivo) |
Courier | ROMAN (romanc.shx) |
Courier + CD_BOLD | ROMAN_BOLD (romant.shx) |
Times | ROMANTIC (rom_____.pfb) |
Times + CD_BOLD | ROMANTIC_BOLD (romb_____.pfb) |
Helvetica | SANSSERIF (sas_____.pfb) |
Helvetica + CD_BOLD | SANSSERIF_BOLD (sasb____.pfb) |