Author Topic: FontMaker crash in OSX  (Read 4226 times)

genius0215

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
FontMaker crash in OSX
« on: February 19, 2017, 09:15:18 PM »
  1. if (File.Exists(fileName))
  2.                 {
  3.                         if (FT_New_Face(lib, fileName, 0, out face) != 0)
  4.                         {
  5.                                 Debug.LogError("Unable to use the chosen font (FT_New_Face).");
  6.                         }
  7.                         else
  8.                         {
  9.                                 FT_FaceRec record = (FT_FaceRec)Marshal.PtrToStructure(face, typeof(FT_FaceRec));
  10.                                 names = new string[record.num_faces];
  11.  
  12.                                 for (int i = 0; i < record.num_faces; i++)
  13.                                 {
  14.                                         IntPtr ptr = IntPtr.Zero;
  15.  
  16.                                         if (FT_New_Face(lib, fileName, i, out ptr) == 0)
  17.                                         {
  18.                                                 string family = Marshal.PtrToStringAnsi(record.family_name);
  19.                                                 string style = Marshal.PtrToStringAnsi(record.style_name);//crash in this line
  20.                                                 names[i] = family + " - " + style;
  21.                                                 FT_Done_Face(ptr);
  22.                                         }
  23.                                 }
  24.                         }
  25.                 }
  26.  
NGUI version :3.11.1
Unity version :5.5.0f3
FreeType version:2.7.1/2.6.5
OSX version : macOS Sierra 10.12.3

I install freetype with brew in OSX, changing the filename to "FreeType.dylib" from "libfreetype.6.dylib"
and i still crash in line  showed above.

how can I do with this issue?

genius0215

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: FontMaker crash in OSX
« Reply #1 on: February 19, 2017, 09:18:38 PM »
  1. if (File.Exists(fileName))
  2. {
  3.         if (FT_New_Face(lib, fileName, 0, out face) != 0)
  4.         {
  5.                 Debug.LogError("Unable to use the chosen font (FT_New_Face).");
  6.         }
  7.         else
  8.         {
  9.                 FT_FaceRec record = (FT_FaceRec)Marshal.PtrToStructure(face, typeof(FT_FaceRec));
  10.                 names = new string[record.num_faces];
  11.  
  12.                 for (int i = 0; i < record.num_faces; i++)
  13.                 {
  14.                         IntPtr ptr = IntPtr.Zero;
  15.  
  16.                         if (FT_New_Face(lib, fileName, i, out ptr) == 0)
  17.                         {
  18.                                 string family = Marshal.PtrToStringAnsi(record.family_name);
  19.                                 string style = Marshal.PtrToStringAnsi(record.style_name);//crash in this line
  20.                                 names[i] = family + " - " + style;
  21.                                 FT_Done_Face(ptr);
  22.                         }
  23.                 }
  24.         }
  25. }
  26.  
NGUI version :3.11.1
Unity version :5.5.0f3
FreeType version:2.7.1/2.6.5
OSX version : macOS Sierra 10.12.3

I install freetype with brew in OSX, changing the filename to "FreeType.dylib" from "libfreetype.6.dylib"
and i still crash in line  showed above.

how can I do with this issue?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: FontMaker crash in OSX
« Reply #2 on: February 21, 2017, 12:34:07 PM »
I'm pretty sure you need a specific version of FreeType. I don't know what version comes with the OSX. Try getting the FreeType from https://www.freetype.org/ and compiling it yourself.

genius0215

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: FontMaker crash in OSX
« Reply #3 on: February 24, 2017, 08:43:07 AM »
I download the newest freetype and compile it, and still crash when I use the FontMaker.
My FreeType version is 2.7.1.
I want to know which version  work well with the NGUI on OSX?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: FontMaker crash in OSX
« Reply #4 on: February 24, 2017, 09:32:11 AM »
I believe it was FreeType 2.5, but it's been so long that I'm not sure...