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

loading another fontloader #344

Closed
u-fischer opened this issue Apr 26, 2016 · 8 comments
Closed

loading another fontloader #344

u-fischer opened this issue Apr 26, 2016 · 8 comments
Labels

Comments

@u-fischer
Copy link

According to the documentation (2016/04/21 v2.7) and luaotfload.conf.main5.pdf it should be possible to load another fontloader with a suitable setting in luaotfload.conf

I tried various variants and they all failed with one exception

[run]
fontloader = reference
;fontloader = default
;fontloader = context
;fontloader = context:
;fontloader= context:D:context-minimals\context\tex\texmf-context

reference gives the error:

luaotfload | init : Using predefined fontloader “reference
”....016/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:114: module 'fontloader-reference.lua' not found:

which is surprising as kpsewhich finds the lua without problems:

G:\Z-Test>kpsewhich fontloader-reference.lua
d:/texlive/2016/texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua

fontloader=default and fontloader=context fails with similar messages (not so surprising as the files are not there).

fontloader=context: loads the files from the texlive context.

I failed to find a way to tell luaotfload the path to my standalone context. Depending on the path (the colons) luaotfload used the context in texlive or the default fontloader.

@phi-gamma
Copy link
Member

···<date: 2016-04-26, Tuesday>···<from: u-fischer>···

reference gives the error:

luaotfload | init : Using predefined fontloader “reference
”....016/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:114: module 'fontloader-reference.lua' not found:

Works here.

We’re just using require() like good Lua citizens. If it
can’t finde the reference loader it shouldn’t be able to find any
of the other Luaotfload files either.

Please post the output of this snippet fed into texlua:

#!/usr/bin/env texlua
kpse.set_program_name "luatex"
print("find", kpse.find_file "fontloader-reference.lua")
print("load", pcall(require, "fontloader-reference.lua"))

@u-fischer
Copy link
Author

It works for the "simple" value if I add a semikolon at the end:

fontloader = reference;

Perhaps a (windows) line ending issue?

I couldn't yet get it working to setup a path to context-minimals. I tried all sort of variants of

fontloader= context:C/Users/USER/context/tex/texmf-context;

but nothing worked. I get messages about empty prefix and then non-existing pathes:

luaotfload | init : Loading Context files under prefix “”.
...
luaotfload | load : Non-existant path “tex/context/base” specified, ignoring

@u-fischer
Copy link
Author

The following syntax seems to work:

fontloader=context: C:/Users/USER/context/tex/texmf-context;

(the space after the colon is important.) Then luaotfload started to use the right prefix.

But it still didn't find the files as luaotfload-init.lua declares

local ctx = "tex/context/base"

But actually the files are in base/mkiv. After using

local ctx = "tex/context/base/mkiv"

it worked.

@phi-gamma
Copy link
Member

···<date: 2016-04-26, Tuesday>···<from: u-fischer>···

The following syntax seems to work:

fontloader=context: C:/Users/USER/context/tex/texmf-context;

(the space after the colon is important.) Then luaotfload
started to use the right prefix.

The semicolon is the comment character and unnecessary at the
end. Also the parser is newline agnostic and should work with DOS
text.

But it still didn't find the files as luaotfload-init.lua declares

local ctx = "tex/context/base"

But actually the files are in base/mkiv.

Hans split the package by format recently.

@u-fischer
Copy link
Author

The semicolon is the comment character ...

Yes I know. After I started to suspect that the end-of-line could be a problem I used it like a % in tex to hide it.

Also the parser is newline agnostic and should work with DOS text.

But it doesn't. I just tried it out: With Unix line endings (LF) fontloader = reference works fine, with CR+LF it breaks and I have to use the semicolon.

Hans split the package by format recently.

That explains it. Can one inject local ctx = "tex/context/base/mkiv" somewhere without having to change the original files?

@phi-gamma
Copy link
Member

···<date: 2016-04-27, Wednesday>···<from: u-fischer>···

Also the parser is newline agnostic and should work with DOS text.

But it doesn't. I just tried it out: With Unix line endings (LF) fontloader = reference works fine, with CR+LF it breaks and I have to use the semicolon.

I can reproduce that. Somehow the \r bypasses the parser.

phi-gamma added a commit to phi-gamma/luaotfload that referenced this issue Apr 27, 2016
Fix issue lualatex#344

An incomplete matching rule for determining configuration values caused
return bytes (0x0d) to leak into the configuration if Windows style
newlines are used. Fixed by adapting the pattern.
phi-gamma added a commit to phi-gamma/luaotfload that referenced this issue Apr 27, 2016
Fix issue lualatex#344

An incomplete matching rule for determining configuration values caused
return bytes (0x0d) to leak into the configuration if Windows style
newlines are used. Fixed by adapting the pattern.
@u-fischer
Copy link
Author

With the update from today CF+LF ending is no longer a problem. But it still doesn't work to load the fontloader from context-minimals with

fontloader= context:D:/context-minimals/context/tex/texmf-context

I had to change again line 226 from luaotfload-init.lua to

local ctx = "tex/context/base/mkiv"

(then it worked even without the space after the first colon).

phi-gamma added a commit to phi-gamma/luaotfload that referenced this issue Jun 10, 2016
Fix issue lualatex#344

The paths changed a while ago making a change necessary. We can’t just
replace the path because older versions of the tree would fail,
rendering bisection unusable. We compensate by testing the candidate
directories beforehand.
@phi-gamma
Copy link
Member

Path fixed, please check the new release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants