git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added swf_TextCountBitsUTF8() and swf_TextSetCharRecordUTF8().
[swftools.git]
/
pdf2swf
/
swfoutput.cc
diff --git
a/pdf2swf/swfoutput.cc
b/pdf2swf/swfoutput.cc
index
9781c71
..
63c33cb
100644
(file)
--- a/
pdf2swf/swfoutput.cc
+++ b/
pdf2swf/swfoutput.cc
@@
-817,8
+817,12
@@
static void putcharacters(TAG*tag)
if(lastx != chardata[t].x ||
lasty != chardata[t].y)
{
if(lastx != chardata[t].x ||
lasty != chardata[t].y)
{
- newx=chardata[t].x;
- newy=chardata[t].y;
+ newx = chardata[t].x;
+ newy = chardata[t].y;
+ if(newx == 0)
+ newx = SET_TO_ZERO;
+ if(newy == 0)
+ newy = SET_TO_ZERO;
}
if(!colorcompare(&color, &chardata[t].color))
{
}
if(!colorcompare(&color, &chardata[t].color))
{
@@
-982,7
+986,8
@@
SWFFont::SWFFont(char*name, int id, char*filename)
this->fontid = strdup(name);
this->t1id = id;
this->fontid = strdup(name);
this->t1id = id;
- char**a= T1_GetAllCharNames(id);
+ char**charnamebase= T1_GetAllCharNames(id);
+ char**a= charnamebase;
int t, outlinepos=0;
char*map[256];
int t, outlinepos=0;
char*map[256];
@@
-1024,7
+1029,7
@@
SWFFont::SWFFont(char*name, int id, char*filename)
t=0;
while(*a)
{
t=0;
while(*a)
{
- map[t] = *a;
+ map[t] = strdup(*a);
a++;
t++;
if(t==256 || !*a) {
a++;
t++;
if(t==256 || !*a) {
@@
-1039,6
+1044,12
@@
SWFFont::SWFFont(char*name, int id, char*filename)
int ret = T1_ReencodeFont(id, map);
if(ret)
fprintf(stderr,"Can't reencode font: (%s) ret:%d\n",filename, ret);
int ret = T1_ReencodeFont(id, map);
if(ret)
fprintf(stderr,"Can't reencode font: (%s) ret:%d\n",filename, ret);
+ /* Deleting the font invalidates the charname array,
+ so we have to ask for it again now.
+ We continue at the position we were, hoping the font
+ didn't shrink in the meantime or something.
+ */
+ a = T1_GetAllCharNames(id) + (a - charnamebase);
}
// parsecharacters
}
// parsecharacters
@@
-1051,9
+1062,13
@@
SWFFont::SWFFont(char*name, int id, char*filename)
this->charname[outlinepos] = strdup(name);
outlinepos++;
}
this->charname[outlinepos] = strdup(name);
outlinepos++;
}
+
+ for(s=0;s<t;s++)
+ free(map[s]);
t=0;
}
}
t=0;
}
}
+ printf("done\n");
}
/* free all tables, write out definefont tags */
}
/* free all tables, write out definefont tags */