View Issue Details

IDProjectCategoryView StatusLast Update
00298372.x IDE BugsFont EditorPublic2020-01-06 16:45
ReporterDanAssigned ToCoreTech 
PriorityMediumSeverityA - Crash/HangReproducibility100%
Status AssignedResolutionOpen 
Platform-OSWindows 10OS VersionPro x64
Product Version2.1.5 
Target VersionFixed in Version 
Summary0029837: Font Editor: Using keyboard to quickly "scroll" through fonts overloads FreeType and stops the preview window updating
DescriptionUsing the keyboard up/down keys to quickly "scroll" through fonts seemingly overloads FreeType and stops the preview window updating for all fonts thereafter - scrolling down the list, every font after Sitka Small is identical; going bottom-to-top it's almost all after Myanmar Text. It looks like we can only actually load a certain number of fonts at once before the font editor breaks.

Getting the silent exceptions in your log and breaking the font editor preview is simple to do, but occasionally you can make the font editor completely fail to update the preview window until you restart GMS2. Depending on the individual machine, some users may even see a "GMS2 has gone unstable" dialog. Your ui.log is then full of the following two exceptions:

[14:52:53:514(9fdb)] Exception in YoYoStudio.Plugins.CorePlugins.FontEditor,Void MonitorFontProperties(System.Object, System.String) : SharpFont.FreeTypeException: FreeType error: Cannot open resource.
   at SharpFont.Face..ctor(Library library, String path, Int32 faceIndex)
   at YoYoStudio.Graphics.FontManager.EnsureFontLoaded(String _font, List`1& _fontfamily)
   at YoYoStudio.Graphics.FontManager.GetTypeFace(String _font, eFontStyleFlags _style, String _styleName)
   at YoYoStudio.GUI.Gadgets.TextBoxStyleConfig.SetFont(String _fontName, Int32 _fontSize, Boolean _aa, eFontStyleFlags _style, String _styleName)
   at YoYoStudio.GUI.Gadgets.TextBox.EndUpdateFont()
   at YoYoStudio.Plugins.CorePlugins.FontEditor.UpdateFont()
   at WeakDelegate(Object , Object[] )
   at YoYoStudio.Core.Utils.WeakDelegate`1.Invoke(Object[] _args)
[14:52:53:515(9fdb)] Exception in YoYoStudio.Plugins.CorePlugins.FontEditor,Void FontSelectionEvent(YoYoStudio.GUI.GUIBase) : SharpFont.FreeTypeException: FreeType error: Cannot open resource.
   at SharpFont.Face..ctor(Library library, String path, Int32 faceIndex)
   at YoYoStudio.Graphics.FontManager.EnsureFontLoaded(String _font, List`1& _fontfamily)
   at YoYoStudio.Graphics.FontManager.GetFontStyles(String _font)
   at YoYoStudio.Plugins.CorePlugins.FontEditor.UpdateFontStyles(String _family)
   at YoYoStudio.Plugins.CorePlugins.FontEditor.FontSelectionEvent(GUIBase _selection)
   at WeakDelegate(Object , Object[] )
   at YoYoStudio.Core.Utils.WeakDelegate`1.Invoke(Object[] _args)
Steps To Reproduce1. Start the ide and open/create any project.
2. Open/create a font resource.
3. Use your mouse to select the font dropdown, then simply close the dropdown.
4. Now use the down arrow to scroll through all system fonts.
5. Observe after a short amount of time how infrequently the font preview window updates. Also observe if you are shown a "GMS2 has gone unstable" dialog (lower repro for this bit - only one machine we have does this).
6. Once you notice it's broken, start individually selecting random fonts with your mouse again and observe this can still fails to fix the preview window for the majority of fonts in the upper/lower half, depending on which direction you scrolled. In this state, reopening the font still failed to fix.

Repro: 100% on multiple machines (ignoring the "Unstable" dialogue, which is only shown on one of our machines)
Additional InformationNote that we don't log the name of the font(s) which cause the issue, and we DO log "DoUndoableAction: 'Set font'" for every single change of font, which seems overkill and spams your log.
TagsFont, IDE
2.x IDE Found In2.1.5.322
2.x Runtime Found In
2.x IDE Verified In
2.x Runtime Verified In

Activities

Dan

2018-07-31 15:27

Adminstrator  

ui.log (310,154 bytes)

Alexander Borup

2018-12-14 16:06

Developer   ~0062255

Last edited: 2018-12-14 16:07

View 2 revisions

I believe this may be due to the fact that we never dispose of typefaces, so it may have just opened too many as the error is Cannot_Open_Resource.

Suggested fix: figure out a sensible way to start disposing of typefaces.