static TextDecorations()
        {
            // Init Underline            
            TextDecoration td = new TextDecoration();
            td.Location       = TextDecorationLocation.Underline;
            underline         = new TextDecorationCollection();
            underline.Add(td);
            underline.Freeze();

            // Init strikethrough
            td = new TextDecoration();
            td.Location       = TextDecorationLocation.Strikethrough;
            strikethrough     = new TextDecorationCollection();
            strikethrough.Add(td);
            strikethrough.Freeze();
            
            // Init overline
            td = new TextDecoration();
            td.Location       = TextDecorationLocation.OverLine;
            overLine          = new TextDecorationCollection();
            overLine.Add(td);
            overLine.Freeze();

            // Init baseline
            td = new TextDecoration();
            td.Location       = TextDecorationLocation.Baseline;
            baseline          = new TextDecorationCollection();
            baseline.Add(td);
            baseline.Freeze();            
        }
Exemple #2
0
        public TextStyle copyWith(
            bool?inherit                        = null,
            Color color                         = null,
            Color backgroundColor               = null,
            string fontFamily                   = null,
            List <string> fontFamilyFallback    = null,
            float?fontSize                      = null,
            FontWeight fontWeight               = null,
            FontStyle?fontStyle                 = null,
            float?letterSpacing                 = null,
            float?wordSpacing                   = null,
            TextBaseline?textBaseline           = null,
            float?height                        = null,
            Paint foreground                    = null,
            Paint background                    = null,
            TextDecoration decoration           = null,
            Color decorationColor               = null,
            TextDecorationStyle?decorationStyle = null,
            float?decorationThickness           = null,
            string debugLabel                   = null)
        {
            D.assert(color == null || foreground == null, () => _kColorForegroundWarning);
            D.assert(backgroundColor == null || background == null, () => _kColorBackgroundWarning);
            string newDebugLabel = null;

            D.assert(() => {
                if (this.debugLabel != null)
                {
                    newDebugLabel = debugLabel ?? $"({this.debugLabel}).copyWith";
                }

                return(true);
            });

            return(new TextStyle(
                       inherit: inherit ?? this.inherit,
                       color: this.foreground == null && foreground == null ? color ?? this.color : null,
                       backgroundColor: this.background == null && background == null ? color ?? this.color : null,
                       fontFamily: fontFamily ?? this.fontFamily,
                       fontFamilyFallback: fontFamilyFallback ?? this.fontFamilyFallback,
                       fontSize: fontSize ?? this.fontSize,
                       fontWeight: fontWeight ?? this.fontWeight,
                       fontStyle: fontStyle ?? this.fontStyle,
                       letterSpacing: letterSpacing ?? this.letterSpacing,
                       wordSpacing: wordSpacing ?? this.wordSpacing,
                       textBaseline: textBaseline ?? this.textBaseline,
                       height: height ?? this.height,
                       decoration: decoration ?? this.decoration,
                       decorationColor: decorationColor ?? this.decorationColor,
                       decorationStyle: decorationStyle ?? this.decorationStyle,
                       decorationThickness: decorationThickness ?? this.decorationThickness,
                       foreground: foreground ?? this.foreground,
                       background: background ?? this.background,
                       debugLabel: newDebugLabel
                       ));
        }
        // Register point scored
        private void Score(string player, string message)
        {
            this.hitTime    = DateTime.MinValue;
            this.inVolley   = false;
            this.scoreDelay = DateTime.Now;
            VolleyStats();
            VolleyNumber++;

            ScoreMessageString = message;

            TextDecoration  myUnderline = new TextDecoration();
            Color           myGreen     = Color.FromRgb(118, 255, 3);
            SolidColorBrush myBrush     = new SolidColorBrush(myGreen);

            myUnderline.Pen = new Pen(myBrush, 2);
            TextDecorationCollection myCollection = new TextDecorationCollection();

            myCollection.Add(myUnderline);

            if (player == "P1")
            {
                this.PlayerOneScore++;
                PlayScore();
                PlayerOneUserName.TextDecorations = myCollection;
                if (debug)
                {
                    P1ScoreMessage.Visibility = Visibility.Visible;
                }
                P2ScoreMessage.Visibility = Visibility.Hidden;
            }
            else
            {
                this.PlayerTwoScore++;
                PlayScore();
                PlayerTwoUserName.TextDecorations = myCollection;
                P1ScoreMessage.Visibility         = Visibility.Hidden;
                if (debug)
                {
                    P2ScoreMessage.Visibility = Visibility.Visible;
                }
            }
            DetermineServe();

            if (PlayerOneScore == 21 || PlayerTwoScore == 21)
            {
                PlayerOneSubPoint.Visibility  = Visibility.Collapsed;
                PlayerOneAddPoint.Visibility  = Visibility.Collapsed;
                PlayerTwoSubPoint.Visibility  = Visibility.Collapsed;
                PlayerTwoAddPoint.Visibility  = Visibility.Collapsed;
                UndoGameOverButton.Visibility = Visibility.Visible;
                GameSummaryButton.Visibility  = Visibility.Visible;

                gameOver = true;
                PlayGameWin();
            }
        }
