Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/ttpset/ttset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7674 by zmatsuo, Mon May 13 15:14:30 2019 UTC revision 7705 by zmatsuo, Tue May 21 15:20:38 2019 UTC
# Line 224  void WriteInt6(PCHAR Sect, PCHAR Key, PC Line 224  void WriteInt6(PCHAR Sect, PCHAR Key, PC
224          WritePrivateProfileString(Sect, Key, Temp, FName);          WritePrivateProfileString(Sect, Key, Temp, FName);
225  }  }
226    
227  void WriteFont(PCHAR Sect, PCHAR Key, PCHAR FName,  // フォント情報書き込み、4パラメータ版
228                             PCHAR Name, int x, int y, int charset)  static void WriteFont(PCHAR Sect, PCHAR Key, PCHAR FName,
229                                              PCHAR Name, int x, int y, int charset)
230  {  {
231          char Temp[80];          char Temp[80];
232          if (Name[0] != 0)          if (Name[0] != 0)
# Line 236  void WriteFont(PCHAR Sect, PCHAR Key, PC Line 237  void WriteFont(PCHAR Sect, PCHAR Key, PC
237          WritePrivateProfileString(Sect, Key, Temp, FName);          WritePrivateProfileString(Sect, Key, Temp, FName);
238  }  }
239    
240    // フォント情報読み込み、4パラメータ版
241    static void ReadFont(
242            const char *Sect, const char *Key, const char *Default, const char *FName,
243            char *FontName, size_t FontNameLen, POINT *FontSize, int *FontCharSet)
244    {
245            char Temp[MAX_PATH];
246            GetPrivateProfileString(Sect, Key, Default,
247                                    Temp, _countof(Temp), FName);
248            if (Temp[0] == 0) {
249                    // デフォルトがセットされていない & iniにエントリーがない場合
250                    FontName[0] = 0;
251                    FontSize->x = 0;
252                    FontSize->y = 0;
253                    FontCharSet = 0;
254            } else {
255                    GetNthString(Temp, 1, FontNameLen, FontName);
256                    GetNthNum(Temp, 2, &(FontSize->x));
257                    GetNthNum(Temp, 3, &(FontSize->y));
258                    GetNthNum(Temp, 4, FontCharSet);
259            }
260    }
261    
262  #define CYGTERM_FILE "cygterm.cfg"  // CygTerm configuration file  #define CYGTERM_FILE "cygterm.cfg"  // CygTerm configuration file
263  #define CYGTERM_FILE_MAXLINE 100  #define CYGTERM_FILE_MAXLINE 100
# Line 925  void PASCAL ReadIniFile(PCHAR FName, PTT Line 946  void PASCAL ReadIniFile(PCHAR FName, PTT
946          ts->TEKColorEmu = GetOnOff(Section, "TEKColorEmulation", FName, FALSE);          ts->TEKColorEmu = GetOnOff(Section, "TEKColorEmulation", FName, FALSE);
947    
948          /* VT Font */          /* VT Font */
949          GetPrivateProfileString(Section, "VTFont", "Terminal,0,-13,1",          ReadFont(Section, "VTFont", "Terminal,0,-13,1", FName,
950                                  Temp, sizeof(Temp), FName);                           ts->VTFont, _countof(ts->VTFont),
951          GetNthString(Temp, 1, sizeof(ts->VTFont), ts->VTFont);                           &ts->VTFontSize, &(ts->VTFontCharSet));
         GetNthNum(Temp, 2, (int far *) &(ts->VTFontSize.x));  
         GetNthNum(Temp, 3, (int far *) &(ts->VTFontSize.y));  
         GetNthNum(Temp, 4, &(ts->VTFontCharSet));  
952    
953          /* Bold font flag */          /* Bold font flag */
954          if (GetOnOff(Section, "EnableBold", FName, TRUE))          if (GetOnOff(Section, "EnableBold", FName, TRUE))
# Line 942  void PASCAL ReadIniFile(PCHAR FName, PTT Line 960  void PASCAL ReadIniFile(PCHAR FName, PTT
960          ts->RussFont = str2id(RussList, Temp, IdWindows);          ts->RussFont = str2id(RussList, Temp, IdWindows);
961    
962          /* TEK Font */          /* TEK Font */
963          GetPrivateProfileString(Section, "TEKFont", "Courier,0,-13,0",          ReadFont(Section, "TEKFont", "Courier,0,-13,0", FName,
964                                  Temp, sizeof(Temp), FName);                           ts->TEKFont, _countof(ts->TEKFont),
965          GetNthString(Temp, 1, sizeof(ts->TEKFont), ts->TEKFont);                           &ts->TEKFontSize, &(ts->TEKFontCharSet));
         GetNthNum(Temp, 2, (int far *) &(ts->TEKFontSize.x));  
         GetNthNum(Temp, 3, (int far *) &(ts->TEKFontSize.y));  
         GetNthNum(Temp, 4, &(ts->TEKFontCharSet));  
966    
967          /* BS key */          /* BS key */
968          GetPrivateProfileString(Section, "BSKey", "",          GetPrivateProfileString(Section, "BSKey", "",
# Line 1332  void PASCAL ReadIniFile(PCHAR FName, PTT Line 1347  void PASCAL ReadIniFile(PCHAR FName, PTT
1347                  ts->TermFlag |= TF_PRINTERCTRL;                  ts->TermFlag |= TF_PRINTERCTRL;
1348    
1349          /* Printer Font --- special option */          /* Printer Font --- special option */
1350          GetPrivateProfileString(Section, "PrnFont", "",          ReadFont(Section, "PrnFont", NULL, FName,
1351                                  Temp, sizeof(Temp), FName);                           ts->PrnFont, _countof(ts->PrnFont),
1352          if (strlen(Temp) == 0) {                           &ts->PrnFontSize, &(ts->PrnFontCharSet));
                 ts->PrnFont[0] = 0;  
                 ts->PrnFontSize.x = 0;  
                 ts->PrnFontSize.y = 0;  
                 ts->PrnFontCharSet = 0;  
         }  
         else {  
                 GetNthString(Temp, 1, sizeof(ts->PrnFont), ts->PrnFont);  
                 GetNthNum(Temp, 2, (int far *) &(ts->PrnFontSize.x));  
                 GetNthNum(Temp, 3, (int far *) &(ts->PrnFontSize.y));  
                 GetNthNum(Temp, 4, &(ts->PrnFontCharSet));  
         }  
1353    
1354          // Page margins (left, right, top, bottom) for printing          // Page margins (left, right, top, bottom) for printing
1355          //    -- special option          //    -- special option

Legend:
Removed from v.7674  
changed lines
  Added in v.7705

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26