True WYSIWYG LaTeX System
Windows     Mac     Linux  

fontspec-etex

This description is valid for BaKoMa TeX 11.60 and later.

See also Font Wizards

fontspec-etex: Emulation of fontspec for eTeX

BaKoMa TeX beginning from V 11.60 introduces fontspec-etex package,
which is emulation of fontspec package (main font selection under XeTeX and LuaTeX) for eTeX.

Most of font packages use fontspec package conditionally, only under XeTeX and LuaTeX.

However, some package do not have such logics.

fontspec-etex: usage

Package Loading

fontspec-etex package must be loaded in document preable in one of two ways:

\usepackage{fontspec-etex} 	% Native call
or
\usepackage{fontspec}		% Compatibility with fontspec ...

General font selection

There are emulation of following main font selection commands:

  • \setmainfont[<font features>]{<font family>}
  • \setsansfont[<font features>]{<font family>}
  • \setmonofont[<font features>]{<font family>}
  • \fontspec[<font features>]{<font family>}
  • \newfontfamily\fontfam[<font features>]{<font family>}

NOTES:

<font family> - we recommend to use font family but not font name or font file name.

<font features> - is just ignored by fontspec-etex package. fontspec-etex eats options before mandatory argument.
fontspec documentation explain optional argument after mandatory, but really fontspec options understands both positions of optional arguments.

Syntax Emulation
Simplest emulation:
  • \defaultfontfeatures{<font features>}
    Just ignores <font features> argument.
  • \IfFontExistsTF{<font name>}{<true branch>}{<false branch>}
    Always executes <false branch>.

Examples, Compatibilty with XeTeX

What is reason to do such package ?

Now you can make documents in BaKoMa TeX with custom fonts whose may be reproduced under another systems using XeTeX. So, for example, following doucment:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Times New Roman}

\begin{document}

This short article use Times new Roman. fontname=\fontname\font

And small fragment using 

{\fontspec{Comic Sans MS} Comic Sans MS - fontname=\fontname\font}

{\fontspec{Comic Sans MS}\bfseries\selectfont Comic Sans MS - fontname=\fontname\font}

\end{document}

Will be compiled by BaKoMa TeX and will be made with the same fonts using XeLaTeX for example in TeXLive.

However, under XeTeX original fontspec selects fonts using internal XeTeX font selection.
Under e-TeX (BaKoMa TeX) fontspec-etex uses Direct Usage of Windows Fonts in LaTeX documents.

Direct Usage of Windows Fonts in LaTeX documents.

Beginning from BaKoMa TeX 8.40 user can refer Windows font families directly from LaTeX without any setup process.

For example, you can write code like following:

{\fontfamily{@castelar}\selectfont Castelar Font family}
{\fontfamily{@curlz@mt}\selectfont Curlz MT Font Family}
{\fontfamily{@forte}\selectfont Forte Font Family}
NOTE: Font family must be: (1) prefixed by '@'; (2) typeset in lowercase; (3) use '@' instead of SPACE.

Alternatively, TTF file names may be used:

{\fontfamily{@curlz___}\selectfont Curlz MT Font Family}
NOTE: It is not important what TTF file (Regular, Bold, Italic, BoldItalic) is referred, Anyway entire font family is assumed.

In other words, all below links are equivalent:

{\fontfamily{@times@new@roman}\selectfont Times New Roman Font Family}
{\fontfamily{@times}\selectfont Times New Roman Font Family}
{\fontfamily{@timesbd}\selectfont Times New Roman Font Family}
{\fontfamily{@timesi}\selectfont Times New Roman Font Family}
{\fontfamily{@timesbi}\selectfont Times New Roman Font Family}

Technically, BaKoMa TeX intercepts opening of proper FD file and generates all required FD, TFM and VF files automatically.