#include #include #include #include #include #include #include"lffSize.h" using namespace std; void vCodes::push_back(const unsigned int& i) { vector.push_back(i); } //find the integer from bool vCodes::find(const unsigned int& n) { int low(0); int high(vector.size()-1); if (high == 0) return false; int middle( (low+high) >> 1); while( middle != low && middle != high) { if ( vector[middle] > n ) { high=middle; } else if ( vector[middle] < n ) { low=middle; } else { return true; } middle=(low+high)>>1; } return vector[low] == n || vector[high] == n; } bool operator<(const lffFont& a, const lffFont& b) { return a.utf8Code < b.utf8Code ; } int main(int argc, char* argv[]) { if(argc<3) { std::cout<<"usage:: [Options] input_lff output_lff\n"; std::cout<<"Options:\n"; std::cout<<"\t-h\treplace font header with WenQuanYi font header. Default is to keep font header\n"; std::cout<<"\t-w\tQuietly overwrite existing font file. Default not to overwrite existing file"< vlf; while(! in0.eof()) { getline(in0,linebuf); if(linebuf.size()==0) { // continue; } lffFont lf; switch(linebuf[0]) { case '#': //case '\n': if( replaceHeader == false) { out0<>std::hex>>lf.utf8Code; oss<<'['<1) { iss.clear(); iss.str(linebuf); iss.seekg(0,std::ios::beg); float f; char c; while(iss.good()) { iss>>c; //std::cout<>c; oss<>f; std::ostringstream oss2; oss2<= 2) { str2.erase(str2.begin() + str2.size() -1 ); } oss<