Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
Tom Callaway | fb64a30851 | |
Tom Callaway | 5d44ab45f5 | |
Tom Callaway | a73ec3b666 | |
Tom Callaway | 208b777e24 | |
Tom Callaway | e554d4ddb5 | |
Tom Callaway | 1076d9ed6f | |
Tom Callaway | cbaa01c7e4 | |
Tom Callaway | 533b54c6e2 | |
Tom Callaway | 6f73e6d8a1 | |
Tom Callaway | aa361b24ae |
|
@ -0,0 +1,25 @@
|
|||
--- etex.src.orig 2015-09-16 14:17:48.263123165 -0400
|
||||
+++ etex.src 2015-09-16 14:14:20.673610421 -0400
|
||||
@@ -290,8 +290,10 @@
|
||||
|
||||
\def \addlanguage #1#2#3#4#5% language patterns exceptions lhm rhm
|
||||
{\expandafter \et@xlang \csname lang@#1\endcsname
|
||||
- \expandafter \chardef \csname lhm@#1\endcsname=#4 % V1.0-1
|
||||
- \expandafter \chardef \csname rhm@#1\endcsname=#5 % V1.0-1
|
||||
+ \def\paramD{#4}\ifx\paramD\empty\def\paramD{1}\fi % Default value lhm is 1 % V2.1-1
|
||||
+ \def\paramE{#5}\ifx\paramD\empty\def\paramE{1}\fi % Default value rhm is 1 % V2.1-1
|
||||
+ \expandafter \chardef \csname lhm@#1\endcsname=\paramD % V2.1-1
|
||||
+ \expandafter \chardef \csname rhm@#1\endcsname=\paramE % V2.1-1
|
||||
\uselanguage {#1}%
|
||||
\input #2
|
||||
\if *#3*\else \input #3 \fi
|
||||
@@ -776,6 +778,9 @@
|
||||
|
||||
%% Revision-history:
|
||||
|
||||
+24-ARP-2015: 2.1;1 Allow empty values on \addlanguages for parameters 4 and 5
|
||||
+ Changed by Edgar Hoch
|
||||
+
|
||||
01-FEB-1999: 2.1;0 Allow file to be used with e-TeX versions 2.0 and 2.1
|
||||
|
||||
25-MAR-1998: 2.0;19 Improved log message for \{glob|loc}{marks|box}vector (PEB)
|
|
@ -0,0 +1,26 @@
|
|||
# macros to keep trees in texlive consistent
|
||||
%_texmf /usr/share/texlive/texmf-local
|
||||
%_texmf_main /usr/share/texlive/texmf-dist
|
||||
%_texmf_vendor /usr/share/texlive/texmf-dist
|
||||
%_texmf_var /var/lib/texmf
|
||||
%_texmf_conf /usr/share/texlive/texmf-config
|
||||
|
||||
%texlive_post \
|
||||
mkdir -p /var/run/texlive \
|
||||
touch /var/run/texlive/run-texhash \
|
||||
touch /var/run/texlive/run-mtxrun \
|
||||
:
|
||||
|
||||
%texlive_postun \
|
||||
if [ $1 == 1 ]; then \
|
||||
mkdir -p /var/run/texlive \
|
||||
touch /var/run/run-texhash \
|
||||
else \
|
||||
%{_bindir}/texhash 2> /dev/null \
|
||||
fi \
|
||||
:
|
||||
|
||||
%texlive_posttrans \
|
||||
if [ -e /var/run/texlive/run-texhash ] && [ -e %{_bindir}/texhash ]; then %{_bindir}/texhash 2> /dev/null; rm -f /var/run/texlive/run-texhash; fi \
|
||||
if [ -e /var/run/texlive/run-mtxrun ]; then export TEXMF=/usr/share/texlive/texmf-dist; export TEXMFCNF=/usr/share/texlive/texmf-dist/web2c; export TEXMFCACHE=/var/lib/texmf; %{_bindir}/mtxrun --generate &> /dev/null; rm -f /var/run/texlive/run-mtxrun; fi \
|
||||
:
|
2
sources
2
sources
|
@ -4878,7 +4878,7 @@ b37f3b875ba84ea75cb34b16e4fa5f8b scrjrnl.source.tar.xz
|
|||
8ae32c66f8ce5104f5a50ef71010188b sdrt.tar.xz
|
||||
cc12d1add5cc4d9d344d562cbe4187fd secdot.doc.tar.xz
|
||||
3b38478e9f3971df9209cf5892765731 secdot.tar.xz
|
||||
cf2b02c77ba6d37fcc80cca049742d2f sectionbox.doc.tar.xz
|
||||
e73f0e9bdc917ac78f92b3e77d38e24d sectionbox.doc.tar.xz
|
||||
8e567ff40030d91cfbf3d98430ea6fad sectionbox.tar.xz
|
||||
65d1b52cf179e5f6e4970c9bc1e61398 section.doc.tar.xz
|
||||
b6d27768607127cc23759313558e7b06 section.tar.xz
|
||||
|
|
|
@ -0,0 +1,437 @@
|
|||
diff -up source/texk/dvipdfm-x/cff.c.svn34700 source/texk/dvipdfm-x/cff.c
|
||||
--- source/texk/dvipdfm-x/cff.c.svn34700 2016-01-18 15:41:06.607571938 -0500
|
||||
+++ source/texk/dvipdfm-x/cff.c 2016-01-18 15:40:28.687781260 -0500
|
||||
@@ -326,9 +326,14 @@ cff_get_index_header (cff_font *cff)
|
||||
ERROR("invalid offsize data");
|
||||
|
||||
idx->offset = NEW(count+1, l_offset);
|
||||
- for (i=0;i<count+1;i++) {
|
||||
+ for (i=0;i<count;i++) {
|
||||
(idx->offset)[i] = get_offset(cff->SFONT_OR_STREAM, idx->offsize);
|
||||
}
|
||||
+ if (count == 0xFFFF)
|
||||
+ cff_seek(cff, cff_tell(cff) + idx->offsize);
|
||||
+ else
|
||||
+ (idx->offset)[i] = get_offset(cff->SFONT_OR_STREAM, idx->offsize);
|
||||
+
|
||||
|
||||
if (idx->offset[0] != 1)
|
||||
ERROR("cff_get_index(): invalid index data");
|
||||
diff -U0 source/texk/dvipdfm-x/ChangeLog.svn34700 source/texk/dvipdfm-x/ChangeLog
|
||||
--- source/texk/dvipdfm-x/ChangeLog.svn34700 2016-01-18 15:54:48.955923281 -0500
|
||||
+++ source/texk/dvipdfm-x/ChangeLog 2016-01-18 15:55:03.811801322 -0500
|
||||
@@ -0,0 +1,5 @@
|
||||
+2014-07-23 Jiang Jiang <gzjjgod@gmail.com>
|
||||
+
|
||||
+ * cff.c, pdfdev.c, pdffont.c, pdffont.h, tt_cmap.c, type0.c, type0.h:
|
||||
+ Support CID-keyed OpenType fonts.
|
||||
+
|
||||
diff -up source/texk/dvipdfm-x/pdfdev.c.svn34700 source/texk/dvipdfm-x/pdfdev.c
|
||||
--- source/texk/dvipdfm-x/pdfdev.c.svn34700 2016-01-18 15:41:35.719411236 -0500
|
||||
+++ source/texk/dvipdfm-x/pdfdev.c 2016-01-18 15:44:38.438402602 -0500
|
||||
@@ -52,6 +52,10 @@
|
||||
|
||||
#include "pdfdev.h"
|
||||
|
||||
+#ifdef XETEX
|
||||
+#include FT_CID_H
|
||||
+#endif
|
||||
+
|
||||
static int verbose = 0;
|
||||
|
||||
void
|
||||
@@ -457,6 +461,7 @@ struct dev_font {
|
||||
int enc_id;
|
||||
#ifdef XETEX
|
||||
unsigned short *ft_to_gid;
|
||||
+ FT_Bool is_cid_keyed;
|
||||
#endif
|
||||
|
||||
/* if >= 0, index of a dev_font that really has the resource and used_chars */
|
||||
@@ -464,6 +469,7 @@ struct dev_font {
|
||||
|
||||
pdf_obj *resource;
|
||||
char *used_chars;
|
||||
+ char *used_glyphs;
|
||||
|
||||
/* Font format:
|
||||
* simple, composite or bitmap.
|
||||
@@ -875,6 +881,10 @@ dev_set_font (int font_id)
|
||||
if (!real_font->resource) {
|
||||
real_font->resource = pdf_get_font_reference(real_font->font_id);
|
||||
real_font->used_chars = pdf_get_font_usedchars(real_font->font_id);
|
||||
+#ifdef XETEX
|
||||
+ if (real_font->is_cid_keyed)
|
||||
+ real_font->used_glyphs = pdf_get_font_usedglyphs(real_font->font_id);
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (!real_font->used_on_this_page) {
|
||||
@@ -959,15 +969,22 @@ handle_multibyte_string (struct dev_font
|
||||
|
||||
#ifdef XETEX
|
||||
if (ctype == -1) { /* freetype glyph indexes */
|
||||
- if (font->ft_to_gid) {
|
||||
+ if (font->ft_to_gid || font->is_cid_keyed) {
|
||||
/* convert freetype glyph indexes to physical GID */
|
||||
const unsigned char *inbuf = p;
|
||||
unsigned char *outbuf = sbuf0;
|
||||
+ FT_Face face = pdf_font_get_ft_face(pdf_get_font(font->font_id));
|
||||
for (i = 0; i < length; i += 2) {
|
||||
unsigned int gid;
|
||||
gid = *inbuf++ << 8;
|
||||
gid += *inbuf++;
|
||||
- gid = font->ft_to_gid[gid];
|
||||
+ if (font->is_cid_keyed) {
|
||||
+ FT_UInt cid = 0;
|
||||
+ FT_Get_CID_From_Glyph_Index(face, gid, &cid);
|
||||
+ gid = cid;
|
||||
+ } else {
|
||||
+ gid = font->ft_to_gid[gid];
|
||||
+ }
|
||||
*outbuf++ = gid >> 8;
|
||||
*outbuf++ = gid & 0xff;
|
||||
}
|
||||
@@ -1156,6 +1173,11 @@ pdf_dev_set_string (spt_t xpos, spt_t yp
|
||||
length = instr_len;
|
||||
|
||||
if (font->format == PDF_FONTTYPE_COMPOSITE) {
|
||||
+ if (real_font->used_glyphs != NULL) {
|
||||
+ for (i = 0; i < length; i += 2)
|
||||
+ add_to_used_chars2(real_font->used_glyphs,
|
||||
+ (unsigned short) (str_ptr[i] << 8)|str_ptr[i+1]);
|
||||
+ }
|
||||
if (handle_multibyte_string(font, &str_ptr, &length, ctype) < 0) {
|
||||
ERROR("Error in converting input string...");
|
||||
return;
|
||||
@@ -1531,10 +1553,17 @@ pdf_dev_locate_font (const char *font_na
|
||||
font->enc_id = pdf_get_font_encoding(font->font_id);
|
||||
#ifdef XETEX
|
||||
font->ft_to_gid = pdf_get_font_ft_to_gid(font->font_id);
|
||||
+
|
||||
+ font->is_cid_keyed = 0;
|
||||
+ {
|
||||
+ FT_Face face = pdf_font_get_ft_face(pdf_get_font(font->font_id));
|
||||
+ FT_Get_CID_Is_Internally_CID_Keyed(face, &font->is_cid_keyed);
|
||||
+ }
|
||||
#endif
|
||||
|
||||
font->resource = NULL; /* Don't ref obj until font is actually used. */
|
||||
font->used_chars = NULL;
|
||||
+ font->used_glyphs = NULL;
|
||||
|
||||
font->extend = 1.0;
|
||||
font->slant = 0.0;
|
||||
diff -up source/texk/dvipdfm-x/pdffont.c.svn34700 source/texk/dvipdfm-x/pdffont.c
|
||||
--- source/texk/dvipdfm-x/pdffont.c.svn34700 2016-01-18 15:45:00.942278377 -0500
|
||||
+++ source/texk/dvipdfm-x/pdffont.c 2016-01-18 15:45:48.742021901 -0500
|
||||
@@ -343,6 +343,24 @@ pdf_get_font_usedchars (int font_id)
|
||||
}
|
||||
}
|
||||
|
||||
+char *
|
||||
+pdf_get_font_usedglyphs (int font_id)
|
||||
+{
|
||||
+ pdf_font *font;
|
||||
+
|
||||
+ CHECK_ID(font_id);
|
||||
+
|
||||
+ font = GET_FONT(font_id);
|
||||
+ if (font->subtype == PDF_FONT_FONTTYPE_TYPE0) {
|
||||
+ Type0Font *t0font;
|
||||
+
|
||||
+ t0font = Type0Font_cache_get(font->font_id);
|
||||
+ return Type0Font_get_usedglyphs(t0font);
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
int
|
||||
pdf_get_font_wmode (int font_id)
|
||||
{
|
||||
@@ -361,6 +379,16 @@ pdf_get_font_wmode (int font_id)
|
||||
}
|
||||
}
|
||||
|
||||
+pdf_font *
|
||||
+pdf_get_font (int font_id)
|
||||
+{
|
||||
+ pdf_font *font;
|
||||
+
|
||||
+ CHECK_ID(font_id);
|
||||
+
|
||||
+ return GET_FONT(font_id);
|
||||
+}
|
||||
+
|
||||
int
|
||||
pdf_get_font_subtype (int font_id)
|
||||
{
|
||||
diff -up source/texk/dvipdfm-x/pdffont.h.svn34700 source/texk/dvipdfm-x/pdffont.h
|
||||
--- source/texk/dvipdfm-x/pdffont.h.svn34700 2016-01-18 15:46:03.101944966 -0500
|
||||
+++ source/texk/dvipdfm-x/pdffont.h 2016-01-18 15:46:33.237783512 -0500
|
||||
@@ -60,9 +60,11 @@ extern void pdf_close_fonts (void);
|
||||
extern int pdf_font_findresource (const char *font_name,
|
||||
double font_scale, fontmap_rec *mrec);
|
||||
|
||||
+extern pdf_font* pdf_get_font (int font_id);
|
||||
extern int pdf_get_font_subtype (int font_id);
|
||||
extern pdf_obj *pdf_get_font_reference (int font_id);
|
||||
extern char *pdf_get_font_usedchars (int font_id);
|
||||
+extern char *pdf_get_font_usedglyphs (int font_id);
|
||||
|
||||
#if 0
|
||||
extern char *pdf_get_font_fontname (int font_id); /* without unique tag */
|
||||
diff -up source/texk/dvipdfm-x/tt_cmap.c.svn34700 source/texk/dvipdfm-x/tt_cmap.c
|
||||
--- source/texk/dvipdfm-x/tt_cmap.c.svn34700 2016-01-18 15:46:52.709679191 -0500
|
||||
+++ source/texk/dvipdfm-x/tt_cmap.c 2016-01-18 15:48:31.221151411 -0500
|
||||
@@ -55,6 +55,10 @@
|
||||
|
||||
#include "tt_cmap.h"
|
||||
|
||||
+#ifdef XETEX
|
||||
+#include FT_CID_H
|
||||
+#endif
|
||||
+
|
||||
#define VERBOSE_LEVEL_MIN 0
|
||||
static int verbose = 0;
|
||||
void
|
||||
@@ -947,6 +951,16 @@ handle_subst_glyphs (CMap *cmap,
|
||||
return count;
|
||||
}
|
||||
|
||||
+unsigned int
|
||||
+gid_to_cid(sfnt *sfont, USHORT gid)
|
||||
+{
|
||||
+ unsigned int cid = 0;
|
||||
+#ifdef XETEX
|
||||
+ FT_Get_CID_From_Glyph_Index(sfont->ft_face, gid, &cid);
|
||||
+#endif
|
||||
+ return cid ? cid : gid;
|
||||
+}
|
||||
+
|
||||
static pdf_obj *
|
||||
create_ToUnicode_cmap4 (struct cmap4 *map,
|
||||
const char *cmap_name, CMap *cmap_add,
|
||||
@@ -985,10 +999,11 @@ create_ToUnicode_cmap4 (struct cmap4 *ma
|
||||
map->idDelta[i]) & 0xffff;
|
||||
}
|
||||
if (is_used_char2(used_glyphs_copy, gid)) {
|
||||
+ unsigned int cid = gid_to_cid(sfont, gid);
|
||||
count++;
|
||||
|
||||
- wbuf[0] = (gid >> 8) & 0xff;
|
||||
- wbuf[1] = (gid & 0xff);
|
||||
+ wbuf[0] = (cid >> 8) & 0xff;
|
||||
+ wbuf[1] = (cid & 0xff);
|
||||
|
||||
wbuf[2] = (ch >> 8) & 0xff;
|
||||
wbuf[3] = ch & 0xff;
|
||||
@@ -1057,9 +1072,10 @@ create_ToUnicode_cmap12 (struct cmap12 *
|
||||
d = ch - map->groups[i].startCharCode;
|
||||
gid = (USHORT) ((map->groups[i].startGlyphID + d) & 0xffff);
|
||||
if (is_used_char2(used_glyphs_copy, gid)) {
|
||||
+ unsigned int cid = gid_to_cid(sfont, gid);
|
||||
count++;
|
||||
- wbuf[0] = (gid >> 8) & 0xff;
|
||||
- wbuf[1] = (gid & 0xff);
|
||||
+ wbuf[0] = (cid >> 8) & 0xff;
|
||||
+ wbuf[1] = (cid & 0xff);
|
||||
len = UC_sput_UTF16BE((long)ch, &p, wbuf+WBUF_SIZE);
|
||||
|
||||
CMap_add_bfchar(cmap, wbuf, 2, wbuf+2, len);
|
||||
diff -up source/texk/dvipdfm-x/type0.c.svn34700 source/texk/dvipdfm-x/type0.c
|
||||
--- source/texk/dvipdfm-x/type0.c.svn34700 2016-01-18 15:48:43.781084121 -0500
|
||||
+++ source/texk/dvipdfm-x/type0.c 2016-01-18 15:53:37.499509899 -0500
|
||||
@@ -45,6 +45,9 @@
|
||||
|
||||
#include "type0.h"
|
||||
|
||||
+#ifdef XETEX
|
||||
+#include FT_CID_H
|
||||
+#endif
|
||||
|
||||
#define TYPE0FONT_DEBUG_STR "Type0"
|
||||
#define TYPE0FONT_DEBUG 3
|
||||
@@ -85,6 +88,7 @@ struct Type0Font {
|
||||
char *fontname; /* BaseFont */
|
||||
char *encoding; /* "Identity-H" or "Identity-V" (not ID) */
|
||||
char *used_chars; /* Used chars (CIDs) */
|
||||
+ char *used_glyphs; /* Used glyphs (GIDs) */
|
||||
|
||||
/*
|
||||
* Type0 only
|
||||
@@ -112,6 +116,7 @@ Type0Font_init_font_struct (Type0Font *f
|
||||
font->descriptor = NULL;
|
||||
font->encoding = NULL;
|
||||
font->used_chars = NULL;
|
||||
+ font->used_glyphs = NULL;
|
||||
font->descendant = NULL;
|
||||
font->wmode = -1;
|
||||
font->flags = FLAG_NONE;
|
||||
@@ -139,6 +144,7 @@ Type0Font_clean (Type0Font *font)
|
||||
font->indirect = NULL;
|
||||
font->descriptor = NULL;
|
||||
font->used_chars = NULL;
|
||||
+ font->used_glyphs = NULL;
|
||||
font->encoding = NULL;
|
||||
font->fontname = NULL;
|
||||
}
|
||||
@@ -147,13 +153,47 @@ Type0Font_clean (Type0Font *font)
|
||||
/* PLEASE FIX THIS */
|
||||
#include "tt_cmap.h"
|
||||
|
||||
+pdf_obj *Type0Font_create_ToUnicode_stream(Type0Font *font) {
|
||||
+ CIDFont *cidfont = font->descendant;
|
||||
+ char *used = Type0Font_get_usedglyphs(font);
|
||||
+ if (!used)
|
||||
+ used = Type0Font_get_usedchars(font);
|
||||
+ return otf_create_ToUnicode_stream(CIDFont_get_ident(cidfont),
|
||||
+ CIDFont_get_opt_index(cidfont),
|
||||
+#ifdef XETEX
|
||||
+ CIDFont_get_ft_face(cidfont),
|
||||
+#endif
|
||||
+ used);
|
||||
+}
|
||||
+
|
||||
+/* Try to load ToUnicode CMap from file system first, if not found fallback to
|
||||
+ * font CMap reverse lookup. */
|
||||
+pdf_obj *Type0Font_try_load_ToUnicode_stream(Type0Font *font, char *cmap_base) {
|
||||
+ char *cmap_name = NEW(strlen(cmap_base) + strlen("-UTF-16"), char);
|
||||
+ pdf_obj *tounicode;
|
||||
+
|
||||
+ sprintf(cmap_name, "%s-UTF16", cmap_base);
|
||||
+ tounicode = pdf_read_ToUnicode_file(cmap_name);
|
||||
+ if (!tounicode) {
|
||||
+ sprintf(cmap_name, "%s-UCS2", cmap_base);
|
||||
+ tounicode = pdf_read_ToUnicode_file(cmap_name);
|
||||
+ }
|
||||
+
|
||||
+ RELEASE(cmap_name);
|
||||
+
|
||||
+ if (!tounicode)
|
||||
+ tounicode = Type0Font_create_ToUnicode_stream(font);
|
||||
+
|
||||
+ return tounicode;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
add_ToUnicode (Type0Font *font)
|
||||
{
|
||||
pdf_obj *tounicode;
|
||||
CIDFont *cidfont;
|
||||
CIDSysInfo *csi;
|
||||
- char *cmap_name, *fontname;
|
||||
+ char *fontname;
|
||||
|
||||
/*
|
||||
* ToUnicode CMap:
|
||||
@@ -197,45 +237,24 @@ add_ToUnicode (Type0Font *font)
|
||||
switch (CIDFont_get_subtype(cidfont)) {
|
||||
case CIDFONT_TYPE2:
|
||||
/* PLEASE FIX THIS */
|
||||
- tounicode = otf_create_ToUnicode_stream(CIDFont_get_ident(cidfont),
|
||||
- CIDFont_get_opt_index(cidfont),
|
||||
-#ifdef XETEX
|
||||
- CIDFont_get_ft_face(cidfont),
|
||||
-#endif
|
||||
- Type0Font_get_usedchars(font));
|
||||
+ tounicode = Type0Font_create_ToUnicode_stream(font);
|
||||
break;
|
||||
default:
|
||||
if (CIDFont_get_flag(cidfont, CIDFONT_FLAG_TYPE1C)) { /* FIXME */
|
||||
- tounicode = otf_create_ToUnicode_stream(CIDFont_get_ident(cidfont),
|
||||
- CIDFont_get_opt_index(cidfont),
|
||||
-#ifdef XETEX
|
||||
- CIDFont_get_ft_face(cidfont),
|
||||
-#endif
|
||||
- Type0Font_get_usedchars(font));
|
||||
+ tounicode = Type0Font_create_ToUnicode_stream(font);
|
||||
} else if (CIDFont_get_flag(cidfont, CIDFONT_FLAG_TYPE1)) { /* FIXME */
|
||||
/* Font loader will create ToUnicode and set. */
|
||||
return;
|
||||
} else {
|
||||
- cmap_name = NEW(strlen(fontname) + 7, char);
|
||||
- sprintf(cmap_name, "%s-UTF16", fontname);
|
||||
- tounicode = pdf_read_ToUnicode_file(cmap_name);
|
||||
- if (!tounicode) {
|
||||
- sprintf(cmap_name, "%s-UCS2", fontname);
|
||||
- tounicode = pdf_read_ToUnicode_file(cmap_name);
|
||||
- }
|
||||
- RELEASE(cmap_name);
|
||||
+ tounicode = Type0Font_try_load_ToUnicode_stream(font, fontname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
- cmap_name = NEW(strlen(csi->registry)+strlen(csi->ordering)+8, char);
|
||||
- sprintf(cmap_name, "%s-%s-UTF16", csi->registry, csi->ordering);
|
||||
- tounicode = pdf_read_ToUnicode_file(cmap_name);
|
||||
- if (!tounicode) {
|
||||
- sprintf(cmap_name, "%s-%s-UCS2", csi->registry, csi->ordering);
|
||||
- tounicode = pdf_read_ToUnicode_file(cmap_name);
|
||||
- }
|
||||
- RELEASE(cmap_name);
|
||||
+ char *cmap_base = NEW(strlen(csi->registry) + strlen(csi->ordering) + 2, char);
|
||||
+ sprintf(cmap_base, "%s-%s", csi->registry, csi->ordering);
|
||||
+ tounicode = Type0Font_try_load_ToUnicode_stream(font, cmap_base);
|
||||
+ RELEASE(cmap_base);
|
||||
}
|
||||
|
||||
if (tounicode) {
|
||||
@@ -310,6 +329,14 @@ Type0Font_get_usedchars (Type0Font *font
|
||||
return font->used_chars;
|
||||
}
|
||||
|
||||
+char *
|
||||
+Type0Font_get_usedglyphs (Type0Font *font)
|
||||
+{
|
||||
+ ASSERT(font);
|
||||
+
|
||||
+ return font->used_glyphs;
|
||||
+}
|
||||
+
|
||||
pdf_obj *
|
||||
Type0Font_get_resource (Type0Font *font)
|
||||
{
|
||||
@@ -495,6 +522,7 @@ Type0Font_cache_find (const char *map_na
|
||||
*/
|
||||
|
||||
font->used_chars = NULL;
|
||||
+ font->used_glyphs = NULL;
|
||||
font->flags = FLAG_NONE;
|
||||
|
||||
switch (CIDFont_get_subtype(cidfont)) {
|
||||
@@ -506,11 +534,19 @@ Type0Font_cache_find (const char *map_na
|
||||
/*
|
||||
* Need used_chars to write W, W2.
|
||||
*/
|
||||
- if ((parent_id = CIDFont_get_parent_id(cidfont, wmode ? 0 : 1)) < 0)
|
||||
+ if ((parent_id = CIDFont_get_parent_id(cidfont, wmode ? 0 : 1)) < 0) {
|
||||
+#ifdef XETEX
|
||||
+ FT_Face face = CIDFont_get_ft_face(cidfont);
|
||||
+ FT_Bool is_cid_keyed = 0;
|
||||
+ FT_Get_CID_Is_Internally_CID_Keyed(face, &is_cid_keyed);
|
||||
+ if (is_cid_keyed)
|
||||
+ font->used_glyphs = new_used_chars2();
|
||||
+#endif
|
||||
font->used_chars = new_used_chars2();
|
||||
- else {
|
||||
+ } else {
|
||||
/* Don't allocate new one. */
|
||||
font->used_chars = Type0Font_get_usedchars(Type0Font_cache_get(parent_id));
|
||||
+ font->used_glyphs = Type0Font_get_usedglyphs(Type0Font_cache_get(parent_id));
|
||||
font->flags |= FLAG_USED_CHARS_SHARED;
|
||||
}
|
||||
break;
|
||||
diff -up source/texk/dvipdfm-x/type0.h.svn34700 source/texk/dvipdfm-x/type0.h
|
||||
--- source/texk/dvipdfm-x/type0.h.svn34700 2016-01-18 15:53:57.179348339 -0500
|
||||
+++ source/texk/dvipdfm-x/type0.h 2016-01-18 15:54:12.494222612 -0500
|
||||
@@ -35,6 +35,7 @@ extern int Type0Font_get_wmode
|
||||
extern char *Type0Font_get_encoding (Type0Font *font);
|
||||
#endif
|
||||
extern char *Type0Font_get_usedchars (Type0Font *font);
|
||||
+extern char *Type0Font_get_usedglyphs (Type0Font *font);
|
||||
|
||||
extern pdf_obj *Type0Font_get_resource (Type0Font *font);
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
--- latexdiff.pl.orig 2013-06-26 18:57:37.000000000 -0400
|
||||
+++ latexdiff.pl 2015-12-17 14:20:49.041293857 -0500
|
||||
@@ -1238,7 +1238,7 @@
|
||||
require File::Spec ;
|
||||
$dirname = File::Basename::dirname($filename);
|
||||
|
||||
- if ( ($includeonly) = ($preamble =~ m/\\includeonly{(.*?)}/ ) ) {
|
||||
+ if ( ($includeonly) = ($preamble =~ m/\\includeonly\{(.*?)}/ ) ) {
|
||||
$includeonly =~ s/,/|/g;
|
||||
} else {
|
||||
$includeonly = '.*?';
|
||||
@@ -1246,7 +1246,7 @@
|
||||
|
||||
print STDERR "DEBUG: includeonly $includeonly\n" if $debug;
|
||||
|
||||
- $text=~s/(^(?:[^%\n]|\\%)*)\\input{(.*?)}|\\include{(${includeonly}(?:\.tex)?)}/{
|
||||
+ $text=~s/(^(?:[^%\n]|\\%)*)\\input\{(.*?)}|\\include\{(${includeonly}(?:\.tex)?)}/{
|
||||
$fname = $2 if defined($2) ;
|
||||
$fname = $3 if defined($3) ;
|
||||
# # add tex extension unless there is a three letter extension already
|
||||
@@ -1917,7 +1917,7 @@
|
||||
s/^(\s*)//s;
|
||||
push(@leadin,$1);
|
||||
# Change \{ to \QLEFTBRACE and \} to \QRIGHTBRACE
|
||||
- s/(?<!\\)\\{/\\QLEFTBRACE /sg;
|
||||
+ s/(?<!\\)\\\{/\\QLEFTBRACE /sg;
|
||||
s/(?<!\\)\\}/\\QRIGHTBRACE /sg;
|
||||
# change begin and end commands within comments such that they
|
||||
# don't disturb the pattern matching (if there are several \begin or \end in one line
|
||||
@@ -1932,23 +1932,23 @@
|
||||
s/\\begin\{(verbatim\*?)\}(.*?)\\end\{\1\}/"\\${1}{". tohash(\%verbhash,"${2}") . "}"/esg;
|
||||
# Convert _n or _\cmd into \SUBSCRIPTNB{n} or \SUBSCRIPTNB{\cmd} and _{nnn} into \SUBSCRIPT{nn}
|
||||
1 while s/(?<!\\)_([^{\\]|\\\w+)/\\SUBSCRIPTNB{$1}/g ;
|
||||
- 1 while s/(?<!\\)_{($pat6)}/\\SUBSCRIPT{$1}/g ;
|
||||
+ 1 while s/(?<!\\)_\{($pat6)}/\\SUBSCRIPT{$1}/g ;
|
||||
# Convert ^n into \SUPERSCRIPTNB{n} and ^{nnn} into \SUPERSCRIPT{nn}
|
||||
1 while s/(?<!\\)\^([^{\\]|\\\w+)/\\SUPERSCRIPTNB{$1}/g ;
|
||||
- 1 while s/(?<!\\)\^{($pat6)}/\\SUPERSCRIPT{$1}/g ;
|
||||
+ 1 while s/(?<!\\)\^\{($pat6)}/\\SUPERSCRIPT{$1}/g ;
|
||||
# Convert $$ $$ into \begin{DOLLARDOLLAR} \end{DOLLARDOLLAR}
|
||||
s/\$\$(.*?)\$\$/\\begin{DOLLARDOLLAR}$1\\end{DOLLARDOLLAR}/sg;
|
||||
# Convert \[ \] into \begin{SQUAREBRACKET} \end{SQUAREBRACKET}
|
||||
s/(?<!\\)\\\[/\\begin{SQUAREBRACKET}/sg;
|
||||
s/\\\]/\\end{SQUAREBRACKET}/sg;
|
||||
# Convert all picture environmentent (\begin{PICTUREENV} .. \end{PICTUREENV} \PICTUREBLOCKenv
|
||||
- s/\\begin{($PICTUREENV)}(.*?)\\end{\1}/\\PICTUREBLOCK$1\{$2\}/sg;
|
||||
+ s/\\begin\{($PICTUREENV)}(.*?)\\end\{\1}/\\PICTUREBLOCK$1\{$2\}/sg;
|
||||
# For --block-math-markup option -convert all \begin{MATH} .. \end{MATH}
|
||||
# into \MATHBLOCKMATH{...} commands, where MATH is any valid math environment
|
||||
# Also convert all array environments into ARRAYBLOCK environments
|
||||
if ( $mathmarkup != FINE ) {
|
||||
- s/\\begin{($ARRENV)}(.*?)\\end{\1}/\\ARRAYBLOCK$1\{$2\}/sg;
|
||||
- s/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end{\1}/\\MATHBLOCK$1\{$2\}/sg;
|
||||
+ s/\\begin\{($ARRENV)}(.*?)\\end\{\1}/\\ARRAYBLOCK$1\{$2\}/sg;
|
||||
+ s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end\{\1}/\\MATHBLOCK$1\{$2\}/sg;
|
||||
}
|
||||
# add final token " STOP"
|
||||
$_ .= " STOP"
|
||||
@@ -2207,15 +2207,15 @@
|
||||
# environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
|
||||
# is not globally minimal but only 'locally' (matching is beginning from the left side of the string)
|
||||
if ( $mathmarkup == FINE ) {
|
||||
- 1 while s/\\begin{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}((?:.(?!(?:\\end{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}|\\begin{MATHMODE})))*?)\\end{MATHMODE}/\\begin{$1}$2\\end{$1}/s;
|
||||
- 1 while s/\\begin{MATHMODE}((?:.(?!\\end{MATHMODE}))*?)\\end{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}/\\begin{$2}$1\\end{$2}/s;
|
||||
- # convert remaining \begin{MATHMODE} \end{MATHMODE} (and not containing & or \\ )into MATHREPL environments
|
||||
- s/\\begin{MATHMODE}((?:(.(?!(?<!\\)\&|\\\\))*)?)\\end{MATHMODE}/\\begin{$MATHREPL}$1\\end{$MATHREPL}/sg;
|
||||
+ 1 while s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}((?:.(?!(?:\\end\{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}|\\begin\{MATHMODE})))*?)\\end\{MATHMODE}/\\begin{$1}$2\\end{$1}/s;
|
||||
+ 1 while s/\\begin\{MATHMODE}((?:.(?!\\end\{MATHMODE}))*?)\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}/\\begin{$2}$1\\end{$2}/s;
|
||||
+ # convert remaining \begin\{MATHMODE} \end{MATHMODE} (and not containing & or \\ )into MATHREPL environments
|
||||
+ s/\\begin\{MATHMODE}((?:(.(?!(?<!\\)\&|\\\\))*)?)\\end\{MATHMODE}/\\begin{$MATHREPL}$1\\end{$MATHREPL}/sg;
|
||||
# others into MATHARRREPL
|
||||
- s/\\begin{MATHMODE}(.*?)\\end{MATHMODE}/\\begin{$MATHARRREPL}$1\\end{$MATHARRREPL}/sg;
|
||||
+ s/\\begin\{MATHMODE}(.*?)\\end\{MATHMODE}/\\begin{$MATHARRREPL}$1\\end{$MATHARRREPL}/sg;
|
||||
|
||||
# now look for AUXCMD math-mode pairs which have only comments (or empty lines between them), and remove the added commands
|
||||
- s/\\begin{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end{\1}$AUXCMD\n/$2/sg;
|
||||
+ s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}$AUXCMD\n((?:\s*%.[^\n]*\n)*)\\end{\1}$AUXCMD\n/$2/sg;
|
||||
} else {
|
||||
# math modes OFF,WHOLE,COARSE: Convert \MATHBLOCKmath{..} commands back to environments
|
||||
s/\\MATHBLOCK($MATHENV|$MATHARRENV|SQUAREBRACKET)\{($pat6)\}/\\begin{$1}$2\\end{$1}/sg;
|
||||
@@ -2299,18 +2299,18 @@
|
||||
1 while s/(%.*)\\CITEDIF($CITECMD)/$1\\$2/mg ;
|
||||
}
|
||||
# Convert \begin{SQUAREBRACKET} \end{SQUAREBRACKET} into \[ \]
|
||||
- s/\\end{SQUAREBRACKET}/\\\]/sg;
|
||||
- s/\\begin{SQUAREBRACKET}/\\\[/sg;
|
||||
+ s/\\end\{SQUAREBRACKET}/\\\]/sg;
|
||||
+ s/\\begin\{SQUAREBRACKET}/\\\[/sg;
|
||||
# 4. Convert \begin{DOLLARDOLLAR} \end{DOLLARDOLLAR} into $$ $$
|
||||
s/\\begin\{DOLLARDOLLAR\}(.*?)\\end\{DOLLARDOLLAR\}/\$\$$1\$\$/sg;
|
||||
# 5. Convert \SUPERSCRIPTNB{n} into ^n and \SUPERSCRIPT{nn} into ^{nnn}
|
||||
- 1 while s/\\SUPERSCRIPTNB{($pat0)}/^$1/g ;
|
||||
- 1 while s/\\SUPERSCRIPT{($pat6)}/^{$1}/g ;
|
||||
+ 1 while s/\\SUPERSCRIPTNB\{($pat0)}/^$1/g ;
|
||||
+ 1 while s/\\SUPERSCRIPT\{($pat6)}/^{$1}/g ;
|
||||
# Convert \SUBSCRIPNB{n} into _n and \SUBCRIPT{nn} into _{nnn}
|
||||
- 1 while s/\\SUBSCRIPTNB{($pat0)}/_$1/g ;
|
||||
- 1 while s/\\SUBSCRIPT{($pat6)}/_{$1}/g ;
|
||||
+ 1 while s/\\SUBSCRIPTNB\{($pat0)}/_$1/g ;
|
||||
+ 1 while s/\\SUBSCRIPT\{($pat6)}/_{$1}/g ;
|
||||
# Change \QLEFTBRACE, \QRIGHTBRACE to \{,\}
|
||||
- s/\\QLEFTBRACE /\\{/sg;
|
||||
+ s/\\QLEFTBRACE /\\\{/sg;
|
||||
s/\\QRIGHTBRACE /\\}/sg;
|
||||
|
||||
return;
|
|
@ -0,0 +1,39 @@
|
|||
--- latexpand.old 2015-12-14 14:51:31.175864811 -0500
|
||||
+++ latexpand 2015-12-14 14:52:58.631365447 -0500
|
||||
@@ -83,7 +83,7 @@ sub process_file
|
||||
# ignored by LaTeX, but we don't allow anything before
|
||||
# to avoid e.g. \verb|\end{document}| from terminating
|
||||
# the file.
|
||||
- if (!$keep_comments && $line =~ /^[ \t]*\\end{document}/) {
|
||||
+ if (!$keep_comments && $line =~ /^[ \t]*\\end\{document}/) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,8 @@ sub process_file
|
||||
|
||||
sub process_line
|
||||
{
|
||||
- my ($_, $prefix) = @_;
|
||||
+ my ($line, $prefix, $file) = @_;
|
||||
+ $_ = $line;
|
||||
unless ($keep_comments) {
|
||||
if ($empty_comments) {
|
||||
s/^%.*$/%/;
|
||||
@@ -134,7 +135,7 @@ sub process_line
|
||||
if ($expand_usepackage) {
|
||||
# Don't bother with before and after text, we just require the
|
||||
# usepackage to be alone on its line.
|
||||
- if (my ($package_name) = /^\s*\\usepackage{([^}]*)}\s*$/) {
|
||||
+ if (my ($package_name) = /^\s*\\usepackage\{([^}]*)}\s*$/) {
|
||||
my $full = find_file($package_name . ".sty", $TEXINPUTS);
|
||||
if ($full) {
|
||||
say $prefix . "Found package file: $full\n";
|
||||
@@ -147,7 +148,7 @@ sub process_line
|
||||
}
|
||||
if ($expand_bbl) {
|
||||
if (my ($before, $bib_name, $after)
|
||||
- = /^(.*)\\bibliography{([^}]*)}(.*)$/) {
|
||||
+ = /^(.*)\\bibliography\{([^}]*)}(.*)$/) {
|
||||
# The BBL file is not necessarily $bib_name.
|
||||
# Take it from the command-line.
|
||||
print $before . $nl;
|
|
@ -0,0 +1,53 @@
|
|||
diff -up ./thumbpdf.pl.fix ./thumbpdf.pl
|
||||
--- ./thumbpdf.pl.fix 2016-02-16 14:43:35.161557949 -0500
|
||||
+++ ./thumbpdf.pl 2016-02-16 14:44:58.346003794 -0500
|
||||
@@ -937,6 +937,16 @@ if ($::opt_makedata)
|
||||
$objno[$count] = $1;
|
||||
$getobjindex[$1] = $count;
|
||||
$objdict[$count] = ($2); # boolean (if $2 exists)
|
||||
+ if (!$objdict[$count]) {
|
||||
+ # check for << on thext line, new PDF-X/2014
|
||||
+ $_ = <PDF>;
|
||||
+ if (/^<<$/) {
|
||||
+ $objdict[$count] = 1;
|
||||
+ $lineno++;
|
||||
+ $_ = <PDF>;
|
||||
+ $lineno++;
|
||||
+ }
|
||||
+ }
|
||||
my $stream = 0;
|
||||
print "* obj $objno[$count]" .
|
||||
(($objdict[$count]) ? " (dict)" : "") .
|
||||
@@ -944,18 +954,18 @@ if ($::opt_makedata)
|
||||
|
||||
# get obj
|
||||
$objtext[$count] = "";
|
||||
- while (<PDF>)
|
||||
+ while ($_)
|
||||
{
|
||||
- $lineno++;
|
||||
-
|
||||
if ($objdict[$count])
|
||||
{
|
||||
if (/^>>/)
|
||||
{
|
||||
last if /^>>\s+endobj$/; # obj without stream
|
||||
|
||||
- # get stream
|
||||
$_ = <PDF>; $lineno++;
|
||||
+ last if /^endobj$/; # obj without stream, new PDF-X/2014
|
||||
+
|
||||
+ # get stream
|
||||
/^stream$/ or die "$Error `stream' expected on line $lineno!\n";
|
||||
|
||||
print "* stream\n" if $::opt_debug;
|
||||
@@ -982,6 +992,9 @@ if ($::opt_makedata)
|
||||
last if /^endobj$/;
|
||||
}
|
||||
$objtext[$count] .= $_;
|
||||
+
|
||||
+ $_ = <PDF>;
|
||||
+ $lineno++;
|
||||
}
|
||||
$count++;
|
||||
}
|
10216
texlive.spec
10216
texlive.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue