logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mdraw_text_extents -

Description

       Compute text pixel width. The mdraw_text_extents() function computes the width of text between from and
       to of M-text mt when it is drawn on a window of frame frame using the mdraw_text_with_control() function
       with the drawing control object control.

       If overall_ink_return is not NULL, this function also computes the bounding box of character ink of the
       M-text, and stores the results in the members of the structure pointed to by overall_ink_return. If the
       M-text has a face specifying a surrounding box, the box is included in the bounding box.

       If overall_logical_return is not NULL, this function also computes the bounding box that provides minimum
       spacing to other graphical features (such as surrounding box) for the M-text, and stores the results in
       the members of the structure pointed to by overall_logical_return.

       If overall_line_return is not NULL, this function also computes the bounding box that provides minimum
       spacing to the other M-text drawn, and stores the results in the members of the structure pointed to by
       overall_line_return. This is a union of overall_ink_return and overall_logical_return if the members
       min_line_ascent, min_line_descent, max_line_ascent, and max_line_descent of control are all zero.

Errors

           MERROR_RANGE

Name

       mdraw_text_extents -

Return Value

           This function returns the width of the text to be drawn in the unit of pixels. If
           control->two_dimensional is nonzero and the text is drawn in multiple physical lines, it returns the
           width of the widest line. If an error occurs, it returns -1 and assigns an error code to the external
           variable merror_code.

Synopsis

       int mdraw_text_extents (MFrame * frame, MText * mt, int from, int to, MDrawControl * control, MDrawMetric
       * overall_ink_return, MDrawMetric * overall_logical_return, MDrawMetric * overall_line_return)

See Also