Skip to content

[Win32] FontMetrics.getAverageCharacterWidth should return unrounded value #2461

@wahlbrink

Description

@wahlbrink

At moment FontMetrics.getAverageCharacterWidth always returns rounded integer values. This leads to poor estimates of text columns (when using scaling) with issues like here: eclipse-platform/eclipse.platform.ui#2836

Expected behavior
FontMetrics.getAverageCharacterWidth should return unrounded values.

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS

Eclipse Version tested: 2025-06 (4.36), I20250528-1830

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions