mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-03-12 21:07:01 +00:00
Kcl library fixes
This commit is contained in:
parent
d350821e27
commit
90e7853412
4 changed files with 8 additions and 5 deletions
File_Format_Library
Toolbox/Lib
|
@ -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();
|
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);
|
var fontDataPtr = Marshal.AllocCoTaskMem(DecryptedFont.Length);
|
||||||
Marshal.Copy(DecryptedFont, 0, fontDataPtr, 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;
|
uint cFonts = 0;
|
||||||
AddFontMemResourceEx(fontDataPtr, (uint)DecryptedFont.Length, IntPtr.Zero, ref cFonts);
|
AddFontMemResourceEx(fontDataPtr, (uint)DecryptedFont.Length, IntPtr.Zero, ref cFonts);
|
||||||
|
|
||||||
privateFonts.AddMemoryFont(fontDataPtr, DecryptedFont.Length);
|
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 };
|
var texbox = new RichTextBox() { Multiline = true, BorderStyle = BorderStyle.None, Dock = DockStyle.Fill };
|
||||||
texbox.BackColor = FormThemes.BaseTheme.FormBackColor;
|
texbox.BackColor = FormThemes.BaseTheme.FormBackColor;
|
||||||
|
|
|
@ -82,7 +82,6 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EditorCoreCommon">
|
<Reference Include="EditorCoreCommon">
|
||||||
<HintPath>..\Toolbox\Lib\EditorCoreCommon.dll</HintPath>
|
<HintPath>..\Toolbox\Lib\EditorCoreCommon.dll</HintPath>
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Gl_EditorFramework">
|
<Reference Include="Gl_EditorFramework">
|
||||||
<HintPath>..\Toolbox\Gl_EditorFramework.dll</HintPath>
|
<HintPath>..\Toolbox\Gl_EditorFramework.dll</HintPath>
|
||||||
|
@ -90,7 +89,6 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="KCLExt">
|
<Reference Include="KCLExt">
|
||||||
<HintPath>..\Toolbox\Lib\KCLExt.dll</HintPath>
|
<HintPath>..\Toolbox\Lib\KCLExt.dll</HintPath>
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="LibHac">
|
<Reference Include="LibHac">
|
||||||
<HintPath>..\Toolbox\Lib\LibHac.dll</HintPath>
|
<HintPath>..\Toolbox\Lib\LibHac.dll</HintPath>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue