刚刚写的小程序
: [ X0 N2 d( x2 Z* Q) b' s测试的时候用比较好吧(因为不知道该替换哪个字库就全换了)8 [% k; U5 |2 V( k% ~
或许可以写个.bat先把文件夹里的东西备份一下
4 g, B3 v6 E( @: L0 S! ?0 i% ^: I- m* a1 C8 Z* ]7 k1 C4 i0 L' M4 N
用法很简单,把做好的字体改名为sourcefile.mvec; M* H& y. h6 v6 _/ q+ t4 A3 ^3 g
和replace.exe放到fonts文件夹里运行,! g* \5 b- u8 F! C9 H- `/ D
应该就能把里面所有的文件都换成sourcefile.mvec的字体了
3 d/ `; x9 `; X+ C6 E% w& C& {/ ^ p+ i( ^8 G& }
只拿了鬼船测试了一下通过,另外个游戏要打包的,没成功,可能是打包过程中出了些故障吧,欢迎大家使用; u: W" A0 a. R* u3 S
+ M$ t1 ~8 p: j: l7 k附源码- #include <iostream>
- #include <fstream>
- #include <dirent.h>
- using namespace std;
- int overwrite(char* srcfile,char* destfile)
- {
- fstream infile;
- fstream outfile;
- int size;
- if (strcmp(srcfile,destfile)==0) return -1; //same file
- infile.open(srcfile,ios::binary|ios::in);
- if (!infile.is_open()) printf("%s failed to open\n",srcfile);
- outfile.open(destfile,ios::binary|ios::out);
- if (!outfile.is_open()) printf("%s failed to open\n",destfile);
- infile.seekg(0,ios::end);
- size = infile.tellg();
- infile.seekg(0,ios::beg);
- char* buffer;
- buffer = new char[size];
- infile.read(buffer,size);
- outfile.write(buffer,size);
- infile.close();
- outfile.close();
- }
- int main()
- {
- DIR *dp;
- if ((dp = opendir(".")) == NULL)
- {cout <<"Error opening directory\n";}
- struct dirent *dirp;
- char outname[255];
- char *temp;
- while ((dirp = readdir(dp)) != NULL) {
- printf("%s file \n",dirp->d_name);
- overwrite("sourcefile.mvec",dirp->d_name);
- }
复制代码 |