Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font size identical for Body and Caption FontTypographies #1248

Open
tyouard opened this issue Oct 10, 2024 · 1 comment
Open

Font size identical for Body and Caption FontTypographies #1248

tyouard opened this issue Oct 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tyouard
Copy link

tyouard commented Oct 10, 2024

Describe the bug

According to WPF UI gallery, the caption FontTypography is 12 sized while Body is 14 sized.
However they look identical and when measuring the pixels they are both identical in height.
Also, the size do not match WinUI3 equivalent typography. Attached is a screenshot of WPF UI gallery vs WinUI3 Gallery.
You can clearly see the size difference between caption and body types in WinUI3, while they look identical in WPF UI gallery.
Apologies if this was a stupid report, I am fairly new to WPF.

To Reproduce

Open WPF UI gallery app, navigate to typograpy section and measure font size in pixels. Compare to WinUI3 equivalent app.

Expected behavior

Different font size is noticeable between caption and body FontTypography.

Screenshots

image

OS version

Edition Windows 11 Enterprise
Version 21H2
OS build 22000.3260

.NET version

8

WPF-UI NuGet version

3.0.5

Additional context

No response

@tyouard tyouard added the bug Something isn't working label Oct 10, 2024
@tyouard
Copy link
Author

tyouard commented Oct 10, 2024

An interesting note, if I apply the style directly it renders OK. It is only when I apply the style via the FontTypography the issue becomes apparent. See this screenshot for the following code:

<StackPanel VerticalAlignment="Top">
        <!--Use normal textblocks-->
        <TextBlock FontSize="12" LineHeight="16"  Text="The lazy brown dog jumped over some cats..."/>
        <TextBlock FontSize="14" LineHeight="20"   Text="The lazy brown dog jumped over some cats..."/>
        <Separator Height="10"></Separator>
        <!--Use wpf UI textblock and manually set style-->
        <ui:TextBlock Style="{StaticResource CaptionTextBlockStyle}"  Text="The lazy brown dog jumped over some cats..." />
        <ui:TextBlock Style="{StaticResource BodyTextBlockStyle}"  Text="The lazy brown dog jumped over some cats..." />
        <Separator Height="10"></Separator>
        <!--Use wpf UI textblock and set FontTypography-->
        <ui:TextBlock FontTypography="Caption"  Text="The lazy brown dog jumped over some cats..." />
        <ui:TextBlock FontTypography="Body"  Text="The lazy brown dog jumped over some cats..." />
    </StackPanel>

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant