0

I'm trying to isolate fonts.ptxlua from pitex to access Open/True-Type fonts with the YaX interface. I can load the font correctly; however, as I tried to typeset some proofs, I found that now LuaTeX interprets the UTF8 input as separate characters on input anywhere above the ASCII boundary (i.e. > \char 127), and I expected it to cleanly map from UTF8 input into the corresponding font slots. It seems as if LuaTeX now reads the UTF8 bytes one by one and does not map the upper characters into the corresponding slots.

\input luatex85.sty
\input pitex
\setfont \mainfont:
   name = "Tempora"
   size = 10pt
   bold = Semi
   big  = 50pt

\section{Ordalía tipográfica}

ἐν ἀρχή ἧν ὁ λόγος

\bye

LuaTeX output

Running the same input with a type1 font typesets the Latin text in TeXnANSI and the Greek one is cleanly discarded, as expected.

\input luatex85.sty
\input plnfss
\let\section\textbf
\usefont{LY1}{ptm}{m}{n}
\section{Ordalía tipográfica}

ἐν ἀρχή ἧν ὁ λόγος

\bye

PDFTeX output

The glyphs are there, for they show up if I load the font with \luaotfload. Which details am I missing?

4
  • 3
    base.ptxlua contains a section -- Latin1 to UTF-8. with the probably relevant functions. But why do you want to use this code? pitex is ten years old, written for a much older luatex version. Both the primitives and the lua version have changed quite a bit since then. Jun 22, 2021 at 6:18
  • 3
    as Ulrike says it looks like the code assumes the source is in latin-1 so runs a latin1 to utf-8 conversion via the input buffer callback, you could probably disable that and see what happens.... Jun 22, 2021 at 6:50
  • @DavidCarlisle indeed: disabling pitex.callback.convert does the trick. There is another couple of faulty functions I have to debug, but the font loader now works as expected. I was clearly looking at the wrong place. mulțumesc!
    – jarnosc
    Jun 22, 2021 at 13:46
  • @UlrikeFischer I mean to use this code, as stated above, because I find the YaX/gates approach charming, and the fontloader is a couple of orders of magnitude smaller than luaotfload.
    – jarnosc
    Jun 22, 2021 at 13:46

1 Answer 1

1

This question was solved in the comments by Ulrike Fischer and David Carlisle, so I will migrate the solution to a Community Wiki answer.

The problem is that pitex assumes that the source is in Latin-1, and performs a Latin-1 to UTF-8 conversion on the input buffer. Disabling the functions in the “-- Latin1 to UTF-8” section allows UTF-8 input to work.

pitex has not been updated since 2011, and LuaTeX has changed considerably since then. Consider carefully whether you want to try to patch it yourself and use it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .