public void DrawStrikethrough(
     Vector2 position,
     float strikethroughWidth,
     float strikethroughThickness,
     float strikethroughOffset,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
 }
Exemple #2
0
        public void MethodSetDirection(CanvasTextDirection direction)
        {
            this.Direction = direction;
            this.ITextLayerChanged <CanvasTextDirection>
            (
                set: (textLayer) => textLayer.Direction = direction,

                type: HistoryType.LayersProperty_SetDirection,
                getUndo: (textLayer) => textLayer.Direction,
                setUndo: (textLayer, previous) => textLayer.Direction = previous
            );
        }
 public void DrawStrikethrough(
     Vector2 position,
     float strikethroughWidth,
     float strikethroughThickness,
     float strikethroughOffset,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     // Normally, we'd add strikethrough support here. Strikethrough isn't used by this demo.
 }
 public void DrawUnderline(
     Vector2 position,
     float underlineWidth,
     float underlineThickness,
     float underlineOffset,
     float runHeight,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
 }
 public void DrawUnderline(
     Vector2 position,
     float underlineWidth,
     float underlineThickness,
     float underlineOffset,
     float runHeight,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     // Normally, we'd add underline support here. Underline isn't used by this demo.
 }
Exemple #6
0
 public void DrawStrikethrough(
     Vector2 position,
     float strikethroughWidth,
     float strikethroughThickness,
     float strikethroughOffset,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     drawingSession.FillRectangle(
         GetLineRectangle(position, strikethroughWidth, strikethroughThickness, strikethroughOffset, glyphOrientation),
         textBrush);
 }
            public void DrawStrikethrough(
                Vector2 position,
                float strikethroughWidth,
                float strikethroughThickness,
                float strikethroughOffset,
                CanvasTextDirection textDirection,
                object brush,
                CanvasTextMeasuringMode measuringMode,
                string locale,
                CanvasGlyphOrientation glyphOrientation)
            {
                var geometry = GetTransformedRectangle(strikethroughWidth, strikethroughThickness, strikethroughOffset, position, glyphOrientation);

                geometries.Add(geometry);
            }
Exemple #8
0
 public void DrawUnderline(
     Vector2 position,
     float underlineWidth,
     float underlineThickness,
     float underlineOffset,
     float runHeight,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     drawingSession.FillRectangle(
         GetLineRectangle(position, underlineWidth, underlineThickness, underlineOffset, glyphOrientation),
         textBrush);
 }
            public void DrawUnderline(
                Vector2 position,
                float underlineWidth,
                float underlineThickness,
                float underlineOffset,
                float runHeight,
                CanvasTextDirection textDirection,
                object brush,
                CanvasTextMeasuringMode measuringMode,
                string locale,
                CanvasGlyphOrientation glyphOrientation)
            {
                var geometry = GetTransformedRectangle(underlineWidth, underlineThickness, underlineOffset, position, glyphOrientation);

                geometries.Add(geometry);
            }
            Matrix3x2 GetDirectionTransform(CanvasTextDirection direction)
            {
                var       arrowBounds        = arrow.ComputeStrokeBounds(4);
                var       arrowCenter        = new Size(arrowBounds.Width, arrowBounds.Height).ToVector2() / 2;
                Matrix3x2 directionTransform = Matrix3x2.Identity;

                switch (direction)
                {
                case CanvasTextDirection.LeftToRightThenTopToBottom:
                    directionTransform = Matrix3x2.Identity;
                    break;

                case CanvasTextDirection.RightToLeftThenTopToBottom:
                    directionTransform = Matrix3x2.CreateScale(-1, 1);
                    break;

                case CanvasTextDirection.LeftToRightThenBottomToTop:
                    directionTransform = Matrix3x2.CreateScale(1, -1);
                    break;

                case CanvasTextDirection.RightToLeftThenBottomToTop:
                    directionTransform = Matrix3x2.CreateScale(-1, -1);
                    break;

                case CanvasTextDirection.TopToBottomThenLeftToRight:
                    directionTransform = Matrix3x2.CreateRotation((float)Math.PI / 2) * Matrix3x2.CreateScale(-1, 1);
                    break;

                case CanvasTextDirection.BottomToTopThenLeftToRight:
                    directionTransform = Matrix3x2.CreateRotation((float)-Math.PI / 2);
                    break;

                case CanvasTextDirection.TopToBottomThenRightToLeft:
                    directionTransform = Matrix3x2.CreateRotation((float)Math.PI / 2);
                    break;

                case CanvasTextDirection.BottomToTopThenRightToLeft:
                    directionTransform = Matrix3x2.CreateRotation((float)-Math.PI / 2) * Matrix3x2.CreateScale(-1, 1);
                    break;
                }

                directionTransform = Matrix3x2.CreateTranslation(-arrowCenter) * directionTransform * Matrix3x2.CreateTranslation(arrowCenter);
                return(directionTransform);
            }
Exemple #11
0
            public void DrawStrikethrough(
                Vector2 position,
                float strikethroughWidth,
                float strikethroughThickness,
                float strikethroughOffset,
                CanvasTextDirection textDirection,
                object brush,
                CanvasTextMeasuringMode measuringMode,
                string locale,
                CanvasGlyphOrientation glyphOrientation)
            {
                var geometry = GetTransformedRectangle(strikethroughWidth, strikethroughThickness, strikethroughOffset, position, glyphOrientation);

                geometries.Add(geometry);
            }
Exemple #12
0
 public void DrawUnderline(
     Vector2 position,
     float underlineWidth, 
     float underlineThickness, 
     float underlineOffset, 
     float runHeight,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
 }            
