### Function

# Gimp text_get_extents_font

#### Declaration [src]

    gboolean
    gimp_text_get_extents_font (
      const gchar* text,
      gdouble size,
      GimpFont* font,
      gint* width,
      gint* height,
      gint* ascent,
      gint* descent
    )

#### Description [src]

Get extents of the bounding box for the specified text.

This tool returns the width and height of a bounding box for the specified text rendered with the specified font information. Ascent and descent of the glyph extents are returned as well. The ascent is the distance from the baseline to the highest point of the character. This is positive if the glyph ascends above the baseline. The descent is the distance from the baseline to the lowest point of the character. This is positive if the glyph descends below the baseline. The size is always in pixels. If you need to set a font in points, divide the size in points by 72.0 and multiply it by the vertical resolution of the image you are taking into account.

#### Parameters

`text`

  Type: `const gchar*`

  The text to generate (in UTF-8 encoding).

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`size`

  Type: `gdouble`

  The size of text in either pixels or points.

`font`

  Type: `GimpFont`

  The name of the font.

  The data is owned by the caller of the function.

`width`

  Type: `gint*`

  The width of the glyph extents.

  The argument will be set by the function.

`height`

  Type: `gint*`

  The height of the glyph extents.

  The argument will be set by the function.

`ascent`

  Type: `gint*`

  The ascent of the glyph extents.

  The argument will be set by the function.

`descent`

  Type: `gint*`

  The descent of the glyph extents.

  The argument will be set by the function.

#### Return value

Type: `gboolean`

TRUE on success.