---
name: "im_text"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_text"
---

# im\_text(3)

render a utf-8 text string into an image

## NAME

im\_text - render a utf-8 text string into an image

## SYNOPSIS

**#include \<vips/vips.h\>**

**int im\_text( out, text, font, width, alignment, dpi )**\
 **IMAGE \*out;**\
 **const char \*text;**\
 **const char \*font;**\
 **int width;**\
 **int alignment;**\
 **int dpi;**

## DESCRIPTION

**[im\_text(3)](/im_text/3.md)** makes an image containing the text string rendered as a bitmap with Pango. The result is a one band 8 bit image with 0 - 255 as black to white. The string may contain Pango markup, for example "\<i\>The\</i\>Guardian".

Fonts are specified pango-style as "family style size", for example "sans 12"  or "times italic 14".

The **width** parameter, if greater than zero, gives the line width to wrap at.

**alignment** can be 0, 1 or 2 for right, centre and left alignment.

**dpi** is the resolution to render the text at. 300 is good for print, 100 for displays.

## RETURN VALUE

The function returns 0 on success and -1 on error.

## SEE ALSO

[im\_plotmask(3)](/im_plotmask/3.md), [im\_insertplace(3)](/im_insertplace/3.md)

## COPYRIGHT

National Gallery 2004
