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

calling luaotfload.main() twice #390

@davidcarlisle

Description

@davidcarlisle

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....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions