Carbon


TXNGetLineMetrics

Header: MacTextEditor.h Carbon status: Under Evaluation

Gets information about line width and height for a specified line of data in text object.

OSStatus TXNGetLineMetrics (
    TXNObject iTXNObject, 
    UInt32 iLineNumber, 
    Fixed *oLineWidth, 
    Fixed *oLineHeight
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object that identifies the document whose line metrics you want to get.

iLineNumber

An unsigned 32-bit integer that specifies the line whose metrics you want to retrieve. You should use the TXNGetLineCount function to determine how many lines are in the text object, so that you specify a valid line number. Line numbers start at 0.

oLineWidth

On return, a pointer to the width of the line, in pixels.

oLineHeight

On return, a pointer to the height of the line, in pixels.

function result

A result code.

DISCUSSION

You can use height and width information to adjust the size of the text object’s frame.

AVAILABILITY

Under evaluation for Carbon. Available in Carbon 1.1 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)