diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2009-06-07 16:05:59 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2009-06-07 16:05:59 +0000 |
commit | 54e3c992e5fdbef6a726b9df1f541ce568a710ae (patch) | |
tree | b7eeb31d3c89a2e202ed1f45788b86b52abc822c /Build/source/texk/xdvipdfmx | |
parent | 4569d4a8a1dfaa90814894444753e232a78146f9 (diff) |
xdvipdfmx 0.7.5 - merging small bugfixes from dvipdfmx
git-svn-id: svn://tug.org/texlive/trunk@13657 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvipdfmx')
-rwxr-xr-x | Build/source/texk/xdvipdfmx/configure | 22 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/configure.ac | 2 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/cmap_read.c | 4 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dpxconf.c | 24 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/pkfont.c | 20 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/t1_load.c | 31 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/type1.c | 46 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/type1c.c | 10 |
8 files changed, 86 insertions, 73 deletions
diff --git a/Build/source/texk/xdvipdfmx/configure b/Build/source/texk/xdvipdfmx/configure index a287070d14d..1e738b65271 100755 --- a/Build/source/texk/xdvipdfmx/configure +++ b/Build/source/texk/xdvipdfmx/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for xdvipdfmx 0.7.4. +# Generated by GNU Autoconf 2.63 for xdvipdfmx 0.7.5. # # Report bugs to <tex-k@tug.org>. # @@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xdvipdfmx' PACKAGE_TARNAME='xdvipdfmx' -PACKAGE_VERSION='0.7.4' -PACKAGE_STRING='xdvipdfmx 0.7.4' +PACKAGE_VERSION='0.7.5' +PACKAGE_STRING='xdvipdfmx 0.7.5' PACKAGE_BUGREPORT='tex-k@tug.org' ac_unique_file="src/dvipdfmx.c" @@ -1510,7 +1510,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xdvipdfmx 0.7.4 to adapt to many kinds of systems. +\`configure' configures xdvipdfmx 0.7.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1580,7 +1580,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xdvipdfmx 0.7.4:";; + short | recursive ) echo "Configuration of xdvipdfmx 0.7.5:";; esac cat <<\_ACEOF @@ -1703,7 +1703,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xdvipdfmx configure 0.7.4 +xdvipdfmx configure 0.7.5 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1717,7 +1717,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xdvipdfmx $as_me 0.7.4, which was +It was created by xdvipdfmx $as_me 0.7.5, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -6962,7 +6962,7 @@ fi # Define the identity of the package. PACKAGE='xdvipdfmx' - VERSION='0.7.4' + VERSION='0.7.5' cat >>confdefs.h <<_ACEOF @@ -16326,7 +16326,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -xdvipdfmx config.lt 0.7.4 +xdvipdfmx config.lt 0.7.5 configured by $0, generated by GNU Autoconf 2.63. Copyright (C) 2008 Free Software Foundation, Inc. @@ -19520,7 +19520,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xdvipdfmx $as_me 0.7.4, which was +This file was extended by xdvipdfmx $as_me 0.7.5, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19583,7 +19583,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -xdvipdfmx config.status 0.7.4 +xdvipdfmx config.status 0.7.5 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/Build/source/texk/xdvipdfmx/configure.ac b/Build/source/texk/xdvipdfmx/configure.ac index 054d1d96929..42db8cd80ee 100644 --- a/Build/source/texk/xdvipdfmx/configure.ac +++ b/Build/source/texk/xdvipdfmx/configure.ac @@ -6,7 +6,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([xdvipdfmx], [0.7.4], [tex-k@tug.org]) +AC_INIT([xdvipdfmx], [0.7.5], [tex-k@tug.org]) AC_PREREQ([2.63]) AC_CONFIG_SRCDIR([src/dvipdfmx.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/Build/source/texk/xdvipdfmx/src/cmap_read.c b/Build/source/texk/xdvipdfmx/src/cmap_read.c index f927b40de77..7830350d926 100644 --- a/Build/source/texk/xdvipdfmx/src/cmap_read.c +++ b/Build/source/texk/xdvipdfmx/src/cmap_read.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/cmap_read.c,v 1.3 2008/01/11 18:04:15 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/cmap_read.c,v 1.4 2009/05/06 01:51:01 chofchof Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -510,7 +510,7 @@ CMap_parse_check_sig (FILE *fp) if (fread(sig, sizeof(char), CMAP_SIG_MAX, fp) != CMAP_SIG_MAX) result = -1; else { - sig[CMAP_SIG_MAX+1] = 0; + sig[CMAP_SIG_MAX] = 0; if (strncmp(sig, "%!PS", 4)) result = -1; else if (strstr(sig+4, "Resource-CMap")) diff --git a/Build/source/texk/xdvipdfmx/src/dpxconf.c b/Build/source/texk/xdvipdfmx/src/dpxconf.c index 29193df1032..e77165b2fab 100644 --- a/Build/source/texk/xdvipdfmx/src/dpxconf.c +++ b/Build/source/texk/xdvipdfmx/src/dpxconf.c @@ -38,10 +38,10 @@ const struct paper paperspecs[] = { {"legal" , 612.00, 1008.00}, {"ledger", 1224.00, 792.00}, {"tabloid", 792.00, 1224.00}, - {"a6", 297.64, 420.91}, - {"a5", 420.91, 595.27}, - {"a4", 595.27, 841.82}, - {"a3", 841.82, 1190.16}, + {"a6", 297.638, 419.528}, + {"a5", 419.528, 595.276}, + {"a4", 595.276, 841.890}, + {"a3", 841.890, 1190.550}, /* * The B series paper formats were first introduced in Japanese * patch (jpatch). The size of b6, ..., b5var paper is JIS paper @@ -49,10 +49,10 @@ const struct paper paperspecs[] = { * libpaper if you need ISO paper sizes. */ #if defined(USE_ISO_PAPERSIZE) || defined(ISO_PAPERSIZE) - {"b6", 354, 499}, - {"b5", 501, 709}, - {"b4", 709, 1002}, - {"b3", 1002, 1418}, + {"b6", 354.331, 498.898}, + {"b5", 498.898, 708.661}, + {"b4", 708.661, 1000.630}, + {"b3", 1000.630, 1417.320}, #else {"b6", 364.25, 515.91}, {"b5", 515.91, 728.50}, @@ -65,10 +65,10 @@ const struct paper paperspecs[] = { {"jisb5", 515.91, 728.50}, {"jisb4", 728.50, 1031.81}, {"jisb3", 1031.81, 1457.00}, - {"isob6", 354, 499}, - {"isob5", 501, 709}, - {"isob4", 709, 1002}, - {"isob3", 1002, 1418}, + {"isob6", 354.331, 498.898}, + {"isob5", 498.898, 708.661}, + {"isob4", 708.661, 1000.630}, + {"isob3", 1000.630, 1417.320}, /* -- */ {NULL, 0, 0}, }; diff --git a/Build/source/texk/xdvipdfmx/src/pkfont.c b/Build/source/texk/xdvipdfmx/src/pkfont.c index 4822d50bc71..803ca0183eb 100644 --- a/Build/source/texk/xdvipdfmx/src/pkfont.c +++ b/Build/source/texk/xdvipdfmx/src/pkfont.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/pkfont.c,v 1.17 2007/11/14 03:12:21 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/pkfont.c,v 1.19 2008/11/03 22:18:52 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -416,7 +416,7 @@ struct pk_header_ unsigned long pkt_len; SIGNED_QUAD chrcode; SIGNED_QUAD wd, dx, dy; - UNSIGNED_QUAD bm_wd, bm_ht, bm_hoff, bm_voff; + SIGNED_QUAD bm_wd, bm_ht, bm_hoff, bm_voff; int dyn_f, run_color; }; @@ -594,7 +594,8 @@ pdf_font_load_pkfont (pdf_font *font) * rendering in several viewers. */ pix2charu = 72. * 1000. / ((double) base_dpi) / point_size; - bbox.llx = bbox.lly = bbox.urx = bbox.ury = 0.0; + bbox.llx = bbox.lly = HUGE_VAL; + bbox.urx = bbox.ury = -HUGE_VAL; while ((opcode = fgetc(fp)) >= 0 && opcode != PK_POST) { if (opcode < 240) { struct pk_header_ pkh; @@ -622,8 +623,8 @@ pdf_font_load_pkfont (pdf_font *font) /* Update font BBox info */ bbox.llx = MIN(bbox.llx, -pkh.bm_hoff); bbox.lly = MIN(bbox.lly, pkh.bm_voff - pkh.bm_ht); - bbox.urx = MIN(bbox.urx, pkh.bm_wd - pkh.bm_hoff); - bbox.ury = MIN(bbox.ury, pkh.bm_voff); + bbox.urx = MAX(bbox.urx, pkh.bm_wd - pkh.bm_hoff); + bbox.ury = MAX(bbox.ury, pkh.bm_voff); pkt_ptr = NEW(pkh.pkt_len, unsigned char); if ((bytesread = fread(pkt_ptr, 1, pkh.pkt_len, fp))!= pkh.pkt_len) { @@ -746,7 +747,8 @@ pdf_font_load_pkfont (pdf_font *font) pdf_add_dict(fontdict, pdf_new_name("Encoding"), pdf_ref_obj(encoding)); pdf_release_obj(encoding); - } + } else + pdf_release_obj(tmp_array); /* FontBBox: Accurate value is important. */ @@ -788,11 +790,5 @@ pdf_font_load_pkfont (pdf_font *font) pdf_add_dict(fontdict, pdf_new_name("LastChar"), pdf_new_number(lastchar)); -#if ENABLE_GLYPHENC - if (encoding_id >= 0) { - pdf_encoding_add_usedchars(encoding_id, usedchars); - } -#endif /* ENABLE_GLYPHENC */ - return 0; } diff --git a/Build/source/texk/xdvipdfmx/src/t1_load.c b/Build/source/texk/xdvipdfmx/src/t1_load.c index 5c05fefd2a3..d9c826e8b90 100644 --- a/Build/source/texk/xdvipdfmx/src/t1_load.c +++ b/Build/source/texk/xdvipdfmx/src/t1_load.c @@ -572,18 +572,24 @@ parse_subrs (cff_font *font, } if (mode != 1) { - subrs = font->subrs[0] = cff_new_index(count); - subrs->data = NEW(offset, card8); - offset = 0; - for (i = 0; i < count; i++) { - subrs->offset[i] = offset + 1; - if (lengths[i] > 0) { - memcpy(subrs->data + offset, data + offsets[i], lengths[i]); - offset += lengths[i]; + if (font->subrs[0] == NULL) { + subrs = font->subrs[0] = cff_new_index(count); + subrs->data = NEW(offset, card8); + offset = 0; + for (i = 0; i < count; i++) { + subrs->offset[i] = offset + 1; + if (lengths[i] > 0) { + memcpy(subrs->data + offset, data + offsets[i], lengths[i]); + offset += lengths[i]; + } } + subrs->offset[count] = offset + 1; + } else { + /* Adobe's OPO_____.PFB and OPBO____.PFB have two /Subrs dicts, + * and also have /CharStrings not followed by dicts. + * Simply ignores those data. By ChoF on 2009/04/08. */ + WARN("Already found /Subrs; ignores the other /Subrs dicts."); } - subrs->offset[count] = offset + 1; - RELEASE(data); RELEASE(offsets); RELEASE(lengths); @@ -611,8 +617,11 @@ parse_charstrings (cff_font *font, tok = pst_get_token(start, end); if (!PST_INTEGERTYPE(tok) || pst_getIV(tok) < 0 || pst_getIV(tok) > CFF_GLYPH_MAX) { + unsigned char *s = pst_getSV(tok); + WARN("Ignores non dict \"/CharStrings %s ...\"", s); + RELEASE(s); RELEASE_TOK(tok); - return -1; + return 0; } count = pst_getIV(tok); RELEASE_TOK(tok); diff --git a/Build/source/texk/xdvipdfmx/src/type1.c b/Build/source/texk/xdvipdfmx/src/type1.c index 0d881b4654a..c057a9cab55 100644 --- a/Build/source/texk/xdvipdfmx/src/type1.c +++ b/Build/source/texk/xdvipdfmx/src/type1.c @@ -1,8 +1,8 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/type1.c,v 1.41 2008/01/06 09:12:06 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/type1.c,v 1.44 2008/08/31 18:42:39 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2008 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -58,6 +58,8 @@ #include "type1.h" +#include "tfm.h" + #define FONT_FLAG_FIXEDPITCH (1 << 0) /* Fixed-width font */ #define FONT_FLAG_SERIF (1 << 1) /* Serif font */ #define FONT_FLAG_SYMBOLIC (1 << 2) /* Symbolic font */ @@ -274,8 +276,7 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, l pdf_obj *tmp_array; int code, firstchar, lastchar; double val; - card16 gid; - int i; + int i, tfm_id; char *usedchars; double scaling; @@ -310,18 +311,14 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, l pdf_add_dict(descriptor, pdf_new_name("FontBBox"), tmp_array); tmp_array = pdf_new_array(); - if (num_glyphs <= 1) { - /* This should be error. */ + if (num_glyphs <= 1) { /* This must be an error. */ firstchar = lastchar = 0; pdf_add_array(tmp_array, pdf_new_number(0.0)); } else { - for (firstchar = 255, lastchar = 0, code = 0; - code < 256; code++) { + for (firstchar = 255, lastchar = 0, code = 0; code < 256; code++) { if (usedchars[code]) { - if (code < firstchar) - firstchar = code; - if (code > lastchar) - lastchar = code; + if (code < firstchar) firstchar = code; + if (code > lastchar) lastchar = code; } } if (firstchar > lastchar) { @@ -329,20 +326,25 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, l pdf_release_obj(tmp_array); return; } + tfm_id = tfm_open(pdf_font_get_mapname(font), 0); for (code = firstchar; code <= lastchar; code++) { if (usedchars[code]) { - gid = cff_glyph_lookup(cffont, enc_vec[code]); + double width; + if (tfm_id < 0) /* tfm is not found */ + width = scaling * widths[cff_glyph_lookup(cffont, enc_vec[code])]; + else + width = 1000. * tfm_get_width(tfm_id, code); pdf_add_array(tmp_array, - pdf_new_number(ROUND(scaling*widths[gid], 1.0))); + pdf_new_number(ROUND(width, 1.0))); } else { pdf_add_array(tmp_array, pdf_new_number(0.0)); } } - } + if (pdf_array_length(tmp_array) > 0) { pdf_add_dict(fontdict, - pdf_new_name("Widths"), pdf_ref_obj(tmp_array)); + pdf_new_name("Widths"), pdf_ref_obj(tmp_array)); } pdf_release_obj(tmp_array); @@ -354,6 +356,7 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, l return; } + static long write_fontfile (pdf_font *font, cff_font *cffont, long num_glyphs) { @@ -667,10 +670,10 @@ pdf_font_load_type1 (pdf_font *font) * The Type 1 seac operator may add another glyph but the glyph name of * those glyphs are contained in standard string. The String Index will * not be modified after here. + * BUT: We cannot update the String Index yet because then we wouldn't be + * able to find the GIDs of the base and accent characters (unless they + * have been used already). */ - cff_dict_update (cffont->topdict, cffont); - cff_dict_update (cffont->private[0], cffont); - cff_update_string(cffont); { cff_index *cstring; @@ -769,6 +772,11 @@ pdf_font_load_type1 (pdf_font *font) if (verbose > 2) MESG("]"); + /* Now we can update the String Index */ + cff_dict_update (cffont->topdict, cffont); + cff_dict_update (cffont->private[0], cffont); + cff_update_string(cffont); + add_metrics(font, cffont, enc_vec, widths, num_glyphs); offset = write_fontfile(font, cffont, num_glyphs); diff --git a/Build/source/texk/xdvipdfmx/src/type1c.c b/Build/source/texk/xdvipdfmx/src/type1c.c index 462d6407092..dc868b04bf1 100644 --- a/Build/source/texk/xdvipdfmx/src/type1c.c +++ b/Build/source/texk/xdvipdfmx/src/type1c.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/type1c.c,v 1.26 2008/05/18 17:05:56 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/type1c.c,v 1.28 2008/08/06 00:10:45 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -401,7 +401,7 @@ pdf_font_load_type1c (pdf_font *font) } /* New CharStrings INDEX */ - charstrings = cff_new_index(256); + charstrings = cff_new_index(257); /* 256 + 1 for ".notdef" glyph */ max_len = 2 * CS_STR_LEN_MAX; charstrings->data = NEW(max_len, card8); charstring_len = 0; @@ -708,6 +708,9 @@ pdf_font_load_type1c (pdf_font *font) /* Copyright and Trademark Notice ommited. */ + /* Handle Widths in fontdict. */ + add_SimpleMetrics(font, cffont, widths, num_glyphs); + /* Close font */ cff_close (cffont); sfnt_close(sfont); @@ -719,9 +722,6 @@ pdf_font_load_type1c (pdf_font *font) MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, offset); } - /* Handle Widths in fontdict. */ - add_SimpleMetrics(font, cffont, widths, num_glyphs); - /* * CharSet might be recommended for subsetted font, but it is meaningful * only for Type 1 font... |