Skip to content

Commit 6da754d

Browse files
authored
Merge pull request #882 from pkgw/texlive-2021
Update to TeXLive 2021
2 parents 8c01b6d + b6d0566 commit 6da754d

119 files changed

Lines changed: 9003 additions & 6867 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ tectonic_bridge_flate = "thiscommit:2021-01-01:eer4ahL4"
134134
tectonic_bridge_graphite2 = "2c1ffcd702a662c003bd3d7d0ca4d169784cb6ad"
135135
tectonic_bridge_harfbuzz = "2c1ffcd702a662c003bd3d7d0ca4d169784cb6ad"
136136
tectonic_bridge_icu = "2c1ffcd702a662c003bd3d7d0ca4d169784cb6ad"
137-
tectonic_bundles = "207e6e796b1827330ee03a4c395fe6db059bddd9"
137+
tectonic_bundles = "thiscommit:2022-03-29:SFnXSaL"
138138
tectonic_cfg_support = "thiscommit:aeRoo7oa"
139139
tectonic_dep_support = "5faf4205bdd3d31101b749fc32857dd746f9e5bc"
140140
tectonic_docmodel = "thiscommit:2022-02-20:2SpEl4c"

crates/bridge_harfbuzz/harfbuzz

Submodule harfbuzz updated 649 files

crates/bundles/src/lib.rs

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,47 @@ impl<B: Bundle + ?Sized> Bundle for Box<B> {
9595
}
9696
}
9797

98-
/// The URL of the default bundle.
98+
/// Get the URL of the default bundle.
9999
///
100-
/// This is a hardcoded URL of a default bundle that will provide some
100+
/// This is a mostly-hardcoded URL of a default bundle that will provide some
101101
/// "sensible" set of TeX support files. The higher-level `tectonic` crate
102102
/// provides a configuration mechanism to allow the user to override this
103103
/// setting, so you should use that if you are in a position to do so.
104104
///
105-
/// This URL will be embedded in the binaries that you create, which may be used
106-
/// for years into the future, so it needs to be durable and reliable. We used
107-
/// `archive.org` for a while, but it had low-level reliability problems and was
108-
/// blocked in China. We now use a custom webservice.
109-
pub const FALLBACK_BUNDLE_URL: &str = "https://relay.fullyjustified.net/default_bundle.tar";
105+
/// The URL depends on the format version supported by the engine, since that
106+
/// roughly corresponds to a TeXLive version, and the engine and TeXLive files
107+
/// are fairly closely coupled.
108+
///
109+
/// The URL template used in this function will be embedded in the binaries that
110+
/// you create, which may be used for years into the future, so it needs to be
111+
/// durable and reliable. We used `archive.org` for a while, but it had
112+
/// low-level reliability problems and was blocked in China. We now use a custom
113+
/// webservice.
114+
pub fn get_fallback_bundle_url(format_version: u32) -> String {
115+
// Format version 32 (TeXLive 2021) was when we introduced versioning to the
116+
// URL.
117+
if format_version < 32 {
118+
"https://relay.fullyjustified.net/default_bundle.tar".to_owned()
119+
} else {
120+
format!(
121+
"https://relay.fullyjustified.net/default_bundle_v{}.tar",
122+
format_version
123+
)
124+
}
125+
}
110126

111127
/// Open the fallback bundle.
112128
///
113129
/// This is essentially the default Tectonic bundle, but the higher-level
114130
/// `tectonic` crate provides a configuration mechanism to allow the user to
115-
/// override the [`FALLBACK_BUNDLE_URL`] setting, and that should be preferred
116-
/// if you’re in a position to use it.
131+
/// override the bundle URL setting, and that should be preferred if you’re in a
132+
/// position to use it.
117133
pub fn get_fallback_bundle(
134+
format_version: u32,
118135
only_cached: bool,
119136
status: &mut dyn StatusBackend,
120137
) -> Result<cache::CachingBundle<itar::IndexedTarBackend>> {
138+
let url = get_fallback_bundle_url(format_version);
121139
let mut cache = cache::Cache::get_user_default()?;
122-
cache.open(FALLBACK_BUNDLE_URL, only_cached, status)
140+
cache.open(&url, only_cached, status)
123141
}

crates/engine_xdvipdfmx/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ cc = "^1.0.66"
3030
[package.metadata.internal_dep_versions]
3131
tectonic_bridge_core = "thiscommit:2021-01-17:fohCh1sh"
3232
tectonic_errors = "5c9ba661edf5ef669f24f9904f99cca369d999e7"
33-
tectonic_pdf_io = "620fe47e87000cede22d5e5eafa0fda81f28b402"
33+
tectonic_pdf_io = "thiscommit:2022-03-29:6nizWic"

crates/engine_xdvipdfmx/xdvipdfmx/dvipdfmx.c

Lines changed: 24 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ static int pdf_version_major = 1;
7777
static int pdf_version_minor = 5;
7878
static int compression_level = 9;
7979

80+
static double annot_grow_x = 0.0;
81+
static double annot_grow_y = 0.0;
8082
static char ignore_colors = 0;
81-
static double annot_grow = 0.0;
8283
static int bookmark_open = 0;
8384
static double mag = 1.0;
8485
static int font_dpi = 600;
@@ -111,80 +112,6 @@ static double x_offset = 72.0;
111112
static double y_offset = 72.0;
112113
static int translate_origin = 0;
113114

114-
115-
/* XXX: there are four quasi-redundant versions of this; grp for K_UNIT__PT */
116-
static int
117-
read_length (double *vp, const char **pp, const char *endptr)
118-
{
119-
char *q;
120-
const char *p = *pp;
121-
double v, u = 1.0;
122-
const char *_ukeys[] = {
123-
#define K_UNIT__PT 0
124-
#define K_UNIT__IN 1
125-
#define K_UNIT__CM 2
126-
#define K_UNIT__MM 3
127-
#define K_UNIT__BP 4
128-
#define K_UNIT__PC 5
129-
#define K_UNIT__DD 6
130-
#define K_UNIT__CC 7
131-
#define K_UNIT__SP 8
132-
"pt", "in", "cm", "mm", "bp", "pc", "dd", "cc", "sp",
133-
NULL
134-
};
135-
int k, error = 0;
136-
137-
q = parse_float_decimal(&p, endptr);
138-
if (!q) {
139-
*vp = 0.0; *pp = p;
140-
return -1;
141-
}
142-
143-
v = atof(q);
144-
free(q);
145-
146-
skip_white(&p, endptr);
147-
q = parse_c_ident(&p, endptr);
148-
if (q) {
149-
char *qq = q;
150-
if (strlen(q) >= strlen("true") &&
151-
!memcmp(q, "true", strlen("true"))) {
152-
q += strlen("true"); /* just skip "true" */
153-
}
154-
if (strlen(q) == 0) {
155-
free(qq);
156-
skip_white(&p, endptr);
157-
qq = q = parse_c_ident(&p, endptr);
158-
}
159-
if (q) {
160-
for (k = 0; _ukeys[k] && strcmp(_ukeys[k], q); k++);
161-
switch (k) {
162-
case K_UNIT__PT: u *= 72.0 / 72.27; break;
163-
case K_UNIT__IN: u *= 72.0; break;
164-
case K_UNIT__CM: u *= 72.0 / 2.54 ; break;
165-
case K_UNIT__MM: u *= 72.0 / 25.4 ; break;
166-
case K_UNIT__BP: u *= 1.0 ; break;
167-
case K_UNIT__PC: u *= 12.0 * 72.0 / 72.27 ; break;
168-
case K_UNIT__DD: u *= 1238.0 / 1157.0 * 72.0 / 72.27 ; break;
169-
case K_UNIT__CC: u *= 12.0 * 1238.0 / 1157.0 * 72.0 / 72.27 ; break;
170-
case K_UNIT__SP: u *= 72.0 / (72.27 * 65536) ; break;
171-
default:
172-
dpx_warning("Unknown unit of measure: %s", q);
173-
error = -1;
174-
break;
175-
}
176-
free(qq);
177-
}
178-
else {
179-
dpx_warning("Missing unit of measure after \"true\"");
180-
error = -1;
181-
}
182-
}
183-
184-
*vp = v * u; *pp = p;
185-
return error;
186-
}
187-
188115
static void
189116
select_paper (const char *paperspec)
190117
{
@@ -201,9 +128,9 @@ select_paper (const char *paperspec)
201128
endptr = p + strlen(p);
202129
if (!comma)
203130
_tt_abort("Unrecognized paper format: %s", paperspec);
204-
error = read_length(&paper_width, &p, comma);
131+
error = dpx_util_read_length(&paper_width, 1.0, &p, comma);
205132
p = comma + 1;
206-
error = read_length(&paper_height, &p, endptr);
133+
error = dpx_util_read_length(&paper_height, 1.0, &p, endptr);
207134
}
208135
if (error || paper_width <= 0.0 || paper_height <= 0.0)
209136
_tt_abort("Invalid paper size: %s (%.2fx%.2f)", paperspec, paper_width, paper_height);
@@ -321,7 +248,10 @@ do_dvi_pages (void)
321248
xo = x_offset; yo = y_offset;
322249
dvi_scan_specials(page_no,
323250
&w, &h, &xo, &yo, &lm,
324-
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
251+
/* No need for encryption options */
252+
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
253+
/* No trailer IDs */
254+
NULL, NULL, NULL);
325255
if (lm != landscape_mode) { /* already swapped for the first page */
326256
SWAP(w, h);
327257
landscape_mode = lm;
@@ -438,9 +368,9 @@ dvipdfmx_main (
438368
* arguments, so we emulate the default TeXLive config file by copying those
439369
* code bits. */
440370

441-
pdf_set_version (5);
442371
select_paper(paperspec);
443-
annot_grow = 0;
372+
annot_grow_x = 0;
373+
annot_grow_y = 0;
444374
bookmark_open = 0;
445375
key_bits = 40;
446376
permission = 0x003C;
@@ -459,7 +389,6 @@ dvipdfmx_main (
459389
/*kpse_init_prog("", font_dpi, NULL, NULL);
460390
kpse_set_program_enabled(kpse_pk_format, true, kpse_src_texmf_cnf);*/
461391
pdf_font_set_dpi(font_dpi);
462-
dpx_delete_old_cache(image_cache_life);
463392

464393
{
465394
/* Dependency between DVI and PDF side is rather complicated... */
@@ -476,6 +405,15 @@ dvipdfmx_main (
476405
&has_id, id1, id2);
477406
}
478407

408+
settings.ver_major = pdf_version_major;
409+
settings.ver_minor = pdf_version_minor;
410+
411+
if (!has_id) {
412+
const char *producer = "xdvipdfmx-0.1, Copyright 2002-2021 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata";
413+
compute_id_string(id1, producer, dvi_filename, pdf_filename);
414+
memcpy(id2, id1, 16);
415+
}
416+
479417
/* Encryption and Other Settings */
480418
{
481419
memset(&settings.encrypt, 0, sizeof(struct pdf_enc_setting));
@@ -488,6 +426,8 @@ dvipdfmx_main (
488426
settings.encrypt.oplain = oplain;
489427
}
490428

429+
settings.object.compression_level = compress ? compression_level : 0;
430+
491431
if (opt_flags & OPT_PDFOBJ_NO_OBJSTM) {
492432
settings.object.enable_objstm = 0;
493433
} else {
@@ -508,32 +448,17 @@ dvipdfmx_main (
508448
}
509449
settings.media_width = paper_width;
510450
settings.media_height = paper_height;
511-
settings.annot_grow_amount = annot_grow;
451+
settings.annot_grow_amount.x = annot_grow_x;
452+
settings.annot_grow_amount.y = annot_grow_y;
512453
settings.outline_open_depth = bookmark_open;
513454
settings.check_gotos = !(opt_flags & OPT_PDFDOC_NO_DEST_REMOVE);
455+
settings.enable_manual_thumb = enable_thumbnail;
514456

515457
settings.device.dvi2pts = dvi2pts;
516458
settings.device.precision = pdfdecimaldigits;
517459
settings.device.ignore_colors = ignore_colors;
518460

519461
set_distiller_template(filter_template);
520-
/* This must come before pdf_open_document where initialization
521-
* of pdf_enc takes place.
522-
*/
523-
pdf_init_device(dvi2pts, pdfdecimaldigits, ignore_colors);
524-
{
525-
int version = pdf_version_major * 10 + pdf_version_minor;
526-
pdf_set_version(version);
527-
}
528-
pdf_set_compression(compress ? compression_level : 0);
529-
if (enable_thumbnail)
530-
pdf_doc_enable_manual_thumbnails();
531-
532-
if (!has_id) {
533-
const char *producer = "xdvipdfmx-0.1, Copyright 2002-2015 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata";
534-
compute_id_string(id1, producer, dvi_filename, pdf_filename);
535-
memcpy(id2, id1, 16);
536-
}
537462

538463
/* Initialize PDF document creation routine. */
539464
pdf_open_document(pdf_filename, creator, id1, id2, settings);

crates/engine_xetex/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ tectonic_bridge_graphite2 = "2c1ffcd702a662c003bd3d7d0ca4d169784cb6ad"
4545
tectonic_bridge_harfbuzz = "2c1ffcd702a662c003bd3d7d0ca4d169784cb6ad"
4646
tectonic_cfg_support = "9d5feb40c7ac6958ee3c50604af9271eb2db2b20"
4747
tectonic_errors = "317ae79ceaa2593fb56090e37bf1f5cc24213dd9"
48-
tectonic_pdf_io = "620fe47e87000cede22d5e5eafa0fda81f28b402"
49-
tectonic_xetex_layout = "2c1ffcd702a662c003bd3d7d0ca4d169784cb6ad"
48+
tectonic_pdf_io = "thiscommit:2022-03-29:jBgdLrP"
49+
tectonic_xetex_layout = "thiscommit:2022-03-29:ovKl9nt"

crates/engine_xetex/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use tectonic_errors::prelude::*;
3535
//
3636
// DEVELOPER NOTE: if you change this, rerun cbindgen! This value is exported
3737
// into the C/C++ code as a #define.
38-
pub const FORMAT_SERIAL: u32 = 31;
38+
pub const FORMAT_SERIAL: u32 = 32;
3939

4040
/// A possible outcome from a (Xe)TeX engine invocation.
4141
///

0 commit comments

Comments
 (0)