Exemple #1
0
        internal void FontMgrSetup(bool frameSizeFixed, bool fontSizeFixed, DrawMode isPlay)
        {
            var tmpZoom = isPlay == DrawMode.Upload ? 1 : Zoom;

            FontMgr.ShowGrid = false;
            //Zoom
            FontMgr.ScaleIndex = tmpZoom;
            //Paint type
            FontMgr.SetStyle(frameSizeFixed, fontSizeFixed);
            //Font info
            FontMgr.TextColor     = IsUpload ? SourceForeColor: ForeColor;
            FontMgr.BackColor     = IsUpload ? SourceBackColor: BackColor;
            FontMgr.FontName      = Font.Name;
            FontMgr.FontHeight    = int.Parse((Font.Size * tmpZoom).ToString());
            FontMgr.Alignment     = _textAlign;;
            FontMgr.LineAlignment = _textVAlign;
            FontMgr.Bold          = (Font.Style & FontStyle.Bold) == FontStyle.Bold;
            FontMgr.Italic        = (Font.Style & FontStyle.Italic) == FontStyle.Italic;
            FontMgr.KernAmount    = KernAmount * tmpZoom;
            FontMgr.LeadAmount    = LeadAmount * tmpZoom;
            //FontMgr.ShowGrid = hideGrid ? false : true;

            if (isPlay == DrawMode.Upload)
            {
                FontMgr.FrameSize = new Size(Math.Abs(base.VirtualBounds.Size.Width.PopulatePixel(-Zoom)), Math.Abs(base.VirtualBounds.Size.Height.PopulatePixel(-Zoom)));
            }
            else
            {
                FontMgr.FrameSize = new Size(Math.Abs(base.VirtualBounds.Size.Width), Math.Abs(base.VirtualBounds.Size.Height));
            }
            //FontMgr.FrameSize = new Size(base.VirtualInnerBounds.Width + base.BorderWidth, base.VirtualInnerBounds.Height + base.BorderWidth);
            //FontMgr.FrameSize = base.VirtualInnerBounds.Size;// InnerSize.ToSize();
            //Text
            FontMgr.Text = Text;

            switch (TextEffect.Effect)
            {
            case OutlineShadowType.SHADED:
                FontMgr.SetShadowAttri(this.TextEffect.EffectColor, this.TextEffect.ShadowLateralShift * Zoom, this.TextEffect.ShadowVerticalShift * Zoom);
                //FontMgr.SetShadowAttri(IsUpload ? this.TextEffect.EffectColor : SignTypeHandler.ConvertColor(this.TextEffect.EffectColor, SignType), this.TextEffect.ShadowLateralShift * Zoom, this.TextEffect.ShadowVerticalShift * Zoom);
                break;

            case OutlineShadowType.OUTLINE:
                FontMgr.SetOutlineAttri(this.TextEffect.EffectColor, (ushort)(this.TextEffect.OutlineWidth * Zoom));
                //FontMgr.SetOutlineAttri(IsUpload ? this.TextEffect.EffectColor : SignTypeHandler.ConvertColor(this.TextEffect.EffectColor, SignType), (ushort)(this.TextEffect.OutlineWidth * Zoom));
                break;

            case OutlineShadowType.NONE:
                FontMgr.CancelTextEffect();
                break;
            }
        }
 private void FontMgrSetup(bool frameSizeFixed, bool fontSizeFixed, bool hideGrid)
 {
     FontMgr.ShowGrid   = !hideGrid;
     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          = Text;
 }