Skip to content

TTF support#2232

Open
Gedo6922 wants to merge 8 commits into
Phobos-developers:developfrom
Gedo6922:my-feature
Open

TTF support#2232
Gedo6922 wants to merge 8 commits into
Phobos-developers:developfrom
Gedo6922:my-feature

Conversation

@Gedo6922
Copy link
Copy Markdown

@Gedo6922 Gedo6922 commented May 30, 2026

Continuation of TTF work of which the previous owner disappeared from existence in unknown circumstances

The old pr: #2178

changes:
-Hook by GDI.

Gedo6922 and others added 6 commits May 28, 2026 20:38
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
@G-LimeJuice
Copy link
Copy Markdown

Stop rewrite my code!

@Metadorius
Copy link
Copy Markdown
Member

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.

@Gedo6922
Copy link
Copy Markdown
Author

Gedo6922 commented May 31, 2026

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

@Gedo6922 Gedo6922 closed this May 31, 2026
@Gedo6922 Gedo6922 reopened this May 31, 2026
Gedo6922 and others added 2 commits June 1, 2026 05:31
-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
@G-LimeJuice
Copy link
Copy Markdown

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.

Excuse me???
I have been researching BitFont and BitText to fix Arabic text support.
I wrote the RTL related code myself but i used somthing AI DeepSeek to modify it so there issue with ordering of RTL like symbols
and then replace parts of it with harfbuzz, freetype, and fribidi to fixed it.
The code was completed about 5 months ago and i developed it without any help.

Kerb, you ruined my project that adds Arabic RTL support to the CnCNet client.
I meant you rejected my RTL implementation for the client and wanted to use HarfBuzz instead of my own code.

I also worked on TTF font rendering in-game and either through HarfBuzz or my own implementation
but it seems you want to redo stuff HarfBuzz.

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?
If there is a problem with my implementation, can you explain what it is?
I would rather discuss and improve it than replace it completely but Nothing!

@Metadorius
Copy link
Copy Markdown
Member

@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.

Why are you unwilling to let me improve the code?
If there is a problem with my implementation, can you explain what it is?
I would rather discuss and improve it than replace it completely but Nothing!

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants