Skip to content

FontStyle will affect all subsequent non-English text globally #19847

@DearVa

Description

@DearVa

Describe the bug

Image

Once FontStyle (Italic or Oblique) is applied to any text, all subsequent non-English text will be affected across the entire Avalonia application. This issue appeared in version 11.3.5. I haven't thoroughly examined Avalonia's source code, but I suspect it might be related to some global state or the rendering stack?

To Reproduce

<Window
  x:Class="LiveMarkdown.Avalonia.Demo.MainWindow" 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" d:DesignHeight="450"
  d:DesignWidth="800" Title="LiveMarkdown.Avalonia.Demo"
  mc:Ignorable="d">
  <StackPanel>
    <TextBlock
      FontStyle="Italic" Text="叮咚鸡 Italic"/>
    <TextBlock Text="大狗叫"/>
    <TextBlock
      FontStyle="Italic" Text="Test Italic"/>
    <TextBlock Text="Test"/>
    <TextBlock
      FontStyle="Italic" Text="こんにちは Italic"/>
    <TextBlock Text="こんにちは"/>
  </StackPanel>
</Window>

Expected behavior

FontStyle of "大狗叫" and "こんにちは" should be normal.

Avalonia version

11.3.5 and above

OS

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions