fontforge / fontforge

Free (libre) font editor for Windows, Mac OS X and GNU+Linux
http://fontforge.github.io/
Other
6.39k stars 696 forks source link

Make Windows build system straightforward to use #4870

Closed NuraliMedeu closed 2 years ago

NuraliMedeu commented 2 years ago

When reporting a bug/issue:

When you open an issue for a change/improvement/feature request:

jtanx commented 2 years ago

Nope, sorry, not going to compile the third party dependencies ourselves just to statically link them. Even if you managed to do that you would still have to contend with all the other resource files.

The build system right now is no more difficult to use as it is on Linux/macOS if you're using msys2; all fontforgebuilds is doing right now is doing a bit extra to make an installer/standalone bundle.

NuraliMedeu commented 2 years ago

Nonetheless, the compiled executable has a Windows 3.1-like theme.

Also, sorry for forgetting to mention this in the issue, but the Python modules fontforge.pyd and psMat.pyd that I compiled didn't work at all.

How can these problems be solved?

ctrlcctrlv commented 2 years ago

The theme issue can almost certainly not be solved to your satisfaction. FontForge does not use Windows’ GUI primitives, from any era. It uses its own primitives. GDraw is themable, but there's no "not reminiscent of 1998" theme.

Regarding #3981, it vaguely reminds me of issue #3981. Is your issue the same?

NuraliMedeu commented 2 years ago

Sorry, I should have been more specific. The executable downloaded from https://fontforge.org has a different theme than the executable that I compiled from the source. I want to know how to theme FontForge so it looks like the release version.

Also, regarding the Python modules, yes, issue #3981 is similar to my situation, but whenever I try to import the modules, the error says something along the lines of the modules being corrupted or invalid (I can't recall the exact message because I don't have access to my computer right now).

jtanx commented 2 years ago

You haven't mentioned how you built it or how you're running it. The theme requires the files from share. If you used the fontforgebuilds script, it would have dumped everything into the ReleasePackage folder.

If you're using msys2 directly, you would need to install it first so that everything is in the right place.

NuraliMedeu commented 2 years ago

I mentioned it in "Steps to reproduce the behavior" above. I tried building it both ways. Using ff-build.sh, even after I edited it to accomodate a user folder with spaces in it, completely failed. The binaries in the ReleasePackage folder ran neither from the File Explorer, nor PowerShell, nor the MSYS2 bash.

When I used MSYS2 directly, I installed the compiled binary, but it didn't launch properly until I copied all of the DLLs from MSYS2 to the the working directory of fontforge.exe.

jtanx commented 2 years ago

Install your msys2 to a path that doesn't contain spaces, you're just asking for trouble with that.

NuraliMedeu commented 2 years ago

MSYS2 is installed outside of my user folder, so its path has no spaces.

jtanx commented 2 years ago

Well in your OP you said you modified your script. Is that still the case? What are the error messages? You haven't posted anything useful to debug anything.

jtanx commented 2 years ago

Also if you've installed it in msys2, you have to launch it from your msys2 shell, not just double click on the binary

NuraliMedeu commented 2 years ago

Well in your OP you said you modified your script. Is that still the case? What are the error messages? You haven't posted anything useful to debug anything.

The fontforgebuilds script uses the path of the cloned repository, which was inside my user folder, hence many paths stored inside the script had spaces in them. I don't place files I work on outside of my user folder, so instead I edited the script to accomodate spaced paths. I had already debugged all of the errors in the script myself, so there is nothing to show here.

Also if you've installed it in msys2, you have to launch it from your msys2 shell, not just double click on the binary

OK, but if I remember correctly, it also didn't run from MSYS2 bash until I manually placed the DLLs.

I forgot some of the specific details like this because I tried building FontForge with Python extensions enabled a few days ago, then deleted my build after I learned that I can use the release build of FontForge with disabled Python extensions to patch my monospace fonts using Nerd Fonts' font-patcher script. Despite my initial problem being solved, I decided to create this issue anyway because I think the build system for FontForge on Windows needs to be at least better documented to avoid such build problems.

jtanx commented 2 years ago

I don't place files I work on outside of my user folder, so instead I edited the script to accomodate spaced paths.

MSYS2 is installed outside of my user folder, so its path has no spaces.

Gee well that's splitting hairs. I've already said that having paths with spaces is just cause for pain, so if you don't want to listen to me then you're on your own there.

I had already debugged all of the errors in the script myself, so there is nothing to show here.

You have literally not posted any error messages or what's not working e.g. with your python modules or how you're using it, so there is nothing I can help you with; I'm not a mind reader.

If you want help you need to be posting logs and as much information as possible, not just 'an error occurred' or 'it doesn't work'.

Like I said, building fontforge in msys2 is as simple as any other package you'll find in that ecosystem. If you don't know how to build and use packages in msys2, that's outside the scope of this project.

NuraliMedeu commented 2 years ago

If you want help you need to be posting logs and as much information as possible, not just 'an error occurred' or 'it doesn't work'.

I will post more information in a few days.

Like I said, building fontforge in msys2 is as simple as any other package you'll find in that ecosystem. If you don't know how to build and use packages in msys2, that's outside the scope of this project.

I agree, but I think that in the CMake guide in this repo's Wiki you should:

  1. mention that MSYS2 is recommended for Windows, and
  2. put links to relevant outside documentation that explains how to build a package on MSYS2.

This will help inexperienced newcomers like me a lot.

ctrlcctrlv commented 2 years ago

Thank you, that advice sounds reasonable enough, so I added this line to that wiki page:

Note: On Windows, the above commands should be run in MSYS2; ffbuild.sh can help with dependency management (from fontforge/fontforgebuilds).

@jtanx may want to tweak the wording. :-)

NuraliMedeu commented 2 years ago

Thank you very much, @ctrlcctrlv !

ctrlcctrlv commented 2 years ago

I realized while working on another project that even among developers MSYS2 penetration is not as high as I'd assumed, a lot of free software in Win32 expects to be built instead with vcpkg and Visual Studio (MSVC), sometimes Chocolatey. So, I think your intuition that we shouldn't expect developers to be familiar with/assume MSYS2 is right.