Creat Text on a Curve - Sizing issues

All discussion related to the VisualCAD/CAM standalone product.
Post Reply
osphoto
Posts: 17
Joined: Thu Nov 08, 2007 1:32 pm

Creat Text on a Curve - Sizing issues

Post by osphoto »

When using lettering on an arc, I'm getting sizing issues.

Capital letters become the same size as non-capital letters and non-capitals letters become bigger.

Also, the spacing between letters vary and pretty much makes this unusable.

I'd like the same type of visual as they would appear on a straight line but just follow a curve. "Sizing" of letters stay true to the font on a line.

I've tried using various fonts thinking it could be a font issue. Some fonts are just worse then others.

In addition, can we enter a value for Kerning vs a slide rule? (Enhancement please).

See attached file for example.

Help please.

I'd like to use the ARC function because my regular CAD doesn't offer this function. Other then doing it the manual way.
Attachments
FontExamples.vcp
File gives examples of my issues.
(329.34 KiB) Downloaded 1021 times
mbr72cnc
Posts: 43
Joined: Thu Jan 27, 2011 1:52 pm
Location: Iowa

Post by mbr72cnc »

Hello Mecsoft Support - I have the same issue with text on a curve. Has this been addressed, what can we do to change this?

Thanks,
Mike
Happy Cutting!
osphoto
Posts: 17
Joined: Thu Nov 08, 2007 1:32 pm

Post by osphoto »

Glad to know I'm not the only one with this issue.

Ive yet to get a response or fix on this issue.
osphoto
Posts: 17
Joined: Thu Nov 08, 2007 1:32 pm

Re: Creat Text on a Curve - Sizing issues

Post by osphoto »

Hello! Is this issue being worked on?

I paid good money to use the text options and it's broke. Why can't this get fixed?
mbr72cnc
Posts: 43
Joined: Thu Jan 27, 2011 1:52 pm
Location: Iowa

Re: Creat Text on a Curve - Sizing issues

Post by mbr72cnc »

:roll: Tried to use this option several times and still have same problem. Ihave tried different methods to solve but with no luck help!
Happy Cutting!
MecSoft Support
Posts: 2405
Joined: Wed Aug 01, 2007 4:15 pm
Location: Irvine, CA, USA
Contact:

Re: Creat Text on a Curve - Sizing issues

Post by MecSoft Support »

This problem is fixed in development. It will show up in an upcoming release.
osphoto
Posts: 17
Joined: Thu Nov 08, 2007 1:32 pm

Re: Creat Text on a Curve - Sizing issues

Post by osphoto »

Thank you for the update. It's been a year to long to fix something like this.

When's the next release coming out? This a "fix" release or major release?
MecSoft Support
Posts: 2405
Joined: Wed Aug 01, 2007 4:15 pm
Location: Irvine, CA, USA
Contact:

Re: Creat Text on a Curve - Sizing issues

Post by MecSoft Support »

The next release is slated for release next month. We should be announcing this soon.
ethanehunt

Re: Creat Text on a Curve - Sizing issues

Post by ethanehunt »

