mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-20 13:04:49 -05:00
AddFontMemRessourceEx not supported on libgdiplus
This commit is contained in:
@@ -562,8 +562,6 @@ public static Image getSprite(PKM pkm)
|
||||
}
|
||||
|
||||
// Font Related
|
||||
[DllImport("gdi32.dll")]
|
||||
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
|
||||
private static readonly PrivateFontCollection s_FontCollection = new PrivateFontCollection();
|
||||
private static FontFamily[] FontFamilies
|
||||
{
|
||||
@@ -581,12 +579,10 @@ private static void setPKXFont()
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] fontData = Resources.pgldings_normalregular;
|
||||
IntPtr fontPtr = Marshal.AllocCoTaskMem(fontData.Length);
|
||||
Marshal.Copy(fontData, 0, fontPtr, fontData.Length);
|
||||
s_FontCollection.AddMemoryFont(fontPtr, Resources.pgldings_normalregular.Length); uint dummy = 0;
|
||||
AddFontMemResourceEx(fontPtr, (uint)Resources.pgldings_normalregular.Length, IntPtr.Zero, ref dummy);
|
||||
Marshal.FreeCoTaskMem(fontPtr);
|
||||
byte[] fontData = Resources.pgldings_normalregular;
|
||||
GCHandle fontHandle = GCHandle.Alloc(fontData, GCHandleType.Pinned);
|
||||
s_FontCollection.AddMemoryFont(fontHandle.AddrOfPinnedObject(), fontData.Length);
|
||||
fontHandle.Free();
|
||||
}
|
||||
catch (Exception ex) { Util.Error("Unable to add ingame font.", ex); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user