New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with luaotfload 2.6 #717
Comments
Related to gregorio-project#717 lualatex/luaotfload#308 The font table was indexed directly which is unsafe when using Luaotfload. Instead, font.getfont() should be used which is overridden by the fontloader. Due to caching, those accesses are faster too than indexing the font table directly as well as using the builtin font.getfont() API. In order to facilitate future extensions to the code, a number of frequent lookups have been implemented as accessor functions. ---------------------------------------------------- expecting font id expecting name ---------------------------------------------------- get_font_by_name() get_score_font_id() get_font_resources() get_score_font_resources() ---------------------------------------------------- The *score_font* varieties look up the string in the ``score_font`` table first. Since in the majority of cases font accesses are followed directly by a lookup of the ``.resources`` subtable, this is covered by the *resources* variants.
Edited to better match the style of the rest of the file. Fixes gregorio-project#717.
@rpspringuel Would you be able to test this against TeX Live 2014? |
It's still not working against luaotfload 2.6 and the latest TeX Live 2015. I'll see if I have time this weekend to try to dig into why it's broken, but I'll take any help anyone can offer. |
Thanks for your help, I'm still unable to do anything before Monday, but I think a good start would be to isolate the problem outside of Gregorio (working in raw TeXLive, requiring no gregorio font nor files, but including the font access code of Gregorio), and make a PR against the luaotfload test repo. This example should raise an obvious error at compile time if the bug is detected. @phi-gamma would that be ok for you? |
I”ll look into it as soon as I can, probably on monday. The table |
The problem is this function in
The
We have thousands of glyphs in the private use area; none of them are iterated by this loop. The relevant part of the log is:
|
Thanks for the investigation! Do you think you could make a small plain TeX file (as simple as possible, no packages loaded except luaotfload), compilable with the |
This code works under 2.5. It produces a large PDF and shows a punctum inclinatum at the end. Under 2.6, it breaks with:
If you comment out the penultimate line, it produce a single page PDF listing the four glyphs I mentioned earlier. |
Thanks a lot! I've reported it in luaotfload issue |
The example is fixed when using local grecc = luatexbase.catcodetables['grecc']
if (luaotfload.version >= "2.6") then
local descriptions = font.getfont(font.id('greciliae')).shared.rawdata.descriptions
local name, unicode
tex.print(grecc, [[Mapping font\par ]])
for _, description in pairs(descriptions) do
unicode = description.unicode
name = description.name
if unicode and unicode >= 0 and not string.match(name, [[%.]]) then
tex.print(grecc, string.format([[%s = %d\par ]], name, unicode))
tex.print(grecc, string.format([[\xdef\GreCP%s{\char%d}]], name, unicode))
end
end
else
local unicodes = font.getfont(font.id('greciliae')).resources.unicodes
local glyph, unicode
tex.print(grecc, [[Mapping font\par ]])
for glyph, unicode in pairs(unicodes) do
if unicode >= 0 and not string.match(glyph, [[%.]]) then
tex.print(grecc, string.format([[%s = %d\par ]], glyph, unicode))
tex.print(grecc, string.format([[\xdef\GreCP%s{\char%d}]], glyph, unicode))
end
end
end
tex.print(grecc, [[That's all, folks!\par]]) in your example, I'm not sure about the conditional though... |
Would it be better check if there is a field called |
Why not yes, I'm just waiting for a possible answer on luaotfload tracker, if it doesn't come, it might be the best solution. |
The problem with that code is that the “unicodes” table is lazily
In any case, I’ve looked at the code and I’d prefer retrieving Here’s an example:
This approach splits the task into two subtasks: Collect unicodes |
How backwards compatible is retrieving "unicodes" via the callback? Does it work in TeX Live 2013? 2014? |
I think it should be rather safe. I admit I didn't understand the |
@henryso The workaround only has an effect if the |
This change was proposed by @phi-gamma. Fixes gregorio-project#717.
This workaround was suggested by @phi-gamma. Fixes gregorio-project#717.
It seems Gregorio is not compatible with latest luaotfload (2.6), see this thread
The text was updated successfully, but these errors were encountered: