When I change font the application will crash
Asked by poren cheng:

when i select menu 'tools-\>Option-\>Diff tab'  
click change Font button  
sourcetree will crash

somebody have same question?

how can i fix this problem?


Answers:
author: Ana Retamal
body: Hi! Can you tell us which Sourcetree and OS version are you using? Also, which font are you selecting when the app crash? Does it happen for any font?

Regards!

Ana

comments: author: poren cheng
body: OS?win7 7601 : Service Pack 1  
Sourcetree?2.3.5 and 2.4.7 both same problem

font?sorry i'm Taiwanese people?i'm not sure isn't Consolas ?

![sourcetree error.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/12572iAB034050DF18E91D/image-dimensions/423x376?v=v2 "sourcetree error.jpg")


author: poren cheng
body: here is sourcetree.log file

-----------------------------------------------------------------------

ERROR \[2018-01-16 12:22:41,726\] \[1\] \[SourceTree.Analytics.Crash.BugSplat.CrashAnalyticsService\] \[DispatcherUnhandledExceptionHandler\] - DispatcherUnhandledExceptionHandler for \[Sourcetree, 2.3.5.0\] called with \[System.Windows.Threading.Dispatcher, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs\]  
System.TypeInitializationException: 'System.Windows.Media.Fonts' ??????????????? ---\> System.IO.FileFormatException: No FontFamily element found in FontFamilyCollection that matches current OS or greater: Windows7SP1 ---\> System.IO.FileFormatException: No FontFamily element found in FontFamilyCollection that matches current OS or greater: Windows7SP1  
? MS.Internal.FontFace.CompositeFontParser.Fail(String message, Exception innerException)  
? MS.Internal.FontFace.CompositeFontParser.ParseFontFamilyCollectionElement()  
? MS.Internal.FontFace.CompositeFontParser..ctor(Stream fileStream)  
--- ????????????? ---  
? MS.Internal.FontFace.CompositeFontParser.Fail(String message, Exception innerException)  
? MS.Internal.FontFace.CompositeFontParser..ctor(Stream fileStream)  
? MS.Internal.FontCache.FamilyCollection.SystemCompositeFonts.GetCompositeFontFamilyAtIndex(Int32 index)  
? MS.Internal.FontCache.FamilyCollection.GetFontFamilies(Uri fontFamilyBaseUri, String fontFamilyLocationReference)  
? System.Windows.Media.Fonts.CreateFamilyCollection(Uri fontLocation, Uri fontFamilyBaseUri, String fontFamilyLocationReference)  
? System.Windows.Media.Fonts..cctor()  
--- ????????????? ---  
? SourceTree.ViewModel.FontPickerWindowViewModel..ctor()  
? SourceTree.ViewModel.PreferencesWindowViewModel.ChangeDiffFont()  
? MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)  
? System.Windows.Controls.Primitives.ButtonBase.OnClick()  
? System.Windows.Controls.Button.OnClick()  
? System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)  
? System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
? System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
? System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
? System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)  
? System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)  
? System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
? System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
? System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
? System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
? System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)  
? System.Windows.Input.InputManager.ProcessStagingArea()  
? System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)  
? System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)  
? System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)  
? System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean\& handled)  
? System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean\& handled)  
? MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean\& handled)  
? MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)  
? System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)  
? System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


author: poren cheng
body: Is there any solution for this problem?


Tags: windows