Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on \text{∅} #248

Closed
ForNeVeR opened this issue Jan 23, 2020 · 2 comments · Fixed by #251
Closed

Exception on \text{∅} #248

ForNeVeR opened this issue Jan 23, 2020 · 2 comments · Fixed by #251

Comments

@ForNeVeR
Copy link
Owner

Whenever I enter a text \text{∅}, the parser throws an exception:

Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at MS.Internal.FontCache.FontFaceLayoutInfo.IntMap.System.Collections.Generic.IDictionary<System.Int32,System.UInt16>.get_Item(Int32 i)
   at WpfMath.Boxes.CharBox.GetGlyphRun(Double scale, Double x, Double y) in D:\X-Files\Projects\wpf-math\src\WpfMath\Boxes\CharBox.cs:line 29
   at WpfMath.Boxes.CharBox.<>c__DisplayClass6_0.<RenderTo>b__0(Double scale) in D:\X-Files\Projects\wpf-math\src\WpfMath\Boxes\CharBox.cs:line 39
   at WpfMath.Rendering.WpfElementRenderer.RenderGlyphRun(Func`2 scaledGlyphFactory, Double x, Double y, Brush foreground) in D:\X-Files\Projects\wpf-math\src\WpfMath\Re
ndering\WpfElementRenderer.cs:line 47
   at WpfMath.Boxes.CharBox.RenderTo(IElementRenderer renderer, Double x, Double y) in D:\X-Files\Projects\wpf-math\src\WpfMath\Boxes\CharBox.cs:line 39
   at WpfMath.Rendering.WpfElementRenderer.RenderElement(Box box, Double x, Double y) in D:\X-Files\Projects\wpf-math\src\WpfMath\Rendering\WpfElementRenderer.cs:line 39

   at WpfMath.TexRenderer.RenderFormulaTo(IElementRenderer renderer, Double x, Double y) in D:\X-Files\Projects\wpf-math\src\WpfMath\TexRenderer.cs:line 51
   at WpfMath.TexRenderer.Render(DrawingContext drawingContext, Double x, Double y) in D:\X-Files\Projects\wpf-math\src\WpfMath\TexRenderer.cs:line 96
   at WpfMath.Controls.FormulaControl.Render() in D:\X-Files\Projects\wpf-math\src\WpfMath\Controls\FormulaControl.xaml.cs:line 157
   at WpfMath.Controls.FormulaControl.OnRenderSettingsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in D:\X-Files\Projects\wpf-math\src\WpfMath\Contr
ols\FormulaControl.xaml.cs:line 191
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, Effecti
veValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
   at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.OnSourceInvalidation(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, Effecti
veValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceW
ithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at System.Windows.Controls.TextBox.set_Text(String value)
   at WpfMath.Example.MainWindow.Window_Loaded(Object sender, RoutedEventArgs e) in D:\X-Files\Projects\wpf-math\src\WpfMath.Example\MainWindow.xaml.cs:line 111
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

@rstm-sf
Copy link
Contributor

rstm-sf commented Jan 29, 2020

@ForNeVeR
Copy link
Owner Author

It still sholdn't throw an exception no matter what :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants