-
-
Notifications
You must be signed in to change notification settings - Fork 991
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
Pango 1.50.12+ cannot load non-system fonts for Wesnoth 1.16 on Windows #7543
Comments
Are there Lato fonts present in wesnoth's |
Yes, I did check they were all there - seems to be unchanged from 1.16.8. |
Darn, I was hoping it was that simple... @Vultraz or maybe @knyghtmare would you be able to try bisecting this? |
Was one of the first things I checked, also hoping to find a straightforward cause... |
Labelled as possible upstream issue as it seems to be pango-related. I dropped pango 1.50.11 DLLs ( Although this doesn't explain why Wesnoth 1.17.15 doesn't have the issue despite using the same pango version (I believe) as Wesnoth 1.16.9. |
Should hopefully address wesnoth#7543
Should hopefully address wesnoth#7543
Should hopefully address wesnoth#7543
What am I supposed to look for? Should I use 1.16.8 as a starting point and the latest 1.16.x commit as the end point? |
1.16.8 and 1.16.9 should suffice. 1.16.8 'good', 1.16.9 'bad'. But if the underlying issue is due to changes in pango, a bisect might not get us anywhere. |
It would be nice if this war reported upstream, if it's a recent change someone at pango that knows the ide might still be around to fix it |
@knyghtmare I guess it doesn't like the lua modules directory not existing for 1.16 for some reason. I don't know why though - a simple |
warning: unable to rmdir 'src/modules/lua': Directory not empty
Updating files: 100% (12450/12450), done.
Switched to branch '1.16'
Your branch is up to date with 'origin/1.16'. It worked but doesn't show in the Github desktop client that it worked |
Github desktop client has always been buggy for me. Try another free GUI git client - GitKraken and SourceTree are both good in my experience |
So if i understood the comment in #7544 (comment) correctly we 'fixed' the 1.16.9 windows steam/download release by using oder dll versions? And this is 'only' about self builds and 1.16.10+ now? |
Correct. |
It appears that with the way 1.16 uses Pango - without fontconfig that's currently in master - something changed in Pango between 1.50.11 and 1.50.14 such that on Windows platforms it will only load a font if it's available in the Windows system pool of fonts. I confirmed this by installing the Lato fonts on my system, and re-confirmed the problem after uninstalling the fonts. I found this from browsing various reports of the same issue for projects that depend on Pango, not Pango itself. Looking at Pango's change log, there doesn't appear to be anything directly associated with this change in behaviour. |
So this is potentially an upstream issue, in that case? |
Perhaps a change in how downstream users are expected to use it. |
This updates to pango 1.50.14 (from 1.50.12) which resolves wesnoth#7217 (but introduces wesnoth#7543).
Did you find anything indicating what that new expected usage is? If not, it would probably be worth it to open an issue on the pango gitlab asking if it's intentional and if it is then what's the new expected way to handle this. |
Actually, I'm not even sure that it's necessarily a new problem. I don't really know how Pango, Cairo, fontconfig, and Wesnoth are all supposed to interact. But reading through various issues like the following seems to suggest that it's an expectation to either use fontconfig to set-up the fonts or have the fonts installed and available system-wide: Automattic/node-canvas#1608 Oh, and I think my GitLab account expired - I gave up on trying to use the platform because of some requirement that the GitLab account name and the name configured in my local Git be the same for MRs. Or maybe that was specific to the project, I can't remember now. |
Reading through those, it sounds like there are a couple options to try and get some additional information:
Otherwise I suppose the question would just be "how are we supposed to be loading game-specific fonts that aren't installed or system-wide?" |
All of these issues are much older then this bug the pango version that changed this is from 2023 or late 2022, and even if our method is not listed there it doesn'tean that it's not supported. I really think the only way to get clarity on this issue is to file an upstream bug report, ideally with a simple example code. |
I noted that as well. As a quick test, I tried libpango 1.50.14 (my distribution normally uses 1.50.6) on Linux and confirmed I don't already have Lato installed as a system font - no apparent issues on either 1.17.18+dev nor 1.16.9 release nor 1.16.10+dev. Just confirming: Windows is the only platform where Wesnoth doesn't use fontconfig (and only for 1.16)? |
Correct. |
After some more testing with vcpkg's builds of Pango and peeking into the Pango source code and git blame records, I'm fairly confident this is caused by https://gitlab.gnome.org/GNOME/pango/-/commit/5bc16f7896ba3eb5b37ffdb03f28c646aad5889e. There's an issue already open for this: https://gitlab.gnome.org/GNOME/pango/-/issues/720 (In summary, it appears to be caused by a switch to DirectWrite that broke Windows GDI support. Wesnoth uses the latter.) This doesn't help the release version of Wesnoth, since that doesn't use MSVC, but while this is an issue I can work around it by adding the following to "overrides": [
{
"name": "pango",
"version": "1.50.11"
}
] |
@loonycyborg Do you need to be aware of this? Perhaps we can hold to libpango 1.50.11 for Windows releases for the time being? |
Advice from Pango developers seems to be to stay on libpango 1.50.11 until they replace the now-missing GDI functionality in a 'PangoWin32 API'. (Or use fontconfig, which we already established in #7544 cannot be done.) DirectWrite - which seems to ignore non-system installed fonts - replaced GDI usage in libpango 1.50.12. https://gitlab.gnome.org/GNOME/pango/-/issues/720#note_1794746 Additionally, it appears any support for non-system fonts with newer Pango would be for Windows 10 first, older Windows second (if at all). |
Nice, thx for finding this. |
I guess we would have to make a separate docker image for msys2+windows build then, with downgraded pango. |
Hey, it seems the bug made it into the 1.16.10 release. :/ |
Should be fixed for 1.16.10 now. |
…hen fontconfig is not used. Works around wesnoth#7543 for developers but does not resolve it as the official Wesnoth Windows builds do not use MSVC or vcpkg. Only necessary for 1.16 because 1.17+ uses fontconfig.
…hen fontconfig is not used. Works around #7543 for developers but does not resolve it as the official Wesnoth Windows builds do not use MSVC or vcpkg. Only necessary for 1.16 because 1.17+ uses fontconfig.
Hi, This issue is raised as Pango/Cairo is transitioning to DirectWrite, so Related upstream items: Current upstream Pango has a new API that works for Windows 10 and later that added support using an API adding non-installed fonts into the With blessings, and cheers! |
Is there documentation for this? |
I suppose this can be closed once 1.18 releases |
Not an issue with 1.18.x release. |
Game and System Information
Description of the bug
Pango reports being unable to load Lato font as per logs:
So far, I only see this issue on 1.16 releases for Windows. 1.17 doesn't appear affected, neither are Linux releases.
1.16.9 on Windows 7:
Steps to reproduce the behavior
Run Wesnoth 1.16.9 on Windows.
Expected behavior
1.16.8 on Windows 7:
1.17.15 on Windows 7:
1.16.9 on Linux:
Additional context
Don't know if it's relevant but Windows release builds includes pango 1.50.11 for Wesnoth 1.16.8 and pango 1.50.14 for both 1.16.9 and 1.17.15.
I cannot bisect this issue due to #7217.
The text was updated successfully, but these errors were encountered: