AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
stringBounds (Object font, String str [, int tight]) yoix.graphics
stringBounds (Object dest, String str [, int tight])  
 
Returns a Rectangle that represents the bounds of the string str when printed in font, which can be given as a Font or String, or when printed on the drawable object dest, which must be an Image or a drawable component (i.e., a Swing or AWT component, like a JCanvas, JFrame, or Canvas, that supports a paint function). The optional tight argument, which is 0 by default, controls the fit of the Rectangle to the str.

By default the result is a "loose fitting" Rectangle that contains the origin and the advance point, which is the where the current point (i.e., the origin) moves after str is printed, and extends ascent units above and descent units below the baseline, which is the line that connects the origin to the advance point. If the optional tight argument is supplied and is non-zero then the result will be a "tight fitting" Rectangle that just covers the characters in str.
 
 See Also:   clearRect, copyArea, drawArc, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, pointInPolygon, pointInRect, rectContainsRect, rectIntersectionRect, rectIntersectsRect, rectUnionRect, stringWidth

 

Yoix is a registered trademark of AT&T Inc.