I was trying the second and third solutions here error-using-fourierenc-with-koma-script-class-nobreakspace-unavailable-in-encod by @egreg which allows TeX Gyre Schola as text font. The last two give an error only with tex4ht.
-- error --- Can't find/open file `TeXGyreSchola:mode=base;script=latn;language=DFLT;.tfm'
My question is: Could TeX Gyre Schola be used as main text also with tex4ht?
Here is a MWE and the command used to compile it. It compiles OK in lualatex, but not with tex4ht in lua mode.
\documentclass[chapterprefix=false]{scrbook}
\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
%commenting this block makes no difference, but was told to use this
%with tex4ht always, in luamode
\ifdefined\HCode
\usepackage[utf8]{luainputenc}
\fi
%see https://tex.stackexchange.com/questions/329855/error-using-fourierenc-with-koma-script-class-nobreakspace-unavailable-in-encod
\usepackage{unicode-math}
\setmainfont{TeX Gyre Schola}[Scale=0.95]
\setmathfont{TeX Gyre Schola Math}[Scale=0.95]
\begin{document}
\chapter{test}
test Münchener-Straße $a+b=\sum_{i=1}^n x_i\sin y$
\end{document}
Now make4ht --lua -u foo.tex gives
.....
This is LuaTeX, Version 0.95.0 (TeX Live 2016)
......
tex4ht.c (2012-07-25-19:36 kpathsea)
tex4ht -cmozhtf
-utf8
foo
(/usr/local/texlive/2016/texmf-dist/tex4ht/base/unix/tex4ht.env)
(/usr/local/texlive/2016/texmf-dist/tex4ht/ht-fonts/mozilla/charset/unicode.4hf)
sh: 1: .tfm: not found
.....
----------------------------------------------------
--- error --- Can't find/open file `TeXGyreSchola:mode=base;script=latn;language=DFLT;.tfm'
Make4ht: Fatal error. Command tex4ht returned exit code 256
Similarly with the second solution given in the linked to answer:
\documentclass[chapterprefix=false]{scrbook}
\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
%commenting this block makes no difference
\ifdefined\HCode
\usepackage[utf8]{luainputenc}
\fi
%see https://tex.stackexchange.com/questions/329855/error-using-fourierenc-with-koma-script-class-nobreakspace-unavailable-in-encod
\usepackage{fouriernc} % for math
\usepackage[no-math]{fontspec}
\setmainfont{TeX Gyre Schola}[Scale=0.95]
\begin{document}
\chapter{test}
test Münchener-Straße $a+b=\sum_{i=1}^n x_i\sin y$
\end{document}
make4ht --lua -u foo.tex gives
ex4ht.c (2012-07-25-19:36 kpathsea)
tex4ht -cmozhtf
-utf8
foo1
(/usr/local/texlive/2016/texmf-dist/tex4ht/base/unix/tex4ht.env)
(/usr/local/texlive/2016/texmf-dist/tex4ht/ht-fonts/mozilla/charset/unicode.4hf)
(/usr/local/texlive/2016/texmf-dist/fonts/tfm/public/fourier/fourier-mex.tfm)
--- warning --- Couldn't find font `fourier-mex.htf' (char codes: 33--232)
So now I am using this solution below, which do not use Tex Gyre for tex when compiling with tex4ht and this now works in both lualatex and tex4ht
\documentclass[chapterprefix=false]{scrbook}
\IfFileExists{luatex85.sty}{\usepackage{luatex85}}{}
\usepackage{fouriernc}
\ifdefined\HCode
\usepackage[utf8]{luainputenc}
\else
\usepackage[no-math]{fontspec}
\setmainfont{TeX Gyre Schola}[Scale=0.95]
\fi
\begin{document}
\chapter{test}
test Münchener-Straße $a+b=\sum_{i=1}^n x_i\sin y$
\end{document}
simple to read introduction to fonts for newbies. The whole topic is anything but simple, unfortunately. – cfr Sep 17 '16 at 02:31