XeLaTeX 和 LuaLaTeX 如何扩展 dvi 格式?

XeLaTeX 和 LuaLaTeX 如何扩展 dvi 格式?

DVI 文件格式的结构由 Donald Knuth 在TEX:该计划, Addison-Wesley,1986 年。

虽然 PDF 是主要的输出格式,但 LuaTeX 也可以输出 DVI 文件。这些 DVI 文件与原始规范中的文件有什么不同吗?

XeTeX 可以输出 XDV 文件,这是 DVI 格式的扩展。XDV 格式有文档记录吗?

答案1

我认为 luatex 生成的 dvi 是标准的。

对于 xdv,xetex.web 定义了扩展格式,相关部分为

\yskip\noindent Commands 250--255 are undefined in normal \.{DVI} files, but
the following commands are used in \.{XDV} files.

\yskip\hang\vbox{\halign{#&#\hfil\cr
|define_native_font| 252 & |k[4]| |s[4]| |flags[2]| |l[1]| |n[l]| |i[4]|\cr
& |if (flags and COLORED) then| |rgba[4]|\cr
& |if (flags and EXTEND) then| |extend[4]|\cr
& |if (flags and SLANT) then| |slant[4]|\cr
& |if (flags and EMBOLDEN) then| |embolden[4]|\cr
}}

\yskip\hang|set_glyphs| 253 |w[4]| |k[2]| |xy[8k]| |g[2k]|.

\yskip\noindent Commands 250 and 255 are undefined in normal \.{XDV} files.

@ @d set_char_0=0 {typeset character 0 and move right}
@d set1=128 {typeset a character and move right}
@d set_rule=132 {typeset a rule and move right}
@d put_rule=137 {typeset a rule}
@d nop=138 {no operation}
@d bop=139 {beginning of page}
@d eop=140 {ending of page}
@d push=141 {save the current positions}
@d pop=142 {restore previous positions}
@d right1=143 {move right}
@d w0=147 {move right by |w|}
@d w1=148 {move right and set |w|}
@d x0=152 {move right by |x|}
@d x1=153 {move right and set |x|}
@d down1=157 {move down}
@d y0=161 {move down by |y|}
@d y1=162 {move down and set |y|}
@d z0=166 {move down by |z|}
@d z1=167 {move down and set |z|}
@d fnt_num_0=171 {set current font to 0}
@d fnt1=235 {set current font}
@d xxx1=239 {extension to \.{DVI} primitives}
@d xxx4=242 {potentially long extension to \.{DVI} primitives}
@d fnt_def1=243 {define the meaning of a font number}
@d pre=247 {preamble}
@d post=248 {postamble beginning}
@d post_post=249 {postamble ending}

@d define_native_font=252 {define native font}
@d set_glyphs=253 {sequence of glyphs with individual x-y coordinates}

相关内容