From 71e57080c599ffd3ca6565e6b152a2f3fc137c62 Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 9 Nov 2001 09:26:34 +0000 Subject: [PATCH] SWFFont now also stores char widths. (a.k.a. advance values) --- pdf2swf/swfoutput.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index 2353efe..f84ebee 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -519,7 +519,9 @@ SWFFont::SWFFont(char*name, int id, char*filename) outline = (T1_OUTLINE**)malloc(t*sizeof(T1_OUTLINE*)); charname = (char**)malloc(t*sizeof(char*)); - memset(charname, t*sizeof(char*), 0); + width = (int*)malloc(t*sizeof(int)); + memset(width, 0, t*sizeof(int)); + memset(charname, 0, t*sizeof(char*)); used = (char*)malloc(t*sizeof(char)); char2swfcharid = (U16*)malloc(t*2); swfcharid2char = (U16*)malloc(t*2); @@ -554,6 +556,7 @@ SWFFont::SWFFont(char*name, int id, char*filename) for(s=0;soutline[outlinepos] = T1_CopyOutline(T1_GetCharOutline(id, s, 100.0, 0)); + this->width[outlinepos] = T1_GetCharWidth(id, s); this->charname[outlinepos] = strdup(T1_GetCharName(id, s)); outlinepos++; } @@ -645,6 +648,7 @@ SWFFont::~SWFFont() for(t=0;t