Data Structures | |
struct | MDrawControl |
Type of a text drawing control. More... | |
struct | MDrawMetric |
Type of metric for gylphs and texts. More... | |
struct | MDrawGlyphInfo |
Type of information about a glyph. More... | |
Typedefs | |
typedef void * | MDrawWindow |
Window system dependent type for a window. | |
typedef void * | MDrawRegion |
Window system dependent type for a region. | |
Functions | |
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, int y, 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. | |
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) |
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) |
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 layouting facility.
|
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 |
|
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 |
|
The mdraw_text() function draws the text between from and to of M-text mt on window win of frame frame at coordinate (x, y).
The appearance of the text (size, style, color, etc) is specified by the value of the text property whose key is The font used to draw a character in the M-text is selected from the value of the fontset property of a face by the following algorithm:
If no font is found by the algorithm above, this function draws an empty box for the character. This function draws only the glyph foreground. To specify the background color, use mdraw_image_text() or mdraw_text_with_control().
This function is the counterpart of
|
|
The mdraw_image_text() function draws the text between from and to of M-text mt as image on window win of frame frame at coordinate (x, y). The way to draw a text is the same as in mdraw_text() except that this function also draws the background with the color specified by faces.
This function is the counterpart of
|
|
The mdraw_text_with_control() function draws the text between from and to of M-text mt on windows win of frame frame at coordinate (x, y). The way to draw a text is the same as in mdraw_text() except that this function also follows what specified in the drawing control object control. For instance, if of control is nonzero, this function draw an M-text 2-dimensionally, i.e., newlines in M-text breaks lines and the following characters are drawn in the next line. See the documentation of the structure @ MDrawControl for more detail. |
|
The mdraw_text_extents() function computes the width of text between from and to of M-text mt when it is drawn on a window of frame frame using the mdraw_text_with_control() function with the drawing control object control.
If overall_ink_return is not
If overall_logical_return is not
If overall_line_return is not
merror_code .
|
|
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 an overall_logical_return are not If control->two_dimensional is nonzero, this function computes only the metrics of characters in the first line. |
|
The mdraw_coordinates_position() function checks which character is to be drawn at coordinate (x, y) when the text between from and to of M-text mt is drawn at the coordinate (0, 0) using the mdraw_text_with_control() function with the drawing control object control. Here, the character position means the number of characters that precede the character in question in mt. frame is used only to get the default face information.
|
|
The The information is stored in the members of info.
|
|
The mdraw_text_items() function draws one or more M-texts on window win of frame at coordinate (x, y). items is an array of the textitems to be drawn and nitems is the number of textimtems in the array.
|
|
|
|
The mdraw_per_char_extents() function computes the text dimension of each character in M-text mt. The faces given as text properties in mt and the default face of frame frame determine the fonts to draw the text. Each successive element in array_return is set to the drawn metrics of successive characters, which is relative to the origin of the drawing, and a rectangle for each character in mt. The number of elements of array_return must be equal to or greater than the number of characters in mt.
If pointer overall_return is not |
|
|