# include # include # include "dislin.h" int main ( int argc, char *argv[] ); /******************************************************************************/ int main ( int argc, char *argv[] ) /******************************************************************************/ /* Purpose: MAIN demonstrates the use of the SYMBOL routine. Modified: 02 September 2005 */ { static char cstr[3]; static char ctit[] = "Symbols"; int i; int nl; int nxp; int ny; printf ( "\n" ); printf ( "DISLIN_EX03:\n" ); printf ( " Demonstrate the use of the SYMBOL routine, for\n" ); printf ( " the generation of special symbols and fonts.\n" ); /* Specify the format of the output file. */ metafl ( "PNG" ); /* Specify the name of the output graphics file. */ setfil ( "dislin_ex03.png" ); setpag ( "da4p" ); disini ( ); pagera ( ); complx ( ); height ( 60 ); nl = nlmess ( ctit ); messag ( ctit, ( 2100 - nl ) / 2, 200 ); height ( 50 ); hsymbl ( 120 ); ny = 150; for ( i = 0; i < 24; i++ ) { if ( ( i % 4 ) == 0 ) { ny = ny + 400; nxp = 550; } else { nxp = nxp + 350; } sprintf ( cstr, "%d", i ); nl = nlmess ( cstr ) / 2; messag ( cstr, nxp-nl ,ny+150 ); symbol ( i, nxp, ny ); } disfin ( ); printf ( "\n" ); printf ( "DISLIN_EX03:\n" ); printf ( " Normal end of execution.\n" ); return 0; }