Based on the comments received, I've been able to answer my question.
See page 27 of the current manual for microtype. ! pdfTeX error (font
expansion): auto expansion is only possible with scalable fonts.
Automatic font expansion has been improved in pdfTeX 1.40, in that it
now not only works with Type 1 fonts but also with TrueType, OpenType
and even non- embedded fonts. The above error message indicates either
that you are trying to apply expansion to a bitmap (pk) font, which is
still not possible, or that the font isn’t found at all, e.g., because
of missing map entries. – cfr
And so the Computer Modern default is the culprit, since it couldn't have been expanded by the LaTeX Microtype package. Bookman and Newcent had worked only because they called up both a Roman alternative and a Sans alternative (my novel uses both). The other packages had failed because they only implemented their own Roman font, while using my TeX distributions default, Computer Modern in my case.
The solution is to set the default fonts in all my LaTeX Preamble templates (that I use with this machine) to Latin Modern, which has identical metrics, is designed to appear identical, but has [T1]fontenc encoding capabilities, which my Microtype package will handle. PdfLaTeX should not be crashing, even so, but since it does, this is the fix. For posterity and others that might have the same problem, here's the fix to the Preamble segment from the question:
%%%%%% novel project %%%%%%%%%
\documentclass{book}
\usepackage{microtype}
\usepackage[T1]{fontenc}
%%% % FIX: change to [T1]fontenc microtype expandable fonts % %%%
\renewcommand{\ttdefault}{lmtt} % FIX: default Computer Modern TT
% changed to Latin Modern TT (typewriter)
\renewcommand{\rmdefault}{lmr} % FIX: default Computer Modern Roman
% changed to Latin Modern Roman
\renewcommand{\sfdefault}{lmss} %FIX: default Computer Modern Sans Serif
% changed to Latin Modern Sans Serif
% % % % % % % % % % % % % % % % % % %
% % % % % PSFNSS2e font packages % % % % % % % %
% % % % % select one package % % % % % % %
% \usepackage{mathptmx} % Times font, default sans
% \usepackage{charter} % Bitstream's Charter font, default sans
% \usepackage{mathpazo} % Palatino font, default sans
% \usepackage{bookman} % Bookman font, Avant Garde sans
% \usepackage{utopia} % Utopia font, default sans
% \usepackage{chancery} % Zapf Chancery font, default sans
% \usepackage{newcent} % New Century Schoolbook font, Avant Garde sans
% % % SELECT NONE ABOVE TO USE Latin Modern new defaults % % % %
%%%%%%% END PREAMBLE %%%%%%%%%%%%%%%%
Edit:
Fontspec support have been just added to tex4ht, you can get it after TL update. Both XeLaTeX and LuaLaTeX are supported, although the implementation is different for both engines.
If you use non-latin scripts, you need to use a correct Script
option in your font declaration, because all Unicode characters used in the document must be declared first. It is done automatically when you use the Script
option.
\documentclass{article}
\usepackage{fontspec}
% \setmainfont{TeX Gyre Termes}
\usepackage{polyglossia}
\setmainlanguage{czech}
\setotherlanguages{greek,russian,hindi}
\newfontfamily\greekfont{Linux Libertine O}[Script=Greek]
\newfontfamily\russianfont{Linux Libertine O}[Script=Cyrillic]
\newfontfamily\hindifont{Siddhanta}[Script=Devanagari]
\begin{document}
Příliš \textit{žluťoučký} kůň \textbf{úpěl} \textsc{ďábelské} ódy.
\begin{greek}
Η Πράγα (τσέχικα: Praha), είναι η πρωτεύουσα και μεγαλύτερη πόλη
της Τσεχίας. Χτισμένη στον ποταμό Μολδάβα (Vltava), στην κεντρική Βοημία,
έχει 1,2 εκατομμύριο κατοίκους. Αποκαλείται επίσης «η χρυσή πόλη» και «μητέρα
των πόλεων». Από το 1992, το ιστορικό κέντρο της Πράγας ανήκει στον κατάλογο
μνημείων παγκόσμιας κληρονομιάς της UNESCO.
\end{greek}
\begin{russian}
Пра́га (чеш. Praha [ˈpraɦa]) — город и столица Чехии; административный центр
Среднечешского края и двух его районов — Прага-Восток и Прага-Запад. Образует
самостоятельную административную единицу страны.
\end{russian}
\begin{hindi}
प्राग युरोप के चेकोस्लोवाकिया देश की राजधानी है।
\end{hindi}
\end{document}
The resulting HTML document:
[Old answer]
The convertor from DVI
to HTML
doesn't support OpenType fonts, which is automatically selected when the Fontspec
package is loaded. This is well known tex4ht
bug and also one which is hardest to fix.
There are two possible workarounds, both of them require modification of the document, unfortunately.
First is to use conditionally luainputenc
package:
\documentclass[11pt]{article}%
\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
\ifdefined\HCode
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\else
\usepackage{fontspec}
\fi
\begin{document}
test
příliš žluťoučký kůň úpěl \textit{ďábelské ódy}
\end{document}
the other option is to use alternative4ht
package from helpers4ht bundle, which contains special configuration for fontspec
with tex4ht
:
\documentclass[11pt]{article}%
\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
\usepackage{alternative4ht}
\altusepackage{fontspec}
\begin{document}
test
příliš žluťoučký kůň úpěl \textit{ďábelské ódy}
\end{document}
you can see more features in this document
Best Answer
I found the solution: Lua uses a font name data base, which I had to update using the command: