From 7ae4bb613de05d88cd782c144019e01bb9f0af83 Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 25 May 2023 10:51:41 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E9=87=8D=E6=9E=84=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Charts/UIChart.cs | 13 ++-- SunnyUI/Common/UMessageTip.cs | 4 +- SunnyUI/Controls/DropItem/UIDropControl.cs | 2 +- SunnyUI/Controls/UIButton.cs | 2 +- SunnyUI/Controls/UIContextMenuStrip.cs | 2 +- SunnyUI/Controls/UIControl.cs | 2 +- SunnyUI/Controls/UIDataGridView.cs | 10 +-- SunnyUI/Controls/UIDataGridViewFooter.cs | 2 +- SunnyUI/Controls/UIEdit.cs | 2 +- SunnyUI/Controls/UIHeaderButton.cs | 2 +- SunnyUI/Controls/UIImageButton.cs | 2 +- SunnyUI/Controls/UILabel.cs | 4 +- SunnyUI/Controls/UIListBoxEx.cs | 2 +- SunnyUI/Controls/UINavBar.cs | 4 +- SunnyUI/Controls/UINavMenu.cs | 4 +- SunnyUI/Controls/UIPanel.cs | 2 +- SunnyUI/Controls/UISmoothLabel.cs | 2 +- SunnyUI/Controls/UITabControl.cs | 4 +- SunnyUI/Controls/UITabControlMenu.cs | 2 +- SunnyUI/Controls/UITextBox.cs | 2 +- SunnyUI/Controls/UIUserControl.cs | 2 +- SunnyUI/Forms/UIForm.cs | 2 +- SunnyUI/Frames/UIPage.cs | 2 +- SunnyUI/Style/UIStyle.cs | 89 ---------------------- SunnyUI/Style/UIStyles.cs | 77 +++++++++++++++++++ 25 files changed, 114 insertions(+), 127 deletions(-) diff --git a/SunnyUI/Charts/UIChart.cs b/SunnyUI/Charts/UIChart.cs index 79495705..48129769 100644 --- a/SunnyUI/Charts/UIChart.cs +++ b/SunnyUI/Charts/UIChart.cs @@ -40,8 +40,8 @@ namespace Sunny.UI Width = 400; Height = 300; - SubFont = UIFontColor.SubFont(); - LegendFont = UIFontColor.SubFont(); + SubFont = UIStyles.SubFont(); + LegendFont = UIStyles.SubFont(); tip.Parent = this; tip.Height = 32; @@ -50,7 +50,7 @@ namespace Sunny.UI tip.Top = 1; tip.StyleCustomMode = true; tip.Style = UIStyle.Custom; - tip.Font = UIFontColor.SubFont(); + tip.Font = UIStyles.SubFont(); tip.RadiusSides = UICornerRadiusSides.None; tip.Visible = false; @@ -65,8 +65,7 @@ namespace Sunny.UI private void Tip_VisibleChanged(object sender, EventArgs e) { tip.IsScaled = true; - float size = SubFont != null ? SubFont.Size : UIFontColor.SubFontSize; - tip.Font = this.Font.DPIScaleFont(size); + tip.Font = this.Font.DPIScaleFont(UIStyles.DefaultSubFontSize); } protected override void Dispose(bool disposing) @@ -206,7 +205,7 @@ namespace Sunny.UI { get { - float size = SubFont != null ? SubFont.Size : UIFontColor.SubFontSize; + float size = UIStyles.DefaultSubFontSize; if (tmpFont == null || !tmpFont.Size.EqualsFloat(size / UIDPIScale.DPIScale())) { @@ -224,7 +223,7 @@ namespace Sunny.UI { get { - float size = LegendFont != null ? LegendFont.Size : UIFontColor.SubFontSize; + float size = UIStyles.DefaultSubFontSize; if (tmpLegendFont == null || !tmpLegendFont.Size.EqualsFloat(size / UIDPIScale.DPIScale())) { diff --git a/SunnyUI/Common/UMessageTip.cs b/SunnyUI/Common/UMessageTip.cs index c69504e4..82d7965c 100644 --- a/SunnyUI/Common/UMessageTip.cs +++ b/SunnyUI/Common/UMessageTip.cs @@ -47,7 +47,7 @@ namespace Sunny.UI public static class UIMessageTip { //默认字体。当样式中的Font==null时用该字体替换 - static readonly Font DefaultFont = UIFontColor.Font(); + static readonly Font DefaultFont = UIStyles.Font(); //文本格式。用于测量和绘制 static readonly StringFormat DefStringFormat = StringFormat.GenericTypographic; @@ -634,7 +634,7 @@ namespace Sunny.UI Width = 2 }; IconSpacing = 5; - TextFont = UIFontColor.Font(); + TextFont = UIStyles.Font(); var fontName = TextFont.Name; if (fontName == "宋体") { TextOffset = new Point(1, 1); } TextColor = Color.Black; diff --git a/SunnyUI/Controls/DropItem/UIDropControl.cs b/SunnyUI/Controls/DropItem/UIDropControl.cs index e250aecd..1ddaa6a2 100644 --- a/SunnyUI/Controls/DropItem/UIDropControl.cs +++ b/SunnyUI/Controls/DropItem/UIDropControl.cs @@ -45,7 +45,7 @@ namespace Sunny.UI Padding = new Padding(0, 0, 30, 2); edit.AutoSize = false; - edit.Font = UIFontColor.Font(); + edit.Font = UIStyles.Font(); edit.Left = 4; edit.Top = 3; edit.Text = String.Empty; diff --git a/SunnyUI/Controls/UIButton.cs b/SunnyUI/Controls/UIButton.cs index 2dca51b3..8699fc68 100644 --- a/SunnyUI/Controls/UIButton.cs +++ b/SunnyUI/Controls/UIButton.cs @@ -195,7 +195,7 @@ namespace Sunny.UI } } - private Font tipsFont = UIFontColor.SubFont(); + private Font tipsFont = UIStyles.SubFont(); /// /// 角标文字字体 diff --git a/SunnyUI/Controls/UIContextMenuStrip.cs b/SunnyUI/Controls/UIContextMenuStrip.cs index 7b703f25..dda8468f 100644 --- a/SunnyUI/Controls/UIContextMenuStrip.cs +++ b/SunnyUI/Controls/UIContextMenuStrip.cs @@ -33,7 +33,7 @@ namespace Sunny.UI public UIContextMenuStrip() { - Font = UIFontColor.Font(); + Font = UIStyles.Font(); RenderMode = ToolStripRenderMode.Professional; Renderer = new ToolStripProfessionalRenderer(ColorTable); Version = UIGlobal.Version; diff --git a/SunnyUI/Controls/UIControl.cs b/SunnyUI/Controls/UIControl.cs index e8594df1..a5958385 100644 --- a/SunnyUI/Controls/UIControl.cs +++ b/SunnyUI/Controls/UIControl.cs @@ -47,7 +47,7 @@ namespace Sunny.UI public UIControl() { Version = UIGlobal.Version; - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); Size = new Size(100, 35); base.MinimumSize = new Size(1, 1); } diff --git a/SunnyUI/Controls/UIDataGridView.cs b/SunnyUI/Controls/UIDataGridView.cs index 3cdb1da1..b17a749b 100644 --- a/SunnyUI/Controls/UIDataGridView.cs +++ b/SunnyUI/Controls/UIDataGridView.cs @@ -63,7 +63,7 @@ namespace Sunny.UI { BackgroundColor = UIColor.White; GridColor = UIColor.Blue; - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); base.DoubleBuffered = true; VBar.Parent = this; @@ -91,17 +91,17 @@ namespace Sunny.UI ColumnHeadersDefaultCellStyle.BackColor = UIColor.Blue; ColumnHeadersDefaultCellStyle.ForeColor = UIColor.White; ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.True; - ColumnHeadersDefaultCellStyle.Font = UIFontColor.Font(); + ColumnHeadersDefaultCellStyle.Font = UIStyles.Font(); //行头部颜色 RowHeadersDefaultCellStyle.BackColor = UIColor.LightBlue; RowHeadersDefaultCellStyle.ForeColor = UIFontColor.Primary; RowHeadersDefaultCellStyle.SelectionBackColor = UIColor.Blue; RowHeadersDefaultCellStyle.SelectionForeColor = Color.White; - RowHeadersDefaultCellStyle.Font = UIFontColor.Font(); + RowHeadersDefaultCellStyle.Font = UIStyles.Font(); - RowsDefaultCellStyle.Font = UIFontColor.Font(); - DefaultCellStyle.Font = UIFontColor.Font(); + RowsDefaultCellStyle.Font = UIStyles.Font(); + DefaultCellStyle.Font = UIStyles.Font(); //标题行行高,与OnColumnAdded事件配合 ColumnHeadersHeight = 32; diff --git a/SunnyUI/Controls/UIDataGridViewFooter.cs b/SunnyUI/Controls/UIDataGridViewFooter.cs index db140e4c..50908b2c 100644 --- a/SunnyUI/Controls/UIDataGridViewFooter.cs +++ b/SunnyUI/Controls/UIDataGridViewFooter.cs @@ -40,7 +40,7 @@ namespace Sunny.UI Height = 29; RadiusSides = UICornerRadiusSides.None; - Font = UIFontColor.Font(); + Font = UIStyles.Font(); foreColor = UIStyles.Blue.DataGridViewFooterForeColor; fillColor = UIStyles.Blue.PlainColor; rectColor = UIStyles.Blue.RectColor; diff --git a/SunnyUI/Controls/UIEdit.cs b/SunnyUI/Controls/UIEdit.cs index 22e85e34..5a0c3ea0 100644 --- a/SunnyUI/Controls/UIEdit.cs +++ b/SunnyUI/Controls/UIEdit.cs @@ -42,7 +42,7 @@ namespace Sunny.UI { //设置为单选边框 BorderStyle = BorderStyle.FixedSingle; - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); base.ForeColor = UIFontColor.Primary; Width = 150; base.MaxLength = 32767; diff --git a/SunnyUI/Controls/UIHeaderButton.cs b/SunnyUI/Controls/UIHeaderButton.cs index 582c683b..9936a28e 100644 --- a/SunnyUI/Controls/UIHeaderButton.cs +++ b/SunnyUI/Controls/UIHeaderButton.cs @@ -146,7 +146,7 @@ namespace Sunny.UI } } - private Font tipsFont = UIFontColor.SubFont(); + private Font tipsFont = UIStyles.SubFont(); [Description("角标文字字体"), Category("SunnyUI")] [DefaultValue(typeof(Font), "微软雅黑, 9pt")] diff --git a/SunnyUI/Controls/UIImageButton.cs b/SunnyUI/Controls/UIImageButton.cs index f49eb2ca..5be9f460 100644 --- a/SunnyUI/Controls/UIImageButton.cs +++ b/SunnyUI/Controls/UIImageButton.cs @@ -209,7 +209,7 @@ namespace Sunny.UI Height = 35; Version = UIGlobal.Version; Cursor = Cursors.Hand; - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); } /// diff --git a/SunnyUI/Controls/UILabel.cs b/SunnyUI/Controls/UILabel.cs index c54de3e1..3e62cd85 100644 --- a/SunnyUI/Controls/UILabel.cs +++ b/SunnyUI/Controls/UILabel.cs @@ -36,7 +36,7 @@ namespace Sunny.UI { public UILabel() { - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); Version = UIGlobal.Version; base.TextAlign = ContentAlignment.MiddleLeft; foreColor = UIStyles.Blue.LabelForeColor; @@ -181,7 +181,7 @@ namespace Sunny.UI { public UILinkLabel() { - Font = UIFontColor.Font(); + Font = UIStyles.Font(); LinkBehavior = LinkBehavior.AlwaysUnderline; Version = UIGlobal.Version; diff --git a/SunnyUI/Controls/UIListBoxEx.cs b/SunnyUI/Controls/UIListBoxEx.cs index b5010f16..24cafacb 100644 --- a/SunnyUI/Controls/UIListBoxEx.cs +++ b/SunnyUI/Controls/UIListBoxEx.cs @@ -191,7 +191,7 @@ namespace Sunny.UI // BorderStyle = BorderStyle.FixedSingle; DrawMode = DrawMode.OwnerDrawFixed; - Font = UIFontColor.Font(); + Font = UIStyles.Font(); IntegralHeight = false; ItemHeight = 25; Size = new Size(150, 200); diff --git a/SunnyUI/Controls/UINavBar.cs b/SunnyUI/Controls/UINavBar.cs index f2f52463..7424987f 100644 --- a/SunnyUI/Controls/UINavBar.cs +++ b/SunnyUI/Controls/UINavBar.cs @@ -56,7 +56,7 @@ namespace Sunny.UI DoubleBuffered = true; UpdateStyles(); - Font = UIFontColor.Font(); + Font = UIStyles.Font(); NavBarMenu.VisibleChanged += NavBarMenu_VisibleChanged; Dock = DockStyle.Top; @@ -351,7 +351,7 @@ namespace Sunny.UI set => NavBarMenu.ImageList = value; } - private Font dropMenuFont = UIFontColor.Font(); + private Font dropMenuFont = UIStyles.Font(); /// /// 标题字体 diff --git a/SunnyUI/Controls/UINavMenu.cs b/SunnyUI/Controls/UINavMenu.cs index e6cf05d6..c31ecd83 100644 --- a/SunnyUI/Controls/UINavMenu.cs +++ b/SunnyUI/Controls/UINavMenu.cs @@ -72,7 +72,7 @@ namespace Sunny.UI //ShowRootLines = false; DoubleBuffered = true; - Font = UIFontColor.Font(); + Font = UIStyles.Font(); //CheckBoxes = false; ItemHeight = 50; BackColor = Color.FromArgb(56, 56, 56); @@ -340,7 +340,7 @@ namespace Sunny.UI } } - private Font tipsFont = UIFontColor.SubFont(); + private Font tipsFont = UIStyles.SubFont(); [Description("角标文字字体"), Category("SunnyUI")] [DefaultValue(typeof(Font), "微软雅黑, 9pt")] diff --git a/SunnyUI/Controls/UIPanel.cs b/SunnyUI/Controls/UIPanel.cs index c6f231fe..64820ef9 100644 --- a/SunnyUI/Controls/UIPanel.cs +++ b/SunnyUI/Controls/UIPanel.cs @@ -39,7 +39,7 @@ namespace Sunny.UI public UIPanel() { InitializeComponent(); - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); base.MinimumSize = new System.Drawing.Size(1, 1); showText = true; SetStyleFlags(true, false, true); diff --git a/SunnyUI/Controls/UISmoothLabel.cs b/SunnyUI/Controls/UISmoothLabel.cs index 417a0294..9ee92145 100644 --- a/SunnyUI/Controls/UISmoothLabel.cs +++ b/SunnyUI/Controls/UISmoothLabel.cs @@ -36,7 +36,7 @@ namespace Sunny.UI { public UISmoothLabel() { - base.Font = UIFontColor.Font(36); + base.Font = UIStyles.Font(); Version = UIGlobal.Version; foreColor = UIStyles.Blue.SmoothLabelForeColor; diff --git a/SunnyUI/Controls/UITabControl.cs b/SunnyUI/Controls/UITabControl.cs index ebe9ddcb..77801bbb 100644 --- a/SunnyUI/Controls/UITabControl.cs +++ b/SunnyUI/Controls/UITabControl.cs @@ -61,7 +61,7 @@ namespace Sunny.UI ItemSize = new Size(150, 40); DrawMode = TabDrawMode.OwnerDrawFixed; - Font = UIFontColor.Font(); + Font = UIStyles.Font(); AfterSetFillColor(FillColor); Version = UIGlobal.Version; @@ -149,7 +149,7 @@ namespace Sunny.UI } } - private Font tipsFont = UIFontColor.SubFont(); + private Font tipsFont = UIStyles.SubFont(); [Description("角标文字字体"), Category("SunnyUI")] [DefaultValue(typeof(Font), "微软雅黑, 9pt")] diff --git a/SunnyUI/Controls/UITabControlMenu.cs b/SunnyUI/Controls/UITabControlMenu.cs index 7c6d4ad3..7da7c979 100644 --- a/SunnyUI/Controls/UITabControlMenu.cs +++ b/SunnyUI/Controls/UITabControlMenu.cs @@ -42,7 +42,7 @@ namespace Sunny.UI base.ItemSize = new Size(40, 200); DrawMode = TabDrawMode.OwnerDrawFixed; - Font = UIFontColor.Font(); + Font = UIStyles.Font(); AfterSetFillColor(FillColor); Size = new Size(450, 270); Version = UIGlobal.Version; diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index 9c336800..bba5fc67 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -72,7 +72,7 @@ namespace Sunny.UI SetStyleFlags(true, true, true); ShowText = false; - Font = UIFontColor.Font(); + Font = UIStyles.Font(); MinimumSize = new Size(1, 16); Width = 150; diff --git a/SunnyUI/Controls/UIUserControl.cs b/SunnyUI/Controls/UIUserControl.cs index f550d6ef..e4584088 100644 --- a/SunnyUI/Controls/UIUserControl.cs +++ b/SunnyUI/Controls/UIUserControl.cs @@ -46,7 +46,7 @@ namespace Sunny.UI InitializeComponent(); Version = UIGlobal.Version; AutoScaleMode = AutoScaleMode.None; - base.Font = UIFontColor.Font(); + base.Font = UIStyles.Font(); base.MinimumSize = new System.Drawing.Size(1, 1); SetStyleFlags(true, false); } diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 9c2432a7..184199d8 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -558,7 +558,7 @@ namespace Sunny.UI /// /// 标题字体 /// - private Font titleFont = UIFontColor.Font(); + private Font titleFont = UIStyles.Font(); /// /// 标题字体 diff --git a/SunnyUI/Frames/UIPage.cs b/SunnyUI/Frames/UIPage.cs index 4cb7d592..b0e891bf 100644 --- a/SunnyUI/Frames/UIPage.cs +++ b/SunnyUI/Frames/UIPage.cs @@ -841,7 +841,7 @@ namespace Sunny.UI /// /// 标题字体 /// - private Font titleFont = UIFontColor.Font(); + private Font titleFont = UIStyles.Font(); /// /// 标题字体 diff --git a/SunnyUI/Style/UIStyle.cs b/SunnyUI/Style/UIStyle.cs index ab575f35..708b8073 100644 --- a/SunnyUI/Style/UIStyle.cs +++ b/SunnyUI/Style/UIStyle.cs @@ -23,11 +23,9 @@ * 2021-10-16: V3.0.8 增加系统DPI缩放自适应 ******************************************************************************/ -using System.Collections.Concurrent; using System.Collections.Generic; using System.Drawing; using System.Reflection; -using System.Runtime.InteropServices; using System.Windows.Forms; namespace Sunny.UI @@ -309,93 +307,6 @@ namespace Sunny.UI /// public static class UIFontColor { - private static readonly ConcurrentDictionary FontCharSets = new ConcurrentDictionary(); - - //GdiCharSet - //一个字节值,该值指定使用此 Font 字符集的 GDI 字符集。 默认值为 1。 - //字符集 值 - //ANSI 0 - //DEFAULT 1 - //象征 2 - //SHIFTJIS 128 - //HANGEUL 129 - //HANGUL 129 - //GB2312 134 - //中国BIG5 136 - //OEM 255 - //JOHAB 130 - //希伯来语 177 - //阿拉伯语 178 - //希腊语 161 - //土耳其语 162 - //越南语 163 - //泰语 222 - //EASTEUROPE 238 - //俄语 204 - //MAC 77 - //波罗的海 186 - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - internal class LOGFONT - { - public int lfHeight; - public int lfWidth; - public int lfEscapement; - public int lfOrientation; - public int lfWeight; - public byte lfItalic; - public byte lfUnderline; - public byte lfStrikeOut; - public byte lfCharSet; - public byte lfOutPrecision; - public byte lfClipPrecision; - public byte lfQuality; - public byte lfPitchAndFamily; - [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 32)] - public string lfFaceName; - } - - internal static byte GetGdiCharSet(string fontName, float fontSize) - { - if (FontCharSets.ContainsKey(fontName)) return FontCharSets[fontName]; - using Font font = new Font(fontName, fontSize); - LOGFONT obj = new LOGFONT(); - font.ToLogFont(obj); - FontCharSets.TryAdd(fontName, obj.lfCharSet); - return obj.lfCharSet; - } - - /// - /// 默认字体 - /// - public static Font Font() - { - byte gdiCharSet = GetGdiCharSet("微软雅黑", FontSize); - return new Font("微软雅黑", FontSize, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet); - } - - /// - /// 默认字体 - /// - public static Font Font(float fontSize) - { - byte gdiCharSet = GetGdiCharSet("微软雅黑", fontSize); - return new Font("微软雅黑", fontSize, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet); - } - - public static float FontSize = 12; - - /// - /// 默认二级字体 - /// - public static Font SubFont() - { - byte gdiCharSet = GetGdiCharSet("微软雅黑", SubFontSize); - return new Font("微软雅黑", SubFontSize, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet); - } - - public static float SubFontSize = 9; - /// /// 主要颜色 /// diff --git a/SunnyUI/Style/UIStyles.cs b/SunnyUI/Style/UIStyles.cs index cd9033a3..d5c0a6bc 100644 --- a/SunnyUI/Style/UIStyles.cs +++ b/SunnyUI/Style/UIStyles.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Drawing; +using System.Runtime.InteropServices; using System.Windows.Forms; namespace Sunny.UI @@ -42,6 +43,82 @@ namespace Sunny.UI public static float FontSize { get; set; } = 12; + private static readonly ConcurrentDictionary FontCharSets = new ConcurrentDictionary(); + + //GdiCharSet + //一个字节值,该值指定使用此 Font 字符集的 GDI 字符集。 默认值为 1。 + //字符集 值 + //ANSI 0 + //DEFAULT 1 + //象征 2 + //SHIFTJIS 128 + //HANGEUL 129 + //HANGUL 129 + //GB2312 134 + //中国BIG5 136 + //OEM 255 + //JOHAB 130 + //希伯来语 177 + //阿拉伯语 178 + //希腊语 161 + //土耳其语 162 + //越南语 163 + //泰语 222 + //EASTEUROPE 238 + //俄语 204 + //MAC 77 + //波罗的海 186 + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + internal class LOGFONT + { + public int lfHeight; + public int lfWidth; + public int lfEscapement; + public int lfOrientation; + public int lfWeight; + public byte lfItalic; + public byte lfUnderline; + public byte lfStrikeOut; + public byte lfCharSet; + public byte lfOutPrecision; + public byte lfClipPrecision; + public byte lfQuality; + public byte lfPitchAndFamily; + [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 32)] + public string lfFaceName; + } + + internal static byte GetGdiCharSet(string fontName) + { + if (FontCharSets.ContainsKey(fontName)) return FontCharSets[fontName]; + using Font font = new Font(fontName, 16); + LOGFONT obj = new LOGFONT(); + font.ToLogFont(obj); + FontCharSets.TryAdd(fontName, obj.lfCharSet); + return obj.lfCharSet; + } + + internal static float DefaultFontSize = 12; + internal static float DefaultSubFontSize = 9; + /// + /// 默认字体 + /// + internal static Font Font() + { + byte gdiCharSet = GetGdiCharSet("微软雅黑"); + return new Font("微软雅黑", DefaultFontSize, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet); + } + + /// + /// 默认二级字体 + /// + internal static Font SubFont() + { + byte gdiCharSet = GetGdiCharSet("微软雅黑"); + return new Font("微软雅黑", DefaultSubFontSize, FontStyle.Regular, GraphicsUnit.Point, gdiCharSet); + } + public static List PopularStyles() { List styles = new List();