コード例 #1
0
ファイル: ShapeTemp.cs プロジェクト: heng222/MyRepository
 private void FontMgrSetup(bool frameSizeFixed, bool fontSizeFixed, bool isPlay)
 {
     FontMgr.ShowGrid   = !isPlay;
     FontMgr.ScaleIndex = Zoom;
     FontMgr.SetStyle(frameSizeFixed, fontSizeFixed);
     FontMgr.TextColor     = ForeColor;
     FontMgr.BackColor     = BackColor;
     FontMgr.FontName      = Font.Name;
     FontMgr.FontHeight    = int.Parse((Font.Size * Zoom).ToString());
     FontMgr.Alignment     = Align;
     FontMgr.LineAlignment = Valign;
     FontMgr.Bold          = (Font.Style & FontStyle.Bold) == FontStyle.Bold;
     FontMgr.Italic        = (Font.Style & FontStyle.Italic) == FontStyle.Italic;
     FontMgr.SignSize      = new Size(SignSize.Width * Zoom - 2, SignSize.Height * Zoom - 2);
     FontMgr.FrameSize     = base.VirtualBounds.Size;
     FontMgr.Text          = GetTempByFormatString(DisplayFormat);
 }
コード例 #2
0
        public frmCLIForm()
        {
            //FontManager.Initialize("C:\\FontPackage.xml");
            // ---------- common attributes -------------------
            _FontMgr.ScaleIndex = 3;
            _FontMgr.SetStyle(true, false);
            _FontMgr.Alignment     = Align.CENTER;
            _FontMgr.LineAlignment = Valign.MIDDLE;
            _FontMgr.KernAmount    = 1 * _FontMgr.ScaleIndex;
            //_FontMgr.LeadAmount = 5 * _FontMgr.ScaleIndex;
            //_FontMgr.Underline = true;
            //_FontMgr.Bold = true;
            //_FontMgr.Italic = true;
            _FontMgr.BackColor = Color.Transparent;
            _FontMgr.TextColor = Color.White;
            _FontMgr.Text      = m_strText;
            //_FontMgr.Text = "Text";
            _FontMgr.SignSize   = new Size(1000, 1000);
            _FontMgr.FrameSize  = _FontMgr.SignSize;
            _FontMgr.FontHeight = 5 * _FontMgr.ScaleIndex;
            //_FontMgr.FontHeight = 16;
            //_FontMgr.FontName = "PL 07 Danielle";
            _FontMgr.FontName = "Arial";// MS Sans Serif
            //_FontMgr.FontName = FontManager.GetProWriteFonts()[0];
            //_FontMgr.FontName = "PL 07 Sans"; // Trans-Lux Pictorials
            //_FontMgr.FontName = "Trans-Lux Pictorials";// MS Sans Serif
            _FontMgr.ShowGrid = true;

            //
            InitializeComponent();

            //
            int iWidth  = this.ClientSize.Width - m_ptStart.X;
            int iHeight = this.ClientSize.Height - m_ptStart.Y;

            // 新的尺寸必须为ScalIndex的整数倍
            iWidth             = (iWidth / (int)(_FontMgr.ScaleIndex)) * (int)_FontMgr.ScaleIndex;
            iHeight            = (iHeight / (int)_FontMgr.ScaleIndex) * (int)_FontMgr.ScaleIndex;
            _FontMgr.FrameSize = new Size(iWidth, iHeight);
        }