-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
GDI engine for font glyph rendering as a replacement for FreeType (take 2) #7572
Conversation
fcf50c5
to
2d4ba10
Compare
But at least the text is correct this time, even if the font is not the expected one. That's already a progress. |
Try now? |
3dfae0e
to
066bbf1
Compare
As the PR is now, I can principally get OpenTTD to load a NanumGothic.ttf without it being installed. However, if I select Korean as game language, it will not use the font for me because it is missing characters. As I just randomly googled for the font file, it is very likely I just have a bad file though. |
066bbf1
to
eaaa754
Compare
@@ -41,8 +40,8 @@ the `static` versions, and OpenTTD currently needs the following dependencies: | |||
To install both the x64 (64bit) and x86 (32bit) variants, you can use: | |||
|
|||
```ps | |||
.\vcpkg install freetype:x64-windows-static liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static | |||
.\vcpkg install freetype:x86-windows-static liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to update the CI to remove this as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a good idea to check the CI can build without Freetype as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI should already build this PR without Freetype as it's removed from the project files, and I tried locally after removing Freetype via vcpkg and it builds fine. But mingw will still build with Freetype as the detection code is untouched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows dependencies come in via OpenTTD/CompileFarm, can't change that in this PR.
… does not depend on Freetype and into one that does. This makes it easier to add other TrueType font rendering engines.
56aa7d2
to
86eb314
Compare
Freetype properly skipped with MinGW. Many warnings in fontcache.cpp with MinGW:
This one is fixable by removing one
I have not tried to fix this one.
Maybe a different cast, but don't know which one yet.
This one can be ignored, there are already similar warnings in win32.cpp and win32_v.cpp
Using %lX fixes it. |
… including FreeType. Building with FreeType is still possible and will take precedence over the GDI renderer, but the project files don't include FreeType anymore by default. Combining GDI rendering with ICU text layout is untested.
… have one, instead of repeatedly guessing the font.
…ot using FreeType.
86eb314
to
0dfc8ec
Compare
I think I've addressed all the mentioned warnings. |
Yup all warnings fixed (except the function cast one, but it's not fixable I think) |
I notice you add an #ifdef in uniscribe code for FreeType. Is it still possible to compile with FreeType on Windows? Is that desirable? |
Yes, I didn't remove any FreeType stuff. After all, it is still needed for other platforms. Whether it is desirable is debatable. Disabling it for Windows would complicate the #ifdef's because you'd have to explicitly exclude WIN32. |
As an aside, I started work on a DirectWrite font renderer (based on this patch) with the intention that it could be used for an eventual UWP build, should we want to go down that route (it would primarily benefit ARM-based Windows 10 devices). FreeType is supported on UWP but GDI isn't, so retaining the possibility of FreeType support on Windows would have some benefit there. In general, I don't see that it would hurt to keep it anyway. |
Rebased PR #6980 which unfortunately can't be reopened. Might fix #7511.
Old description: