Skip to content

Tooltip font too small at high resolutions (2560×1600) #183

Description

@w1semannn

Prerequisites

  • I have searched for similar issues and confirmed this is not a duplicate

Game Version

  • Command & Conquer Generals
  • Command & Conquer Generals: Zero Hour
  • Other (please specify below)

Operating System

  • macOS
  • Linux
  • Other (please specify below)

Bug Description

Hi, fbraz3
At resolution 2560×1600 on macOS (Apple M1), tooltip text in the command bar popup (unit name, cost, description) is extremely small and barely readable.
Investigation:
I modified ControlBarPopupDescription.wnd (both as loose file override and directly in WindowZH.big) trying sizes 14, 24, 48, 64 for Arial — no visual change. I also changed the font name to Times New Roman — still no change. This confirms that overrideTooltipGadgetFont() in ControlBar.cpp completely overrides the .wnd font, using oldFont->pointSize which always resolves to the design-resolution value (8pt).
Root cause:
overrideTooltipGadgetFont() preserves oldFont->pointSize from the .wnd file without scaling it to the current display resolution. At 2560×1600, this makes 8pt render as roughly 8 physical pixels.
Suggested fix:
Scale the point size by currentHeight / 600.0f (design resolution height) in overrideTooltipGadgetFont:
cppfloat scaleY = (float)TheDisplay->getHeight() / 600.0f;
int scaledSize = max(oldFont->pointSize, (int)(oldFont->pointSize * scaleY));
GameFont *newFont = TheFontLibrary->getFont(kUnicodeFonts[i], scaledSize, oldFont->bold);
Workaround: Resolution 1280×800 makes text readable.
System: macOS, Apple M1, GeneralsX Beta 12

Reproduction Steps

  1. Set resolution to 2560×1600 in Options.ini
  2. Start any skirmish or campaign mission
  3. Hover mouse over any unit or building button in the command bar
  4. Observe tooltip popup — text (unit name, cost, description) is extremely small and barely readable

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions