summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfmx/dvipdfmx-20120420/src')
-rw-r--r--Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c2
-rw-r--r--Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c39
-rw-r--r--Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c18
-rw-r--r--Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c39
-rw-r--r--Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c7
-rw-r--r--Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c13
6 files changed, 71 insertions, 47 deletions
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c
index 72828782dc5..6d790ec6f22 100644
--- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c
+++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c
@@ -70,7 +70,7 @@ static struct {
{"Adobe", "Japan1", {-1, -1, 2, 2, 4, 5, 6, 6}},
{"Adobe", "Korea1", {-1, -1, 1, 1, 2, 2, 2, 2}},
{"Adobe", "Identity", {-1, -1, 0, 0, 0, 0, 0, 0}},
- {NULL, NULL, {0,0,0,0,0,0,0,0}}
+ {NULL, NULL, { 0, 0, 0, 0, 0, 0, 0, 0}}
};
#define UCS_CC 0
#define ACC_START 1
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c
index a76929fac90..bccc34ba25a 100644
--- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c
+++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c
@@ -467,7 +467,7 @@ CIDFont_type0_dofont (CIDFont *font)
{
sfnt *sfont;
cff_font *cffont;
- FILE *fp;
+ FILE *fp = NULL;
cff_index *charstrings, *idx;
cff_charsets *charset = NULL;
cff_fdselect *fdselect = NULL;
@@ -571,7 +571,8 @@ CIDFont_type0_dofont (CIDFont *font)
RELEASE(CIDToGIDMap);
cff_close(cffont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return;
}
@@ -689,7 +690,8 @@ CIDFont_type0_dofont (CIDFont *font)
cff_close(cffont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
if (verbose > 1)
MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, destlen);
@@ -719,7 +721,7 @@ CIDFont_type0_open (CIDFont *font, const char *name,
char *fontname;
sfnt *sfont;
cff_font *cffont;
- FILE *fp;
+ FILE *fp = NULL;
unsigned long offset = 0;
ASSERT(font);
@@ -746,7 +748,8 @@ CIDFont_type0_open (CIDFont *font, const char *name,
if (!(cffont->flag & FONTTYPE_CIDFONT)) {
cff_close(cffont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
@@ -819,7 +822,7 @@ CIDFont_type0_open (CIDFont *font, const char *name,
/* getting font info. from TrueType tables */
if ((font->descriptor
= tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0)) == NULL)
- ERROR("Could not obtain neccesary font info.");
+ ERROR("Could not obtain necessary font info.");
if (opt->embed) {
memmove(fontname + 7, fontname, strlen(fontname) + 1);
@@ -851,7 +854,8 @@ CIDFont_type0_open (CIDFont *font, const char *name,
pdf_new_number(1000)); /* not sure */
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return 0;
}
@@ -871,7 +875,7 @@ CIDFont_type0_t1cdofont (CIDFont *font)
int parent_id;
char *used_chars;
double default_width, nominal_width;
- FILE *fp;
+ FILE *fp = NULL;
ASSERT(font);
@@ -1102,7 +1106,8 @@ CIDFont_type0_t1cdofont (CIDFont *font)
}
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
if (verbose > 1)
MESG("[%u glyphs][%ld bytes]", num_glyphs, destlen);
@@ -1133,7 +1138,7 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name,
sfnt *sfont;
cff_font *cffont;
unsigned long offset = 0;
- FILE *fp;
+ FILE *fp = NULL;
ASSERT(font);
@@ -1159,7 +1164,8 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name,
if (cffont->flag & FONTTYPE_CIDFONT) {
cff_close(cffont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
@@ -1218,7 +1224,7 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name,
/* getting font info. from TrueType tables */
if ((font->descriptor
= tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0)) == NULL)
- ERROR("Could not obtain neccesary font info.");
+ ERROR("Could not obtain necessary font info.");
if (opt->embed) {
memmove(fontname + 7, fontname, strlen(fontname) + 1);
@@ -1246,7 +1252,8 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name,
pdf_add_dict(font->fontdict, pdf_new_name("CIDSystemInfo"), csi_dict);
}
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return 0;
}
@@ -1372,11 +1379,9 @@ t1_load_UnicodeCMap (const char *font_name,
return -1;
cffont = t1_load_font(NULL, 1, fp);
- if (!cffont) {
- DPXFCLOSE(fp);
- return -1;
- }
DPXFCLOSE(fp);
+ if (!cffont)
+ return -1;
cmap_id = load_base_CMap(font_name, wmode, cffont);
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c
index 91cf66db27f..9408772533f 100644
--- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c
+++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c
@@ -498,7 +498,7 @@ CIDFont_type2_dofont (CIDFont *font)
unsigned char *cidtogidmap;
USHORT num_glyphs;
int i, glyph_ordering = 0, unicode_cmap = 0;
- FILE *fp;
+ FILE *fp = NULL;
if (!font->indirect)
return;
@@ -853,7 +853,8 @@ CIDFont_type2_dofont (CIDFont *font)
if (cidtogidmap)
RELEASE(cidtogidmap);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return;
}
@@ -873,7 +874,8 @@ CIDFont_type2_dofont (CIDFont *font)
fontfile = sfnt_create_FontFile_stream(sfont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
if (!fontfile)
ERROR("Could not created FontFile stream for \"%s\".", font->ident);
@@ -926,7 +928,7 @@ CIDFont_type2_open (CIDFont *font, const char *name,
char *fontname;
sfnt *sfont;
unsigned long offset = 0;
- FILE *fp;
+ FILE *fp = NULL;
ASSERT(font && opt);
@@ -960,7 +962,8 @@ CIDFont_type2_open (CIDFont *font, const char *name,
break;
default:
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
break;
}
@@ -1059,7 +1062,7 @@ CIDFont_type2_open (CIDFont *font, const char *name,
font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0);
if (!font->descriptor) {
- ERROR("Could not obtain neccesary font info.");
+ ERROR("Could not obtain necessary font info.");
}
if (opt->embed) {
@@ -1076,7 +1079,8 @@ CIDFont_type2_open (CIDFont *font, const char *name,
pdf_new_name(fontname));
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
/*
* Don't write fontdict here.
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c
index 9ba07b0993d..9a88efc0f0b 100644
--- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c
+++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c
@@ -68,7 +68,7 @@ pdf_font_open_truetype (pdf_font *font)
pdf_obj *fontdict, *descriptor;
sfnt *sfont;
int embedding = 1; /* Must be embedded. */
- FILE *fp;
+ FILE *fp = NULL;
int length, error = 0;
ASSERT( font );
@@ -89,7 +89,8 @@ pdf_font_open_truetype (pdf_font *font)
if (!sfont) {
WARN("Could not open TrueType font: %s", ident);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
@@ -104,7 +105,8 @@ pdf_font_open_truetype (pdf_font *font)
if (error) {
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1; /* Silently */
}
@@ -124,9 +126,10 @@ pdf_font_open_truetype (pdf_font *font)
pdf_obj *tmp;
tmp = tt_get_fontdesc(sfont, &embedding, -1, 1);
if (!tmp) {
- ERROR("Could not obtain neccesary font info.");
+ ERROR("Could not obtain necessary font info.");
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
ASSERT(pdf_obj_typeof(tmp) == PDF_DICT);
@@ -189,7 +192,8 @@ pdf_font_open_truetype (pdf_font *font)
}
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
pdf_add_dict(fontdict,
pdf_new_name("Type"), pdf_new_name("Font"));
@@ -882,7 +886,7 @@ pdf_font_load_truetype (pdf_font *font)
int index = pdf_font_get_index(font);
char **enc_vec;
pdf_obj *fontfile;
- FILE *fp;
+ FILE *fp = NULL;
sfnt *sfont;
int i, error = 0;
@@ -902,14 +906,16 @@ pdf_font_load_truetype (pdf_font *font)
if (!sfont) {
ERROR("Unable to open TrueType/dfont file: %s", ident);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
} else if (sfont->type != SFNT_TYPE_TRUETYPE &&
sfont->type != SFNT_TYPE_TTC &&
sfont->type != SFNT_TYPE_DFONT) {
ERROR("Font \"%s\" not a TrueType/dfont font?", ident);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
@@ -925,7 +931,8 @@ pdf_font_load_truetype (pdf_font *font)
if (error) {
ERROR("Reading SFND table dir failed for font-file=\"%s\"... Not a TrueType font?", ident);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
@@ -941,14 +948,16 @@ pdf_font_load_truetype (pdf_font *font)
if (error) {
ERROR("Error occured while creating font subfont for \"%s\"", ident);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
#if ENABLE_NOEMBED
if (!embedding) {
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return 0;
}
#endif /* ENABLE_NOEMBED */
@@ -964,7 +973,8 @@ pdf_font_load_truetype (pdf_font *font)
ERROR("Required TrueType table \"%s\" does not exist in font: %s",
required_table[i].name, ident);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
}
@@ -977,7 +987,8 @@ pdf_font_load_truetype (pdf_font *font)
ERROR("Could not created FontFile stream for \"%s\".", ident);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
if (verbose > 1)
MESG("[%ld bytes]", pdf_stream_length(fontfile));
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c
index 7b4d5bee947..4b4a8491879 100644
--- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c
+++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c
@@ -1029,7 +1029,7 @@ otf_create_ToUnicode_stream (const char *font_name,
int cmap_add_id;
tt_cmap *ttcmap;
char *cmap_name;
- FILE *fp;
+ FILE *fp = NULL;
sfnt *sfont;
long offset = 0;
@@ -1124,7 +1124,8 @@ otf_create_ToUnicode_stream (const char *font_name,
RELEASE(cmap_name);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return cmap_ref;
}
@@ -1601,7 +1602,7 @@ otf_load_Unicode_CMap (const char *map_name, int ttc_index, /* 0 for non-TTC fon
unsigned long offset = 0;
char *base_name = NULL, *cmap_name = NULL;
char *tounicode_name = NULL;
- FILE *fp;
+ FILE *fp = NULL;
otl_gsub *gsub_list = NULL;
tt_cmap *ttcmap;
CMap *cmap, *base, *tounicode = NULL;
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c
index 081f0a4870b..2681befc178 100644
--- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c
+++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c
@@ -70,7 +70,7 @@ int
pdf_font_open_type1c (pdf_font *font)
{
char *ident, *fontname;
- FILE *fp;
+ FILE *fp = NULL;
sfnt *sfont;
cff_font *cffont;
pdf_obj *descriptor, *tmp;
@@ -106,7 +106,8 @@ pdf_font_open_type1c (pdf_font *font)
if (cffont->flag & FONTTYPE_CIDFONT) {
cff_close (cffont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return -1;
}
@@ -149,7 +150,8 @@ pdf_font_open_type1c (pdf_font *font)
}
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
return 0;
}
@@ -230,7 +232,7 @@ pdf_font_load_type1c (pdf_font *font)
pdf_obj *fontdict, *descriptor;
char *usedchars;
char *fontname, *uniqueTag, *ident, *fullname;
- FILE *fp;
+ FILE *fp = NULL;
int encoding_id;
pdf_obj *fontfile, *stream_dict;
char **enc_vec;
@@ -708,7 +710,8 @@ pdf_font_load_type1c (pdf_font *font)
cff_close (cffont);
sfnt_close(sfont);
- DPXFCLOSE(fp);
+ if (fp)
+ DPXFCLOSE(fp);
if (verbose > 1) {
MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, offset);