DOKK / manpages / debian 10 / m17n-docs / m17nDraw.3m17n.en
Drawing(3m17n) The m17n Library Drawing(3m17n)

Drawing - Drawing M-texts on a window.


struct MDrawControl
Type of a text drawing control. struct MDrawMetric
Type of metric for glyphs and texts. struct MDrawGlyphInfo
Type of information about a glyph. struct MDrawGlyph
Type of information about a glyph metric and font.


typedef void * MDrawWindow
Window system dependent type for a window. typedef void * MDrawRegion
Window system dependent type for a region.


int mdraw_text (MFrame *frame, MDrawWindow win, int x, int y, MText *mt, int from, int to)
Draw an M-text on a window. int mdraw_image_text (MFrame *frame, MDrawWindow win, int x, int y, MText *mt, int from, int to)
Draw an M-text on a window as an image. int mdraw_text_with_control (MFrame *frame, MDrawWindow win, int x, int y, MText *mt, int from, int to, MDrawControl *control)
Draw an M-text on a window with fine control. int mdraw_text_extents (MFrame *frame, MText *mt, int from, int to, MDrawControl *control, MDrawMetric *overall_ink_return, MDrawMetric *overall_logical_return, MDrawMetric *overall_line_return)
Compute text pixel width. 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)
Compute the text dimensions of each character of M-text. int mdraw_coordinates_position (MFrame *frame, MText *mt, int from, int to, int x_offset, int y_offset, MDrawControl *control)
Return the character position nearest to the coordinates. int mdraw_glyph_info (MFrame *frame, MText *mt, int from, int pos, MDrawControl *control, MDrawGlyphInfo *info)
Compute information about a glyph. int mdraw_glyph_list (MFrame *frame, MText *mt, int from, int to, MDrawControl *control, MDrawGlyph *glyphs, int array_size, int *num_glyphs_return)
Compute information about glyph sequence. void mdraw_text_items (MFrame *frame, MDrawWindow win, int x, int y, MDrawTextItem *items, int nitems)
Draw one or more textitems. int mdraw_default_line_break (MText *mt, int pos, int from, int to, int line, int y)
Calculate a line breaking position. void mdraw_per_char_extents (MFrame *frame, MText *mt, MDrawMetric *array_return, MDrawMetric *overall_return)
Obtain per character dimension information. void mdraw_clear_cache (MText *mt)
clear cached information.


int mdraw_line_break_option
Option of line breaking for drawing text.

Drawing M-texts on a window.

The m17n GUI API provides functions to draw M-texts.

The fonts used for drawing are selected automatically based on the fontset and the properties of a face. A face also specifies the appearance of M-texts, i.e. font size, color, underline, etc.

The drawing format of M-texts can be controlled in a variety of ways, which provides powerful 2-dimensional layout facility.

FIELD DOCUMENTATION:

unsigned MDrawControl::as_image

unsigned MDrawControl::align_head

unsigned MDrawControl::two_dimensional

unsigned MDrawControl::orientation_reversed

unsigned MDrawControl::enable_bidi

unsigned MDrawControl::ignore_formatting_char

unsigned MDrawControl::fixed_width

unsigned MDrawControl::anti_alias

unsigned MDrawControl::disable_overlapping_adjustment

unsigned int MDrawControl::min_line_ascent

unsigned int MDrawControl::min_line_descent

unsigned int MDrawControl::max_line_ascent

unsigned int MDrawControl::max_line_descent

unsigned int MDrawControl::max_line_width

unsigned int MDrawControl::tab_width

void(* MDrawControl::format)(int line, int y, int *indent, int *width)

The indentation specifies how many pixels the first glyph of each line is shifted to the right (if the member <orientation_reversed> is zero) or to the left (otherwise). If the value is negative, each line is shifted to the reverse direction.

The width limit specifies how many pixels each line can occupy on the display. The value 0 means that there is no limit.

LINE and Y are reset to 0 when a line is broken by a newline character, and incremented each time when a long line is broken because of the width limit.

This has an effect only when <two_dimensional> is nonzero.

int(* MDrawControl::line_break)(MText *mt, int pos, int from, int to, int line, int y)

The function must return a character position to break the line.

The function should not modify MT.

The mdraw_default_line_break() function is useful for such a script that uses SPACE as a word separator.

int MDrawControl::with_cursor

int MDrawControl::cursor_pos

int MDrawControl::cursor_width

int MDrawControl::cursor_bidi

int MDrawControl::partial_update

int MDrawControl::disable_caching

MDrawRegion MDrawControl::clip_region

FIELD DOCUMENTATION:

int MDrawMetric::x

int MDrawMetric::y

unsigned int MDrawMetric::width

unsigned int MDrawMetric::height

FIELD DOCUMENTATION:

int MDrawGlyphInfo::from

int MDrawGlyphInfo::to

int MDrawGlyphInfo::line_from

int MDrawGlyphInfo::line_to

int MDrawGlyphInfo::x

int MDrawGlyphInfo::y

MDrawMetric MDrawGlyphInfo::metrics

MFont* MDrawGlyphInfo::font

int MDrawGlyphInfo::prev_from

int MDrawGlyphInfo::next_to

int MDrawGlyphInfo::left_from

int MDrawGlyphInfo::left_to

int MDrawGlyphInfo::right_from

int MDrawGlyphInfo::right_to

int MDrawGlyphInfo::logical_width

FIELD DOCUMENTATION:

int MDrawGlyph::from

int MDrawGlyph::to

int MDrawGlyph::glyph_code

int MDrawGlyph::x_advance

int MDrawGlyph::y_advance

int MDrawGlyph::x_off

int MDrawGlyph::y_off

int MDrawGlyph::lbearing

int MDrawGlyph::rbearing

int MDrawGlyph::ascent

int MDrawGlyph::descent

MFont* MDrawGlyph::font

MSymbol MDrawGlyph::font_type

void* MDrawGlyph::fontp

typedef void* MDrawWindow

Window system dependent type for a window. The type MDrawWindow is for a window; a rectangular area that works in several ways like a miniature screen.

What it actually points depends on a window system. A program that uses the m17n-X library must coerce the type Drawable to this type.

typedef void* MDrawRegion

Window system dependent type for a region. The type MDrawRegion is for a region; an arbitrary set of pixels on the screen (typically a rectangular area).

What it actually points depends on a window system. A program that uses the m17n-X library must coerce the type Region to this type.

Option of line breaking for drawing text. The variable mdraw_line_break_option specifies line breaking options by logical-or of the members of MTextLineBreakOption. It controls the line breaking algorithm of the function mdraw_default_line_break().

Generated automatically by Doxygen for The m17n Library from the source code.

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>.

12 Jan 2011 Version 1.6.2