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

System.ArgumentException occurs with Font Family in Win2D Controls on Windows in VS Code #24609

Open
BrundhaVelusamy opened this issue Sep 5, 2024 · 6 comments
Labels
area-fonts Custom fonts and Font related API's platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@BrundhaVelusamy
Copy link

Description

When running a .NET MAUI application in Visual Studio Code on Windows, a System.ArgumentException with the message "Value does not fall within the expected range" occurs if the font family is set for any Win2D-drawn custom controls. The exception does not occur when running the same project in Visual Studio.

Replication sample:
FontFamilyIssue.zip

Steps to Reproduce

  1. Run the project on VS code.
  2. System.ArgumentException will occur.
  3. Remove the font family from the custom control, the exception will not occur.

Link to public reproduction project repository

No response

Version with bug

8.0.82 SR8.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

@BrundhaVelusamy BrundhaVelusamy added the t/bug Something isn't working label Sep 5, 2024
Copy link
Contributor

github-actions bot commented Sep 5, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Sep 9, 2024
@ninachen03
Copy link

I can repro this issue at Windows platform on the latest 17.12.0 Preview 1.0(8.0.82 &8.0.80 & 8.0.3).
image

@mattleibow
Copy link
Member

This may be a packaged/unpackaged difference. Because Windows apps cannot be launched via the CLI/VSCode :( we use an unpackaged app. VS uses packaged by default.

Now, does this help you? Not really, but it will explain why the different IDEs behave differently.

What is the value that eventually gets to the font family? format.FontFamily = fontFamily?.Source;

@mattleibow mattleibow added s/needs-info Issue needs more info from the author area-fonts Custom fonts and Font related API's labels Sep 11, 2024
@BrundhaVelusamy
Copy link
Author

BrundhaVelusamy commented Sep 12, 2024

This may be a packaged/unpackaged difference. Because Windows apps cannot be launched via the CLI/VSCode :( we use an unpackaged app. VS uses packaged by default.

Now, does this help you? Not really, but it will explain why the different IDEs behave differently.

What is the value that eventually gets to the font family? format.FontFamily = fontFamily?.Source;

@mattleibow, Thank you for your details.

format.FontFamily = fontFamily?.Source; --> Here format.FontFamily will get the details of the assigned font family of the custom control, like ms-appx:///Cinzel-Regular.ttf#Cinzel.

There is already an existing issue in WinUI when building the project on the Unpackaged version on Visual Studio:
CanvasTextFormat throws in Unpackaged apps

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 12, 2024
@BrundhaVelusamy
Copy link
Author

Any update on this issue?

@BrundhaVelusamy
Copy link
Author

Please provide high priority for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-fonts Custom fonts and Font related API's platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants