FluentIcons icon indicating copy to clipboard operation
FluentIcons copied to clipboard

Crash when NativeAOT enabled

Open shatyuka opened this issue 10 months ago • 5 comments

Avalonia 11.0.10 FluentIcons.Avalonia 1.1.234 Crash on both macOS and Windows with UseSegoeMetrics() and NativeAOT on.

Unhandled Exception: System.InvalidOperationException: Could not create glyphTypeface.
   at Avalonia.Media.Typeface.get_GlyphTypeface() + 0x78
   at Avalonia.Media.TextFormatting.TextRunProperties.get_CachedGlyphTypeface() + 0x3c
   at Avalonia.Media.TextFormatting.TextCharacters.CreateShapeableRun(ReadOnlyMemory`1, TextRunProperties, SByte, FontManager, TextRunProperties&) + 0x80
   at Avalonia.Media.TextFormatting.TextCharacters.GetShapeableCharacters(ReadOnlyMemory`1, SByte, FontManager, TextRunProperties&, FormattingObjectPool.RentedList`1) + 0x54
   at Avalonia.Media.TextFormatting.TextFormatterImpl.CoalesceLevels(IReadOnlyList`1, ReadOnlySpan`1, FontManager, FormattingObjectPool.RentedList`1) + 0x474
   at Avalonia.Media.TextFormatting.TextFormatterImpl.ShapeTextRuns(IReadOnlyList`1, TextParagraphProperties, FormattingObjectPool, FontManager, FlowDirection&) + 0x318
   at Avalonia.Media.TextFormatting.TextFormatterImpl.FormatLine(ITextSource, Int32, Double, TextParagraphProperties, TextLineBreak) + 0x114
   at Avalonia.Media.TextFormatting.TextLayout.CreateTextLines() + 0x180
   at Avalonia.Media.TextFormatting.TextLayout..ctor(String, Typeface, Double, IBrush, TextAlignment, TextWrapping, TextTrimming, TextDecorationCollection, FlowDirection, Double, Double, Double, Double, Int32, IReadOnlyList`1) + 0x1bc
   at FluentIcons.Avalonia.SymbolIcon.Core.InvalidateText(String, Typeface, Double, IBrush) + 0x94
   at FluentIcons.Avalonia.SymbolIcon.InvalidateText() + 0x154
   at FluentIcons.Avalonia.SymbolIcon.OnLoaded(RoutedEventArgs) + 0x1c
   at Avalonia.Controls.Control.<>c.<.cctor>b__69_0() + 0xc8
   at Avalonia.Threading.DispatcherOperation.InvokeCore() + 0x1ac
   at Avalonia.Threading.DispatcherOperation.Execute() + 0x6c
   at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation) + 0x64
   at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean) + 0xb4
   at Avalonia.Threading.Dispatcher.Signaled() + 0x40
   at Avalonia.Native.Interop.Impl.__MicroComIAvnPlatformThreadingInterfaceEventsVTable.Signaled(Void*) + 0x7c
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x24
   at Avalonia.Native.DispatcherImpl.RunLoop(CancellationToken) + 0x268
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl) + 0x110
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame) + 0xb0
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken) + 0x10c
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[]) + 0x54

shatyuka avatar Apr 24 '24 06:04 shatyuka