re. Positioning text within a circle

  • From: "Ian D. Nichols" <inich@xxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>, <programmingblind@xxxxxxxxxxxxx>
  • Date: Sun, 8 Feb 2009 23:11:47 -0500

Hello Listers,

Thanks to those from Program-l and ProgrammingBlind who replied to my question. 
 I apologize that my initial post did not make it clear that the text did not 
need to be centred in the circle, and did not let you know that I am using a 
Borland C++ command line compiler in the Windows environment.

thanks to Ken, David, Everett and Sina, whose ideas, although expressed a 
little differently, boiled down to essentially the same thing:

Take any point in the bounding square of the circle.
form a right angled triangle with that point and the centre of the circle as 
its hypotenuse, 
and the 3rd point on the vertical axis through the centre with the same y value 
as the original point.
Calculate the length of the hypotenuse using good old Pythagorus.
If it is greater than  the radius, the point is outside the circle.

I think I owe you this explanation:

My project is a stand-alone Win32 program that  enables the user to print text 
onto a blank CD or DVD label.  Such a label is, of course, round, hence the 
circle.  My program draws a circle on the screen, and has a function to add 
text to the screen. That would enable a sighted user to see whether or not the 
text was within it.  I needed the procedure we have been discussing so that the 
program could alert a blind or visually-impaired user that at least part of the 
text was on the non-printable part of the label sheet.

the method suggested is far simpler and more reliabel than the complicated 
scenario I had imagined, which would have had each corner of the text rectangle 
compared with numerous points on the circumference of the circle.

If anyone is interested in checking out my program, please contact me 
privately, and I'll send you a .zip file containing the executable, a 
documentation file, a Readme.txt file containing installation instructions, and 
a set of JAWS configuration files that I have developped for it.  The program 
is in working order - I have used it to produce several CD labels - but it 
still needs further refinement.  Over the next few days I will code and test 
this new procedure.

Again, many thanks to you all.  Once again these lists have proved their great 
value.

All the best,

Ian

Ian D. Nichols,
toronto, Canada

Other related posts: