Пример #1
0
        public TextOutlines()
        {
            this.InitializeComponent();

            CurrentTextEffectOption         = TextEffectOption.None;
            CurrentTextDirection            = CanvasTextDirection.TopToBottomThenLeftToRight;
            CurrentVerticalGlyphOrientation = CanvasVerticalGlyphOrientation.Default;
            CurrentTextLengthOption         = TextLengthOption.Paragraph;

            if (ThumbnailGenerator.IsDrawingThumbnail)
            {
                CurrentTextDirection    = CanvasTextDirection.LeftToRightThenTopToBottom;
                CurrentTextLengthOption = TextLengthOption.Short;
            }

            ShowNonOutlineText = true;
        }
Пример #2
0
        public GlyphRotation()
        {
            this.InitializeComponent();

            DataContext = this;

            CurrentTextEffectOption         = TextEffectOption.UnderlineEveryOtherWord;
            CurrentTextDirection            = CanvasTextDirection.RightToLeftThenBottomToTop;
            CurrentVerticalGlyphOrientation = CanvasVerticalGlyphOrientation.Default;

            ShowNonCustomText = true;

            testString = "This demonstrates the correct way to do glyph rotation from a custom text renderer in Win2D. Of course, if your script is always read left-to-right then top-to-bottom, there is no need to handle rotation. However, in general, callers of DrawGlyphRun should ensure that the correct transform is used- particularly for vertical text.";

            if (ThumbnailGenerator.IsDrawingThumbnail)
            {
                testString           = "Glyph rotation";
                CurrentTextDirection = CanvasTextDirection.TopToBottomThenLeftToRight;
            }

            everyOtherWordBoundary = Utils.GetEveryOtherWord(testString);
        }
Пример #3
0
        public GlyphRotation()
        {
            this.InitializeComponent();

            DataContext = this;

            CurrentTextEffectOption = TextEffectOption.UnderlineEveryOtherWord;
            CurrentTextDirection = CanvasTextDirection.RightToLeftThenBottomToTop;
            CurrentVerticalGlyphOrientation = CanvasVerticalGlyphOrientation.Default;

            ShowNonCustomText = true;

            testString = "This demonstrates the correct way to do glyph rotation from a custom text renderer in Win2D. Of course, if your script is always read left-to-right then top-to-bottom, there is no need to handle rotation. However, in general, callers of DrawGlyphRun should ensure that the correct transform is used- particularly for vertical text.";

            if (ThumbnailGenerator.IsDrawingThumbnail)
            {
                testString = "Glyph rotation";
                CurrentTextDirection = CanvasTextDirection.TopToBottomThenLeftToRight;
            }

            everyOtherWordBoundary = Utils.GetEveryOtherWord(testString);
        }