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

FontFamily Property Not Working in App.xaml for .NET MAUI 9 #27216

Open
Johanna-Victoria opened this issue Jan 19, 2025 · 2 comments
Open

FontFamily Property Not Working in App.xaml for .NET MAUI 9 #27216

Johanna-Victoria opened this issue Jan 19, 2025 · 2 comments
Labels
s/needs-repro Attach a solution or code which reproduces the issue t/bug Something isn't working

Comments

@Johanna-Victoria
Copy link

Johanna-Victoria commented Jan 19, 2025

Description

The FontFamily property set in the App.xaml resource dictionary with a key does not apply to Button controls in .NET MAUI 9. While the FontFamily can be set directly on individual Button elements, applying it globally through the resource dictionary using a key is ineffective.

Expected Behavior
The Button should use the FontFamily specified in the style (FontAwesome in the example).

Actual Behavior
The FontFamily define in ResourceDictionary is not applied to the Button. Instead, the button uses the default system font.

Steps to Reproduce

Steps to Reproduce

  1. Create a new .NET MAUI 9 project.
  2. Define a FontFamily in the App.xaml resource dictionary:
    <Application.Resources> <ResourceDictionary> <Style x:Key="ButtonFontStyle" TargetType="Button"> <Setter Property="FontFamily" Value="FontAwesome" /> </Style> </ResourceDictionary> </Application.Resource
  3. Add a Button to any Page in the app without explicitly setting its FontFamily
    <Button Text="Test Button" Style="{StaticResource ButtonFontStyle}" />

Link to public reproduction project repository

No response

Version with bug

9.0.30 SR3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

@Johanna-Victoria Johanna-Victoria added the t/bug Something isn't working label Jan 19, 2025
@jfversluis
Copy link
Member

Have you added the font file to your project? Please provide a reproduction

@jfversluis jfversluis added the s/needs-repro Attach a solution or code which reproduces the issue label Jan 19, 2025
Copy link
Contributor

Hi @Johanna-Victoria. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s/needs-repro Attach a solution or code which reproduces the issue t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants