Re: Choice of processor
David Carlisle <[email protected]> Wed, 5 Mar 2025 11:24:27 +0000
| Newsgroups | gmane.comp.tex.texhax |
|---|---|
| Message-ID | <CAEW6iOihneqQbwN4w+DONM+kpoOaKr_YhtF0Hn5p6Pvfrc_Vcw@mail.gmail.com> |
On Wed, 5 Mar 2025 at 11:07, Philip Taylor <[email protected]> wrote: > OK, adding "\input luaotfload.sty" appears to allow access to some (but > not yet all) system fonts (LuaTeX states that it cannot find "Avenir LT Std > 45 Book") > > luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font > "Avenir LT Std 45 Book" not found. > > luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate. > > ! Font \mlfont=Avenir LT Std 45 Book at 6pt not loadable: metric data not > found > > or bad. > > l.66 \font \mlfont = "Avenir LT Std 45 Book" at 6 pt > > — the reason for that remains to be investigated. However, I now have > another problem. I make frequent use of XeTeX's \strcmp primitive — is > there a LuaTeX equivalent ? > LaTeX has been providing a strcmp implementation in Lua for decades so for the vast majority of users such issues (the point of the thread started by Peter) simply don't exist. If you choose to use plain tex and ignore decades of development by other people that's fine but you then need to actually do the work of doing those implementations, but to give you a start latex uses \begin{macro}[no-user-doc]{\tex_strcmp:D} % Compare two strings, expanding to |0| if they are equal, % |-1| if the first one is smaller and |1| if the second one is smaller. % Here \enquote{smaller} refers to codepoint order which does not correspond to % the user expected order for most non-ASCII strings. % \begin{macrocode} local minus_tok = token_new(string.byte'-', 12) local zero_tok = token_new(string.byte'0', 12) local one_tok = token_new(string.byte'1', 12) luacmd('tex_strcmp:D', function() local first = scan_string() local second = scan_string() if first < second then put_next(minus_tok, one_tok) else put_next(first == second and zero_tok or one_tok) end end, 'global') % \end{macrocode} % \end{macro} You might want to call it \strcmp rather than \tex_strcmp:D but otherwise it should work put it inside \directlua{...} David I removed tex-live list, it's unrelated to tex-live and I'm sure Karl has other things to do with TL2025 release > -- > *Philip Taylor* >