home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff153.lzh / Dme / src / cmd3.c < prev    next >
C/C++ Source or Header  |  1987-06-15  |  1KB  |  81 lines

  1.  
  2. /*
  3.  * CMD3.C
  4.  *
  5.  *    (C)Copyright 1988 by Matthew Dillon, All Rights Reserved
  6.  */
  7.  
  8. #include "defs.h"
  9. #include <local/xmisc.h>
  10. #include <stdio.h>
  11.  
  12. extern FONT *OpenFont(), *OpenDiskFont();
  13.  
  14. /*
  15.  *  SETFONT font size
  16.  */
  17.  
  18. void
  19. do_setfont()
  20. {
  21.     FONT *font1;
  22.     TA Ta;
  23.  
  24.     Ta.ta_Name    = av[1];
  25.     Ta.ta_YSize = atoi(av[2]);
  26.     Ta.ta_Style = 0;
  27.     Ta.ta_Flags = 0;
  28.  
  29.     font1 = OpenFont(&Ta);
  30.     if (font1 == NULL || font1->tf_YSize != Ta.ta_YSize) {
  31.     FONT *font2;
  32.  
  33.     if (openlibs(DISKFONT_LIB)) {
  34.         if (font2 = OpenDiskFont(&Ta)) {
  35.         if (font1)
  36.             CloseFont(font1);
  37.         font1 = font2;
  38.         }
  39.         closelibs(DISKFONT_LIB);
  40.     } else {
  41.         title("diskfonts failed");
  42.     }
  43.     }
  44.     if (font1) {
  45.     if (Ep->Font)
  46.         CloseFont(Ep->Font);
  47.     Ep->Font = font1;
  48.     SetFont(Ep->Win->RPort, font1);
  49.     SetRast(Ep->Win->RPort, 0);
  50.     RefreshWindowFrame(Ep->Win);
  51.     set_window_params();
  52.     text_redisplay();
  53.     } else {
  54.     title("Unable to find font");
  55.     }
  56. }
  57.  
  58. do_ignorecase()
  59. {
  60.     register ED *ep = Ep;
  61.  
  62.     if (av[1][0]) {
  63.     switch(av[1][1] & 0x1F) {
  64.     case 'n'&0x1F:
  65.         ep->IgnoreCase = 1;
  66.         break;
  67.     case 'f'&0x1F:
  68.         ep->IgnoreCase = 0;
  69.         break;
  70.     case 'o'&0x1F:
  71.         ep->IgnoreCase = 1 - ep->IgnoreCase;
  72.         break;
  73.     }
  74.     if (ep->IgnoreCase)
  75.         title("Case InSensitive");
  76.     else
  77.         title("Case Sensitive");
  78.     }
  79. }
  80.  
  81.