1
0
mirror of synced 2024-12-01 02:27:22 +01:00

Kcl library fixes

This commit is contained in:
KillzXGaming 2019-09-12 21:09:39 -04:00
parent d350821e27
commit 90e7853412
4 changed files with 8 additions and 5 deletions

View File

@ -102,20 +102,25 @@ namespace FirstPlugin
}
}
public override void OnClick(TreeView treeview)
private System.Drawing.Font ToFont(int Size = 72)
{
System.Drawing.Text.PrivateFontCollection privateFonts = new System.Drawing.Text.PrivateFontCollection();
// We HAVE to do this to register the font to the system (Weird .NET bug !)
var fontDataPtr = Marshal.AllocCoTaskMem(DecryptedFont.Length);
Marshal.Copy(DecryptedFont, 0, fontDataPtr, DecryptedFont.Length);
// We HAVE to do this to register the font to the system (Weird .NET bug !)
uint cFonts = 0;
AddFontMemResourceEx(fontDataPtr, (uint)DecryptedFont.Length, IntPtr.Zero, ref cFonts);
privateFonts.AddMemoryFont(fontDataPtr, DecryptedFont.Length);
System.Drawing.Font font = new System.Drawing.Font(privateFonts.Families[0], 12);
return new System.Drawing.Font(privateFonts.Families[0], Size);
}
public override void OnClick(TreeView treeview)
{
var font = ToFont();
var texbox = new RichTextBox() { Multiline = true, BorderStyle = BorderStyle.None, Dock = DockStyle.Fill };
texbox.BackColor = FormThemes.BaseTheme.FormBackColor;

View File

@ -82,7 +82,6 @@
</Reference>
<Reference Include="EditorCoreCommon">
<HintPath>..\Toolbox\Lib\EditorCoreCommon.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Gl_EditorFramework">
<HintPath>..\Toolbox\Gl_EditorFramework.dll</HintPath>
@ -90,7 +89,6 @@
</Reference>
<Reference Include="KCLExt">
<HintPath>..\Toolbox\Lib\KCLExt.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LibHac">
<HintPath>..\Toolbox\Lib\LibHac.dll</HintPath>

Binary file not shown.

Binary file not shown.