PDA

View Full Version : How to make text to follow an arc ?



JariV
01-07-2012, 10:31 AM
7190
Dear all,

I have a hobby project constructing a pedigree fan chart using PowerPoint VBA.

I have managed to make a six-generation-fan by using the ShapePie object (see the attached picture). Every sector is one Pie object. I have also been able to align Text Boxes to each sector, or rather to the four-sided polygon generated when the inner pie sector is on the top of the outer one (the picture explains it much better). Each polygon is intended to contain one ancestor record; currently it holds the name of the TextBox.

However, closer to the centre I would like to make the text to curve to follow the arc of the sector (or the polygon).

Question 1): what would be the best way to do this by using VBA?
The Text Effect / Transform / Follow path seems a clumsy approach, and I am not sure how then to control the arc using the VBA.

2) How can I change the font size within one TextBox using VBA? E.g. the name with a bigger font and then the birth date with smaller.

If I add the name first with a font size 9 and use .InsertAfter for the birth date and then e.g., .TextFrame2.TextRange.Font.Size = 7, the font size for the whole box changes.

Thanks in advance for the help

Cheers,
JariV

Capungo
01-09-2012, 01:33 PM
I have no idea about your question but I should admit that I am impressed. That's a great piece of work. And I am sorry for occupying space here instead of puting forth a new approach...

JariV
01-10-2012, 01:25 AM
Capungo, thanks for the compliment.

7199

This picture shows what I was able to accomplish manually. It is some time ago, but I believe I used Text Effect -Follow Path, but it was rather laborius to adjust the text with different amount of text for each polygon.

If this could be done by using VBA code, it'd help a lot !


Regards,
JariV

The other question I was able to solve by using the " .Paragraphs(1).Font.Size = " function.

JariV
02-11-2012, 07:04 AM
7411

FYI,

I was able to solve this (at least for my needs) by creating a textbox for each letter of the text to be rotated (see attached picture), and then rotating each with certain angle to follow the arc. This was a bit complicated, the code runs slow and using a fixed size font is preferred, but it works, also for any length of the arc and for multiple lines.

I saw a discussion in the net on using an API CreateFontIndirect in Visual Basic (http://www.nirsoft.net/vb/rotated.html) , but this seemed even more complicated and I was not sure if it applied to PowerPoint.

Cheers,
-JariV

John Wilson
02-12-2012, 09:44 AM
That's the only way I know (we have an AddIn (http://www.pptalchemy.co.uk/PowerPoint_circular.html) that calculates the code angles for you but it's not a freebie)

delete123
03-26-2012, 09:28 AM
what is that?