.\" Copyright (C) 2001 Information-technology Promotion Agency (IPA) .\" Copyright (C) 2001-2011 .\" National Institute of Advanced Industrial Science and Technology (AIST) .\" This file is part of the m17n library documentation. .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Section, no Front-Cover Texts, .\" and no Back-Cover Texts. A copy of the license is included in the .\" appendix entitled "GNU Free Documentation License". .TH "Drawing" 3m17n "12 Jan 2011" "Version 1.6.2" "The m17n Library" \" -*- nroff -*- .ad l .nh .SH NAME Drawing \- Drawing M\-texts on a window. .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBMDrawControl\fP" .br .RI "\fIType of a text drawing control. \fP" .ti -1c .RI "struct \fBMDrawMetric\fP" .br .RI "\fIType of metric for glyphs and texts. \fP" .ti -1c .RI "struct \fBMDrawGlyphInfo\fP" .br .RI "\fIType of information about a glyph. \fP" .ti -1c .RI "struct \fBMDrawGlyph\fP" .br .RI "\fIType of information about a glyph metric and font. \fP" .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef void * \fBMDrawWindow\fP" .br .RI "\fIWindow system dependent type for a window. \fP" .ti -1c .RI "typedef void * \fBMDrawRegion\fP" .br .RI "\fIWindow system dependent type for a region. \fP" .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBmdraw_text\fP (\fBMFrame\fP *frame, \fBMDrawWindow\fP win, int x, int y, \fBMText\fP *mt, int from, int to)" .br .RI "\fIDraw an M-text on a window. \fP" .ti -1c .RI "int \fBmdraw_image_text\fP (\fBMFrame\fP *frame, \fBMDrawWindow\fP win, int x, int y, \fBMText\fP *mt, int from, int to)" .br .RI "\fIDraw an M-text on a window as an image. \fP" .ti -1c .RI "int \fBmdraw_text_with_control\fP (\fBMFrame\fP *frame, \fBMDrawWindow\fP win, int x, int y, \fBMText\fP *mt, int from, int to, \fBMDrawControl\fP *control)" .br .RI "\fIDraw an M-text on a window with fine control. \fP" .ti -1c .RI "int \fBmdraw_text_extents\fP (\fBMFrame\fP *frame, \fBMText\fP *mt, int from, int to, \fBMDrawControl\fP *control, \fBMDrawMetric\fP *overall_ink_return, \fBMDrawMetric\fP *overall_logical_return, \fBMDrawMetric\fP *overall_line_return)" .br .RI "\fICompute text pixel width. \fP" .ti -1c .RI "int \fBmdraw_text_per_char_extents\fP (\fBMFrame\fP *frame, \fBMText\fP *mt, int from, int to, \fBMDrawControl\fP *control, \fBMDrawMetric\fP *ink_array_return, \fBMDrawMetric\fP *logical_array_return, int array_size, int *num_chars_return, \fBMDrawMetric\fP *overall_ink_return, \fBMDrawMetric\fP *overall_logical_return)" .br .RI "\fICompute the text dimensions of each character of M-text. \fP" .ti -1c .RI "int \fBmdraw_coordinates_position\fP (\fBMFrame\fP *frame, \fBMText\fP *mt, int from, int to, int x_offset, int y_offset, \fBMDrawControl\fP *control)" .br .RI "\fIReturn the character position nearest to the coordinates. \fP" .ti -1c .RI "int \fBmdraw_glyph_info\fP (\fBMFrame\fP *frame, \fBMText\fP *mt, int from, int pos, \fBMDrawControl\fP *control, \fBMDrawGlyphInfo\fP *info)" .br .RI "\fICompute information about a glyph. \fP" .ti -1c .RI "int \fBmdraw_glyph_list\fP (\fBMFrame\fP *frame, \fBMText\fP *mt, int from, int to, \fBMDrawControl\fP *control, \fBMDrawGlyph\fP *glyphs, int array_size, int *num_glyphs_return)" .br .RI "\fICompute information about glyph sequence. \fP" .ti -1c .RI "void \fBmdraw_text_items\fP (\fBMFrame\fP *frame, \fBMDrawWindow\fP win, int x, int y, \fBMDrawTextItem\fP *items, int nitems)" .br .RI "\fIDraw one or more textitems. \fP" .ti -1c .RI "int \fBmdraw_default_line_break\fP (\fBMText\fP *mt, int pos, int from, int to, int line, int y)" .br .RI "\fICalculate a line breaking position. \fP" .ti -1c .RI "void \fBmdraw_per_char_extents\fP (\fBMFrame\fP *frame, \fBMText\fP *mt, \fBMDrawMetric\fP *array_return, \fBMDrawMetric\fP *overall_return)" .br .RI "\fIObtain per character dimension information. \fP" .ti -1c .RI "void \fBmdraw_clear_cache\fP (\fBMText\fP *mt)" .br .RI "\fIclear cached information. \fP" .in -1c .SS "Variables" .in +1c .ti -1c .RI "int \fBmdraw_line_break_option\fP" .br .RI "\fIOption of line breaking for drawing text. \fP" .in -1c .SH "Detailed Description" .PP Drawing M\-texts on a window. The m17n GUI API provides functions to draw M\-texts. .PP 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. .PP The drawing format of M\-texts can be controlled in a variety of ways, which provides powerful 2\-dimensional layout facility. .SH "Data Structure Documentation" .SS MDrawControl .PP .ad l .nh .PP \fBFIELD DOCUMENTATION:\fP .PP .PP \fBunsigned \fBMDrawControl::as_image\fP\fP .PP \fBunsigned \fBMDrawControl::align_head\fP\fP .PP \fBunsigned \fBMDrawControl::two_dimensional\fP\fP .PP \fBunsigned \fBMDrawControl::orientation_reversed\fP\fP .PP \fBunsigned \fBMDrawControl::enable_bidi\fP\fP .PP \fBunsigned \fBMDrawControl::ignore_formatting_char\fP\fP .PP \fBunsigned \fBMDrawControl::fixed_width\fP\fP .PP \fBunsigned \fBMDrawControl::anti_alias\fP\fP .PP \fBunsigned \fBMDrawControl::disable_overlapping_adjustment\fP\fP .PP \fBunsigned int \fBMDrawControl::min_line_ascent\fP\fP .PP \fBunsigned int \fBMDrawControl::min_line_descent\fP\fP .PP \fBunsigned int \fBMDrawControl::max_line_ascent\fP\fP .PP \fBunsigned int \fBMDrawControl::max_line_descent\fP\fP .PP \fBunsigned int \fBMDrawControl::max_line_width\fP\fP .PP \fBunsigned int \fBMDrawControl::tab_width\fP\fP .PP \fBvoid(* \fBMDrawControl::format\fP)(int line, int y, int *indent, int *width)\fP .PP The indentation specifies how many pixels the first glyph of each line is shifted to the right (if the member is zero) or to the left (otherwise). If the value is negative, each line is shifted to the reverse direction. .PP The width limit specifies how many pixels each line can occupy on the display. The value 0 means that there is no limit. .PP 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. .PP This has an effect only when is nonzero. .PP \fBint(* \fBMDrawControl::line_break\fP)(\fBMText\fP *mt, int pos, int from, int to, int line, int y)\fP .PP The function must return a character position to break the line. .PP The function should not modify MT. .PP The \fBmdraw_default_line_break()\fP function is useful for such a script that uses SPACE as a word separator. .PP \fBint \fBMDrawControl::with_cursor\fP\fP .PP \fBint \fBMDrawControl::cursor_pos\fP\fP .PP \fBint \fBMDrawControl::cursor_width\fP\fP .PP \fBint \fBMDrawControl::cursor_bidi\fP\fP .PP \fBint \fBMDrawControl::partial_update\fP\fP .PP \fBint \fBMDrawControl::disable_caching\fP\fP .PP \fB\fBMDrawRegion\fP \fBMDrawControl::clip_region\fP\fP .SS MDrawMetric .PP .ad l .nh .PP \fBFIELD DOCUMENTATION:\fP .PP .PP \fBint \fBMDrawMetric::x\fP\fP .PP \fBint \fBMDrawMetric::y\fP\fP .PP \fBunsigned int \fBMDrawMetric::width\fP\fP .PP \fBunsigned int \fBMDrawMetric::height\fP\fP .SS MDrawGlyphInfo .PP .ad l .nh .PP \fBFIELD DOCUMENTATION:\fP .PP .PP \fBint \fBMDrawGlyphInfo::from\fP\fP .PP \fBint \fBMDrawGlyphInfo::to\fP\fP .PP \fBint \fBMDrawGlyphInfo::line_from\fP\fP .PP \fBint \fBMDrawGlyphInfo::line_to\fP\fP .PP \fBint \fBMDrawGlyphInfo::x\fP\fP .PP \fBint \fBMDrawGlyphInfo::y\fP\fP .PP \fB\fBMDrawMetric\fP \fBMDrawGlyphInfo::metrics\fP\fP .PP \fB\fBMFont\fP* \fBMDrawGlyphInfo::font\fP\fP .PP \fBint \fBMDrawGlyphInfo::prev_from\fP\fP .PP \fBint \fBMDrawGlyphInfo::next_to\fP\fP .PP \fBint \fBMDrawGlyphInfo::left_from\fP\fP .PP \fBint \fBMDrawGlyphInfo::left_to\fP\fP .PP \fBint \fBMDrawGlyphInfo::right_from\fP\fP .PP \fBint \fBMDrawGlyphInfo::right_to\fP\fP .PP \fBint \fBMDrawGlyphInfo::logical_width\fP\fP .SS MDrawGlyph .PP .ad l .nh .PP \fBFIELD DOCUMENTATION:\fP .PP .PP \fBint \fBMDrawGlyph::from\fP\fP .PP \fBint \fBMDrawGlyph::to\fP\fP .PP \fBint \fBMDrawGlyph::glyph_code\fP\fP .PP \fBint \fBMDrawGlyph::x_advance\fP\fP .PP \fBint \fBMDrawGlyph::y_advance\fP\fP .PP \fBint \fBMDrawGlyph::x_off\fP\fP .PP \fBint \fBMDrawGlyph::y_off\fP\fP .PP \fBint \fBMDrawGlyph::lbearing\fP\fP .PP \fBint \fBMDrawGlyph::rbearing\fP\fP .PP \fBint \fBMDrawGlyph::ascent\fP\fP .PP \fBint \fBMDrawGlyph::descent\fP\fP .PP \fB\fBMFont\fP* \fBMDrawGlyph::font\fP\fP .PP \fB\fBMSymbol\fP \fBMDrawGlyph::font_type\fP\fP .PP \fBvoid* \fBMDrawGlyph::fontp\fP\fP .SH "Typedef Documentation" .PP .SS "typedef void* \fBMDrawWindow\fP" .PP Window system dependent type for a window. The type \fBMDrawWindow\fP is for a window; a rectangular area that works in several ways like a miniature screen. .PP What it actually points depends on a window system. A program that uses the m17n\-X library must coerce the type \fCDrawable\fP to this type. .SS "typedef void* \fBMDrawRegion\fP" .PP Window system dependent type for a region. The type \fBMDrawRegion\fP is for a region; an arbitrary set of pixels on the screen (typically a rectangular area). .PP What it actually points depends on a window system. A program that uses the m17n\-X library must coerce the type \fCRegion\fP to this type. .SH "Variable Documentation" .PP .SS "int \fBmdraw_line_break_option\fP" .PP Option of line breaking for drawing text. The variable \fBmdraw_line_break_option\fP specifies line breaking options by logical\-or of the members of \fBMTextLineBreakOption\fP. It controls the line breaking algorithm of the function \fBmdraw_default_line_break()\fP. .SH "Author" .PP Generated automatically by Doxygen for The m17n Library from the source code. .SH COPYRIGHT Copyright (C) 2001 Information\-technology Promotion Agency (IPA) .br Copyright (C) 2001\-2011 National Institute of Advanced Industrial Science and Technology (AIST) .br Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License .