- name = T1_GetCharName(t1fontindex, t);
- if(!name || name[0]=='.')
- {
- this->charname[t] = 0;
- this->outline[t] = 0;
+ char**a= T1_GetAllCharNames(id);
+ int t=0, outlinepos=0;
+ char*map[256];
+ while(a[t])
+ t++;
+
+ this->charnum = t;
+ if(!t)
+ return;
+ logf("<notice> Font %s(%d): Storing %d outlines.\n", name, id, t);
+
+ outline = (T1_OUTLINE**)malloc(t*sizeof(T1_OUTLINE*));
+ charname = (char**)malloc(t*sizeof(char*));
+
+ t=0;
+ while(*a)
+ {
+ map[t] = *a;
+ a++;
+ t++;
+ if(t==256 || !*a) {
+ int s;
+ for(s=t;s<256;s++)
+ map[s] = ".notdef";
+
+ int ret = T1_ReencodeFont(id, map);
+ if(ret) {
+ T1_DeleteFont(id);
+ T1_LoadFont(id);
+ int ret = T1_ReencodeFont(id, map);
+ if(ret)
+ fprintf(stderr,"Can't reencode font: (%s) ret:%d\n",filename, ret);
+ }
+
+ // parsecharacters
+ for(s=0;s<t;s++)
+ {
+ this->outline[outlinepos] = T1_CopyOutline(T1_GetCharOutline(id, s, 100.0, 0));
+ this->charname[outlinepos] = strdup(T1_GetCharName(id, s));
+ outlinepos++;
+ }
+ t=0;