When programming for Windows Presentation Foundation (WPF), a significant bonus accompanies the programming of text on a path: you can animate the individual points defining the path and watch the characters bounce around in response. As usual in WPF, there is more than one way to do this job, and I'll demonstrate several approaches. As is also common in WPF, the difficult part of the job turns out to be something other than what might originally be assumed. In putting text on a path, the big problem really isn't figuring out how to move and rotate the text characters. That's relatively straightforward. The hard part is properly informing the WPF layout system of the correct size of the resultant graphic. A graphics path is a collection of straight lines and curves. Some of these lines and curves might be connected to each other. Some might form enclosed areas. In WPF, the graphics path is encapsulated in both the PathGeometry and StreamGeometry classes. StreamGeometry offers better performance, but the individual points that define the path become fixed and cannot be animated.
In placing text on a path, it's pretty much essential that the lines and curves comprising the path be connected end to end with each other. You probably don't want to deal with a text string jumping across a disconnection in the path. For this reason, the WPF class I'm really interested in is PathFigure, which is a single collection of connected straight lines and curves. A PathGeometry is a collection of one or more PathFigure objects.
The PathFigure itself defines a StartPoint and contains a collection of segments. The first segment begins at the StartPoint, and each successive segment continues where the last one left off. These segments are all derivatives of the abstract PathSegment class: LineSegment, PolyLineSegment, BezierSegment, PolyBezierSegment, QuadraticBezierSegment, PolyQuadraticBezierSegment, and ArcSegment. In other words, a PathFigure is a connected series of straight lines, Bezier curves, quadratic Bezier curves, and arcs, which are curves on the circumference of an ellipse.
A PathFigure has a geometric length. In the source code that accompanies this column, I refer to this length with the variable pathLength. If the PathFigure consists solely of LineSegment and PolyLineSegment objects, calculating the length is trivial: simply use the Pythagorean Theorem to calculate the length of each line and accumulate them. But an ArcSegment requires more complex math, and calculating the length of a Bezier curve is a positively frightening job.
To simplify the calculation of the PathFigure length, it's convenient to convert the path to a collection of polylines that approximate the curves. This is called flattening the path. It's then easy to calculate the length with repeated application of the Pythagorean Theorem. WPF even makes knowledge of the Pythagorean Theorem unnecessary: subtracting one point from another results in a Vector object, and the Vector object contains a Length property that returns the length between the two points.
The PathFigure class contains a method named GetFlattenedPathFigure that returns another PathFigure containing only Line­Segment and PolyLineSegment objects. And this is ideal for calculating the length of the entire PathFigure.
A text string rendered with a particular font and font size also has a geometric size. If you use the popular TextBlock element to display text, the width of the displayed text is available from the ActualWidth property. During the layout process prior to the actual display, ActualWidth might not be set yet, but TextBlock will set its DesiredSize property to the size of the text.
TextBlock uses the FormattedText object for calculating the size of its text, and this class is also available to the application programmer. The FormattedText constructor requires the text string itself, a font size, and an object of type Typeface, which is built from the desired FontFamily, FontStyle, FontWeight, and FontStretch objects.
A couple of different approaches come to mind for uniting the PathFigure and the text string. You might want to specify a particular font size for the text and display the text starting at the beginning of the path. But the text might not fit the whole path, and (worse) it might exceed the length of the path. What then?
To avoid those problems, I took a different approach: I decided to scale the size of the text to make it exactly the length of the path from beginning to end. The text is first created with an arbitrary font size, which is 100 in the sample programs. The width of the text is stored in a variable named textLength.
The ratio of pathLength to textLength is a number I call scalingFactor. This scaling factor must be applied as a transform to the individual text characters so they fit on the path from beginning to end.
Each individual character in the text string is subjected not only to this scaling transform but also to two other transforms: a translation transform moves the character to a particular position on the path, and a rotation transform turns the character so its baseline is tangent to the path.
PathGeometry defines a method named GetPointAtFractionLength that is extremely useful for positioning text on the path. The method requires an argument ranging from 0 to 1 indicating a fractional length of the path. The method returns the corresponding point on the path. This fractional length is easy to provide. Each character occupies a fractional length of the path equal to the width of the individual character times the scaling factor divided by pathLength. The point on the path returned by the method is useful for translating the character to the path. As an extra bonus, the GetPointAtFractionLength method returns a second point representing the tangent of the path at that point. Passing the X and Y properties of this second point to the Math.Atan2 method gives you the angle necessary to rotate the text character.
Although GetPointAtFractionLength is defined by PathGeometry and not PathFigure, it's easy to make a PathGeometry from a single PathFigure for purposes of using GetPointAtFractionLength.
mbr72cnc
Posts: 43
Joined: Thu Jan 27, 2011 1:52 pm
Location: Iowa

Re: Creat Text on a Curve - Sizing issues

Post by mbr72cnc »

Thank you for the explanation, I did as you mentioned, made text on an arc with no problems. Except needed to do alittle tweeking to rotate text to match arc.

Thanks again,
Mike
Happy Cutting!
osphoto
Posts: 17
Joined: Thu Nov 08, 2007 1:32 pm

Re: Creat Text on a Curve - Sizing issues

Post by osphoto »

When is the new update release? That "next month" has come and gone.
mbr72cnc
Posts: 43
Joined: Thu Jan 27, 2011 1:52 pm
Location: Iowa

Re: Creat Text on a Curve - Sizing issues

Post by mbr72cnc »

Last I heard it was in January, VisualMILL 2012. I have tried the Beta version. Text on a curve works great. can't wait to upgrade!
Happy Cutting!
osphoto
Posts: 17
Joined: Thu Nov 08, 2007 1:32 pm

Re: Creat Text on a Curve - Sizing issues

Post by osphoto »

After many months on giving up on getting this feature working, here is what I've found.

I tested this function in VM2012. Believe it or not, the exact same thing happens that happens in VM6. The characters are all different sizes, etc. Unbelievable! So, it appears nothing has been fixed.

Now, I'm running VM2012 along with VM6 as it was told to me by Anita and sales that I can do this.

I wanted to verify if there are any discrepancies by running both versions on the same machine. So, I installed VM2012 on a new machine. Ran the same test and the text on a curve worked as it should! In trying to figure out more of a difference, the new machine is not running VisualArt.

I go back to my original machine, unload VisualArt via Windows Program Remove, run the same text on a curve test and HOLY SMOKES! It freaking works in VM2012 and in VM6! Just to make sure, I re-installed VisualArt and the curve on a text is still working! Even crazier, how is it that Visual Art effected VM2012?

I'm wondering if during the last update to VM6 I didn't remove VisualArt during the update that caused this problem to begin with.

Any way, this is how I solved my issue with the failure of text on a curve.
Post Reply