void ffw_reencode_raw2(char ** mapping, int mapping_len, int force) { Encoding * enc = calloc(1, sizeof(Encoding)); enc->enc_name = strcopy(""); enc->char_cnt = mapping_len; enc->unicode = (int32_t*)malloc(mapping_len * sizeof(int32_t)); enc->psnames = (char**)calloc(mapping_len, sizeof(char*)); int i; for(i = 0; i < mapping_len; ++i) { if(mapping[i]) { enc->unicode[i] = UniFromName(mapping[i], ui_none, &custom); enc->psnames[i] = strcopy(mapping[i]); } else { enc->unicode[i] = -1; } } enc->next = enc_head; enc_head = enc; ffw_do_reencode(enc, force); }
void ffw_reencode(const char * encname, int force) { Encoding * enc = FindOrMakeEncoding(encname); if(!enc) err("Unknown encoding %s\n", encname); ffw_do_reencode(enc, force); }
void ffw_reencode_raw(int32 * mapping, int mapping_len, int force) { Encoding * enc = calloc(1, sizeof(Encoding)); enc->only_1byte = enc->has_1byte = true; enc->char_cnt = mapping_len; enc->unicode = (int32_t*)malloc(mapping_len * sizeof(int32_t)); memcpy(enc->unicode, mapping, mapping_len * sizeof(int32_t)); enc->enc_name = strcopy(""); enc->next = enc_head; enc_head = enc; ffw_do_reencode(enc, force); }
void ffw_reencode_raw(int32 * mapping, int mapping_len, int force) { Encoding * enc = calloc(1, sizeof(Encoding)); enc->only_1byte = enc->has_1byte = true; int len = (mapping_len < 256) ? 256 : mapping_len; enc->char_cnt = len; enc->unicode = (int32_t*)malloc(len * sizeof(int32_t)); memcpy(enc->unicode, mapping, mapping_len * sizeof(int32_t)); if(mapping_len < 256) { int i; for(i = mapping_len; i < 256; ++i) enc->unicode[i] = -1; } enc->enc_name = strcopy(""); enc->next = enc_head; enc_head = enc; ffw_do_reencode(enc, force); }
void ffw_reencode_glyph_order(void) { ffw_do_reencode(original_enc, 0); }
void ffw_reencode_unicode_full(void) { ffw_do_reencode(unicodefull_enc, 0); }