Example #1
0
        /// <summary>
        /// Method to draw a string on a <see cref="GraphicsPath"/> of a string
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
        /// <param name="s">The string to measure</param>
        /// <param name="font">The <see cref="Font"/> to use</param>
        /// <param name="brush">The <see cref="Brush"/> to use</param>
        /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
        /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
        /// <param name="letterSpace">A value controlling the spacing between letters</param>
        /// <param name="rotateDegree">A value controlling the rotation of <paramref name="s"/></param>
        /// <param name="graphicsPath">The <see cref="GraphicsPath"/> along which to render.</param>
        /// <param name="angles">A list of angle values (in degrees), one for each letter</param>
        /// <param name="pointsText">A list of positions, one for each letter</param>
        /// <param name="pointsUp">A list of points (don't know what for)</param>
        public static RectangleF[] MeasureString(IGraphics graphics, string s, Font font, Brush brush,
                                                 TextPathAlign textPathAlign, TextPathPosition textPathPosition,
                                                 int letterSpace, float rotateDegree, GraphicsPath graphicsPath,
                                                 ref List <float> angles, ref List <PointF> pointsText,
                                                 ref List <Point> pointsUp)
        {
            TextOnPath top = TextOnPath.TextOnPathInstance;

            top.Text                  = s;
            top.Font                  = font;
            top.FillColorTop          = brush;
            top.TextPathPathPosition  = textPathPosition;
            top.TextPathAlignTop      = textPathAlign;
            top.PathDataTop           = graphicsPath.PathData;
            top.LetterSpacePercentage = letterSpace;
            top.Graphics              = graphics;
            top.GraphicsPath          = graphicsPath;
            top.MeasureString         = true;
            top.RotateDegree          = rotateDegree;
            top.DrawTextOnPath();
            angles     = top.Angles;
            pointsText = top.PointsText;
            pointsUp   = top.PointsTextUp;
            return(top.RegionList.ToArray());
        }
Example #2
0
 public static RectangleF[] MeasureString( Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
 {
     List<float> angles = new List<float>();
     List<PointF> pointsText = new List<PointF>();
     List<Point> pointsTextUp = new List<Point>();
     return MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, 0, graphicsPath,ref angles, ref pointsText, ref pointsTextUp);
 }
 public static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace,float rotateDegree, GraphicsPath graphicsPath)
 {
     TEXT_ON_PATH.Text = s;
     TEXT_ON_PATH.Font = font;
     TEXT_ON_PATH.FillColorTop = brush;
     TEXT_ON_PATH.TextPathPathPosition = textPathPosition;
     TEXT_ON_PATH.TextPathAlignTop = textPathAlign;
     TEXT_ON_PATH.PathDataTop = graphicsPath.PathData;
     TEXT_ON_PATH.LetterSpacePercentage = letterSpace;
     TEXT_ON_PATH._graphics = graphics;
     TEXT_ON_PATH._graphicsPath = graphicsPath;
     TEXT_ON_PATH._measureString = false;
     TEXT_ON_PATH._rotateDegree = rotateDegree;
     TEXT_ON_PATH.DrawTextOnPath();
 }
 internal static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath)
 {
     TEXT_ON_PATH.Text = s;
     TEXT_ON_PATH.Font = font;
     TEXT_ON_PATH.FillColorTop = brush;
     TEXT_ON_PATH.TextPathPathPosition = textPathPosition;
     TEXT_ON_PATH.TextPathAlignTop = textPathAlign;
     TEXT_ON_PATH.PathDataTop = graphicsPath.PathData;
     TEXT_ON_PATH.LetterSpacePercentage = letterSpace;
     TEXT_ON_PATH._graphics = graphics;
     TEXT_ON_PATH._measureString = true;
     TEXT_ON_PATH._rotateDegree = rotateDegree;
     TEXT_ON_PATH.DrawTextOnPath();
     return TEXT_ON_PATH._regionList.ToArray();
 }
