-
- kritzelkratz
- Posts: 18
- Joined:
Problem with FontWeight="Bold"
Hi,
In our xaml-File we're trying to create a bold, colored Label like this:
<Label FontWeight="Bold" Foreground="red">Hello</Label>
The Label's color is red, it doesn't appear to be bold, however. We've tried this with other FontWeights and TextBlock, both of which don't work, either.
What are we doing wrong here?
In our xaml-File we're trying to create a bold, colored Label like this:
<Label FontWeight="Bold" Foreground="red">Hello</Label>
The Label's color is red, it doesn't appear to be bold, however. We've tried this with other FontWeights and TextBlock, both of which don't work, either.
What are we doing wrong here?
-
-
sfernandez
Site Admin
- Posts: 3197
- Joined:
Re: Problem with FontWeight="Bold"
Hi,
Font styles usually come from different .ttf files. If you are using your own font, you should provide the .ttf for all styles you want to use.
You can find an example in the first tutorial of the documentation.
A font resource (.font) is a text file with a list of file font references, one item per line. For example, Roboto.font contains:
Referenced .ttf files must be found next to the .font file. The .font file can contain as many references as you wish, even a single one, but it is recommended that all the referenced files belongs to the same font family, being that family the name of the .font file.
The above .font could be used this way:
Note that the reference to the font is relative to the location of the .xaml file. Here we are supposing that Roboto.font is located in the subfolder Fonts/ relative to the .xaml.
Referenced fonts must always be inside the project folder. Operating system fonts are not supported.
Font styles usually come from different .ttf files. If you are using your own font, you should provide the .ttf for all styles you want to use.
You can find an example in the first tutorial of the documentation.
A font resource (.font) is a text file with a list of file font references, one item per line. For example, Roboto.font contains:
Code: Select all
Roboto-Regular.ttf
Roboto-Italic.ttf
Roboto-Bold.ttf
Roboto-BoldItalic.ttf
The above .font could be used this way:
Code: Select all
<Grid>
<Button Content="Click Me!" FontFamily="Fonts/#Roboto" />
<Button Content="Click Me!" FontFamily="Fonts/#Roboto" FontWeight="Bold" />
</Grid>
Referenced fonts must always be inside the project folder. Operating system fonts are not supported.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 16 guests