home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 8 / boot-disc-1997-04.iso / PDA_Soft / Psion / misc / SetFont / SETFONT.TXT < prev   
Text File  |  1994-08-04  |  2KB  |  83 lines

  1. As I've postet my converted fonts to comp.sys.psion, I got a small
  2. programme (setfont.img) which will set the system-font (used by
  3. menus, dialogs etc.) to a non-ROM-font from ' psioncorp@cix.compulink.co.uk
  4. (Psion UK plc)'. I asked if I could spread this little file, he said
  5. yes and sent me also the source code.
  6.  
  7. ..bye.. (ns103@fim.uni-erlangen.de) (if you understand german, call
  8.                                      my BBS: +49-911-3939034.)
  9.  
  10.  
  11.  
  12. #include <plib.h>
  13. #include <wlib.h>
  14. #include <hwif.h>
  15.  
  16.  
  17. GLREF_D UWORD       _UseFullScreen; 
  18. LOCAL_D UINT        wMainWid;   /* Handle for Main window */
  19. LOCAL_D UINT        wMainGC;    /* Graphic context for Main window */
  20.  
  21. LOCAL_C VOID MainLoop(VOID)
  22.     {
  23.     INT         handle;
  24.     H_DI_FSEL   FileDialog; 
  25.     TEXT openbuf[P_FNAMESIZE+2];
  26.  
  27.  
  28.     uZTStoBCS(&openbuf[0],"LOC::M:\\FON\\COURIR13.FON");
  29.     FileDialog.fname = &openbuf[0]; 
  30.     FileDialog.flags = 
  31. H_FILE_PICK_SELECTOR|H_FILE_RESTRICT_LIST|H_FILE_SET_DEFEXT;
  32.  
  33.  
  34.     if (uOpenDialog("Set system font"))
  35.         return;
  36.     if (uAddDialogItem(H_DIALOG_FSEL,"File:",&FileDialog))
  37.         return;
  38.     if (uRunDialog()<=0)
  39.         return;    
  40.     
  41.     *(openbuf + (*openbuf) + 1) = 0;
  42.     handle = gOpenFont(openbuf + 1);
  43.  
  44.     if (wSetSystemFont(W_SYSTEM_FONT_S3B, handle, 0))
  45.         {
  46.         wDisconnect();
  47.         p_printf("Could not do wSetSystemFont");
  48.         p_getch();
  49.         }
  50.  
  51.     p_exit(0);
  52.  
  53.     }
  54.  
  55.  
  56. LOCAL_C VOID CreateGC(VOID)
  57.  
  58.    {
  59.    wMainGC   =  gCreateGC0(wMainWid);
  60.  
  61.    if (wMainGC < 0)
  62.       p_exit(wMainGC);
  63.    }
  64.  
  65.  
  66. LOCAL_C VOID SpecificInit(VOID)
  67.  
  68.    {
  69.    wMainWid = uFindMainWid();
  70.    CreateGC();
  71.    }
  72.  
  73. GLDEF_C VOID main(VOID)
  74.    
  75.    {
  76.    _UseFullScreen = TRUE;
  77.    uCommonInit();
  78.    SpecificInit();
  79.    MainLoop();
  80.    }
  81.  
  82.  
  83.