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

Set custom font for application #1711

Closed
OmidAtaei1984 opened this issue Jan 3, 2024 · 7 comments
Closed

Set custom font for application #1711

OmidAtaei1984 opened this issue Jan 3, 2024 · 7 comments
Labels
status/resolved The issue has been fixed status/stale type/question Further information is requested

Comments

@OmidAtaei1984
Copy link

OmidAtaei1984 commented Jan 3, 2024

Hello. good day. There is no guidance on the site regarding how to use web fonts, font-face and how to set the font for the application globally. It can be done for components such as mcontainer when adding the service, using the command:

options.Defaults = new Dictionary<string, IDictionary<string, object?>?>()
{
{ nameof(Mcontainer), new Dictionary<string, object?>() { { nameof(Mcontainer.Style), "font-family: ''CustomeFontName"} } },
}

The font can be set, but in components such as MCard, the above command must be added again for that component, or in "popupService.EnqueueSnackbarAsync", the displayed text font is independent of the set font.

@capdiem
Copy link
Contributor

capdiem commented Jan 4, 2024

@OmidAtaei1984 Why not use global CSS(wwwroot/app.css) to set font-family?

@capdiem capdiem added type/question Further information is requested status/needs feedback labels Jan 4, 2024
@OmidAtaei1984
Copy link
Author

@OmidAtaei1984 Why not use global CSS(wwwroot/app.css) to set font-family?

Hello. As you can see in the picture, setting font-family in Body has no effect, but after setting Style in Program.cs, the desired font is applied.
1
2
3
4

@capdiem
Copy link
Contributor

capdiem commented Jan 4, 2024

@OmidAtaei1984
image

app.css:

.m-application {
  font-family: TheBlackList, ...
}

@capdiem capdiem added status/resolved The issue has been fixed and removed status/needs feedback labels Jan 4, 2024
@OmidAtaei1984
Copy link
Author

OmidAtaei1984 commented Jan 6, 2024

Hello. I made the settings, but there was no change in the font of the program. If I am wrong, please guide me.
2024-01-06 (1)
2024-01-06 (2)
2024-01-06 (3)

@capdiem
Copy link
Contributor

capdiem commented Jan 6, 2024

@OmidAtaei1984 You should check the font-family of the text "Hello world" instead of body.

From your screenshot, it seems that the program did not restart successfully, causing app.css not to be reapplied.

Copy link

This issue is stale because it has been open for 4 days with no activity.

Copy link

This issue is closed because it has been open for 3 days with stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/resolved The issue has been fixed status/stale type/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants