Font Handling in XeTeX
Does it produce TFM file level information on the fly during typesetting?
No, XeTeX reads font metrics directly during typesetting (with the support of third party libraries), no “internal” TFM is generated for what XeTeX calls native fonts.
is TFM format enough to represent all necessary information required for typesetting documents using OpenType or TrueType fonts?
No, apart from the limitation on the number of glyphs represented by TFM files (which can be, more or less, eliminated e.g. Omega’s OFM files), OpenType provide more advanced typographic features far beyond the ligaturing mechanisms supported by TFM format.
… does it mean that unless a font is available on both in Linux and Mac, I can't compile a .dvi file on Linux and see it in Mac?
That is true, unless you have the exact same font file on the exact same location on both systems, XeTeX’s generated XDV (eXtended DVI) can not be processed on the other system. However, XeTeX’s final output is PDF files which are portable, the XDV files are regarded as intermediate representation, a mere implementation detail. Note also that this is true for regular DVI files; if you don’t have the same metrics files and fonts on both systems the DVI files can not be processed, DVI is device independent but not portable.
When you load a font in TeX, with a primitive command
\font\foo=bar
to which all high level macros (of LaTeX, for instance) eventually reduce, TeX will read the bar.tfm
file and store in memory the information it contains.
There's no need of TFM files for OpenType and TrueType fonts in XeTeX, because the necessary information is already in the fonts' tables, which XeTeX is able to examine.
Actually XeTeX stores much more metric information than the usual font in TeX, which have normally only seven parameters. With
\font\foo="Linux Libertine O"
XeTeX knows values up to \fontdimen65
for this font. However the limit to seven \fontdimen
parameters is not hardwired in the TFM format and a font can have any number of them (seven is the minimum for a text font, though).
The output format of XeTeX is XDV, an extension of the DVI format, for which no previewer is available. It's impossible to preview an XDV file with Xdvi or other DVI previewers. Indeed the XDV file is handed to xdvipdfmx
during processing for producing a PDF file, which contains all the necessary information to be read on any platform.