Apply Web2C TCX tables to native byte streams
This commit is contained in:
1 parent
3bb2330676
commit
509f229a52
13 files changed
+393
-38
No files matched your search
+11
-2
@@ -30,7 +30,7 @@ fn run() -> Result<(), String> {
|
||||
let mut args = env::args().skip(1);
|
||||
let Some(command) = args.next() else {
|
||||
return Err(
|
||||
"usage: texrra serve [input.tex] [port] | texrra native [--job] [--initex] [--etex] [--dump-format | --load-format FILE] [--step-limit N] [--input-profile tex8bit|unicode|xetex] [--texmf-root DIR] [--input-policy tex|project] [--project-snapshot FILE] [--generated-initial JSON | --observe-generated-initial] [--resource-manifest JSON] [--layout-manifest JSON] [--failure-manifest JSON] input.tex [output.pdf|output.dvi]".into(),
|
||||
"usage: texrra serve [input.tex] [port] | texrra native [--job] [--initex] [--etex] [--dump-format | --load-format FILE] [--step-limit N] [--input-profile tex8bit|unicode|xetex] [--translate-file FILE] [--texmf-root DIR] [--input-policy tex|project] [--project-snapshot FILE] [--generated-initial JSON | --observe-generated-initial] [--resource-manifest JSON] [--layout-manifest JSON] [--failure-manifest JSON] input.tex [output.pdf|output.dvi]".into(),
|
||||
);
|
||||
};
|
||||
if command == "native" {
|
||||
@@ -49,6 +49,7 @@ fn run() -> Result<(), String> {
|
||||
let mut generated_initial = None;
|
||||
let mut observe_generated_initial = false;
|
||||
let mut input_policy_explicit = false;
|
||||
let mut translation_file = None;
|
||||
let mut input_policy = texrra_tex_core::resources::InputPolicy::Project;
|
||||
let input = loop {
|
||||
match args.next().as_deref() {
|
||||
@@ -60,6 +61,11 @@ fn run() -> Result<(), String> {
|
||||
_ => return Err("--input-profile requires tex8bit, unicode or xetex".into()),
|
||||
};
|
||||
}
|
||||
Some("--translate-file") => {
|
||||
translation_file = Some(PathBuf::from(
|
||||
args.next().ok_or("--translate-file requires a TCX filename")?,
|
||||
));
|
||||
}
|
||||
Some("--job") => native_job_target = true,
|
||||
Some("--initex") => initex = true,
|
||||
Some("--etex") => etex = true,
|
||||
@@ -146,7 +152,7 @@ fn run() -> Result<(), String> {
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|| input.with_extension(if dump_format { "tfx" } else { "pdf" }));
|
||||
if args.next().is_some() {
|
||||
return Err("usage: texrra native [--job] [--initex] [--etex] [--dump-format | --load-format FILE] [--step-limit N] [--input-profile tex8bit|unicode|xetex] [--texmf-root DIR] [--input-policy tex|project] [--project-snapshot FILE] [--generated-initial JSON | --observe-generated-initial] [--resource-manifest JSON] [--layout-manifest JSON] [--failure-manifest JSON] input.tex [output.pdf|output.dvi]".into());
|
||||
return Err("usage: texrra native [--job] [--initex] [--etex] [--dump-format | --load-format FILE] [--step-limit N] [--input-profile tex8bit|unicode|xetex] [--translate-file FILE] [--texmf-root DIR] [--input-policy tex|project] [--project-snapshot FILE] [--generated-initial JSON | --observe-generated-initial] [--resource-manifest JSON] [--layout-manifest JSON] [--failure-manifest JSON] input.tex [output.pdf|output.dvi]".into());
|
||||
}
|
||||
let diagnostic = native_compile(
|
||||
&input,
|
||||
@@ -162,6 +168,7 @@ fn run() -> Result<(), String> {
|
||||
observe_generated_initial,
|
||||
input_policy,
|
||||
input_profile,
|
||||
translation_file.as_deref(),
|
||||
native_job_target,
|
||||
dump_format,
|
||||
load_format.as_deref(),
|
||||
@@ -245,6 +252,7 @@ fn native_compile(
|
||||
observe_generated_initial: bool,
|
||||
input_policy: texrra_tex_core::resources::InputPolicy,
|
||||
input_profile: texrra_tex_core::execution::InputProfile,
|
||||
translation_file: Option<&Path>,
|
||||
native_job_target: bool,
|
||||
dump_format: bool,
|
||||
load_format: Option<&Path>,
|
||||
@@ -299,6 +307,7 @@ fn native_compile(
|
||||
};
|
||||
request.etex = etex;
|
||||
request.input_profile = input_profile;
|
||||
request.translation_file = translation_file.map(Path::to_owned);
|
||||
request.limits = limits;
|
||||
request.resource_manifest = manifest.map(Path::to_owned);
|
||||
request.layout_manifest = layout_manifest.map(Path::to_owned);
|
||||
|
||||
Reference in new issue
Block a user