- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS
  - AnnotateImage
  - EncodeSJIS
  - EncodeUnicode
  - GetTypeMetrics

# NAME

annotate - Methods to Annotate an Image

# SYNOPSIS

unsigned int AnnotateImage( Image *image, DrawInfo *draw_info );

encoding= EncodeSJIS( text, count );

unicode= EncodeUnicode( text, count );

unsigned int GetTypeMetrics( Image *image, const DrawInfo *draw_info, TypeMetric *metrics );

# FUNCTION DESCRIPTIONS

## AnnotateImage

> AnnotateImage() annotates an image with text. Optionally you can include any of the following bits of information about the image by embedding the appropriate special characters:

The format of the AnnotateImage method is:

> unsigned int AnnotateImage ( Image *image, DrawInfo *draw_info );

A description of each parameter follows:

  status:
    Method AnnotateImage returns True if the image is annotated otherwise False.

  image:
    The image.

  draw_info:
    The draw info.

## EncodeSJIS

> EncodeSJIS() converts an ASCII text string to 2-bytes per character code ( like UCS-2 ) . Returns the translated codes and the character count. Characters under 0x7f are just copied, characters over 0x80 are tied with the next character.

Method contributed by Katsutoshi Shibuya.

The format of the EncodeSJIS function is:

> encoding=EncodeSJIS ( text, count );

A description of each parameter follows:

  encoding:
    `EncodeSJIS()` returns a pointer to an unsigned short array representing the encoded version of the ASCII string.

  text:
    The text.

  count:
    return the number of characters generated by the encoding.

## EncodeUnicode

> EncodeUnicode() converts an ASCII text string to Unicode and returns the Unicode translation and the character count. Normal characters are just copied.

The format of the EncodeUnicode function is:

> unicode=EncodeUnicode ( text, count );

A description of each parameter follows:

  unicode:
    `EncodeUnicode()` returns a pointer to an unsigned short array array representing the encoded version of the ASCII string.

  text:
    The text.

  count:
    return the number of characters generated by the encoding.

## GetTypeMetrics

> GetTypeMetrics() returns the following information for the specified font and text:

  o
    character width o character height o ascent o descent o text width o text height o maximum horizontal advance o underline position o underline thickness

The format of the GetTypeMetrics method is:

> unsigned int GetTypeMetrics ( Image *image, const DrawInfo *draw_info, TypeMetric *metrics );

A description of each parameter follows:

  image:
    The image.

  draw_info:
    The draw info.

  metrics:
    Return the font metrics in this structure.