home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / LATTIC_3.ZIP / EXAMPLES / TEXT.C < prev   
C/C++ Source or Header  |  1990-05-14  |  1KB  |  64 lines

  1. /*
  2.  * Demonstrate the Line-A text routines
  3.  *
  4.  * lc -L text.c
  5.  *
  6.  * Copyright (c) 1990 HiSoft
  7.  */
  8.  
  9. #include <linea.h>
  10. #include <string.h>
  11.  
  12. int main(void)
  13. {
  14.     register int i;
  15.     
  16.     linea0();
  17.     for (i=0; i<0x20; i++)
  18.     {
  19.         register const char *s="Hello World";
  20.         register char c;
  21.  
  22.         if (i>=0x10)
  23.             DSTX=V_X_MAX/2;
  24.         else
  25.             DSTX=0;
  26.         while (c=*s++)
  27.         {
  28.             short x[500];
  29.  
  30.             TEXTFG=1;
  31.             TEXTBG=0;
  32.             STYLE=i;
  33.             c-=V_DEF_FONT->font_low_ade;
  34.             SRCX=V_DEF_FONT->font_char_off[c];
  35.             SRCY=0;
  36.             DELX=V_DEF_FONT->font_char_off[c+1]-SRCX;
  37.             DELY=V_DEF_FONT->font_height;
  38.             FBASE=V_DEF_FONT->font_data;
  39.             FWIDTH=V_DEF_FONT->font_width;
  40.             LITEMSK=V_DEF_FONT->font_lightening;
  41.             SKEWMSK=V_DEF_FONT->font_skewing;
  42.             WEIGHT=V_DEF_FONT->font_thickening;
  43.             if (STYLE & 1<<2)    /* skewed */
  44.             {
  45.                 ROFF=V_DEF_FONT->font_right_off;
  46.                 LOFF=V_DEF_FONT->font_left_off;
  47.             }
  48.             else
  49.                 ROFF=LOFF=0;
  50.             SCALE=0;
  51.             XDDA=0x8000;
  52.             DDAINC=256;
  53.             SCALDIR=0;
  54.             CHUP=0;
  55.             MONO=0;
  56.             SCRTCHP=x;
  57.             SCRPT2=sizeof(x)/2;
  58.             CLIP=0;
  59.             DSTY=(i&0xf)*V_DEF_FONT->font_height;
  60.             linea8();
  61.         }
  62.     }
  63. }
  64.