Example #5
0
 public static RectangleF[] MeasureString( Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath,ref List<float> angles, ref List<PointF> pointsText, ref List<Point> pointsUp)
 {
     TEXT_ON_PATH.Text = s;
     TEXT_ON_PATH.Font = font;
     TEXT_ON_PATH.FillColorTop = brush;
     TEXT_ON_PATH.TextPathPathPosition = textPathPosition;
     TEXT_ON_PATH.TextPathAlignTop = textPathAlign;
     TEXT_ON_PATH.PathDataTop = graphicsPath.PathData;
     TEXT_ON_PATH.LetterSpacePercentage = letterSpace;
     TEXT_ON_PATH._graphics = graphics;
     TEXT_ON_PATH._graphicsPath = graphicsPath;
     TEXT_ON_PATH._measureString = true;
     TEXT_ON_PATH._rotateDegree = rotateDegree;
     TEXT_ON_PATH.DrawTextOnPath();
     angles = TEXT_ON_PATH._angles;
     pointsText = TEXT_ON_PATH._pointText;
     pointsUp = TEXT_ON_PATH._pointTextUp;
     return TEXT_ON_PATH._regionList.ToArray();
 }
Example #6
0
 public static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath, int vOffset)
 {
     return MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, 0, graphicsPath, vOffset);
 }
 public static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, GraphicsPath graphicsPath)
 {
     return MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, graphicsPath);
 }
Example #8
0
 public static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath, int vOffset)
 {
     DrawString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, 0, graphicsPath, vOffset);
 }
Example #9
0
        /// <summary>
        /// Method to draw a string on a <see cref="GraphicsPath"/> of a string
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
        /// <param name="s">The string to measure</param>
        /// <param name="font">The <see cref="Font"/> to use</param>
        /// <param name="brush">The <see cref="Brush"/> to use</param>
        /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
        /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
        /// <param name="letterSpace">A value controlling the spacing between letters</param>
        /// <param name="rotateDegree">A value controlling the rotation of <paramref name="s"/></param>
        /// <param name="graphicsPath">The <see cref="GraphicsPath"/> describing the </param>
        /// <param name="showPath">A value indicating if the <paramref name="graphicsPath"/> should be drawn, too.</param>
        public static void DrawString(IGraphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath, bool showPath)
        {
            var top = TextOnPath.TextOnPathInstance;
            
            top.Text = s;
            top.Font = font;
            top.FillColorTop = brush;
            top.TextPathPathPosition = textPathPosition;
            top.TextPathAlignTop = textPathAlign;
            top.PathDataTop = graphicsPath.PathData;
            top.LetterSpacePercentage = letterSpace;
            top.Graphics = graphics;
            top.GraphicsPath = graphicsPath;
            top.MeasureString = false;
            top.RotateDegree = rotateDegree;
            top.ShowPath = showPath;
            top.DrawTextOnPath();

        }
Example #10
0
 public static RectangleF[] MeasureString(Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath, ref List <float> angles, ref List <PointF> pointsText, ref List <Point> pointsUp)
 {
     TEXT_ON_PATH.Text                  = s;
     TEXT_ON_PATH.Font                  = font;
     TEXT_ON_PATH.FillColorTop          = brush;
     TEXT_ON_PATH.TextPathPathPosition  = textPathPosition;
     TEXT_ON_PATH.TextPathAlignTop      = textPathAlign;
     TEXT_ON_PATH.PathDataTop           = graphicsPath.PathData;
     TEXT_ON_PATH.LetterSpacePercentage = letterSpace;
     TEXT_ON_PATH._graphics             = graphics;
     TEXT_ON_PATH._graphicsPath         = graphicsPath;
     TEXT_ON_PATH._measureString        = true;
     TEXT_ON_PATH._rotateDegree         = rotateDegree;
     TEXT_ON_PATH.DrawTextOnPath();
     angles     = TEXT_ON_PATH._angles;
     pointsText = TEXT_ON_PATH._pointText;
     pointsUp   = TEXT_ON_PATH._pointTextUp;
     return(TEXT_ON_PATH._regionList.ToArray());
 }
Example #11
0
 /// <summary>
 /// Method to measure the length of a string
 /// </summary>
 /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
 /// <param name="s">The string to measure</param>
 /// <param name="font">The <see cref="Font"/> to use</param>
 /// <param name="brush">The <see cref="Brush"/> to use</param>
 /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
 /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
 /// <param name="graphicsPath">The <see cref="GraphicsPath"/> describing the </param>
 /// <returns>An array of <see cref="RectangleF"/>s</returns>
 public static RectangleF[] MeasureString(IGraphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, GraphicsPath graphicsPath)
 {
     return(MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, graphicsPath));
 }
