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

TextBox: Wrong font stretch when setting font family #808

Open
ceee opened this issue Jun 5, 2019 · 11 comments
Open

TextBox: Wrong font stretch when setting font family #808

ceee opened this issue Jun 5, 2019 · 11 comments
Labels
area-TextBox TextBox, RichEditBox bug Something isn't working needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Controls Issue for the Controls team

Comments

@ceee
Copy link

ceee commented Jun 5, 2019

Describe the bug
When you set a font family via FontFamily in a TextBox it may use the wrong font stretch by default, in case the font family contains multiple stretches.
This is the case for Arial, Bahnschrift and others.
There is no way to select a different font stretch in a TextBox as the FontStretch property seems to be completely ignored.
The same problem also exists for the RichEditBox.

Steps to reproduce the bug

  1. Create a new UWP project
  2. Add this XAML into the MainPage.xaml
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
  <TextBlock Text="Arial" FontFamily="Arial" FontSize="32" />
  <TextBox Text="Arial" FontFamily="Arial" FontSize="32" FontStretch="Normal" Margin="0 20 0 0" Width="300" />
</StackPanel>

Expected behavior
It is expected that the rendered text from the TextBlock looks the same as from the TextBox. Instead Arial Narrow is used and the FontStretch property is completely ignored.

Screenshots
image

Version Info
OS: Win10 Pro x64 (17763)
SDK: Reproduced this with 17763, 17134, 16299 and 15063.

@ceee ceee changed the title Wront font stretch when setting font family in a TextBox TextBox: Wront font stretch when setting font family Jun 5, 2019
@ceee ceee changed the title TextBox: Wront font stretch when setting font family TextBox: Wrong font stretch when setting font family Jun 5, 2019
@chrisglein chrisglein added area-TextBox TextBox, RichEditBox bug Something isn't working labels Jun 10, 2019
@ceee
Copy link
Author

ceee commented Jul 11, 2019

Any updates on this?

@ceee
Copy link
Author

ceee commented Sep 7, 2019

Ping ping... @chrisglein

@marcelwgn
Copy link
Collaborator

I think this is something we can only fix with WinUI 3.0 since settting the font stretch on the content presenting ScrollViewer has no effect, and changing the content presenting ScrollViewer to a ContentPresenter and setting thats FontStretch does not work either.

@chrisglein chrisglein added the needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) label Oct 2, 2019
@chrisglein
Copy link
Member

Confirmed. Neither TextBox.FontStretch or RichEditBox.FontStretch are not setting this with RichEdit. This is a bug, and to fix it we'd need to do it in WinUI 3.0. For RichEditBox as a workaround the app can set it in code through the document API on CharacterFormat using the ITextCharacterFormat API.

@jevansaks jevansaks added area-Framework needs-triage Issue needs to be triaged by the area owners labels Nov 7, 2019
@chrisglein chrisglein removed the needs-triage Issue needs to be triaged by the area owners label Jan 24, 2020
@ceee
Copy link
Author

ceee commented Jul 29, 2020

Still broken in WinUI 3.0 Preview 2, @chrisglein @chingucoding @jevansaks

image

@DierkDroth
Copy link

Still broken after releasing WindowsAppSdk. Confirmed with TextBox/TextBlock + Roboto font.

@ceee
Copy link
Author

ceee commented Apr 6, 2022

Almost 3 years later and this is still ignored 😔
@chrisglein As this was not part of WinUI 3, when and where can we expect a fix for this issue?

@ceee
Copy link
Author

ceee commented Apr 15, 2022

@jevansaks @chrisglein Any updates on this issue?

@AndrewKeepCoding
Copy link
Contributor

I'd really appreciate if this get fixed soon.😢

@ceee
Copy link
Author

ceee commented Jul 20, 2023

@jevansaks @chrisglein Any updates on this issue?

@bpulliam bpulliam added team-Controls Issue for the Controls team and removed team-Framework labels Aug 22, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 22, 2023
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Aug 29, 2023
@JohnnyWestlake
Copy link

Bumping this; I also don't understand why you would need WinUI 3 to fix it. It's an internal platform issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TextBox TextBox, RichEditBox bug Something isn't working needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

8 participants