Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

calling luaotfload.main() twice #390

Closed
davidcarlisle opened this issue Dec 6, 2016 · 0 comments
Closed

calling luaotfload.main() twice #390

davidcarlisle opened this issue Dec 6, 2016 · 0 comments

Comments

@davidcarlisle
Copy link
Member

This is related to the closed pull request #323 but perhaps with slightly different motivation.

If luaotfload is called from tex via \RequirePackage{luaotfload} or similar then the usual latex mechanisms mean it is safe to do twice, with the second being a no-op.

If you initialise directly from lua the sequence is


  require('luaotfload-main')
  local _void = luaotfload.main ()

But if you do that twice, the require mechanism only loads the package the first time but main() dies the second time with


Module luatexbase Error: Unable to create callback `luaotfload.patch_font':
(luatexbase)             callback type disallowed as name on input line 49

Would it be possible for luaotfload.main () to check an internal flag and see that luaotfload is already initialised and if so silently do nothing?

The motivation here is that we are considering (finally:-) to make lualatex and xelatex default to Unicode encoding which means in lualatex case adding something to \everyjob to load luaotfload.

I'd hoped to just use lua rather than load a latex package at that point but this issue probably prevents that as having done so, any document using

\usepackage{luaotfload}

dies with the above error.

Can work around that, but it seemed worth putting in a feature request....

@davidcarlisle davidcarlisle changed the title calling luaoatfload.main() twice calling luaotfload.main() twice Dec 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants