📄 gxfont.cs
字号:
using System;
using System.Runtime.InteropServices;
#if !DESKTOP
using Microsoft.WindowsMobile.DirectX;
using Microsoft.WindowsMobile.DirectX.Direct3D;
#else
using Microsoft.DirectX.Direct3D;
#endif
namespace GXGraphicsLibrary
{
/// <summary>
/// Draw modes
/// </summary>
public enum FontDrawFlags
{
GDDRAWTEXT_LEFT = 0x0001,
GDDRAWTEXT_CENTER = 0x0002,
GDDRAWTEXT_RIGHT = 0x0004
}
public interface IGXFont : IDisposable {}
/// <summary>
/// Summary description for GXFont.
/// </summary>
public class GDIGXFont : IGXFont
{
protected System.Drawing.Font m_font = null;
/// <summary>
/// Gets the GDI font associated with this font data.
/// </summary>
public System.Drawing.Font MyFont { get { return m_font; } }
/// <summary>
/// Allocate and load a font.
/// </summary>
/// <param name="fontName">Name of font family</param>
public GDIGXFont(string fontName)
{
m_font = new System.Drawing.Font(fontName, 12, System.Drawing.FontStyle.Regular);
}
public void Dispose()
{
if(m_font != null)
m_font.Dispose();
}
}
public class DirectXGXFont : IGXFont
{
protected Font m_font = null;
public Font MyFont { get { return m_font; } }
public DirectXGXFont(string fontName, Device device)
{
System.Drawing.Font gdi_font = new System.Drawing.Font(fontName, 12, System.Drawing.FontStyle.Regular);
m_font = new Font(device, gdi_font);
}
public void Dispose()
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -