NAME

win32.c - implements some win32 specific code, specifically Win32 font support.

SYNOPSIS

i_img_dim bbox[6];
if (i_wf_bbox(facename, size, text, text_len, bbox)) {
  // we have the bbox
}
i_wf_text(face, im, tx, ty, cl, size, text, len, align, aa, utf8);
i_wf_cp(face, im, tx, ty, channel, size, text, len, align, aa, utf8)

DESCRIPTION

An Imager interface to font output using the Win32 GDI.

i_wf_bbox(face, size, text, length, bbox, utf8)

Calculate a bounding box for the text.

i_wf_text(face, im, tx, ty, cl, size, text, len, align, aa)

Draws the text in the given color.

i_wf_cp(face, im, tx, ty, channel, size, text, len, align, aa)

Draws the text in the given channel.

i_wf_addfont(char const *filename, char const *resource_file)

Adds a TTF font file as usable by the application.

Where possible the font is added as private to the application.

Under Windows 95/98/ME the font is added globally, since we don't have any choice. In either case call i_wf_delfont() to remove it.

i_wf_delfont(char const *filename, char const *resource_file)

Deletes a TTF font file as usable by the application.

INTERNAL FUNCTIONS

set_logfont(face, size, lf)

Fills in a LOGFONT structure with reasonable defaults.

render_text(face, size, text, length, aa, pbm, psz, tm)

renders the text to an in-memory RGB bitmap

It would be nice to render to greyscale, but Windows doesn't have native greyscale bitmaps.

utf8_to_wide_string(text, text_len, wide_chars)

BUGS

Should really use a structure so we can set more attributes.

Should support UTF8

AUTHOR

Tony Cook <tony@develop-help.com>

SEE ALSO

Imager(3)