---
name: "mdraw_text_per_char_extents"
section: "3m17n"
platform: "linux"
package: "m17n-docs"
version: "1.8.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mdraw_text_per_char_extents"
---

# mdraw\_text\_per\_char\_extents(3m17n)

## NAME

mdraw\_text\_per\_char\_extents -

## SYNOPSIS

int **mdraw\_text\_per\_char\_extents** (**MFrame** \* *frame*, **MText** \* *mt*, int *from*, int *to*, **MDrawControl** \* *control*, **MDrawMetric** \* *ink\_array\_return*, **MDrawMetric** \* *logical\_array\_return*, int *array\_size*, int \* *num\_chars\_return*, **MDrawMetric** \* *overall\_ink\_return*, **MDrawMetric** \* *overall\_logical\_return*)

## DESCRIPTION

Compute the text dimensions of each character of M-text. The **mdraw\_text\_per\_char\_extents()** function computes the drawn metric of each character between **from** and **to** of M-text **mt** assuming that they are drawn on a window of frame **frame** using the **mdraw\_text\_with\_control()** function with the drawing control object **control**.

**array\_size** specifies the size of **ink\_array\_return** and **logical\_array\_return**. Each successive element of **ink\_array\_return** and **logical\_array\_return** are set to the drawn ink and logical metrics of successive characters respectively, relative to the drawing origin of the M-text. The number of elements of **ink\_array\_return** and **logical\_array\_return** that have been set is returned to **num\_chars\_return**.

If **array\_size** is too small to return all metrics, the function returns -1 and store the requested size in **num\_chars\_return**. Otherwise, it returns zero.

If pointer **overall\_ink\_return** and **overall\_logical\_return** are not `NULL`, this function also computes the metrics of the overall text and stores the results in the members of the structure pointed to by **overall\_ink\_return** and **overall\_logical\_return**.

If **control-\>two\_dimensional** is nonzero, this function computes only the metrics of characters in the first line. \

## COPYRIGHT

Copyright (C) 2001 Information-technology Promotion Agency (IPA)\
 Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)\
 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License  \<http://www.gnu.org/licenses/fdl.html\>.