Example #12
0
 public static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, GraphicsPath graphicsPath, int vOffset)
 {
     DrawString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, graphicsPath, vOffset);
 }
 internal static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, GraphicsPath graphicsPath)
 {
     DrawString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, graphicsPath);
 }
Example #14
0
        /// <summary>
        /// Method to measure the length of a string along a <see cref="GraphicsPath"/>
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
        /// <param name="s">The string to measure</param>
        /// <param name="font">The <see cref="Font"/> to use</param>
        /// <param name="brush">The <see cref="Brush"/> to use</param>
        /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
        /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
        /// <param name="letterSpace">A value controlling the spacing between letters</param>
        /// <param name="graphicsPath">The <see cref="GraphicsPath"/> describing the </param>
        /// <returns>An array of <see cref="RectangleF"/>s</returns>
        public static RectangleF[] MeasureString(IGraphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
        {
            var angles       = new List <float>();
            var pointsText   = new List <PointF>();
            var pointsTextUp = new List <Point>();

            return(MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, 0, graphicsPath, ref angles, ref pointsText, ref pointsTextUp));
        }
 private static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
 {
     return(MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, letterSpace, 0, graphicsPath));
 }
 internal static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath)
 {
     TEXT_ON_PATH.Text                  = s;
     TEXT_ON_PATH.Font                  = font;
     TEXT_ON_PATH.FillColorTop          = brush;
     TEXT_ON_PATH.TextPathPathPosition  = textPathPosition;
     TEXT_ON_PATH.TextPathAlignTop      = textPathAlign;
     TEXT_ON_PATH.PathDataTop           = graphicsPath.PathData;
     TEXT_ON_PATH.LetterSpacePercentage = letterSpace;
     TEXT_ON_PATH._graphics             = graphics;
     TEXT_ON_PATH._measureString        = true;
     TEXT_ON_PATH._rotateDegree         = rotateDegree;
     TEXT_ON_PATH.DrawTextOnPath();
     return(TEXT_ON_PATH._regionList.ToArray());
 }
 private static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
 {
     DrawString(graphics, s, font, Color.Black, brush, textPathAlign, textPathPosition, letterSpace, 0, graphicsPath);
 }
Example #18
0
 /// <summary>
 /// Method to measure the length of a string along a <see cref="GraphicsPath"/>
 /// </summary>
 /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
 /// <param name="s">The string to measure</param>
 /// <param name="font">The <see cref="Font"/> to use</param>
 /// <param name="brush">The <see cref="Brush"/> to use</param>
 /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
 /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
 /// <param name="letterSpace">A value controlling the spacing between letters</param>
 /// <param name="graphicsPath">The <see cref="GraphicsPath"/> describing the </param>
 /// <returns>An array of <see cref="RectangleF"/>s</returns>
 public static void DrawString(IGraphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
 {
     DrawString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, 0, graphicsPath, false);
 }
 private static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
 {
     DrawString(graphics, s, font,Color.Black, brush, textPathAlign, textPathPosition, letterSpace, 0, graphicsPath);
 }
Example #20
0
        /// <summary>
        /// Method to draw a string on a <see cref="GraphicsPath"/> of a string
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
        /// <param name="s">The string to measure</param>
        /// <param name="font">The <see cref="Font"/> to use</param>
        /// <param name="brush">The <see cref="Brush"/> to use</param>
        /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
        /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
        /// <param name="letterSpace">A value controlling the spacing between letters</param>
        /// <param name="rotateDegree">A value controlling the rotation of <paramref name="s"/></param>
        /// <param name="graphicsPath">The <see cref="GraphicsPath"/> describing the </param>
        /// <param name="showPath">A value indicating if the <paramref name="graphicsPath"/> should be drawn, too.</param>
        public static void DrawString(IGraphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath, bool showPath)
        {
            var top = TextOnPath.TextOnPathInstance;

            top.Text                  = s;
            top.Font                  = font;
            top.FillColorTop          = brush;
            top.TextPathPathPosition  = textPathPosition;
            top.TextPathAlignTop      = textPathAlign;
            top.PathDataTop           = graphicsPath.PathData;
            top.LetterSpacePercentage = letterSpace;
            top.Graphics              = graphics;
            top.GraphicsPath          = graphicsPath;
            top.MeasureString         = false;
            top.RotateDegree          = rotateDegree;
            top.ShowPath              = showPath;
            top.DrawTextOnPath();
        }
 private static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath)
 {
     return MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, letterSpace, 0, graphicsPath);
 }
