khaledhosny / harftex

A TeX enginge with embedded HarfBuzz and Lua
GNU General Public License v2.0
30 stars 0 forks source link

does not load ttc fonts #7

Closed emojifreak closed 5 years ago

emojifreak commented 5 years ago

When harflatex (This is HarfTeX, Version 0.3.0 (TeX Live 2020/dev)) processes the following file:

\documentclass{minimal}

\begin{document}
\font\test={name:Cambria:mode=node;}
\test aaa
\end{document}

harflatex produces the following error and does not give a PDF file:

</usr/local/share/fonts/ms/cambria.ttc
! error:  (file /usr/local/share/fonts/ms/cambria.ttc) (type 2): invalid TTC in
dex number -1 (0..1), using index 0 for font Cambria
!  ==> Fatal error occurred, no output PDF file produced!

Cambria is a ttc font bundled with MS Windows 10 (and earlier Windows). As far as I see, any ttc font produces the same error as above.

Both This is LuaTeX, Version 1.10.0 (TeX Live 2019) and This is LuaHBTeX, Version 1.11.1 (TeX Live 2020/dev) can correctly handle the above LaTeX file.

khaledhosny commented 5 years ago

Fixed in master. However this only fixes loading the first cont in the collection, for proper fix see https://github.com/u-fischer/luaotfload/issues/66.

khaledhosny commented 5 years ago

Loading TTC fonts should always work with 0.4.0, even without the luaotfload fix mentioned above.

emojifreak commented 5 years ago

Thanks. I could use Cambria Math having index 2 (in luaotfload-tool) as below.

\documentclass{minimal}
\usepackage{unicode-math}
\setmathfont{Cambria Math}
\setmainfont{Cambria}

\begin{document}
aaa $aaa$
\end{document}
khaledhosny commented 5 years ago

Great, thanks for confirming.