question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FontStyle is broken in the Fluent theme

See original GitHub issue

Describe the bug When the Fluent theme is enabled, setting the FontStyle property of a TextBlock to Italic results in text that is sometimes bold, sometimes regular, sometimes light, sometimes demi-bold, but never in italics. The weight of the text appears to change randomly every time the application is launched (without recompiling).

To Reproduce Steps to reproduce the behavior:

  1. Create a new Avalonia 0.10.0 application
  2. Enable the Fluent theme (I replaced the contents of Application.Styles in App.xaml with <FluentTheme Mode="Light" />)
  3. Replace the contents of the main window with something like:
    <Window xmlns="https://github.com/avaloniaui"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            mc:Ignorable="d" Width="450" Height="250"
            x:Class="TestAvaloniaFonts.MainWindow"
            Title="TestAvaloniaFonts" FontSize="30">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="1*" />
          <RowDefinition Height="1*" />
          <RowDefinition Height="1*" />
          <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <TextBlock VerticalAlignment="Center">Regular text</TextBlock>
        <TextBlock Grid.Row="1" FontWeight="Bold" VerticalAlignment="Center">Bold text</TextBlock>
        <TextBlock Grid.Row="2" FontStyle="Italic" VerticalAlignment="Center">Italic text</TextBlock>
        <TextBlock Grid.Row="3" FontWeight="Bold" FontStyle="Italic" VerticalAlignment="Center">Bold italic text</TextBlock>
      </Grid>
    </Window>
    
    
  4. Compile and run the application multiple times.

Expected behavior The “Italic text” should be in italics, and the “Bold Italic text” should be bold and in italics.

Screenshots Here are a few examples of the results of running the same application multiple times: image

Desktop (please complete the following information):

  • OS: this happens at least on Windows 10 and Ubuntu 20.04. I have not tested on macOS.
  • Version: the bug happens at least on 0.10.0-preview6, 0.10.0-rc1, 0.10.0-rc2 and 0.10.0.

Additional context This is very similar to #4370, except that in this case custom fonts actually work, and it is only the default font that is broken. Also, that issue only happened on Windows, while this appears to affect Linux as well. And this only happens when the Fluent theme is enabled.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Gillibaldcommented, Jan 27, 2021

The font manager should always produce the same fallback values when the request doesn’t change so this is a bug.

2reactions
Gillibaldcommented, Jan 27, 2021

I will come up with a clean way to configure the default in the AppBuilder. That way we can provide an optional font package and you will be able to customize the lookup routine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segoe UI Fluent Icons (and/or segmdl2) font files are ...
Segoe UI Fluent Icons (and/or segmdl2) font files are broken/corrupted. So, on Windows 10, I replaced some of the fonts to get the...
Read more >
Customizing fonts · microsoft/fluentui Wiki
Fluent UI React provides various options for customizing text fonts. For customizing icon fonts, see this page instead.
Read more >
Fonts broken on update
I'm running Neve 3.0.11 and I really need to update – came back to the site after a year. Whenever I update however...
Read more >
Fluent Theme Overview
By default, the Fluent theme uses the Segoe UI font family but the font itself is not included in the theme package. You...
Read more >
[Metrology] Metro + Fluent + Windows Themes for Home ...
Under Themes, choose the color you like for the Metro themes. Pick Auto, Light, or Dark Mode for the theme. Segoe UI font...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found