home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 600-699 / ff634.lha / APIG / apig33.lzh / e13_fonts.rexx < prev    next >
OS/2 REXX Batch file  |  1992-02-29  |  3KB  |  114 lines

  1. /*  example use of fonts  */
  2.  
  3.  x = addlib("apig.library",0,-30,0)
  4.  
  5.  portname = "example13_port"
  6.  p = openport(portname)
  7.  call set_apig_globals()      /* Create Intuition Global Constants */
  8.  
  9.  scr = 0 
  10.  scrtitle = "Hey Buddy, Yea You,  This is Your New Screen  !"
  11.  wintitle = "This is your title"
  12.  winidcmp = CLOSEWINDOW+GADGETDOWN+GADGETUP
  13.  winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
  14.  
  15. /* scr = openscreen(0,0,640,400,3,4,5,LACE+HIRES,CUSTOMSCREEN,scrtitle) */
  16.  
  17.  /* open window */
  18.   w1  = openwindow(portname,0,0,640,400,2,4,winidcmp,winflags,wintitle,scr,0,0,0) 
  19.   rpw1 = getwindowrastport(w1) 
  20. /*
  21.   call setrgb4(w1,0,2,2,2)
  22.   call setrgb4(w1,1,3,3,3)
  23.   call setrgb4(w1,2,2,7,7)
  24.   call setrgb4(w1,3,0,0,0)
  25.   call setrgb4(w1,4,11,11,11)
  26.   call setrgb4(w1,5,4,4,5)
  27.   call setrgb4(w1,6,6,9,13)
  28.   call setrgb4(w1,7,15,15,15)
  29. */
  30.   fcourier11 = maketattr(w1,"courier.font",11)
  31.   fcourier13 = maketattr(w1,"courier.font",13)
  32.   fcourier15 = maketattr(w1,"courier.font",15)
  33.   fcourier18 = maketattr(w1,"courier.font",18)
  34.   fcourier24 = maketattr(w1,"courier.font",24)
  35.   
  36.   fsapphire14 = maketattr(w1,"sapphire.font",14)
  37.   fsapphire19 = maketattr(w1,"sapphire.font",19)
  38.   
  39.   fruby8    = maketattr(w1,"ruby.font",8)
  40.   fruby12   = maketattr(w1,"ruby.font",12)
  41.   fruby15   = maketattr(w1,"ruby.font",15)
  42.   
  43.   courier11 = openfont(fcourier11)
  44.   courier13 = openfont(fcourier13)
  45.   courier15 = openfont(fcourier15)
  46.   courier18 = openfont(fcourier18)
  47.   courier24 = openfont(fcourier24)
  48.   
  49.   sapphire14 = openfont(fsapphire14)
  50.   sapphire19 = openfont(fsapphire19)
  51.  
  52.   ruby8  = openfont(fruby8)
  53.   ruby12 = openfont(fruby12)
  54.   ruby15 = openfont(fruby15)
  55.  
  56.   i2x = makeitext(w1,"YES",6,3,2,3,JAM2,fcourier18,0)
  57.   i3x = makeitext(w1,"NO",6,3,2,3,JAM2,fcourier24,0)
  58.   i1x = makeitext(w1,"this is a test",6,3,2,7,JAM2,fcourier15,0)
  59.   
  60.   x = printitext(rpw1,i1x,420,30)
  61.   x = printitext(rpw1,i2x,420,50)
  62.   x = printitext(rpw1,i3x,420,70)
  63.   
  64.   x = pitext(rpw1,40,20,"Courier 11 Font",6,1,JAM2,fcourier11)
  65.   x = pitext(rpw1,40,40,"Courier 13 Font",6,2,JAM2,fcourier13)
  66.   x = pitext(rpw1,40,60,"Courier 15 Font",6,3,JAM2,fcourier15)
  67.   x = pitext(rpw1,40,80,"Courier 18 Font",6,4,JAM2,fcourier18)
  68.   x = pitext(rpw1,40,100,"Courier 24 Font",6,5,JAM2,fcourier24)
  69.   x = pitext(rpw1,350,110," THIS  IS A TEST ",7,2,JAM2,fcourier24)
  70.   x = pitext(rpw1,350,134," Courier 24 Font ",7,2,JAM2,fcourier24)
  71.  
  72.   x = pitext(rpw1,40,130,"Sapphire 14 Font",4,1,JAM2,fsapphire14)
  73.   x = pitext(rpw1,40,150,"Sapphire 19 Font",1,2,JAM2,fsapphire19)
  74.  
  75.   x = pitext(rpw1,40,180,"Ruby 8 Font",1,3,JAM2,fruby8)
  76.   x = pitext(rpw1,40,200,"Ruby 12 Font",1,4,JAM2,fruby12)
  77.   x = pitext(rpw1,40,220,"Ruby 15 Font",1,5,JAM2,fruby15)
  78.  
  79.  
  80. exitme = 0
  81.  
  82. do forever
  83.      x = waitpkt(portname)
  84.   
  85.      do forever 
  86.   
  87.         msg = '0000 0000'x
  88.         msg = getpkt(portname)
  89.         if msg = '0000 0000'x then leave
  90.         class = getarg(msg,0)
  91.         if class = 512 then exitme = 1
  92.         x = reply(msg,0)  
  93.      end  
  94.    if exitme = 1 then leave
  95.    
  96. end
  97.  
  98. a = closefont(courier11)
  99. a = closefont(courier13)
  100. a = closefont(courier15)
  101. a = closefont(courier18)
  102. a = closefont(courier24)
  103. a = closefont(sapphire14)
  104. a = closefont(sapphire19)
  105. a = closefont(ruby8)
  106. a = closefont(ruby12)
  107. a = closefont(ruby15)
  108. say "CloseFont returned " a
  109.  
  110. a =closewindow(w1)
  111. a =closescreen(scr)
  112.  
  113. exit
  114.