Exemple #4
0
 /// <summary>
 /// 操作の対象になるドキュメントと文字のエンコーディングを指定して構築
 /// </summary>
 public AbstractTerminal(ConnectionTag tag, ICharDecoder decoder)
 {
     _tag               = tag;
     _decoder           = decoder;
     _terminalMode      = TerminalMode.Normal;
     _currentdecoration = TextDecoration.Default;
     _manipulator       = new GLineManipulator(80);
     _bufferForMacro    = new StringBuilder();
     _signalForMacro    = new AutoResetEvent(false);
 }
Exemple #5
0
 public Style(string fontName, UnitPx fontSize, FontWeight fontWeight, FontStyle fontStyle, TextTransform textTransform, TextDecoration textDecoration, Color color)
 {
     this.FontName       = fontName;
     this.FontSize       = fontSize;
     this.FontWeight     = fontWeight;
     this.FontStyle      = fontStyle;
     this.TextTransform  = textTransform;
     this.TextDecoration = textDecoration == TextDecoration.Inherit? TextDecoration.None: textDecoration;
     this.Color          = color;
 }
Exemple #6
0
        public void tdOver(object sender, RoutedEventArgs e)
        {
            TextDecorationCollection myCollection = new TextDecorationCollection();
            TextDecoration           myOverline   = new TextDecoration();

            myOverline.Location         = TextDecorationLocation.OverLine;
            myOverline.Pen              = new Pen(Brushes.Red, 1);
            myOverline.PenThicknessUnit = TextDecorationUnit.FontRecommended;
            myCollection.Add(myOverline);
            tb1.TextDecorations = myCollection;
        }
Exemple #7
0
        public void tdStrike(object sender, RoutedEventArgs e)
        {
            TextDecorationCollection myCollection    = new TextDecorationCollection();
            TextDecoration           myStrikethrough = new TextDecoration();

            myStrikethrough.Location         = TextDecorationLocation.Strikethrough;
            myStrikethrough.Pen              = new Pen(Brushes.Red, 1);
            myStrikethrough.PenThicknessUnit = TextDecorationUnit.FontRecommended;
            myCollection.Add(myStrikethrough);
            tb1.TextDecorations = myCollection;
        }
