Resolve named XeTeX fonts through captured resource catalogues

This commit is contained in:
gloamxun committed 2026-11-21 15:54:06 +08:00
1 parent a31de14eb2
commit 767c8ffced
10 files changed
+513 -12

No files matched your search

+12 -2
View File
@@ -2596,7 +2596,14 @@ impl Executor {
self.unread(first)
}
fn filename(&mut self, files: &mut impl SourceProvider) -> Result<std::string::String, Error> {
self.filename_with_quoting(files).map(|(name, _)| name)
}
fn filename_with_quoting(
&mut self,
files: &mut impl SourceProvider,
) -> Result<(String, bool), Error> {
let first = self.expanded_non_space(files)?;
let mut used_quotes = false;
let mut name = std::string::String::new();
if first.token.kind.begin_group() {
loop {
@@ -2614,7 +2621,10 @@ impl Executor {
let mut quoted = false;
while let Some(token) = next {
match token.token.kind {
TokenKind::Character('"', CatCode::Other) => quoted = !quoted,
TokenKind::Character('"', CatCode::Other) => {
quoted = !quoted;
used_quotes = true;
}
TokenKind::Character(' ', CatCode::Space) if quoted => name.push(' '),
TokenKind::Character(_, CatCode::Space) => break,
TokenKind::Character(c, CatCode::Letter | CatCode::Other) => name.push(c),
@@ -2632,7 +2642,7 @@ impl Executor {
if name.is_empty() {
return self.fail("empty filename");
}
self.decode_filename(name)
self.decode_filename(name).map(|name| (name, used_quotes))
}
fn decode_filename(&self, name: String) -> Result<String, Error> {
if self.state.input_profile() == super::InputProfile::TeX8Bit {