I wonder if this makes sense to anyone ...
I am writing some routines to align multiple stringshapes into a
group2D to represent a "paragraph." In order to calculate left-,
center- and right- alignment, I need to get the width of each line. I
create a temporary picture to have access to its graphics property so I
can use its stringwidth function.
Because the stringwidth method of the graphics class returns an
integer, and I'd like more precision, I set the graphics textsize to 10
times that of my stringshape, and then divide the stringwidth by 10
after I get it from the graphics.
I have noticed that the string widths calculated from the graphics
class are not terribly accurate if I get them from a 1-bit picture,
causing quite noticeable mis-alignment. However, they are much more
accurate if I create an 8-bit temporary picture instead.
Can someone explain this? It's not a big deal now that I've found a way
around it, but I'd be interested to know nonetheless.
Thanks,
--
Peter Truskier
Premedia Systems, Inc.
Berkeley, CA USA
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|