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

[Bugfix] tonumber(ffi.C.wcslen()) #1

Merged
merged 1 commit into from
Jun 25, 2023
Merged

[Bugfix] tonumber(ffi.C.wcslen()) #1

merged 1 commit into from
Jun 25, 2023

Conversation

Akatmks
Copy link

@Akatmks Akatmks commented Dec 1, 2022

We found that the current Yutils.lua will run into problems if character spacing is not set to 0. This is reproduced in sepro's and my test.

We had a look at several different versions of Yutils.lua, and we believe this tonumber() is the fix to the problem.

sepro told me to make this pull request. we will also inform arch1t3cht about this issue.

Steps to reproduce

  1. Install zf.everythingShape from https://github.com/TypesettingTools/zeref-Aegisub-Scripts
  2. Open style manager and set style character spacing to any value other than 0.0. For example, 1.0.
  3. Create a line of subtitle and use the „Shape To Clip“ function inside zf.everythingShape on the subtitle.

Thank you.

@CoffeeFlux
Copy link
Member

@Akatmks what value is returned when the spacing is non-zero? Doesn't wcslen always return a number - is this some issue with the ffi bindings? I'm a bit confused by this PR, or at least why that's the fix.

@CoffeeFlux CoffeeFlux merged commit 91a4ac7 into TypesettingTools:master Jun 25, 2023
@Akatmks
Copy link
Author

Akatmks commented Jun 25, 2023

It seems like it is something with ffi. Before tonumber the return is a ffi cdata, and lua for seems to only accept lua number.
image

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

Successfully merging this pull request may close these issues.

2 participants