-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Windows binary distribution #410
Comments
Simon, I am working in mingw64 on Win 10. I have used your build from source instructions in this environment. I am thinking that this will create a sile.exe file, but as I don't know much about this stuff, I may be off track. The ./configure is getting stuck on:
I had modified the configure.ac Also I modified the ax_lua.m4 to
i.e it now includes lua5.3 that was missing. Though moving lua to the end may be wrong. Any insights on what may be wrong? If what I am doing is off track then just say so. Ian |
I've no idea why that's failing. The test it should be performing is:
Can you attach the output of config.log? |
Well, I just managed to replicate that error! Looking into it now. |
It's this: https://github.com/Alexpux/MINGW-packages/issues/949 |
OK, here's the state of SILE building on Windows so far:
This is all happening in the Appveyor branch, with build logs here: https://ci.appveyor.com/project/simoncozens/sile/build/1.0.73 If anyone who knows Lua-on-Windows (I'm looking at you @pkulchenko) has time to have a look over what I'm doing and sanity check it, particularly |
@simoncozens, I won't be able to help with
Why would you need this? |
Thanks! Would be very handy to compare notes. The idea behind a C wrapper (which I've now written) ties into my end goal for distribution on Windows: rather than installing Cygwin and Lua and Luarocks and everything else and then SILE, the installer just unpacks a punch of stuff into C:\Program Files\SILE, where all the dependency libraries - Mingw, Freetype, Harfbuzz, ICU, Lua and so on - are stashed away and nobody needs to care that they're running Lua and half of Unix when they type "sile foo.sil". |
Simon, I've made some progress on getting this to run, but on a snapshot from last year, which predates lfs and justenoughicu requirements. I got it working using DLLs from mingw32/msys2 distribution; here is the full list of libraries used:
The last two are Lua libraries and the rest are DLLs from There have been couple of issues; first of all, I copied all the DLLs into the local folder from which I run SILE; if this is not done, then there is a high likelihood that one of the libraries will be present in one of the folders in PATH that sits before mingw folders, which is likely to make it fail, simply because it will be a 64bit library (from The second issue was with This worked fine, but it took a while to complete the first run (probably about 20s) while the fonts were scanned and the cache was compiled. The subsequent runs were without much of a delay. The next step would be to build a more recent version with justenoughicu and other additions. |
Couple of issues I ran into compiling the current master with msys2/mingw32:
I fixed this by adding:
This is fixed by installing a proper icu module:
I fixed this by renaming ICU libraries according to this discussion: I also got message |
Here is the list of additional libraries that is needed to decouple the installation from mingw:
@simoncozens, I got it all running without issues, but the resulting PDFs have boxes instead of characters. What would be the reason for that? The console output looks correct:
|
I rolled back changes to the earlier commit that works for me (e9d821d), but still using the new binaries and with |
This is what
|
@simoncozens, @alerque, any ideas on why I'm getting boxes instead of characters in the output? |
OK, that's weird. Strange that it can't get a version string out of the fonts, which makes me suspect that either the fonts are bad or that the opentype parser isn't working on Windows. That shouldn't affect output, however. Could you try:
This will tell me whether or not the problem is to do with finding the right glyphs in the font (Harfbuzz problem) or outputting the glyph to pdf (libtexpdf problem). |
@simoncozens, here is the output:
The fonts should be good as I can use them with the old version from the same install without issues (I just switch the DLLs and checkout older SILE commit), so it looks like Harfbuzz issue as the results are wrong in my viewer as well (no PDF output). |
Yeah, all the zeroes are telling me that it's a Harfbuzz issue. But the fact that Harfbuzz can't find any glyphs and the opentype parser can't read the version number makes me suspect something else:
You should get about 362644. If you don't, have a look at:
The code I'm suspecting, which looks very innocuous, is:
|
I'm getting 91:
This looks like I only have Gentium installed and nothing else? I checked |
hm, maybe it needs to read as binary file... |
Yep, this fixes it: diff --git a/core/harfbuzz-shaper.lua b/core/harfbuzz-shaper.lua
index 7a5710a..504705f 100644
--- a/core/harfbuzz-shaper.lua
+++ b/core/harfbuzz-shaper.lua
@@ -53,7 +53,7 @@ SILE.shapers.harfbuzz = SILE.shapers.base {
local face = fontconfig._face(opts)
SU.debug("fonts", "Resolved font family "..opts.family.." -> "..(face and face.filename))
if not face.filename then SU.error("Couldn't find face "..opts.family) end
- local fh,e = io.open(face.filename)
+ local fh,e = io.open(face.filename, "rb")
if e then SU.error("Can't open "..e) end
face.data = fh:read("*all")
return face |
Simon, everything is back to normal so far with the fix, but I noticed one small difference between rules shown in the generated PDF and my preview: This is how the line information is shown in the output:
The lines are generated using the following: Not sure why the line is moved relative to the text, but I've been wondering which one is the correct location. Note that it's quite possible there is something wrong with my positions, but all the other objects (including the image) are properly positioned on the page. |
The generated PDF is correct, your preview is off. The height parameter is supposed to specify the thickness of the line, not the raise distance relative to the baseline. Something is off there. |
Interesting; thank you Caleb. I'll check my calculations... |
@alerque, thank you for checking. It turned out that the rule calculations are correct, but I used to have a small adjustment for the text when I was trying to match the PDF output and it was only done for text. Essentially, when I remove that adjustment, everything looks the same as in the PDF, but it's somehow 2 pixels higher than it should be. Is there a way to check for exact pixel coordinates in generated PDF to match with the ones I'm calculating? Maybe there is something wrong with the point relative to which my text is drawn? I calculate it as the following:
Because the text drawing in my case is relative to the top left corner, I recalculate it from the baseline origin by subtracting |
I think I have done pretty much of the tasks in the main content of this issue. Checkout my fork here: https://github.com/harrysummer/sile/tree/win32
|
@harrysummer Oh wow, that is a brilliant idea! |
Wow. This is superb. |
so. what have we got now? have we got a portlable zip which i can extract and run it? i'd be okay with it even if it doen't install and even if i may have to configure some folder locations thereafter somewhere if that's what'd be needed. The Resolved one
what's ICU? International Componenets for Unicode? https://icu.unicode.org |
We had something like that, but at this point I don't know if the things inside the ZIP are usabel. It is being built in CI by Azure and the builds are still running (successfully) for most commits and PRs to the project, but none of us are in a position to evaluate them and figure out what works, what doesn't, what needs changing, etc. You can see recent builds here: https://dev.azure.com/sile-typesetter/sile/_build It claims to have built an artifact, but what is or isn't in that artifact at this point is anybody's guess. |
This could be easily done via NSIS. |
I have no idea what NSIS is, but sure knock yourself out. I'm happy to facilitate contributions from Windows folks making their life easier, I just don't have the interest or time to make it happen myself. Also medium term there is a very solid chance one option for running SILE will be as a single Rust binary with an embeded Lua interpreter and all the default support files baked in. See #1762 for current progress on that front. Getting the Rust CLI and embeded Lua interpreter is already fully working, but getting everything including the assorted C modules embeded is a bit trickier. |
That’s shocking. Right now, you can acknowledge NSIS here, which give great help for this issue: https://nsis.sourceforge.io/Main_Page |
Why would that be shocking? AFAIC, I've used NSIS since the early 2000s for some job-related projects.
Someone interested and thinking it's an easy topic is surely welcome to help 😸 |
We need one. But I don't have the resources to make one.
To make this happen we will need:
The text was updated successfully, but these errors were encountered: