Sometimes it’s nice to have a curved heading instead of a straight line in your writer document. The curved heading could be in the form of a semi-circle, an arc (or arch). This could curve left or right, depending on how you want your heading formatted. All this is possible in OpenOffice.org Writer, or LibreOffice Writer. Word 2011 for Mac: under Text Styles, click Effects, point to an effect, and then click the one that you want. Add a shadow [Compatibility Mode] Compatibility mode indicates that the document was created using an earlier version of Word or saved in an earlier file format.
- How To Curve Text In Illustrator
- How To Curve Text In Silhouette Studio
- How To Curve Text In Cricut Design Space
- How To Curve Text In Silhouette
- How To Curve Text In Word 2011 Mac
- How To Curve Text In Publisher
For an application I am building I have drawn 2 circles. One a bit bigger than the other. I want to curve text between those lines, for a circular menu I am building.
I read most stuff about curving a text that you have to split up your text in characters and draw each character on it's own with the right angle in mind (by rotating the context you are drawing on).
I just can't wrap my head around on how to get the right angles and positions for my characters.
I included a screenshot on what the menu, at the moment, look like. Only the texts I added by are loaded from an image in an UIImageView.
I hope someone can get me some starting points on how I can draw the text in the white circle, at certain points.
EDIT:Ok, I am currently at this point:
I accomplish by using the following code:
These are the variables I use in there:
The rotation of the words seem correct, the placement also. Now I need somehow figure out at which rotation the letters (and their coordinates) should be. I could use some help with that.
Edit: Fixed! Check out the following code!
12 Answers
I tried to work it out quickly on paper, so i may be wrong :)
Convert the length of the string into units on the UnitCircle. Thus (string.lenght/ circle perimeter)*2Pi. You now have the angle in radians for the whole string. (That is the angle between start and end of the string)
For the separate letters you could do the same to get the angle (in radians) for individual letters (using letter widths)
Once you have the angle in radians you can work out the x and y position (and rotation) of the letters.
Bonus: for even spacing you could even work out the ratio between the total length of all strings and the whole perimeter. And divide the remaining space equally between the string.
UpdateI made a proof of concept using html5/canvas, so view it with a decent browser :) You should be able to port it. (mind you, the code isn't commented)
wtf: the code runs fine with the chrome debug console open, and fails when it is closed. (workaround: open chrome console: ctrl-shift-j and reload the page: f5); FF3.6.8 seems to do fine, but the letters 'dance'.
I adapted Apple's CoreTextArcCocoa sample project (mentioned by Tom H in this reply) and thought I'd share it here.
I added a few other features as well, such as the ability to set the arc size to something smaller than 180, and the text color and offset shift as properties (so that you don't have to have a huge frame to show the whole text).
To save you some time,here is what i've found for the CoreTextArcView that exposes
this is valid for r > 0 and arcsize > 0.
EI Captain v2.0Check out this Apple sample project: CoreTextArcCocoa
Demonstrates using Core Text to draw text along an arc in a Cocoa application. As well, this sample illustrates how you can use the Cocoa font panel to receive font settings that can be used by Core Text to select the font used for drawing.
CoreText is also available in iOS so you should be able to implement something similar.
TomHTomHThis is my method to draw curved attributed strings on layers, at a predefined angle (in radians):
The string is also automatically reversed on the bottom area of the arc.
I tried the git project mentioned above, and as ZpaceZombor said , there is a wrong offset
I've changed simply to
I've set the radius to the Min value between width and height of the container view, so i've set the arc size to 2π .
I've arbitrary changed the line
with
I've changed the init method to
After a lot of attempts, i've produce this modification to the function PrepareGlyphArcInfo
And changed the drawRect:
method to
As you can see i've use a really not good method for calculate the space between each caracter ( in the original example the space between characters are based also on the arc size). Anyway this seems to work almost fine.
The best solution could be to curve a rectangle ( so the linear text ), with graphics effort and less strange calculations.
This is what i've obtained
Hope it helps
Luca IacoLuca IacoJuggleware's solution works great, I can't seem to find a way to change the direction though, i.e. how would I go to move the arc from clockwise to counter-clockwise?
Update: After struggling for days with the overcomplicated code in that example, I decided to roll my own. I went for a declarative approach using CATextLayers which are placed on the circle and rotated individually. This way the results were much more simple to achieve. Here's the core code for you:
DrMickeyLauerHow To Curve Text In Illustrator
DrMickeyLauerYou can download a sample project that use CoreTextArcView: https://github.com/javenisme/CurvaView
Take the circumference of the inner circle. This is the circle you want the base of the characters to be rendered onto. We'll call this circumference totalLength
.
I assume you have a list of strings to render around the circle in textItems
.
Take the width of each string into a textWidths
array and distribute them evenly across totalLength
, perhaps like this pseudo(pythonish) code:
Although better layouts can no doubt be done in the cases where the assert would trigger, all that really matters is that we know where individual words start and end in a known area. To render on a straight line of length totalLength
we simply start rendering each block of text at offsets[i]
.
To get it onto the circle, we'll map that straight line back onto the circumference. To do that we need to map each pixel along that line onto a position on the circle and an angle. This function converts the offset along that line into an angle (it takes values in the range 0 to totalLength
)
that's your angle. To get a position:
That's a bit more tricky. This is pretty much the crux of your issues, I'd have thought. The big deal is that you need to offset back along the tangent of the circle to work out the point to start rendering so that the middle of the character hits the radius of the circle. What constitues 'back' depends on your coordinate system. if 0,0 is in the bottom left, then the signs of the tangent components is swapped. I assumed top left.
This is important: I'm also making a big assumption that the text rotation occurs around the bottom left of the glyph. If it doesn't then things will look a bit weird. It will be more noticeable at larger font sizes. There is always a way to compensate for wherever it rotates around, and there's usually a way to tell the system where you want the rotation origin to be (that will be related to the CGContextTranslateCTM
call in your code I'd imagine) you'll need to do a small experiment to get characters drawing at a single point rotating around their bottom left.
circleRotation
is just an offset so you can rotate the whole circle, rather than having things always be in the same orientation. That's in radians too.
so now for each character in each block of text:
That's the concept, anyway.
Referring to Ali Seyman's answer:
You can download a sample project that use CoreTextArcView: https://github.com/javenisme/CurvaView
Add on this method to reduce the view frame size, just like UILabel.
If anyone could improve on reducing the height as well, welcome to add on.
How To Curve Text In Silhouette Studio
Durul DalkanatDurul Dalkanatthat is the best url https://github.com/javenisme/CurvaView to set curve your text:
But as per the the degree wise curve i just update a code little bit and we can set the curve as a degree wise . like 45,60,90 180, 360.
Look at the code : https://github.com/tikamsingh/CurveTextWithAngle
You can take some idea.
Not the answer you're looking for? Browse other questions tagged iphonecocoa-touchmathquartz-graphicsquartz-2d or ask your own question.
merrill,
Pages has nothing like WordArt. A rather primitive substitute is to create as many text boxes as you have characters in your text and position and rotate the text boxes along a line.
A free third party app that's similar to WordArt is Art Text 2 LIte from the Mac App Store. It's overkill and has a learning curve, but may do the job for you.
How To Curve Text In Cricut Design Space
How To Curve Text In Silhouette
There are other more sophisticated and costly graphics programs that will do what you want.
In all cases, Copy the result and Paste into Pages.
How To Curve Text In Word 2011 Mac
Jerry
How To Curve Text In Publisher
Sep 21, 2011 12:38 PM