Exemple #8
0
        private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            if (e.ColumnIndex == 2)
            {
                e.SubItem.ForeColor = primaryCellColor;
            }
            else
            {
                e.SubItem.ForeColor = otherCellColor;
            }

            if (e.ColumnIndex != 0)
            {
                return;
            }

            // Setup album artwork column
            Song song = (Song)e.Model;

            if (song.TrackNumber == 1)
            {
                Image albumCover = this.GetAlbumArtwork(song);
                if (albumCover != null)
                {
                    // albumCover = albumCover.GetThumbnailImage(120, 120, delegate { return false; }, IntPtr.Zero);
                    ImageDecoration decoration = new ImageDecoration(albumCover);
                    decoration.ShrinkToWidth          = true;
                    decoration.AdornmentCorner        = ContentAlignment.BottomCenter;
                    decoration.ReferenceCorner        = ContentAlignment.TopCenter;
                    e.SubItem.Decoration              = decoration;
                    albumImageDecorations[song.Album] = new ForwardingDecoration(e.Item, e.SubItem, decoration);

                    TextDecoration td = new TextDecoration(song.Album, ContentAlignment.BottomCenter);
                    td.Font = this.objectListView1.Font;
                    td.Wrap = false;

                    td.TextColor      = primaryCellColor;
                    td.BackColor      = Color.FromArgb(255, 16, 16, 16);
                    td.CornerRounding = 4;

                    //td.BackColor = otherCellColor;
                    //td.TextColor = Color.FromArgb(255, 16, 16, 16);
                    //td.CornerRounding = 0;
                    e.SubItem.Decorations.Add(td);
                }
            }
            else
            {
                if (albumImageDecorations.ContainsKey(song.Album))
                {
                    e.SubItem.Decoration = albumImageDecorations[song.Album];
                }
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="dec"></param>
 /// <returns></returns>
 /// <exclude/>
 public Color CalcBackColor(TextDecoration dec)
 {
     if (dec.Inverted)
     {
         return(CalcTextColor_Impl(dec));
     }
     else
     {
         return(CalcBackColor_Impl(dec));
     }
 }
Exemple #10
0
 public TextRun(string text, FontStyle fontStyle, FontVariant fontVariant, FontWeight fontWeight, TextDecoration textDecoration, VerticalAlign verticalAlign)
     : base(string.IsNullOrEmpty(text))
 {
     // init
     Text           = text;
     FontStyle      = fontStyle;
     FontVariant    = fontVariant;
     FontWeight     = fontWeight;
     TextDecoration = textDecoration;
     VerticalAlign  = verticalAlign;
 }
Exemple #11
0
        public TextStyle apply(
            Color color = null,
            TextDecoration decoration           = null,
            Color decorationColor               = null,
            TextDecorationStyle?decorationStyle = null,
            string fontFamily          = null,
            double fontSizeFactor      = 1.0,
            double fontSizeDelta       = 0.0,
            int fontWeightDelta        = 0,
            double letterSpacingFactor = 1.0,
            double letterSpacingDelta  = 0.0,
            double wordSpacingFactor   = 1.0,
            double wordSpacingDelta    = 0.0,
            double heightFactor        = 1.0,
            double heightDelta         = 0.0
            )
        {
            D.assert(this.fontSize != null || (fontSizeFactor == 1.0 && fontSizeDelta == 0.0));
            D.assert(this.fontWeight != null || fontWeightDelta == 0.0);
            D.assert(this.letterSpacing != null || (letterSpacingFactor == 1.0 && letterSpacingDelta == 0.0));
            D.assert(this.wordSpacing != null || (wordSpacingFactor == 1.0 && wordSpacingDelta == 0.0));
            D.assert(this.height != null || (heightFactor == 1.0 && heightDelta == 0.0));

            string modifiedDebugLabel = "";

            D.assert(() => {
                if (this.debugLabel != null)
                {
                    modifiedDebugLabel = this.debugLabel + ".apply";
                }

                return(true);
            });

            return(new TextStyle(
                       inherit: this.inherit,
                       color: color ?? this.color,
                       fontFamily: fontFamily ?? this.fontFamily,
                       fontSize: this.fontSize == null ? null : this.fontSize * fontSizeFactor + fontSizeDelta,
                       fontWeight: this.fontWeight == null ? null : this.fontWeight,
                       fontStyle: this.fontStyle,
                       letterSpacing: this.letterSpacing == null
                    ? null
                    : this.letterSpacing * letterSpacingFactor + letterSpacingDelta,
                       wordSpacing: this.wordSpacing == null ? null : this.wordSpacing * wordSpacingFactor + wordSpacingDelta,
                       textBaseline: this.textBaseline,
                       height: this.height == null ? null : this.height * heightFactor + heightDelta,
                       background: this.background,
                       decoration: decoration ?? this.decoration,
                       decorationColor: decorationColor ?? this.decorationColor,
                       decorationStyle: decorationStyle ?? this.decorationStyle,
                       debugLabel: modifiedDebugLabel
                       ));
        }
        public LineSpellColorizer(TextEditor editor)
        {
            mEditor = editor;
            var dec = new TextDecoration();

            dec.Pen = new Pen {
                Thickness = 1, DashStyle = DashStyles.DashDot, Brush = new SolidColorBrush(Colors.Red)
            };
            dec.PenThicknessUnit = TextDecorationUnit.FontRecommended;
            collection.Add(dec);
        }
Exemple #13
0
        public string ToCss()
        {
            string text = TextDecoration.ToString().ToLower();

            if (TextDecoration == TextDecoration.LineThrough)
            {
                text = "line-through";
            }

            return(CssStyleBroker.WrapCssClassName(this, String.Format("text-decoration: {0}", text)));
        }
        private static TextDecorationCollection GetUnderlineTextDecorations(XmlReader reader, Inline inline)
        {
            TextDecoration textDecoration;

            Color?color = GetColor(reader[ColorAttribute, WordprocessingMLNamespace]);
            Brush brush = color.HasValue ? new SolidColorBrush(color.Value) : inline.Foreground;

            TextDecorationCollection textDecorations = new TextDecorationCollection {
                (textDecoration = new TextDecoration {
                    Location = TextDecorationLocation.Underline,
                    Pen = new Pen {
                        Brush = brush
                    }
                })
            };

            switch (GetValueAttribute(reader))
            {
            case "single":
                break;

            case "double":
                textDecoration.PenOffset = inline.FontSize * 0.05;
                textDecoration           = textDecoration.Clone();
                textDecoration.PenOffset = inline.FontSize * -0.05;
                textDecorations.Add(textDecoration);
                break;

            case "dotted":
                textDecoration.Pen.DashStyle = DashStyles.Dot;
                break;

            case "dash":
                textDecoration.Pen.DashStyle = DashStyles.Dash;
                break;

            case "dotDash":
                textDecoration.Pen.DashStyle = DashStyles.DashDot;
                break;

            case "dotDotDash":
                textDecoration.Pen.DashStyle = DashStyles.DashDotDot;
                break;

            case "none":
            // fallthrough
            default:
                // If underline type is none or unsupported then it will be ignored.
                return(null);
            }

            return(textDecorations);
        }
Exemple #15
0
        public static TextDecorationCollection GetStrikeThough()
        {
            TextDecorationCollection mycollection = new TextDecorationCollection();

            TextDecoration myStrikeThough = TextDecorations.Strikethrough[0].Clone();

            //myStrikeThough.PenThicknessUnit = TextDecorationUnit.Pixel;

            mycollection.Add(myStrikeThough);

            return(mycollection);
        }
Exemple #16
0
        public static TextDecorationCollection GetUnderline()
        {
            TextDecorationCollection mycollection = new TextDecorationCollection();

            TextDecoration myUnderline = TextDecorations.Underline[0].Clone();

            //myUnderline.PenThicknessUnit = TextDecorationUnit.Pixel;

            mycollection.Add(myUnderline);

            return(mycollection);
        }
Exemple #17
0
        /// <summary>
        /// Event on format cell
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void FastOlvOnFormatCell(object sender, FormatCellEventArgs args)
        {
            CompletionItem item = (CompletionItem)args.Model;

            if (item == null)
            {
                return;
            }

            // display the flags
            int offset = -5;

            item.DoForEachFlag((name, flag) => {
                Image tryImg = (Image)ImageResources.ResourceManager.GetObject(name);
                if (tryImg != null)
                {
                    ImageDecoration decoration = new ImageDecoration(tryImg, 100, ContentAlignment.MiddleRight)
                    {
                        Offset = new Size(offset, 0)
                    };
                    if (args.SubItem.Decoration == null)
                    {
                        args.SubItem.Decoration = decoration;
                    }
                    else
                    {
                        args.SubItem.Decorations.Add(decoration);
                    }
                    offset -= 20;
                }
            });

            // display the sub string
            if (offset < -5)
            {
                offset -= 5;
            }
            if (!String.IsNullOrEmpty(item.SubString))
            {
                TextDecoration decoration = new TextDecoration(item.SubString, 100)
                {
                    Alignment      = ContentAlignment.MiddleRight,
                    Offset         = new Size(offset, 0),
                    Font           = FontManager.GetFont(FontStyle.Bold, 10),
                    TextColor      = ThemeManager.Current.SubTextFore,
                    CornerRounding = 1f,
                    Rotation       = 0,
                    BorderWidth    = 1,
                    BorderColor    = ThemeManager.Current.SubTextFore
                };
                args.SubItem.Decorations.Add(decoration);
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="dec"></param>
 /// <returns></returns>
 /// <exclude/>
 public Color CalcTextColor(TextDecoration dec)
 {
     // inverted xor invisible
     if (dec.Inverted != dec.Invisible)
     {
         return(CalcBackColor_Impl(dec));
     }
     else
     {
         return(CalcTextColor_Impl(dec));
     }
 }
        void CreateStrikeout(TextBlock textBlock, TextStyleDecorator styleDecorator)
        {
            TextDecoration strikeOut = new TextDecoration();

            strikeOut.Location = TextDecorationLocation.Strikethrough;

            Pen p = CreateWpfPen(styleDecorator);

            strikeOut.Pen = p;
            strikeOut.PenThicknessUnit = TextDecorationUnit.FontRecommended;
            textBlock.TextDecorations.Add(strikeOut);
        }
Exemple #20
0
        protected virtual void ProcessSGR(string param)
        {
            string[]       ps  = param.Split(';');
            TextDecoration dec = _currentdecoration;

            foreach (string cmd in ps)
            {
                int code = ParseSGRCode(cmd);
                ProcessSGRParameterANSI(code, ref dec);
            }
            _currentdecoration = dec;
        }
Exemple #21
0
        private TextDecorationCollection GetUnderline(SolidColorBrush color, int thickness)
        {
            var collection = new TextDecorationCollection();
            var strike     = new TextDecoration();

            strike.Location = TextDecorationLocation.Underline;

            strike.Pen = new Pen(color, thickness);
            strike.PenThicknessUnit = TextDecorationUnit.FontRecommended;

            collection.Add(strike);
            return(collection);
        }
Exemple #22
0
        /// <summary>
        /// 咨询链接鼠标事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void hyperLink_MouseEnter(object sender, MouseEventArgs e)
        {
            var            tb          = sender as Hyperlink;
            TextDecoration myUnderline = new TextDecoration();
            Pen            myPen       = new Pen();

            myPen.Brush = new SolidColorBrush(Color.FromArgb(0xff, 0, 0, 0));
            TextDecorationCollection myCollection = new TextDecorationCollection();

            myCollection.Add(myUnderline);
            myUnderline.Pen    = myPen;
            tb.TextDecorations = myCollection;
        }
Exemple #23
0
            public TextHolderFaultFormat()
            {
                var c = new TextDecorationCollection();
                var s = new TextDecoration
                {
                    Location         = TextDecorationLocation.Underline,
                    Pen              = new Pen(Brushes.Red, 2),
                    PenThicknessUnit = TextDecorationUnit.FontRecommended
                };

                c.Add(s);
                TextDecorations = c;
            }
Exemple #24
0
        // Toggle underline.
        private void mnuFontUnderline_Click(object sender, RoutedEventArgs e)
        {
            TextDecorationCollection decorations = new TextDecorationCollection();

            if (!IsUnderlined())
            {
                TextDecoration text_decoration = new TextDecoration();
                text_decoration.Location = TextDecorationLocation.Underline;
                decorations.Add(text_decoration);
            }

            txtBody.SetValue(Paragraph.TextDecorationsProperty, decorations);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is IEnumerable <CorrectedWord>))
            {
                return(new FlowDocument());
            }

            var doc         = new FlowDocument();
            int currentLine = 0;
            var paragraph   = new Paragraph();

            doc.Blocks.Add(paragraph);
            var words = (IEnumerable <CorrectedWord>)value;

            foreach (var word in words)
            {
                if (word.LineIndex != currentLine)
                {
                    paragraph.Inlines.Add(new Run("\r\n"));
                    currentLine = word.LineIndex;
                }

                var text       = new TextBlock(new Run(!string.IsNullOrEmpty(word.Corrected) ? word.Corrected : word.Original));
                var decoration = new TextDecoration {
                    Location = TextDecorationLocation.Underline
                };
                // vert si le mot existe dans le dictionnaire
                if (word.IsCorrect)
                {
                    decoration.Pen = new Pen(Brushes.Green, 2);
                }
                // orange si on a trouvé une correspondance (proche)
                else if (!string.IsNullOrEmpty(word.Corrected) && word.DistanceFromOriginal > 0)
                {
                    decoration.Pen = new Pen(Brushes.Orange, 2);
                }
                // rouge si aucune correspondance n'a été trouvée
                else
                {
                    decoration.Pen = new Pen(Brushes.Red, 2);
                }
                text.TextDecorations = new TextDecorationCollection();
                text.TextDecorations.Add(decoration);

                paragraph.Inlines.Add(text);

                paragraph.Inlines.Add(" ");
            }

            return(doc);
        }
Exemple #26
0
        private void Init()
        {
            this.Title = "Popup Context Menu";

            menu = new ContextMenu();

            itemBold        = new MenuItem();
            itemBold.Header = "Bold";
            menu.Items.Add(itemBold);

            itemItalic        = new MenuItem();
            itemItalic.Header = "Italic";
            menu.Items.Add(itemItalic);

            TextDecorationLocation[] locs = (TextDecorationLocation[])Enum.GetValues(typeof(TextDecorationLocation));       //枚举文本装饰器的位置

            itemDecor = new MenuItem[locs.Length];
            for (int i = 0; i < locs.Length; i++)
            {
                //创建文本装饰器
                TextDecoration decor = new TextDecoration();
                decor.Location = locs[i];   //设置文本装饰器的垂直位置

                itemDecor[i]        = new MenuItem();
                itemDecor[i].Header = locs[i].ToString();
                itemDecor[i].Tag    = decor;
                menu.Items.Add(itemDecor[i]);
            }

            //为所有菜单指定同一个Click处理函数
            menu.AddHandler(MenuItem.ClickEvent, new RoutedEventHandler(MenuOnClick));

            TextBlock text = new TextBlock();

            text.FontSize            = 32;
            text.HorizontalAlignment = HorizontalAlignment.Center;
            text.VerticalAlignment   = VerticalAlignment.Center;
            this.Content             = text;

            string strQuote = "To be, or not to be, that is the question";

            string[] strWords = strQuote.Split();

            foreach (string str in strWords)
            {
                Run run = new Run(str);
                run.TextDecorations = new TextDecorationCollection();       //为Run对象显示创建TextDecorationCollection型对象,这个collection默认是不存在的,而且TextDecorations通常是null
                text.Inlines.Add(run);
                text.Inlines.Add(" ");
            }
        }
Exemple #27
0
        // create red underline used to mark misspelled words
        TextDecorationCollection CreateErrorUnderline()
        {
            var u = new TextDecoration();

            u.Pen              = new Pen(new SolidColorBrush(Colors.Red), 1.5);
            u.Pen.DashStyle    = new DashStyle(new double[] { 1.5, 2 }, 0);
            u.PenOffsetUnit    = TextDecorationUnit.Pixel;
            u.PenThicknessUnit = TextDecorationUnit.Pixel;

            var tdc = new TextDecorationCollection();

            tdc.Add(u);
            return(tdc);
        }
        static TextDecorationCollection CreateStrikeThrough()
        {
            var textDecoration = new TextDecoration
            {
                Location      = TextDecorationLocation.Strikethrough,
                PenOffset     = +0.3,
                PenOffsetUnit = TextDecorationUnit.FontRecommended
            };
            var textDecorations = new TextDecorationCollection();

            textDecorations.Add(textDecoration);

            return(textDecorations);
        }
Exemple #29
0
        public Imla()
        {
            SpellCheker = null;
            gCollection = new TextDecorationCollection();
            TextDecoration dec = new TextDecoration();

            dec.Pen = new Pen {
                Thickness = 2, DashStyle = DashStyles.Dash, Brush = new SolidColorBrush(Colors.Red)
            };
            dec.PenThicknessUnit = TextDecorationUnit.FontRecommended;
            gCollection.Add(dec);
            gCollection.Freeze();
            FindReplace = false;
        }
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(TextIndent != null ? TextIndent.ToStepValue() : "$");
            parameters.Add(TextAlign != null ? TextAlign.ToStepValue() : "$");
            parameters.Add(TextDecoration != null ? TextDecoration.ToStepValue() : "$");
            parameters.Add(LetterSpacing != null ? LetterSpacing.ToStepValue() : "$");
            parameters.Add(WordSpacing != null ? WordSpacing.ToStepValue() : "$");
            parameters.Add(TextTransform != null ? TextTransform.ToStepValue() : "$");
            parameters.Add(LineHeight != null ? LineHeight.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Exemple #31
0
            private CiteProc.Formatting.TextDecoration Map(TextDecoration decoration)
            {
                switch (decoration)
                {
                case v10.TextDecoration.None:
                    return(CiteProc.Formatting.TextDecoration.None);

                case v10.TextDecoration.Underline:
                    return(CiteProc.Formatting.TextDecoration.Underline);

                default:
                    throw new NotSupportedException();
                }
            }
Exemple #32
0
 public CssStyle()
 {
     color=	new Color(0, 0, 0);
     background=	new Background();
     border=	new Border();
     clear=	FloatType.none;
     display=	Display.inline;
     _float=	FloatType.none;
     height=	new FlexibleFloat(0f, FlexFloatType.px);
     margin=	new Margin(0f, 0f, 0f, 0f);
     padding=	new Padding(0f, 0f, 0f, 0f);
     width=	new FlexibleFloat(100f, FlexFloatType.percentage);
     letterSpacing=	new FlexibleFloat(FlexibleFloat.letterSpacingNormal, FlexFloatType.px);
     lineHeight=	new FlexibleFloat(FlexibleFloat.lineHeightNormal, FlexFloatType.px);
     textAlign=	TextAlignment.left;
     textIndex=	new FlexibleFloat(0f, FlexFloatType.px);
     textTransform=	TextTransform.none;
     whiteSpace=	WhiteSpace.normal;
     wordSpacing=	new FlexibleFloat(FlexibleFloat.wordSpacingNormal, FlexFloatType.px);
     textDecoration=	TextDecoration.none;
     font=	new Sdx.Font("arial", 14);
     listStyle=	new ListStyle();
 }
Exemple #33
0
 public virtual void ChangeValue(TextDecoration val)
 {
     withvalue = true;
 }
Exemple #34
0
 public void TextDecoration(TextDecoration value)
 {
   IntPtr exception = IntPtr.Zero;
   #if ANYCPU
   if (NativeLibrary.Is64Bit)
   #endif
   #if WIN64 || ANYCPU
   NativeMethods.X64.DrawingWand_TextDecoration(Instance, (UIntPtr)value, out exception);
   #endif
   #if ANYCPU
   else
   #endif
   #if !WIN64 || ANYCPU
   NativeMethods.X86.DrawingWand_TextDecoration(Instance, (UIntPtr)value, out exception);
   #endif
   CheckException(exception);
 }
 public override void ChangeValue(TextDecoration val)
 {
     Value = val;
     base.ChangeValue(value);
 }
Exemple #36
0
 /// <summary>
 /// Creates a new DrawableTextDecoration instance.
 /// </summary>
 /// <param name="decoration">The text decoration.</param>
 public Drawables TextDecoration(TextDecoration decoration)
 {
   _Drawables.Add(new DrawableTextDecoration(decoration));
   return this;
 }
        //------------------------------------------------------
        //
        //  Private Methods
        //
        //------------------------------------------------------

        #region Private Methods

        // Calculates TextDecorations for speller errors.
        private static TextDecorationCollection GetErrorTextDecorations()
        {
            //
            // Build a "squiggle" Brush.
            //
            // This works by hard-coding a 3 pixel high TextDecoration, and
            // then tiling horizontally.  (We can't scale the squiggle in
            // the vertical direction, there's no support to limit tiling
            // to just the horizontal from the MIL.)
            //

            DrawingGroup drawingGroup = new DrawingGroup();
            DrawingContext drawingContext = drawingGroup.Open();
            Pen pen = new Pen(Brushes.Red, 0.33);

            // This is our tile:
            //
            //  x   x
            //   x x
            //    x
            //
            drawingContext.DrawLine(pen, new Point(0.0, 0.0), new Point(0.5, 1.0));
            drawingContext.DrawLine(pen, new Point(0.5, 1.0), new Point(1.0, 0.0));

            drawingContext.Close();

            DrawingBrush brush = new DrawingBrush(drawingGroup);
            brush.TileMode = TileMode.Tile;
            brush.Viewport = new Rect(0, 0, 3, 3);
            brush.ViewportUnits = BrushMappingMode.Absolute;

            TextDecoration textDecoration = new TextDecoration(
                            TextDecorationLocation.Underline,
                            new Pen(brush, 3),
                            0,
                            TextDecorationUnit.FontRecommended,
                            TextDecorationUnit.Pixel);

            TextDecorationCollection decorationCollection = new TextDecorationCollection();
            decorationCollection.Add(textDecoration);

            decorationCollection.Freeze();

            return decorationCollection;
        }
 ///<summary>
 /// Creates a new DrawableTextDecoration instance.
 ///</summary>
 ///<param name="decoration">The text decoration.</param>
 public DrawableTextDecoration(TextDecoration decoration)
 {
   Decoration = decoration;
 }
		public DrawableTextDecoration(TextDecoration decoration)
			: base(AssemblyHelper.CreateInstance(Types.DrawableTextDecoration, new Type[] {Types.TextDecoration}, decoration))
		{
		}
Exemple #40
0
 public void TextDecoration(TextDecoration value)
 {
   _NativeInstance.TextDecoration(value);
 }