Example #22
0
 public static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, float rotateDegree, GraphicsPath graphicsPath, int vOffset)
 {
     TEXT_ON_PATH.Text                  = s;
     TEXT_ON_PATH.Font                  = font;
     TEXT_ON_PATH.FillColorTop          = brush;
     TEXT_ON_PATH.TextPathPathPosition  = textPathPosition;
     TEXT_ON_PATH.TextPathAlignTop      = textPathAlign;
     TEXT_ON_PATH.PathDataTop           = graphicsPath.PathData;
     TEXT_ON_PATH.LetterSpacePercentage = letterSpace;
     TEXT_ON_PATH._graphics             = graphics;
     TEXT_ON_PATH._graphicsPath         = graphicsPath;
     TEXT_ON_PATH._measureString        = false;
     TEXT_ON_PATH._rotateDegree         = rotateDegree;
     TEXT_ON_PATH.VerticalOffset        = vOffset;
     TEXT_ON_PATH.DrawTextOnPath();
 }
 public static void DrawString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, GraphicsPath graphicsPath)
 {
     DrawString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, graphicsPath);
 }
Example #24
0
 public static RectangleF[] MeasureString(this Graphics graphics, string s, Font font, Brush brush, TextPathAlign textPathAlign, TextPathPosition textPathPosition, int letterSpace, GraphicsPath graphicsPath, int vOffset)
 {
     return(MeasureString(graphics, s, font, brush, textPathAlign, textPathPosition, 100, 0, graphicsPath, vOffset));
 }
Example #25
0
 /// <summary>
 /// Method to draw a string on a <see cref="GraphicsPath"/> of a string
 /// </summary>
 /// <param name="graphics">The <see cref="Graphics"/> object to use</param>
 /// <param name="s">The string to measure</param>
 /// <param name="font">The <see cref="Font"/> to use</param>
 /// <param name="brush">The <see cref="Brush"/> to use</param>
 /// <param name="textPathAlign">The horizontal position on the <paramref name="graphicsPath"/></param>
 /// <param name="textPathPosition">The vertical position on the <paramref name="graphicsPath"/></param>
 /// <param name="letterSpace">A value controlling the spacing between letters</param>
 /// <param name="rotateDegree">A value controlling the rotation of <paramref name="s"/></param>
 /// <param name="graphicsPath">The <see cref="GraphicsPath"/> along which to render.</param>
 /// <param name="angles">A list of angle values (in degrees), one for each letter</param>
 /// <param name="pointsText">A list of positions, one for each letter</param>
 /// <param name="pointsUp">A list of points (don't know what for)</param>
 public static RectangleF[] MeasureString(IGraphics graphics, string s, Font font, Brush brush,
                                          TextPathAlign textPathAlign, TextPathPosition textPathPosition,
                                          int letterSpace, float rotateDegree, GraphicsPath graphicsPath,
                                          ref List<float> angles, ref List<PointF> pointsText,
                                          ref List<Point> pointsUp)
 {
     TextOnPath top = TextOnPath.TextOnPathInstance;
     top.Text = s;
     top.Font = font;
     top.FillColorTop = brush;
     top.TextPathPathPosition = textPathPosition;
     top.TextPathAlignTop = textPathAlign;
     top.PathDataTop = graphicsPath.PathData;
     top.LetterSpacePercentage = letterSpace;
     top.Graphics = graphics;
     top.GraphicsPath = graphicsPath;
     top.MeasureString = true;
     top.RotateDegree = rotateDegree;
     top.DrawTextOnPath();
     angles = top.Angles;
     pointsText = top.PointsText;
     pointsUp = top.PointsTextUp;
     return top.RegionList.ToArray();
 }