The Simulation driver was created to simulate functions that were not supported by some CD drivers. It works jointly with the other driver (known as "client"), using its pixel, line and text functions to simulate arcs, sectors, polygons, boxes, and fillings with styles.
Important: All simulation primitives are based in the client's Pixel, Image and/or Line functions.
The Simulation driver is used in several parts of the CD library.
In many drivers, the behavior of a given primitive may not be the expected. Usually this is documented in the manual. If you wish to activate the simulation of a primitive, simply call function cdSimulate with the code of the primitive to be simulated.
parameter can be the name of a font or the name of a font file (not including
path, nor the extension ".ttf"). If a name is specified some pre-defined
correspondents are tried, for instance the know font names "Courier",
"Times" and "Helvetica" are mapped to "cour", "times", and
their styles are added to the font file name as a suffix: "bd", "i" and
"bi", to match bold, italic and bold-italic. Those files are also available in
the "cd/etc" folder of the CD distribution packages. If the pre-defined names
are not used, the typeface parameter is used as the file name. It can also use a
manual font map added using the attribute ADDFONTMAP (see
Font files can be located in the current directory, in the directory pointed by the CDDIR environment variable, in the native system font directory, or by using the full path of the file in the typeface parameter. The ".ttf" file extension is always automatically added to the end of the file name. In Linux font files are searched using FontConfig.
The search order is: ADDFONTMAP, pre-defined names, native system, and full path.
cdCanvasSetAttribute(canvas, "ADDFONTMAP", "MyWingDings=wingxing");