From 4a6a93fe0bd0e8a252c37f76569673a91e31cf9b Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 27 Jan 2002 01:14:31 +0000 Subject: [PATCH] improved font search routine. --- pdf2swf/SWFOutputDev.cc | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 326f98b..1bcd271 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -767,8 +767,6 @@ char type3Warning=0; int SWFOutputDev::searchT1Font(char*name) { int i; - - int id=-1; int mapid=-1; char*filename=0; for(i=0;i Loading extra font %s from %s\n", FIXNULL(fontname), + FIXNULL(T1_GetFontFileName(i))); + } + if(fontname && !strcmp(name, fontname)) { + logf(" Extra font %s is being used.\n", fontname); + return i; + } + fontname = T1_GetFontFileName(i); + if(strrchr(fontname,'/')) + fontname = strrchr(fontname,'/')+1; + + if(strstr(fontname, name)) { + logf(" Extra font %s is being used.\n", fontname); + return i; + } } } - return id; + return -1; } void SWFOutputDev::updateLineWidth(GfxState *state) -- 1.7.10.4