diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2009-09-04 03:52:24 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2009-09-04 03:52:24 +0000 |
commit | 15227bce56c42a7f3131e084d78cccabb54f7457 (patch) | |
tree | c788e12a48783e121e15fec62f8e2852d3c0039a | |
parent | 4a9a5e0e400d2368a9a420a39c8d3aa5f3a27326 (diff) |
xdvipdfmx 0.7.7: merging some minor fixes from dvipdfmx
git-svn-id: svn://tug.org/texlive/trunk@15080 c570f23f-e606-0410-a88d-b1316a301751
-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/cff.c | 35 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/cff.h | 4 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/cff_dict.c | 8 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/cidtype0.c | 14 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dpxfile.c | 15 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dpxfile.h | 6 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/pdfximage.c | 5 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/spc_dvips.c | 6 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/t1_load.c | 75 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/truetype.c | 4 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/tt_post.c | 2 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/tt_table.c | 10 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/type1.c | 6 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/type1c.c | 11 |
16 files changed, 119 insertions, 106 deletions
diff --git a/Build/source/texk/xdvipdfmx/configure b/Build/source/texk/xdvipdfmx/configure index b4b2537bb90..c1f510cd591 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.5. +# Generated by GNU Autoconf 2.63 for xdvipdfmx 0.7.7. # # 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.5' -PACKAGE_STRING='xdvipdfmx 0.7.5' +PACKAGE_VERSION='0.7.7' +PACKAGE_STRING='xdvipdfmx 0.7.7' PACKAGE_BUGREPORT='tex-k@tug.org' ac_unique_file="src/dvipdfmx.c" @@ -1513,7 +1513,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.5 to adapt to many kinds of systems. +\`configure' configures xdvipdfmx 0.7.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1583,7 +1583,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xdvipdfmx 0.7.5:";; + short | recursive ) echo "Configuration of xdvipdfmx 0.7.7:";; esac cat <<\_ACEOF @@ -1711,7 +1711,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xdvipdfmx configure 0.7.5 +xdvipdfmx configure 0.7.7 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1725,7 +1725,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.5, which was +It was created by xdvipdfmx $as_me 0.7.7, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -6985,7 +6985,7 @@ fi # Define the identity of the package. PACKAGE='xdvipdfmx' - VERSION='0.7.5' + VERSION='0.7.7' cat >>confdefs.h <<_ACEOF @@ -16387,7 +16387,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -xdvipdfmx config.lt 0.7.5 +xdvipdfmx config.lt 0.7.7 configured by $0, generated by GNU Autoconf 2.63. Copyright (C) 2008 Free Software Foundation, Inc. @@ -19593,7 +19593,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.5, which was +This file was extended by xdvipdfmx $as_me 0.7.7, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19656,7 +19656,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.5 +xdvipdfmx config.status 0.7.7 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 50d5fdc96a3..792407402ae 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.5], [tex-k@tug.org]) +AC_INIT([xdvipdfmx], [0.7.7], [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/cff.c b/Build/source/texk/xdvipdfmx/src/cff.c index ad2ff9b7253..b22704593f5 100644 --- a/Build/source/texk/xdvipdfmx/src/cff.c +++ b/Build/source/texk/xdvipdfmx/src/cff.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/cff.c,v 1.15 2004/09/11 14:50:28 hirata Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/cff.c,v 1.16 2008/10/13 19:42:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -553,11 +553,13 @@ void cff_update_string (cff_font *cff) cff->_string = NULL; } -s_SID cff_add_string (cff_font *cff, char *str) +s_SID cff_add_string (cff_font *cff, const char *str, int unique) +/* Setting unique == 1 eliminates redundant or predefined strings. */ { card16 idx; cff_index *strings; l_offset offset, size; + long len = strlen(str); if (cff == NULL) ERROR("CFF font not opened."); @@ -566,28 +568,29 @@ s_SID cff_add_string (cff_font *cff, char *str) cff->_string = cff_new_index(0); strings = cff->_string; - for (idx = 0; idx < strings->count; idx++) { - size = strings->offset[idx+1] - strings->offset[idx]; - offset = strings->offset[idx]; - if (size == strlen(str) && - !memcmp(strings->data+offset-1, str, strlen(str))) - return (idx + CFF_STDSTR_MAX); + if (unique) { + /* TODO: do binary search to speed things up */ + for (idx = 0; idx < CFF_STDSTR_MAX; idx++) { + if (cff_stdstr[idx] && !strcmp(cff_stdstr[idx], str)) + return idx; + } + for (idx = 0; idx < strings->count; idx++) { + size = strings->offset[idx+1] - strings->offset[idx]; + offset = strings->offset[idx]; + if (size == len && !memcmp(strings->data+offset-1, str, len)) + return (idx + CFF_STDSTR_MAX); + } } - for (idx = 0; idx < CFF_STDSTR_MAX; idx++) { - if (cff_stdstr[idx] && - !strcmp(cff_stdstr[idx], str)) - return idx; - } offset = (strings->count > 0) ? strings->offset[strings->count] : 1; strings->offset = RENEW(strings->offset, strings->count+2, l_offset); if (strings->count == 0) strings->offset[0] = 1; idx = strings->count; strings->count += 1; - strings->offset[strings->count] = offset + strlen(str); - strings->data = RENEW(strings->data, offset+strlen(str)-1, card8); - memcpy(strings->data+offset-1, str, strlen(str)); + strings->offset[strings->count] = offset + len; + strings->data = RENEW(strings->data, offset+len-1, card8); + memcpy(strings->data+offset-1, str, len); return (idx + CFF_STDSTR_MAX); } diff --git a/Build/source/texk/xdvipdfmx/src/cff.h b/Build/source/texk/xdvipdfmx/src/cff.h index 3a39c80cafd..6aca8c4b12e 100644 --- a/Build/source/texk/xdvipdfmx/src/cff.h +++ b/Build/source/texk/xdvipdfmx/src/cff.h @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/cff.h,v 1.9 2004/09/11 14:50:28 hirata Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/cff.h,v 1.10 2008/10/13 19:42:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -147,7 +147,7 @@ extern unsigned short* cff_get_ft_to_gid(cff_font *cff); extern int cff_match_string (cff_font *cff, const char *str, s_SID sid); extern char *cff_get_string (cff_font *cff, s_SID id); extern long cff_get_sid (cff_font *cff, char *str); -extern s_SID cff_add_string (cff_font *cff, char *str); +extern s_SID cff_add_string (cff_font *cff, const char *str, int unique); extern void cff_update_string (cff_font *cff); #define cff_is_stdstr(s) (cff_get_sid(NULL, (s)) >= 0) diff --git a/Build/source/texk/xdvipdfmx/src/cff_dict.c b/Build/source/texk/xdvipdfmx/src/cff_dict.c index 0d54730fb4a..d529d27dbe1 100644 --- a/Build/source/texk/xdvipdfmx/src/cff_dict.c +++ b/Build/source/texk/xdvipdfmx/src/cff_dict.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/cff_dict.c,v 1.16 2008/05/22 10:08:02 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/cff_dict.c,v 1.17 2008/10/13 19:42:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -705,14 +705,14 @@ void cff_dict_update (cff_dict *dict, cff_font *cff) id = (dict->entries)[i].id; if (dict_operator[id].argtype == CFF_TYPE_SID) { str = cff_get_string(cff, (dict->entries)[i].values[0]); - (dict->entries)[i].values[0] = cff_add_string(cff, str); + (dict->entries)[i].values[0] = cff_add_string(cff, str, 1); RELEASE(str); } else if (dict_operator[id].argtype == CFF_TYPE_ROS) { str = cff_get_string(cff, (dict->entries)[i].values[0]); - (dict->entries)[i].values[0] = cff_add_string(cff, str); + (dict->entries)[i].values[0] = cff_add_string(cff, str, 1); RELEASE(str); str = cff_get_string(cff, (dict->entries)[i].values[1]); - (dict->entries)[i].values[1] = cff_add_string(cff, str); + (dict->entries)[i].values[1] = cff_add_string(cff, str, 1); RELEASE(str); } } diff --git a/Build/source/texk/xdvipdfmx/src/cidtype0.c b/Build/source/texk/xdvipdfmx/src/cidtype0.c index be3086c1af0..5a5edd089c3 100644 --- a/Build/source/texk/xdvipdfmx/src/cidtype0.c +++ b/Build/source/texk/xdvipdfmx/src/cidtype0.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/cidtype0.c,v 1.38 2008/05/17 04:18:47 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/cidtype0.c,v 1.39 2008/10/13 19:42:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -1001,7 +1001,7 @@ CIDFont_type0_t1cdofont (CIDFont *font) cffont->fdarray[0] = cff_new_dict(); cff_dict_add(cffont->fdarray[0], "FontName", 1); cff_dict_set(cffont->fdarray[0], "FontName", 0, - (double) cff_add_string(cffont, font->fontname + 7)); /* FIXME: Skip XXXXXX+ */ + (double) cff_add_string(cffont, font->fontname + 7, 1)); /* FIXME: Skip XXXXXX+ */ cff_dict_add(cffont->fdarray[0], "Private", 2); cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0); cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0); @@ -1080,8 +1080,8 @@ CIDFont_type0_t1cdofont (CIDFont *font) cff_dict_remove((cffont->private)[0], "Subrs"); /* no Subrs */ } - cff_add_string(cffont, (char *)"Adobe"); - cff_add_string(cffont, (char *)"Identity"); + cff_add_string(cffont, "Adobe", 1); + cff_add_string(cffont, "Identity", 1); cff_dict_update(cffont->topdict, cffont); cff_dict_update(cffont->private[0], cffont); @@ -1950,7 +1950,7 @@ CIDFont_type0_t1dofont (CIDFont *font) cffont->fdarray[0] = cff_new_dict(); cff_dict_add(cffont->fdarray[0], "FontName", 1); cff_dict_set(cffont->fdarray[0], "FontName", 0, - (double) cff_add_string(cffont, font->fontname + 7)); /* FIXME: Skip XXXXXX+ */ + (double) cff_add_string(cffont, font->fontname + 7, 1)); /* FIXME: Skip XXXXXX+ */ cff_dict_add(cffont->fdarray[0], "Private", 2); cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0); cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0); @@ -2027,8 +2027,8 @@ CIDFont_type0_t1dofont (CIDFont *font) RELEASE(CIDToGIDMap); - cff_add_string(cffont, (char *)"Adobe"); - cff_add_string(cffont, (char *)"Identity"); + cff_add_string(cffont, "Adobe", 1); + cff_add_string(cffont, "Identity", 1); cff_dict_update(cffont->topdict, cffont); cff_dict_update(cffont->private[0], cffont); diff --git a/Build/source/texk/xdvipdfmx/src/dpxfile.c b/Build/source/texk/xdvipdfmx/src/dpxfile.c index d8d51309831..c74e9817151 100644 --- a/Build/source/texk/xdvipdfmx/src/dpxfile.c +++ b/Build/source/texk/xdvipdfmx/src/dpxfile.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/dpxfile.c,v 1.24 2008/05/22 10:08:02 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/dpxfile.c,v 1.25 2009/03/12 19:29:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -668,7 +668,7 @@ dpx_create_temp_file (void) } #elif defined(HAVE_MKSTEMP) # define __TMPDIR "/tmp" -# define TEMPLATE "/dvipdfmx.XXXXXX" +# define TEMPLATE "/dvipdfmx.XXXXXXXX" { char *_tmpd; int _fd = -1; @@ -726,7 +726,9 @@ dpx_delete_temp_file (char *tmp) * Please modify as appropriate (see also pdfximage.c and dvipdfmx.c). */ int -dpx_file_apply_filter (const char *cmdtmpl, const char *input, const char *output) +dpx_file_apply_filter (const char *cmdtmpl, + const char *input, const char *output, + unsigned char version) { char *cmd = NULL; char *p, *q; @@ -767,6 +769,13 @@ if ((l) + (n) >= (m)) { \ } else { strcpy(cmd + n, input); n += strlen(input); } + case 'v': /* Version number, e.g. 1.4 */ { + char buf[6]; + sprintf(buf, "1.%hhu", version); + need(cmd, n, size, strlen(buf)); + strcpy(cmd + n, buf); n += strlen(buf); + break; + } case 0: break; case '%': diff --git a/Build/source/texk/xdvipdfmx/src/dpxfile.h b/Build/source/texk/xdvipdfmx/src/dpxfile.h index 1dd9138f14e..374c362bbb0 100644 --- a/Build/source/texk/xdvipdfmx/src/dpxfile.h +++ b/Build/source/texk/xdvipdfmx/src/dpxfile.h @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/dpxfile.h,v 1.8 2008/05/18 12:05:22 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/dpxfile.h,v 1.9 2009/03/12 19:29:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -57,7 +57,9 @@ extern char * dpx_find_opentype_file (const char *filename); extern void dpx_file_set_verbose (void); -extern int dpx_file_apply_filter (const char *cmdtmpl, const char *input, const char *output); +extern int dpx_file_apply_filter (const char *cmdtmpl, + const char *input, const char *output, + unsigned char version); extern char *dpx_create_temp_file (void); extern void dpx_delete_temp_file (char *tmp); /* tmp freed here */ diff --git a/Build/source/texk/xdvipdfmx/src/pdfximage.c b/Build/source/texk/xdvipdfmx/src/pdfximage.c index 36a8abde918..6c2077a21ea 100644 --- a/Build/source/texk/xdvipdfmx/src/pdfximage.c +++ b/Build/source/texk/xdvipdfmx/src/pdfximage.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/pdfximage.c,v 1.21 2008/05/29 13:43:51 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/pdfximage.c,v 1.22 2009/03/12 19:29:48 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -842,7 +842,8 @@ ps_include_page (pdf_ximage *ximage, const char *filename) } } #endif - error = dpx_file_apply_filter(distiller_template, filename, temp); + error = dpx_file_apply_filter(distiller_template, filename, temp, + (unsigned char) pdf_get_version()); if (error) { WARN("Image format conversion for \"%s\" failed...", filename); dpx_delete_temp_file(temp); diff --git a/Build/source/texk/xdvipdfmx/src/spc_dvips.c b/Build/source/texk/xdvipdfmx/src/spc_dvips.c index 29088d21dd8..f624a753c43 100644 --- a/Build/source/texk/xdvipdfmx/src/spc_dvips.c +++ b/Build/source/texk/xdvipdfmx/src/spc_dvips.c @@ -586,7 +586,8 @@ spc_handler_ps_tricks_parse_path (struct spc_env *spe, struct spc_arg *args, } } #endif - error = dpx_file_apply_filter(distiller_template, gs_in, gs_out); + error = dpx_file_apply_filter(distiller_template, gs_in, gs_out, + (unsigned char) pdf_get_version()); if (error) { WARN("Image format conversion for PSTricks failed."); RELEASE(gs_in); @@ -673,7 +674,8 @@ spc_handler_ps_tricks_render (struct spc_env *spe, struct spc_arg *args) } } #endif - error = dpx_file_apply_filter(distiller_template, gs_in, gs_out); + error = dpx_file_apply_filter(distiller_template, gs_in, gs_out, + (unsigned char) pdf_get_version()); if (error) { WARN("Image format conversion for PSTricks failed."); RELEASE(gs_in); diff --git a/Build/source/texk/xdvipdfmx/src/t1_load.c b/Build/source/texk/xdvipdfmx/src/t1_load.c index d9c826e8b90..d4751354a8a 100644 --- a/Build/source/texk/xdvipdfmx/src/t1_load.c +++ b/Build/source/texk/xdvipdfmx/src/t1_load.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/t1_load.c,v 1.11 2008/01/11 18:04:15 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/t1_load.c,v 1.13 2009/04/08 03:10:58 chofchof Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -59,13 +59,8 @@ #if 0 /* We no longer need encryption. */ -static unsigned char t1_encrypt (unsigned char plain); -#endif /* 0 */ -static void t1_crypt_init (unsigned short key); -static unsigned char t1_decrypt (unsigned char cipher); static unsigned short r = T1_EEKEY, c1 = 52845, c2 = 22719; -#if 0 static unsigned char t1_encrypt (unsigned char plain) { unsigned char cipher; @@ -73,19 +68,26 @@ static unsigned char t1_encrypt (unsigned char plain) r = (cipher + r) * c1 + c2; return cipher; } -#endif /* 0 */ static void t1_crypt_init (unsigned short key) { r = key; } +#endif /* 0 */ -static unsigned char t1_decrypt (unsigned char cipher) +static void +t1_decrypt (unsigned short key, + unsigned char *dst, const unsigned char *src, + long skip, long len) { - unsigned char plain; - plain = (cipher ^ (r >> 8)); - r = (cipher + r) * c1 + c2; - return plain; + len -= skip; + while (skip--) + key = (key + *src++) * 52845u + 22719u; + while (len--) { + unsigned char c = *src++; + *dst++ = (c ^ (key >> 8)); + key = (key + c) * 52845u + 22719u; + } } /* T1CRYPT */ @@ -549,17 +551,9 @@ parse_subrs (cff_font *font, data = RENEW(data, max_size, card8); } if (lenIV >= 0) { - long j; - + t1_decrypt(T1_CHARKEY, data+offset, *start, lenIV, len); offsets[idx] = offset; - lengths[idx] = len - lenIV; - t1_crypt_init(T1_CHARKEY); - for (j = 0; j < lenIV; j++) - t1_decrypt(*((*start)+j)); - for (j = lenIV; j < len ; j++) { - data[offset] = (card8) t1_decrypt(*((*start)+j)); - offset++; - } + offset += (lengths[idx] = len - lenIV); } else if (len > 0) { offsets[idx] = offset; lengths[idx] = len; @@ -688,7 +682,12 @@ parse_charstrings (cff_font *font, #endif if (gid > 0) - charset->data.glyphs[gid-1] = cff_add_string(font, glyph_name); + charset->data.glyphs[gid-1] = cff_add_string(font, glyph_name, 0); + /* + * We don't care about duplicate strings here since + * later a subset font of this font will be generated. + */ + RELEASE(glyph_name); tok = pst_get_token(start, end); @@ -735,20 +734,9 @@ parse_charstrings (cff_font *font, *start += 1; if (mode != 1) { if (lenIV >= 0) { - t1_crypt_init(T1_CHARKEY); - for (j = 0; j < lenIV; j++) - t1_decrypt(*((*start)+j)); - if (gid == 0) { - charstrings->offset[gid] = 1; /* start at 1 */ - for (j = lenIV; j < len; j++) { - charstrings->data[j-lenIV] = t1_decrypt(*((*start)+j)); - } - } else { - charstrings->offset[gid] = offset + 1; /* start at 1 */ - for (j = lenIV; j < len; j++) { - charstrings->data[offset+j-lenIV] = t1_decrypt(*((*start)+j)); - } - } + long offs = gid ? offset : 0; + charstrings->offset[gid] = offs + 1; /* start at 1 */ + t1_decrypt(T1_CHARKEY, charstrings->data+offs, *start, lenIV, len); offset += len - lenIV; } else { if (gid == 0) { @@ -970,7 +958,11 @@ parse_part1 (cff_font *font, char **enc_vec, cff_dict_add(font->topdict, key, 1); if ((sid = cff_get_sid(font, strval)) == CFF_STRING_NOTDEF) - sid = cff_add_string(font, strval); /* FIXME */ + sid = cff_add_string(font, strval, 0); /* FIXME */ + /* + * We don't care about duplicate strings here since + * later a subset font of this font will be generated. + */ cff_dict_set(font->topdict, key, 0, sid); } RELEASE(strval); @@ -1207,12 +1199,7 @@ t1_load_font (char **enc_vec, int mode, FILE *fp) ERROR("Reading PFB (BINARY part) file failed."); return NULL; } else { - long i; - - t1_crypt_init(T1_EEKEY); - for (i = 0; i < length; i++) { - buffer[i] = (unsigned char) t1_decrypt(buffer[i]); - } + t1_decrypt(T1_EEKEY, buffer, buffer, 0, length); } start = buffer + 4; end = buffer + length; if (parse_part2(cff, &start, end, mode) < 0) { diff --git a/Build/source/texk/xdvipdfmx/src/truetype.c b/Build/source/texk/xdvipdfmx/src/truetype.c index eb920f6fb03..4ba3dce9cef 100644 --- a/Build/source/texk/xdvipdfmx/src/truetype.c +++ b/Build/source/texk/xdvipdfmx/src/truetype.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/truetype.c,v 1.10 2008/05/22 11:03:09 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/truetype.c,v 1.11 2009/08/28 00:26:17 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -261,7 +261,7 @@ do_widths (pdf_font *font, double *widths) else width = 1000. * tfm_get_width(tfm_id, code); pdf_add_array(tmparray, - pdf_new_number(ROUND(width, 1.0))); + pdf_new_number(ROUND(width, 0.1))); } else { pdf_add_array(tmparray, pdf_new_number(0.0)); } diff --git a/Build/source/texk/xdvipdfmx/src/tt_post.c b/Build/source/texk/xdvipdfmx/src/tt_post.c index ef687ffe75f..d5f21cb37f1 100644 --- a/Build/source/texk/xdvipdfmx/src/tt_post.c +++ b/Build/source/texk/xdvipdfmx/src/tt_post.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/tt_post.c,v 1.2 2004/09/11 15:23:48 hirata Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/tt_post.c,v 1.3 2009/08/17 00:49:45 chofchof Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. diff --git a/Build/source/texk/xdvipdfmx/src/tt_table.c b/Build/source/texk/xdvipdfmx/src/tt_table.c index 5cd14565063..9a83456837b 100644 --- a/Build/source/texk/xdvipdfmx/src/tt_table.c +++ b/Build/source/texk/xdvipdfmx/src/tt_table.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/tt_table.c,v 1.9 2008/05/08 10:32:09 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/tt_table.c,v 1.11 2009/05/02 12:16:32 chofchof Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -189,7 +189,6 @@ tt_read_hhea_table (sfnt *sfont) ULONG len; struct tt_hhea_table *table = NULL; - len = sfnt_find_table_len(sfont, "hmtx"); sfnt_locate_table(sfont, "hhea"); table = NEW(1, struct tt_hhea_table); @@ -211,12 +210,15 @@ tt_read_hhea_table (sfnt *sfont) if (table->metricDataFormat != 0) ERROR("unknown metricDataFormat"); table->numOfLongHorMetrics = sfnt_get_ushort(sfont); + + len = sfnt_find_table_len(sfont, "hmtx"); table->numOfExSideBearings = (USHORT)((len - table->numOfLongHorMetrics * 4) / 2); return table; } /* vhea */ +#if 0 char * tt_pack_vhea_table (struct tt_vhea_table *table) { @@ -243,6 +245,7 @@ tt_pack_vhea_table (struct tt_vhea_table *table) return data; } +#endif struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont) { @@ -252,7 +255,6 @@ struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont) table = NEW(1, struct tt_vhea_table); - len = sfnt_find_table_len(sfont, "vmtx"); sfnt_locate_table(sfont, "vhea"); table->version = sfnt_get_ulong(sfont); table->vertTypoAscender = sfnt_get_short (sfont); @@ -270,6 +272,8 @@ struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont) } table->metricDataFormat = sfnt_get_short(sfont); table->numOfLongVerMetrics = sfnt_get_ushort(sfont); + + len = sfnt_find_table_len(sfont, "vmtx"); table->numOfExSideBearings = (USHORT)((len - table->numOfLongVerMetrics * 4) / 2); return table; diff --git a/Build/source/texk/xdvipdfmx/src/type1.c b/Build/source/texk/xdvipdfmx/src/type1.c index c057a9cab55..18d0ec72165 100644 --- a/Build/source/texk/xdvipdfmx/src/type1.c +++ b/Build/source/texk/xdvipdfmx/src/type1.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/type1.c,v 1.44 2008/08/31 18:42:39 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/type1.c,v 1.46 2009/08/28 00:26:17 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -335,7 +335,7 @@ add_metrics (pdf_font *font, cff_font *cffont, char **enc_vec, double *widths, l else width = 1000. * tfm_get_width(tfm_id, code); pdf_add_array(tmp_array, - pdf_new_number(ROUND(width, 1.0))); + pdf_new_number(ROUND(width, 0.1))); } else { pdf_add_array(tmp_array, pdf_new_number(0.0)); } @@ -631,7 +631,7 @@ pdf_font_load_type1 (pdf_font *font) break; } - sid = cff_add_string(cffont, glyph); /* FIXME */ + sid = cff_add_string(cffont, glyph, 1); /* FIXME */ if (duplicate < code) { /* found duplicates */ cffont->encoding->supp[cffont->encoding->num_supps].code = duplicate; cffont->encoding->supp[cffont->encoding->num_supps].glyph = sid; diff --git a/Build/source/texk/xdvipdfmx/src/type1c.c b/Build/source/texk/xdvipdfmx/src/type1c.c index dc868b04bf1..efe7af53e3b 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.28 2008/08/06 00:10:45 matthias Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/type1c.c,v 1.30 2009/08/28 00:26:17 matthias Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -211,7 +211,7 @@ add_SimpleMetrics (pdf_font *font, cff_font *cffont, else width = 1000. * tfm_get_width(tfm_id, code); pdf_add_array(tmp_array, - pdf_new_number(ROUND(width, 1.0))); + pdf_new_number(ROUND(width, 0.1))); } else { pdf_add_array(tmp_array, pdf_new_number(0.0)); } @@ -477,7 +477,12 @@ pdf_font_load_type1c (pdf_font *font) * cff_add_string(cff, ...) -> cff_string_add(string, ...). */ sid_orig = cff_get_sid (cffont, enc_vec[code]); - sid = cff_add_string(cffont, enc_vec[code]); + sid = sid_orig < CFF_STDSTR_MAX ? + sid_orig : cff_add_string(cffont, enc_vec[code], 0); + /* + * We use "unique = 0" because duplicate strings are impossible + * at this stage unless the original font already had duplicates. + */ /* * Check if multiply-encoded glyph. |