summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-05-04 23:27:01 +0000
committerKarl Berry <karl@freefriends.org>2007-05-04 23:27:01 +0000
commitd5ed55a3d879b9fa7b48c4c9c6ea1841defeaeb8 (patch)
treeb4e6d7992b7989e0f8a3a3def89aab8b3a0c097a /Build/source
parent6abdd5bdd14ddbb6e48bafcf0dc9c9a68c304f92 (diff)
avoid download if font if already done as header (e.g., from eps)
git-svn-id: svn://tug.org/texlive/trunk@4233 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog8
-rw-r--r--Build/source/texk/dvipsk/download.c7
-rw-r--r--Build/source/texk/dvipsk/dvips.c3
-rw-r--r--Build/source/texk/dvipsk/dvips.h3
-rw-r--r--Build/source/texk/dvipsk/finclude.c11
5 files changed, 31 insertions, 1 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index 3328ed8d702..773a00a6e7b 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-05 Karl Berry <karl@tug.org>
+
+ * dvips.h (DOWNLOADEDPSSIZE): new constant.
+ * dvips.c (downloadedpsname): new global array.
+ * finclude.c: set it up as we download.
+ * download.c: use it to avoid downloading fonts as both header
+ and font. (From Akira.)
+
2007-05-04 Karl Berry <karl@tug.org>
* dvips.h (BANNER): change to 5.96dev to distinguish from the release.
diff --git a/Build/source/texk/dvipsk/download.c b/Build/source/texk/dvipsk/download.c
index ae8b3aece8e..02e01f1bf54 100644
--- a/Build/source/texk/dvipsk/download.c
+++ b/Build/source/texk/dvipsk/download.c
@@ -433,6 +433,8 @@ static void addGlyph(char *glyphName) {
* Download a PostScript font, using partial font downloading if
* necessary.
*/
+extern char *downloadedpsname[];
+
void downpsfont P2C(charusetype *, p, charusetype *, all)
{
#ifdef DOWNLOAD_USING_PDFTEX
@@ -445,6 +447,7 @@ void downpsfont P2C(charusetype *, p, charusetype *, all)
struct resfont *rf ;
int cc;
extern char *realnameoffile ;
+ int j;
curfnt = p->fd ;
rf = curfnt->resfont ;
@@ -458,6 +461,10 @@ void downpsfont P2C(charusetype *, p, charusetype *, all)
return ;
if (rf->sent == 2) /* sent as header, from a PS file */
return ;
+ for (j=0; downloadedpsname[j] && j < DOWNLOADEDPSSIZE; j++) {
+ if (strcmp (downloadedpsname[j], rf->PSname) == 0)
+ return;
+ }
if (all->fd == 0)
error("! internal error in downpsfont") ;
if (!partialdownload) {
diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c
index 11d5a844a9d..9f78ccbced7 100644
--- a/Build/source/texk/dvipsk/dvips.c
+++ b/Build/source/texk/dvipsk/dvips.c
@@ -50,6 +50,7 @@ extern char *strtok() ; /* some systems don't have this in strings.h */
#ifdef VMS
static char ofnme[252],infnme[252],pap[40],thh[20];
#endif
+char *downloadedpsname[DOWNLOADEDPSSIZE]; /* PS names fully downloaded as headers */
fontdesctype *fonthead ; /* list of all fonts mentioned so far */
fontdesctype *curfnt ; /* the currently selected font */
sectiontype *sections ; /* sections to process document in */
@@ -555,6 +556,8 @@ main P2C(int, argc, char **, argv)
#endif
register sectiontype *sects ;
+ for(i=0 ; i < DOWNLOADEDPSSIZE; i++)
+ downloadedpsname[i] = NULL;
#ifdef KPATHSEA
kpse_set_program_name (argv[0], "dvips");
kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
diff --git a/Build/source/texk/dvipsk/dvips.h b/Build/source/texk/dvipsk/dvips.h
index 246d655cad1..c58eb794040 100644
--- a/Build/source/texk/dvipsk/dvips.h
+++ b/Build/source/texk/dvipsk/dvips.h
@@ -53,13 +53,14 @@ extern char *sprintf() ;
* of a string that can be handled in specials, so it should not be
* set too small.
*/
-#define STRINGSIZE (200000) /* maximum total chars in strings in program */
+#define STRINGSIZE (200000) /* maximum total chars in strings in program */
#define RASTERCHUNK (8192) /* size of chunk of raster */
#define MINCHUNK (240) /* minimum size char to get own raster */
#define STACKSIZE (350) /* maximum stack size for dvi files */
#define MAXFRAME (10) /* maximum depth of virtual font recursion */
#define MAXFONTHD (100) /* number of unique names of included fonts */
#define STDOUTSIZE (75) /* width of a standard output line */
+#define DOWNLOADEDPSSIZE (1000) /* max number of downloaded fonts to check */
/*
* Other constants, which define printer-dependent stuff.
*/
diff --git a/Build/source/texk/dvipsk/finclude.c b/Build/source/texk/dvipsk/finclude.c
index 4cd5d09f3ef..8e902f0c265 100644
--- a/Build/source/texk/dvipsk/finclude.c
+++ b/Build/source/texk/dvipsk/finclude.c
@@ -57,6 +57,8 @@ extern int to_close ;
extern integer debug_flag;
#endif /* DEBUG */
+extern char *downloadedpsname[];
+
/*
* Create a font descriptor for a font included in a psfile. There will be
* no fontmaptype node for the resulting font descriptor until this font is
@@ -252,6 +254,10 @@ scan_fontnames P2C(char *, str, char *, psfile)
char *p,*pe;
struct resfont *re;
int i;
+ int j = 0;
+
+ while (downloadedpsname[j] != NULL && j < DOWNLOADEDPSSIZE)
+ j++;
/* Turn all newlines, CRs, and tabs into spaces. */
p = str;
@@ -312,6 +318,11 @@ scan_fontnames P2C(char *, str, char *, psfile)
infont = 0 ;
}
re->sent = 2 ;
+ if (j < DOWNLOADEDPSSIZE) {
+ downloadedpsname[j] = (char *)xmalloc(strlen(re->PSname) + 1);
+ strcpy (downloadedpsname[j], re->PSname);
+ j++;
+ }
} else {
char eb[1000];
sprintf(eb,"Font %s used in file %s is not in the mapping file.",