Closed klousCan closed 1 month ago
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
删除这一行就不报错了
看起来不是很合理啊
@pfncfen Tom can you please help to check this issue?
I will close this issue for now, since this is caused by the Avalonia glyph handling for ligature characters. You can check if you can use a font without ligature.
Avalonia 版本:11.0.10 Semi.Avalonia版本:11.0.7.2
System.IndexOutOfRangeException: Index was outside the bounds of the array. at Avalonia.Media.GlyphRun.CreateGlyphRunMetrics() at Avalonia.Media.GlyphRun.get_Metrics() at Avalonia.Media.GlyphRun.get_BaselineOrigin() at Avalonia.Media.GlyphRun.CreateGlyphRunImpl() at Avalonia.Media.GlyphRun.get_PlatformImpl() at Avalonia.Media.GlyphRun.get_InkBounds() at Avalonia.Media.TextFormatting.TextLineImpl.CreateLineMetrics() at Avalonia.Media.TextFormatting.TextLineImpl.FinalizeLine() at Avalonia.Media.TextFormatting.TextFormatterImpl.FormatLine(ITextSource textSource, Int32 firstTextSourceIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) at Avalonia.Media.TextFormatting.TextLayout.CreateTextLines() at Avalonia.Media.TextFormatting.TextLayout..ctor(String text, Typeface typeface, Double fontSize, IBrush foreground, TextAlignment textAlignment, TextWrapping textWrapping, TextTrimming textTrimming, TextDecorationCollection textDecorations, FlowDirection flowDirection, Double maxWidth, Double maxHeight, Double lineHeight, Double letterSpacing, Int32 maxLines, IReadOnlyListg Adapter|0(Object sender, RoutedEventArgs e)
at Avalonia.Interactivity.RoutedEvent.<>c__DisplayClass23_0.b0(ValueTuple
1 textStyleOverrides) at Avalonia.Controls.Presenters.TextPresenter.CreateTextLayoutInternal(Size constraint, String text, Typeface typeface, IReadOnlyList
1 textStyleOverrides) at Avalonia.Controls.Presenters.TextPresenter.CreateTextLayout() at Avalonia.Controls.Presenters.TextPresenter.get_TextLayout() at Avalonia.Controls.Presenters.TextPresenter.MoveCaretToTextPosition(Int32 textPosition, Boolean trailingEdge) at Avalonia.Controls.TextBox.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change) at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change) at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty1 property, Optional
1 oldValue, BindingValue1 newValue, BindingPriority priority, Boolean isEffectiveValue) at Avalonia.PropertyStore.EffectiveValue
1.SetAndRaiseCore(ValueStore owner, StyledProperty1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue) at Avalonia.PropertyStore.EffectiveValue
1.SetCurrentValueAndRaise(ValueStore owner, StyledProperty1 property, T value) at Avalonia.PropertyStore.ValueStore.SetCurrentValue[T](StyledProperty
1 property, T value) at Avalonia.AvaloniaObject.SetCurrentValue[T](StyledProperty1 property, T value) at Avalonia.Controls.TextBox.OnCaretIndexChanged(AvaloniaPropertyChangedEventArgs e) at Avalonia.Controls.TextBox.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change) at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change) at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty
1 property, Optional1 oldValue, BindingValue
1 newValue, BindingPriority priority, Boolean isEffectiveValue) at Avalonia.PropertyStore.EffectiveValue1.SetAndRaiseCore(ValueStore owner, StyledProperty
1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue) at Avalonia.PropertyStore.EffectiveValue1.SetCurrentValueAndRaise(ValueStore owner, StyledProperty
1 property, T value) at Avalonia.PropertyStore.ValueStore.SetCurrentValue[T](StyledProperty1 property, T value) at Avalonia.AvaloniaObject.SetCurrentValue[T](StyledProperty
1 property, T value) at Avalonia.Controls.TextBox.HandleTextInput(String input) at Avalonia.Controls.TextBox.OnTextInput(TextInputEventArgs e) at Avalonia.Input.InputElement.<>c.<.cctor>b32_4(InputElement x, TextInputEventArgs e) at Avalonia.Interactivity.RoutedEvent1.<>c__DisplayClass1_0
1.2 args) at Avalonia.Reactive.AnonymousObserver
1.OnNext(T value) at Avalonia.Reactive.LightweightObservableBase1.PublishNext(T value) at Avalonia.Reactive.LightweightSubject
1.OnNext(T value) at Avalonia.Interactivity.RoutedEvent.InvokeRaised(Object sender, RoutedEventArgs e) at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e) at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) at Avalonia.Input.KeyboardDevice.ProcessRawEvent(RawInputEventArgs e) at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) at Avalonia.Native.WindowBaseImpl.RawTextInputEvent(UInt64 timeStamp, String text) at Avalonia.Native.WindowBaseImpl.WindowBaseEvents.Avalonia.Native.Interop.IAvnWindowBaseEvents.RawTextInputEvent(UInt64 timeStamp, String text) at Avalonia.Native.Interop.Impl.MicroComIAvnWindowBaseEventsVTable.RawTextInputEvent(Void this, UInt64 timeStamp, Byte text) --- End of stack trace from previous location --- at Avalonia.Native.DispatcherImpl.RunLoop(CancellationToken token) at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl) at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder) at AvaloniaApplication1.Desktop.Program.Main(String[] args) in /Users/liuzichun/Desktop/ardesktop/AvaloniaApplication1.Desktop/Program.cs:line 18