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

Crash on Windows 7 SP1 #26

Closed
manu-st opened this issue May 3, 2018 · 2 comments
Closed

Crash on Windows 7 SP1 #26

manu-st opened this issue May 3, 2018 · 2 comments

Comments

@manu-st
Copy link

manu-st commented May 3, 2018

Hi,

I have a crash when using font-manager with electron 1.7.9 on Windows 7 with SP1. What I can tell is that it crashes with this callstack:

00 DWrite!DWriteCreateFactory+0x143b3
01 DWrite!DWriteCreateFactory+0x141b3
02 fontmanager!resultFromFont(struct IDWriteFont * font = 0x00000000`00383410)+0x1ad [c:\dev\node_modules\font-manager\src\fontmanagerwindows.cc @ 127]
03 fontmanager!getAvailableFonts(unsigned int64 _Count = <Value unavailable error>, void * _Ptr = <Value unavailable error>, class std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > _First = <Value unavailable error>)+0x1cb [c:\dev\node_modules\font-manager\src\fontmanagerwindows.cc @ 191]
04 fontmanager!getAvailableFonts<0>(class Nan::FunctionCallbackInfo<v8::Value> * info = 0x000007fe`effea7a0, class v8::Local<v8::Array> * handle = <Value unavailable error>)+0x11 [c:\dev\node_modules\font-manager\src\fontmanager.cc @ 112]
05 fontmanager!Nan::imp::FunctionCallbackWrapper(class v8::FunctionCallbackInfo<v8::Value> * info = 0x00000000`001aa660)+0xb6 [c:\dev\node_modules\font-manager\node_modules\nan\nan_callbacks_12_inl.h @ 175]
06 node!v8::internal::AllocationSpaceName+0x12cf0
...

When it fails the font being processed is the following:
0x00000000`05982040 "C:\WINDOWS\FONTS\ARIAL.TTF"

and the line of the crash seems around these:

      // this method requires windows 7, so we need to cast to an IDWriteFontFace1
      IDWriteFontFace1 *face1 = static_cast<IDWriteFontFace1 *>(face);
      bool monospace = face1->IsMonospacedFont() == TRUE;

Any idea why and how I could work around this issue?

Thanks,
Manu

@manu-st
Copy link
Author

manu-st commented May 3, 2018

Look at the code and the documentation from Microsoft about IDWriteFontFace1, it said it requires the Platform Update For Windows 7 (https://msdn.microsoft.com/en-us/library/windows/desktop/hh780409(v=vs.85).aspx) which I found at: https://www.microsoft.com/en-us/download/details.aspx?id=36805.

After installing it the crash was gone.

Could the code be modified to not crash?

@TanninOne
Copy link
Contributor

I've created a pull request that should address this. It should then work on Windows 7 prior to the platform update but the "monospace" flag will always be set to false.

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

No branches or pull requests

3 participants