get-text-extent in dc<%>
Gets the dimensions of a string drawn into this drawing context. The result is four real numbers:
the total width of the text (depends on both the font and the text);
the total height of the font (depends only on the font);
the distance from the baseline of the font to the bottom of the descender (included in the height, depends only on the font); and
extra vertical space added to the font by the font designer (included in the height, and often zero; depends only on the font).
The returned width and height define a rectangle is that guaranteed to contain the text string when it is drawn, but the fit is not necessarily tight. Some undefined number of pixels on the left, right, top, and bottom of the drawn string may be ``whitespace,'' depending on the whims of the font designer and the platform-specific font-scaling mechanism.
Unlike most methods, this method can be called for a bitmap-dc%
object without a bitmap installed.
(-> four non-negative real numbers: width, height, descent, and spacesenda-dcget-text-extentstringfontcombine?offset)
string: string
font=#f:font%object or#f
combine?=#f: boolean
offset=0: exact non-negative integerReturns the size of
stringat it would be drawn in the drawing context, starting from theoffsetcharacter ofstring, and continuing until the end ofstringor the first null character. Thefontargument specifies the font to use in measuring the text; if it is#f, the current font of the drawing area is used. (See alsoset-font.)If
combine?is#t, thentextmay be drawn with adjacent characters combined to ligature glyphs, with Unicode combining characters as a single glyph, with kerning, with right-to-left ordering of characters, etc. Ifcombine?is#f, then the result is the same as if each character is drawn separately, and Unicode control characters are ignored.