Skip to content
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

SILE with Lua 5.1 issue with "before kern" styling #84

Closed
Omikhleia opened this issue Aug 31, 2024 · 1 comment · Fixed by #85
Closed

SILE with Lua 5.1 issue with "before kern" styling #84

Omikhleia opened this issue Aug 31, 2024 · 1 comment · Fixed by #85
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Omikhleia
Copy link
Owner

Omikhleia commented Aug 31, 2024

Observed

$ sile examples/lefevre-tuor-idril.sil 
SILE v0.15.5 (LuaJIT 2.1.1723675123) [Rust]
<examples/lefevre-tuor-idril.sil> as sil
</usr/share/sile/core/sile.lua:622> as lua
[1] [2] Error: runtime error: ./packages/resilient/styles/init.lua:575: attempt to compare table with number
stack traceback:
	[C]: in function '__lt'
	./packages/resilient/styles/init.lua:575: in function <./packages/resilient/styles/init.lua:544>
(...)

Fix

In packages/resilient/styles/init.lua :

   SILE.registerUnit("thsp", {
     relative = true,
     definition = function (value)
-      return value * 0.5 * utils.interwordSpace()
+      return value * 0.5 * utils.interwordSpace():tonumber()
     end
   })

Analysis

Overlooked difference between Lua 5.4 (implicit conversion applies) and Lua 5.1.

@Omikhleia Omikhleia added the bug Something isn't working label Aug 31, 2024
@Omikhleia
Copy link
Owner Author

Omikhleia commented Aug 31, 2024

Clearly overlooked: my older SILE 0.14 with Lua 5.1 (actually LuaJIT) build from #70 also has the issue. (Just to clarify it's not related to the recent SILE 0.15 updates -- I had forgottten this "example" article)

@Omikhleia Omikhleia self-assigned this Sep 28, 2024
@Omikhleia Omikhleia added this to the 2.5.0 milestone Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant