Skip to content

Support Typography.NumeralAlignment on TextBlock #23011

@MartinZikmund

Description

@MartinZikmund

Current behavior

Setting Typography.NumeralAlignment="Tabular" on a TextBlock has no effect on non-Windows platforms. Digits retain proportional widths, causing layout shifts when numeric values change (e.g., in countdown timers).

<Style x:Key="TimeComponentStyle" TargetType="TextBlock">
    <Setter Property="FontWeight" Value="Light" />
    <Setter Property="FontSize" Value="55" />
    <Setter Property="FontFamily" Value="ms-appx:///Assets/Fonts/Inter-Light.ttf#Inter" />
    <Setter Property="Typography.NumeralAlignment" Value="Tabular" />
</Style>

Expected behavior

Typography.NumeralAlignment="Tabular" should activate the OpenType tnum feature on the font, making all digit characters (0-9) render with equal width. This works correctly on Windows (WinAppSDK) but is not implemented on Uno Platform targets.

How to reproduce it

  1. Use a font that supports tabular figures (e.g., Inter, Roboto, Source Sans)
  2. Set Typography.NumeralAlignment="Tabular" on a TextBlock
  3. Display changing numeric content (e.g., a countdown timer)
  4. Observe that digits still have proportional widths and the text shifts as values change

Workaround

None currently — using fixed-width containers around each digit is a layout-level workaround but does not address the root cause.

Works on

  • Windows (WinAppSDK) ✅

Doesn't work on

  • Skia targets (Desktop, Linux, macOS via Skia)
  • WebAssembly
  • iOS
  • Android

(Listing all non-Windows targets as presumably affected — haven't verified each individually)

Environment

  • Uno.Sdk: latest
  • .NET: 10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions