Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,804,192 Members 37,566 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Problem with curved text

Tip us?
 
MrBiggzz
Old
#1  
Member - OP
Thanks Meter 7
Posts: 52
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Default [Q] Problem with curved text

Hi!

I'm trying to have text that hugs the outside of a circle. Now if the text string is long it pulls away from the curve of the circle and if the string is short it curves right into the circle.

I'd like to have it just ride the outside of the circle no matter if it's 10 characters or 100.

Anybody have an idea how this is done?

Many thanks in advanced!
 
ma11en
Old
(Last edited by ma11en; 8th March 2014 at 10:48 PM.)
#2  
ma11en's Avatar
Senior Member
Thanks Meter 50
Posts: 105
Join Date: Jun 2012
Location: Nottingham
Hi,

What parameters are you using to define the curve?

Regards


Ok,

I've had a play and this seems to work.


Define the circle, here I have a Diameter* of 180*.


Add a text module, set the Text Alignment to Centre.


Set Curve to 175, now the magic bit is setting the Width which is Pi Diameter* = (3.14 180*) = 565

I've learnt something today, l hope this helps.

Regards Mark.

Sent from my One X using Tapatalk
The Following User Says Thank You to ma11en For This Useful Post: [ Click to Expand ]
 
MrBiggzz
Old
#3  
Member - OP
Thanks Meter 7
Posts: 52
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Quote:
Originally Posted by ma11en View Post
Hi,
I've learnt something today, l hope this helps.

Regards Mark.

Sent from my One X using Tapatalk
It did help. Couple of questions!

1) How'd did you figure out the 'Curve' angle?

2) The shape outline just color that so it vanished? Correct?

I think I got it!
 
MrBiggzz
Old
#4  
Member - OP
Thanks Meter 7
Posts: 52
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Mark,

Is it possible to have the text upside down at the bottom of the circle so that reads right?

BTW you're like God for this little trick!

Click image for larger version

Name:	Screenshot_2014-03-09-00-22-12.jpg
Views:	44
Size:	114.2 KB
ID:	2621146
 
ma11en
Old
#5  
ma11en's Avatar
Senior Member
Thanks Meter 50
Posts: 105
Join Date: Jun 2012
Location: Nottingham
Hi,

Good stuff.

1. Just a bit nerdy with numbers, as it was based on circles Pi came to mind (shame I'm not smart enough to do anything productive with it )

2. Yeah, I just put it there so I could see what was happening.

Play around with Rotate in 90 degree steps (you will need to adjust X and Y positions) this will move the centre point of your text to 3, 6 or 9 o'clock.

If you change the Curve to a negative number it will bend the text in the opposite direction (you will need to reduce the Width, which appears to be;

(diameter-(font size+some spacing from the circle)*Pi



Here the width is (180-(15+4))*Pi = 505.

Regards Mark.

Sent from my One X using Tapatalk

---------- Post added at 07:38 AM ---------- Previous post was at 07:34 AM ----------

And one more example



Sent from my One X using Tapatalk
The Following User Says Thank You to ma11en For This Useful Post: [ Click to Expand ]
 
MrBiggzz
Old
#6  
Member - OP
Thanks Meter 7
Posts: 52
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Quote:
Originally Posted by ma11en View Post
Hi,

Here the width is (180-(15+4))*Pi = 505.
This formula, where did the 15+4 come from? I'm following the rest. I would need to make another lay to do this since the text would be inside the circle. Not a problem. And I guess that circle outline is going to help as a point of reference.

Interesting!

What could be interesting is if Zooper every animated something like this. But .. I'm sure that would go against being battery efficient.

Thanks for all your help!
 
ma11en
Old
#7  
ma11en's Avatar
Senior Member
Thanks Meter 50
Posts: 105
Join Date: Jun 2012
Location: Nottingham
Hi,

15 is the font size and 4 is approx the space between the text and the circle.

Regards Mark.

Sent from my One X using Tapatalk
The Following User Says Thank You to ma11en For This Useful Post: [ Click to Expand ]
 
MrBiggzz
Old
#8  
Member - OP
Thanks Meter 7
Posts: 52
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Quote:
Originally Posted by ma11en View Post
Hi,

15 is the font size and 4 is approx the space between the text and the circle.

Regards Mark.

Sent from my One X using Tapatalk
Got it!

Thanks for all this! + I hope it helps someone else trying to do something similar!
 
ma11en
Old
#9  
ma11en's Avatar
Senior Member
Thanks Meter 50
Posts: 105
Join Date: Jun 2012
Location: Nottingham
No worries.

Sent from my One X using Tapatalk
 
MrBiggzz
Old
#10  
Member - OP
Thanks Meter 7
Posts: 52
Join Date: Jul 2013
Location: Indianapolis

 
DONATE TO ME
Mark,

If I could bother you one last time?

Is there an easy way to absolute center elements on the grid? That would make lining these circles so much more easy!

Thanks again!

- Dave

Sent from my Nexus 5 using Tapatalk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes