if (File.Exists(fileName))
{
if (FT_New_Face(lib, fileName, 0, out face) != 0)
{
Debug.LogError("Unable to use the chosen font (FT_New_Face).");
}
else
{
FT_FaceRec record
= (FT_FaceRec
)Marshal
.PtrToStructure(face,
typeof(FT_FaceRec
)); names
= new string[record
.num_faces];
for (int i = 0; i < record.num_faces; i++)
{
IntPtr ptr = IntPtr.Zero;
if (FT_New_Face(lib, fileName, i, out ptr) == 0)
{
string family = Marshal.PtrToStringAnsi(record.family_name);
string style = Marshal.PtrToStringAnsi(record.style_name);//crash in this line
names[i] = family + " - " + style;
FT_Done_Face(ptr);
}
}
}
}
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?