internal unsafe void refreshName() { if (nativeFontFamily == IntPtr.Zero) { return; } char * namePtr = stackalloc char[GDIPlus.FACESIZE]; Status status = GDIPlus.GdipGetFamilyName(nativeFontFamily, (IntPtr)namePtr, 0); GDIPlus.CheckStatus(status); name = Marshal.PtrToStringUni((IntPtr)namePtr); }
internal void refreshName() { StringBuilder sb; if (nativeFontFamily == IntPtr.Zero) { return; } sb = new StringBuilder(GDIPlus.FACESIZE); Status status = GDIPlus.GdipGetFamilyName(nativeFontFamily, sb, 0); GDIPlus.CheckStatus(status); name = sb.ToString(); }
internal void refreshName() { StringBuilder sb; if (nativeFontFamily == IntPtr.Zero) { return; } sb = new StringBuilder(GDIPlus.FACESIZE); Console.WriteLine("before calling Win32GdipGetFamilyName"); Status status = GDIPlus.GdipGetFamilyName(nativeFontFamily, sb, 0); Console.WriteLine($"after calling Win32GdipGetFamilyName: {sb.ToString()}"); GDIPlus.CheckStatus(status); name = sb.ToString(); }