Exemple #13
0
 public void DrawStrikethrough(
     Vector2 position,
     float strikethroughWidth, 
     float strikethroughThickness, 
     float strikethroughOffset,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale, 
     CanvasGlyphOrientation glyphOrientation)
 {
 }
Exemple #14
0
            public void DrawUnderline(
                Vector2 position,
                float underlineWidth,
                float underlineThickness,
                float underlineOffset,
                float runHeight,
                CanvasTextDirection textDirection,
                object brush,
                CanvasTextMeasuringMode measuringMode,
                string locale,
                CanvasGlyphOrientation glyphOrientation)
            {
                var geometry = GetTransformedRectangle(underlineWidth, underlineThickness, underlineOffset, position, glyphOrientation);

                geometries.Add(geometry);
            }
 public void DrawStrikethrough(
     Vector2 position,
     float strikethroughWidth,
     float strikethroughThickness,
     float strikethroughOffset,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     // Normally, we'd add strikethrough support here. Strikethrough isn't used by this demo.
 }
 public void DrawUnderline(
     Vector2 position,
     float underlineWidth,
     float underlineThickness,
     float underlineOffset,
     float runHeight,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     drawingSession.FillRectangle(
         GetLineRectangle(position, underlineWidth, underlineThickness, underlineOffset, glyphOrientation),
         textBrush);
 }
 public DirectionInfo(CanvasTextDirection direction)
 {
     Direction = direction;
 }
Exemple #18
0
 public void DrawUnderline(Vector2 point, float underlineWidth, float underlineThickness, float underlineOffset, float runHeight, CanvasTextDirection textDirection, object brush, CanvasTextMeasuringMode textMeasuringMode, string localeName, CanvasGlyphOrientation glyphOrientation)
 {
     //throw new NotImplementedException();
     ;
 }
Exemple #19
0
 public void DrawStrikethrough(Vector2 point, float strikethroughWidth, float strikethroughThickness, float strikethroughOffset, CanvasTextDirection textDirection, object brush, CanvasTextMeasuringMode textMeasuringMode, string localeName, CanvasGlyphOrientation glyphOrientation)
 {
     //throw new NotImplementedException();
     ;
 }
 public DirectionInfo(CanvasTextDirection direction, CanvasImageSource imageSource)
 {
     Direction   = direction;
     ImageSource = imageSource;
 }
 public void DrawUnderline(
     Vector2 position,
     float underlineWidth,
     float underlineThickness,
     float underlineOffset,
     float runHeight,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     // Normally, we'd add underline support here. Underline isn't used by this demo.
 }
 public DirectionInfo(CanvasTextDirection direction, CanvasImageSource imageSource)
 {
     Direction = direction;
     ImageSource = imageSource;
 }
        private Matrix3x2 GetDirectionTransform(CanvasTextDirection direction)
        {
            var arrowBounds = arrow.ComputeStrokeBounds(4);
            var arrowCenter = new Size(arrowBounds.Width, arrowBounds.Height).ToVector2() / 2;
            Matrix3x2 directionTransform = Matrix3x2.Identity;

            switch (direction)
            {
                case CanvasTextDirection.LeftToRightThenTopToBottom:
                    directionTransform = Matrix3x2.Identity;
                    break;

                case CanvasTextDirection.RightToLeftThenTopToBottom:
                    directionTransform = Matrix3x2.CreateScale(-1, 1);
                    break;

                case CanvasTextDirection.LeftToRightThenBottomToTop:
                    directionTransform = Matrix3x2.CreateScale(1, -1);
                    break;

                case CanvasTextDirection.RightToLeftThenBottomToTop:
                    directionTransform = Matrix3x2.CreateScale(-1, -1);
                    break;

                case CanvasTextDirection.TopToBottomThenLeftToRight:
                    directionTransform = Matrix3x2.CreateRotation((float)Math.PI / 2) * Matrix3x2.CreateScale(-1, 1);
                    break;

                case CanvasTextDirection.BottomToTopThenLeftToRight:
                    directionTransform = Matrix3x2.CreateRotation((float)-Math.PI / 2);
                    break;

                case CanvasTextDirection.TopToBottomThenRightToLeft:
                    directionTransform = Matrix3x2.CreateRotation((float)Math.PI / 2);
                    break;

                case CanvasTextDirection.BottomToTopThenRightToLeft:
                    directionTransform = Matrix3x2.CreateRotation((float)-Math.PI / 2) * Matrix3x2.CreateScale(-1, 1);
                    break;
            }

            directionTransform = Matrix3x2.CreateTranslation(-arrowCenter) * directionTransform * Matrix3x2.CreateTranslation(arrowCenter);
            return directionTransform;
        }
Exemple #24
0
 public DirectionInfo(CanvasTextDirection direction)
 {
     Direction = direction;
 }
 public CanvasGeometry GetArrow(CanvasTextDirection direction)
 {
     return(arrow.Transform(GetDirectionTransform(direction)));
 }
 public CanvasGeometry GetArrow(CanvasTextDirection direction)
 {
     return arrow.Transform(GetDirectionTransform(direction));
 }
 public void DrawStrikethrough(
     Vector2 position,
     float strikethroughWidth,
     float strikethroughThickness,
     float strikethroughOffset,
     CanvasTextDirection textDirection,
     object brush,
     CanvasTextMeasuringMode measuringMode,
     string locale,
     CanvasGlyphOrientation glyphOrientation)
 {
     drawingSession.FillRectangle(
         GetLineRectangle(position, strikethroughWidth, strikethroughThickness, strikethroughOffset, glyphOrientation),
         textBrush);
 }