home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 568a.lha / APIG_v1.1 / e13_fonts.rexx < prev    next >
OS/2 REXX Batch file  |  1991-09-28  |  3KB  |  113 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.   fcourier11 = maketattr(w1,"courier.font",11)
  30.   fcourier13 = maketattr(w1,"courier.font",13)
  31.   fcourier15 = maketattr(w1,"courier.font",15)
  32.   fcourier18 = maketattr(w1,"courier.font",18)
  33.   fcourier24 = maketattr(w1,"courier.font",24)
  34.   
  35.   fsapphire14 = maketattr(w1,"sapphire.font",14)
  36.   fsapphire19 = maketattr(w1,"sapphire.font",19)
  37.   
  38.   fruby8    = maketattr(w1,"ruby.font",8)
  39.   fruby12   = maketattr(w1,"ruby.font",12)
  40.   fruby15   = maketattr(w1,"ruby.font",15)
  41.   
  42.   courier11 = openfont(fcourier11)
  43.   courier13 = openfont(fcourier13)
  44.   courier15 = openfont(fcourier15)
  45.   courier18 = openfont(fcourier18)
  46.   courier24 = openfont(fcourier24)
  47.   
  48.   sapphire14 = openfont(fsapphire14)
  49.   sapphire19 = openfont(fsapphire19)
  50.  
  51.   ruby8  = openfont(fruby8)
  52.   ruby12 = openfont(fruby12)
  53.   ruby15 = openfont(fruby15)
  54.  
  55.   i2x = makeitext(w1,"YES",6,3,2,3,JAM2,fcourier18,0)
  56.   i3x = makeitext(w1,"NO",6,3,2,3,JAM2,fcourier24,0)
  57.   i1x = makeitext(w1,"this is a test",6,3,2,7,JAM2,fcourier15,0)
  58.   
  59.   x = printitext(rpw1,i1x,420,30)
  60.   x = printitext(rpw1,i2x,420,50)
  61.   x = printitext(rpw1,i3x,420,70)
  62.   
  63.   x = pitext(rpw1,40,20,"Courier 11 Font",6,1,JAM2,fcourier11)
  64.   x = pitext(rpw1,40,40,"Courier 13 Font",6,2,JAM2,fcourier13)
  65.   x = pitext(rpw1,40,60,"Courier 15 Font",6,3,JAM2,fcourier15)
  66.   x = pitext(rpw1,40,80,"Courier 18 Font",6,4,JAM2,fcourier18)
  67.   x = pitext(rpw1,40,100,"Courier 24 Font",6,5,JAM2,fcourier24)
  68.   x = pitext(rpw1,350,110," THIS  IS A TEST ",7,2,JAM2,fcourier24)
  69.   x = pitext(rpw1,350,134," Courier 24 Font ",7,2,JAM2,fcourier24)
  70.  
  71.   x = pitext(rpw1,40,130,"Sapphire 14 Font",4,1,JAM2,fsapphire14)
  72.   x = pitext(rpw1,40,150,"Sapphire 19 Font",1,2,JAM2,fsapphire19)
  73.  
  74.   x = pitext(rpw1,40,180,"Ruby 8 Font",1,3,JAM2,fruby8)
  75.   x = pitext(rpw1,40,200,"Ruby 12 Font",1,4,JAM2,fruby12)
  76.   x = pitext(rpw1,40,220,"Ruby 15 Font",1,5,JAM2,fruby15)
  77.  
  78.  
  79. exitme = 0
  80.  
  81. do forever
  82.      x = waitpkt(portname)
  83.   
  84.      do forever 
  85.   
  86.         msg = '0000 0000'x
  87.         msg = getpkt(portname)
  88.         if msg = '0000 0000'x then leave
  89.         class = getarg(msg,0)
  90.         if class = 512 then exitme = 1
  91.         x = reply(msg,0)  
  92.      end  
  93.    if exitme = 1 then leave
  94.    
  95. end
  96.  
  97. a = closefont(courier11)
  98. a = closefont(courier13)
  99. a = closefont(courier15)
  100. a = closefont(courier18)
  101. a = closefont(courier24)
  102. a = closefont(sapphire14)
  103. a = closefont(sapphire19)
  104. a = closefont(ruby8)
  105. a = closefont(ruby12)
  106. a = closefont(ruby15)
  107. say "CloseFont returned " a
  108.  
  109. a =closewindow(w1)
  110. a =closescreen(scr)
  111.  
  112. exit
  113.