Include unboxed inline math in pdfTeX font expansion
This commit is contained in:
1 parent
8cd0263b97
commit
0f10163b5b
4 files changed
+91
-8
No files matched your search
@@ -461,6 +461,40 @@ fn font_expansion_codes_invalidate_cached_break_geometry() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn font_expansion_uses_unboxed_inline_math() {
|
||||
let source = r"\catcode123=1 \catcode125=2 \catcode36=3
|
||||
\font\roman=cmr10 \roman
|
||||
\textfont0=\roman \scriptfont0=\roman \scriptscriptfont0=\roman
|
||||
\font\symbol=cmsy10
|
||||
\textfont2=\symbol \scriptfont2=\symbol \scriptscriptfont2=\symbol
|
||||
\font\extension=cmex10
|
||||
\textfont3=\extension \scriptfont3=\extension \scriptscriptfont3=\extension
|
||||
\mathcode65=65
|
||||
\pdfoutput=1 \pdffontexpand\roman 100 100 10 autoexpand
|
||||
\hsize=31pt \parfillskip=0pt plus1fil \rightskip=0pt plus1fil
|
||||
\pretolerance=100 \tolerance=200 \linepenalty=10 \baselineskip=12pt
|
||||
\showboxbreadth=99 \showboxdepth=99
|
||||
\setbox0=\vbox{\pdfadjustspacing=1 \noindent $AA$ $AA$\par}
|
||||
\setbox1=\vbox{\pdfadjustspacing=2 \noindent $AA$ $AA$\par}
|
||||
\setbox2=\vbox{\pdfadjustspacing=2 \noindent \hbox{$AA$} $AA$\par}
|
||||
\showbox0 \showbox1 \showbox2
|
||||
\end
|
||||
";
|
||||
let executed = execute(source, &mut Host::default()).unwrap();
|
||||
let lists = reports(&executed);
|
||||
assert_eq!(lists.len(), 3);
|
||||
for (report, (line_count, expanded_chars)) in lists.iter().zip([(2, 0), (1, 4), (2, 0)]) {
|
||||
assert_eq!(
|
||||
report.text.lines().filter(|line| line.starts_with(r".\hbox(")).count(),
|
||||
line_count,
|
||||
"{}",
|
||||
report.text
|
||||
);
|
||||
assert_eq!(report.text.matches(r"\roman (-80) A").count(), expanded_chars);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn autoexpand_assigns_font_numbers_and_shares_parameters() {
|
||||
let declaration = r"\catcode123=1 \catcode125=2
|
||||
|
||||
Reference in new issue
Block a user