X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fswfoutput.cc;h=62850815a6ae3001b17990b77c45f955a152dc91;hb=06aa9dc1fe16b6965b7ea00dbcfaeb8209cdf1bc;hp=0da570becc5f9370184e7b0b40a15c2b83247961;hpb=6a9c24e4aaa166f49ea31593733b2598de6f78fd;p=swftools.git diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 0da570b..6285081 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -996,13 +996,18 @@ SWFFont::SWFFont(char*name, int id, char*filename) int t, outlinepos=0; char*map[256]; + char*null = 0; + if(!a) + a=&null; + t=0; while(a[t]) t++; this->charnum = t; - if(!charnum) - return; + if(!charnum) { + this->standardtablesize = 0; + } msg(" Font %s(%d): Storing %d outlines.\n", FIXNULL(name), id, charnum); this->standardtablesize = 256; @@ -1166,7 +1171,8 @@ SWFFont::~SWFFont() } free(ptr); - free(outline); + if(outline) + free(outline); for(t=0;t initializing swf output for size %d*%d\n", sizex,sizey); @@ -1364,8 +1370,10 @@ void swfoutput_init(struct swfoutput* obj, char*_filename, int _sizex, int _size swf.fileVersion = flashversion; swf.frameRate = 0x0040; // 1 frame per 4 seconds - swf.movieSize.xmax = 20*sizex; - swf.movieSize.ymax = 20*sizey; + swf.movieSize.xmin = 20*x1; + swf.movieSize.ymin = 20*y1; + swf.movieSize.xmax = 20*x2; + swf.movieSize.ymax = 20*y2; swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR); tag = swf.firstTag; @@ -1373,8 +1381,10 @@ void swfoutput_init(struct swfoutput* obj, char*_filename, int _sizex, int _size rgb.g = 0xff; rgb.b = 0xff; swf_SetRGB(tag,&rgb); - if(flag_protected) // good practice! /r + + if(flag_protected) tag = swf_InsertTag(tag, ST_PROTECT); + depth = 1; startdepth = depth; }