home *** CD-ROM | disk | FTP | other *** search
- //▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- //▒ ▒
- //▒ CCVECTOR INSIGHT Ver 1.00 ▒
- //▒ ▒
- //▒ All rights reserved. Copyright (c) 1992,1993 ▒
- //▒ ▒
- //▒ Miniway Software Development Corp. ▒
- //▒ ▒
- //▒ Beijing, P. R. China ▒
- //▒ ▒
- //▒ Phone: 255.6266, 257.1113-1108, 1308 ▒
- //▒ ▒
- //▒ Fax: 255.6266 ▒
- //▒ ▒
- //▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- #include <graphics.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <conio.h>
- #include <io.h>
- #include <dos.h>
- #include <stdio.h>
- #include <time.h>
- #include <string.h>
-
-
- typedef struct DotFile { int Index;
- char *FileName;
- };
-
- struct DotFile DotFiles[]={ {0, "CVFONT.001"},
- {1, "CVFONT.002"},
- {2, "CVFONT.003"},
- {3, "CVFONT.004"},
- {12, "CVFONT.005"},
- {14, "CVFONT.006"},
- {7, "CVFONT.007"},
- {4, "CVFONT.008"},
- {11, "CVFONT.009"},
- {5, "CVFONT.010"},
- {8, "CVFONT.011"},
- {13, "CVFONT.012"},
- {6, "CVFONT.013"},
- {29, "CVFONT.014"},
- {15, "CVFONT.015"},
- {16, "CVFONT.016"},
- {17, "CVFONT.017"},
- {18, "CVFONT.018"},
- {24, "CVFONT.019"},
- {25, "CVFONT.020"},
- {23, "CVFONT.021"},
- {21, "CVFONT.022"},
- {22, "CVFONT.023"},
- {27, "CVFONT.024"},
- {28, "CVFONT.025"},
- {26, "CVFONT.026"}
- };
-
-
-
- unsigned char * GetDOTS(unsigned int ccode,
- int FileIndex,
- int FHandle,
- int Width,
- int Height);
-
-
- /*▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒*/
- main(int args, char *argv[])
- {
- // display all fonts on screen */
- int Height=95, Width=127, Handle; /*MAX is 368x368*/
-
- // display each font on screen */
- // int Height=368, Width=368, Handle; /*MAX is 368x368*/
-
- // display 4 font on screen */
- // int Height=239, Width=319, Handle; /*MAX is 368x368*/
-
-
-
- unsigned char BitValue[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
- unsigned int ccode=1601, code;
-
- int i,j,k,m,n,fnts_screen, retv;
- int ii;
-
- unsigned char *buf;
- unsigned int *dos;
-
- unsigned int color_bk=7;
- unsigned int color_fg=6;
- unsigned int color_border=2;
- unsigned int color_point=14;
-
-
-
- /* request auto detection */
- int gdriver = DETECT, gmode, errorcode;
- int Flag = 0 ;
-
-
- /*** get hz's GB code ***/
- if(args>1)
- { i=atoi(argv[1]);
- if(i>0 && i<=87)
- ccode=i*100+1;
- else
- if(i>=1601 && i<=8794)
- {
- if((j=(i % 100))>=1 && j<=94) ccode=i;
- }
- }
-
- /* initialize graphics mode */
- initgraph(&gdriver, &gmode, "");
-
- /* read result of initialization */
- errorcode = graphresult();
-
- if(errorcode != grOk) /* an graphics error occurred */
- {
- printf("Graphics error: %s\n", grapherrormsg(errorcode));
- printf("Press any key to halt:");
- getch();
- exit(1); /* return with error code */
- }
-
- clearviewport(); /*** clear screen ***/
-
- color_bk=8;
- color_fg=4;
- color_border=9;
- color_point=11;
-
-
- while(1)
- {
- if((ccode % 100)>94) ccode=((ccode / 100)+1)*100+1;
- if((ccode / 100)>87) ccode=1601;
-
- clearviewport();
- setbkcolor(color_bk);
- setcolor(color_border);
-
- rectangle(0,0,getmaxx(),getmaxy());
-
-
- for(i=0, ii=-1; i<=26; i++)
- {
- if((Handle=open(DotFiles[i].FileName, 0))==-1) continue;
-
- ii++;
-
- buf=GetDOTS(ccode, DotFiles[i].Index, Handle,Width,Height);
- close(Handle);
-
- if(buf == 0) continue;
-
- dos=(unsigned int *) (buf+16928/*0x3F48*/);
-
- /***
- [buf] is a point of hz dots buffer
-
- [dos] is a point of hz vectors buffer
- ***/
-
- fnts_screen=(getmaxx()/Width)*(getmaxy()/Height);
- setviewport( ( (ii%fnts_screen) % ((getmaxx())/Width ) )*Width +1,
- ( (ii%fnts_screen) / ((getmaxy())/Height) )*Height +1,
- ( (ii%fnts_screen) % ((getmaxx())/Width ) )*Width +Width ,
- ( (ii%fnts_screen) / ((getmaxy())/Height) )*Height+Height,
- 1 );
-
- /*********************** draw hz use its vectors ***************************/
- /****
- setwritemode(COPY_PUT);
- setfillstyle(SOLID_FILL, 7);
- m=0;
- while( (j=dos[m])>0 )
- {
- m++;
- fillpoly(j, &dos[m]);
- m=m+j*2;
- }
- setwritemode(COPY_PUT);
- getch();
- ****/
-
-
- /***************************** fill hz *************************************/
- clearviewport();
-
- for(m=0; m<Width; m++)
- for(n=0; n<Height; n++)
- {
- j=(m/8)*Height+n;
- k=m % 8;
- if(BitValue[k] & buf[j])
- {
- if( ( (n%2)&&(m%2) ) || ( !( n%2) && ! ( m % 2) ) )
- putpixel(m,n,color_fg);
- else
- putpixel(m,n,color_fg);
- }
- }
- // getch();
-
-
- /****************************** draw outline *******************************/
- clearviewport();
- for(m=0; m<Width; m++)
- for(n=0; n<Height; n++)
- {
- j=(m/8)*Height+n;
- k=m % 8;
-
- if( (BitValue[k] & buf[j]) && ( !Flag ) )
- {
- putpixel(m, n, color_fg); Flag = 1 ;
- }
- else
- if( !(BitValue[k] & buf[j]) && ( Flag ) )
- {
- putpixel(m, n, color_fg); Flag = 0 ;
- }
-
- }
-
- for(n=0; n<Height; n++)
- for(m=0; m<Width; m++)
- {
- j=(m/8)*Height+n;
- k=m % 8;
-
- if( (BitValue[k] & buf[j]) && ( !Flag ) )
- {
- putpixel(m, n, color_fg); Flag = 1 ;
- }
- else
- if( !(BitValue[k] & buf[j]) && ( Flag ) )
- {
- putpixel(m, n, color_fg); Flag = 0 ;
- }
- }
- // getch();
-
- /************************* display keypoints *******************************/
-
- m=0;
- while( (j=dos[m])>0 )
- {
- m++;
- while(j)
- {
- putpixel(dos[m], dos[m+1], color_point);
- m+=2;
- j--;
- }
- }
- // getch();
-
- setviewport( 0, 0, getmaxx(), getmaxy(), 0); /* CLIP=0:OFF */
- }
-
- ccode++;
-
- if(kbhit())
- {
- if((i=getch())==0) i=getch()<<8;
- if(i==27) break;
- }
-
- }
- getch();
-
- closegraph(); /* clean up */
-
- return 0;
- }
-
-
-