Skip to content

[Windows] Change the LineStackingStrategy to BlockLineHeight for Labels on Windows #24520

@PureWeen

Description

@PureWeen

Description

The default LineStackingStrategy on WinUI currently means that using a LineHeight multiplier < 1 will have no effect.

Given the following XAML.

  <VerticalStackLayout>

    <Label BackgroundColor="Green" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Red" LineHeight="0.8" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Green" LineHeight="0.2" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Red" LineHeight="0.4" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Green" LineHeight="1.0" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Red" LineHeight="1.2" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Green" LineHeight="1.4" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Red" LineHeight="1.6" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Green" LineHeight="2.0" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    <Label Grid.Row="1" AutomationId="label" BackgroundColor="Red" LineHeight="4.6" FontSize="20" Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
  </VerticalStackLayout>

WinUI currently looks like this

image

If you change the LineStackingStrategy to BlockLineHeight it looks like this

image

The second image seems like it should be our default across platforms

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions