Reference Manual - 1.8.0
IDirectFBFont   GetStringExtents

Get the logical and real extents of the specified string as if it were drawn with this font.

DFBResult GetStringExtents (
  IDirectFBFont   * thiz,
  const char   * text,
  int   bytes,
  DFBRectangle   * ret_logical_rect,
  DFBRectangle   * ret_ink_rect
);

Bytes specifies the number of bytes to take from the string or -1 for the complete NULL-terminated string.

The logical rectangle describes the typographic extents and should be used to layout text. The ink rectangle describes the smallest rectangle containing all pixels that are touched when drawing the string. If you only need one of the rectangles, pass NULL for the other one.

The ink rectangle is guaranteed to be a valid rectangle with positive width and height, while the logical rectangle may have negative width indicating right-to-left layout.

The rectangle offsets are reported relative to the baseline and refer to the text being drawn using DSTF_LEFT.

Creative Commons License This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License