home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 640a.lha / FontConverter / Source.LZH / Source / Example2.c < prev    next >
C/C++ Source or Header  |  1992-04-26  |  2KB  |  76 lines

  1. /************************************************************************/
  2. /*                                                                      */
  3. /*                            Compiler: DICE                            */
  4. /*                                                                      */
  5. /*                            Compilerusage:                            */
  6. /*                                                                      */
  7. /*               DCC -oExample2 Example2.c Font.c Font1.c               */
  8. /*                                                                      */
  9. /************************************************************************/
  10.  
  11.  
  12. #include <intuition/intuition.h>
  13.  
  14. extern struct IntuitionBase *IntuitionBase;
  15. extern struct GfxBase *GfxBase;
  16.  
  17. extern struct TextFont Ruby12Font;
  18. extern struct TextFont Garnet9Font;
  19.  
  20. struct Window *win;
  21. struct RastPort *rp;
  22. struct IntuiMessage *mes;
  23.  
  24. struct NewWindow nwin =
  25.   {
  26.     30,15,220,55,0,1,CLOSEWINDOW,ACTIVATE|WINDOWCLOSE|RMBTRAP,
  27.     NULL,NULL,"<- Click to close",NULL,NULL,0,0,0,0,WBENCHSCREEN
  28.   };
  29.  
  30. ULONG mesclass;
  31.  
  32. dummy()
  33.   {
  34.     _waitwbmsg();
  35.   }
  36.  
  37. _main()
  38.   {
  39.     win=(struct Window *)OpenWindow(&nwin);
  40.  
  41.     rp=win->RPort;
  42.  
  43.     SetAPen(rp,1);
  44.  
  45.     FontInit_Ruby12();
  46.     FontInit_Garnet9();
  47.  
  48.     SetFont ( rp,&Ruby12Font );
  49.     Move(rp,20,27);
  50.     Text(rp,"This is an example.",19);
  51.  
  52.     SetFont ( rp,&Garnet9Font );
  53.     Move(rp,20,45);
  54.     Text(rp,"Output with Text().",19);
  55.  
  56.     for(;;)
  57.       {
  58.         if(mes=(struct IntuiMessage *)GetMsg(win->UserPort))
  59.           {
  60.             mesclass=mes->Class;
  61.             ReplyMsg(mes);
  62.             if(mesclass==CLOSEWINDOW)
  63.               {
  64.                 close_all();
  65.                 exit(0);
  66.               }
  67.           }
  68.       }
  69.   }
  70.  
  71. close_all()
  72.   {
  73.     CloseWindow(win);
  74.   }
  75.  
  76.