TTF support#2232
Conversation
Integrates FreeType for font rasterization and HarfBuzz for complex text shaping, including support for right-to-left (RTL) languages like Arabic. This new system overrides the legacy BitFont rendering for certain text elements, enabling the use of TrueType/OpenType fonts and configurable sizing via `UIMD.INI`. External dependencies (FreeType, HarfBuzz, Fribidi, etc.) are managed through vcpkg. Project settings (`Phobos.props`) are updated to include vcpkg paths and switch to the Cdecl calling convention.
Replaces the FreeType and HarfBuzz-based text renderer with a GDI-based implementation. This change simplifies external dependencies by removing the `vcpkg` submodule and all direct references to its installed libraries in `Phobos.props`. The new system leverages Windows' native GDI for font rasterization and text layout, while retaining support for configurable fonts via `UIMD.INI`. The `MessageListClass_Draw_TTF` hook, which previously used the FreeType renderer, is also removed.
No hasArabic — GDI handles RTL automatically No DT_RTLREADING — not needed, Windows detects text direction No font caching — single font, loaded once No GDIFont struct — just an HFONT ~50 lines for the core rendering logic Color conversion simplified: (c & 0x1F) * 8 instead of * 255 / 31
-TTF not applying to igname msgs
|
Stop rewrite my code! |
That's not how it works, broski. In order to contribute your changes you've made a derivative of Phobos' GPL licensed code, modified it and published it. Your contribution is under GPL license and was distributed as a pull request. You can't just tell people to stop modifying it. The only thing I agree with is that you should be added to credits list for it (which you should've done in the first place). @Gedo6922 please add him and yourself to CREDITS.md. |
sure thing I already mentioned that it's Continuation of his work and will be added to the credit anyway |
-Adjusted pause menu
-Useless changes removed
-Known issues:
* Text Box for deployed MCV is smaller than the text "Power = XX Drain =XX"
* Multiplayer and game msg chat yet to support ttf
Excuse me??? Kerb, you ruined my project that adds Arabic RTL support to the CnCNet client. I also worked on TTF font rendering in-game and either through HarfBuzz or my own implementation Why did you change your mind about my project? Why did you turn against it? Why are you unwilling to let me improve the code? |
|
@G-LimeJuice We are not obliged to accept your code. We are not obliged to accept your code without edits as well. None of this is implied, written in any policies or licenses. I haven't "ruined" anything, it's you who ragequitted upon receiving criticism from the folks. Our only goal is for the code to be optimal, producing correct results AND maintainable. Throwing a tantrum in response is childish.
This is bullshit, it's you who quit without any explanation and closed your PR(s) upon receiving criticism, and now you're saying this. Maybe don't lie? If you don't want to understand and accept how civilized software development is done, then don't make a headache for everyone else. You are free to collaborate with us, but this isn't collaboration. |
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Continuation of TTF work of which the previous owner disappeared from existence in unknown circumstances
The old pr: #2178
changes:
-Hook by GDI.