logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

m17nDraw_-_Dra - - Drawing M-texts on a window.

Author

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

Data Structure Documentation

MDrawControl
       Type of a text drawing control.

       FIELDDOCUMENTATION:unsignedMDrawControl::as_image If nonzero, draw an M-text as image, i.e. with background filled with
       background colors of faces put on the M-text. Otherwise, the background is not changed.

       unsignedMDrawControl::align_head If nonzero and the first glyph of each line has negative lbearing,
       shift glyphs horizontally to right so that no pixel is drawn to the left of the specified position.

       unsignedMDrawControl::two_dimensional If nonzero, draw an M-text two-dimensionally, i.e., newlines in
       M-text breaks lines and the following characters are drawn in the next line. If <format> is non-NULL, and
       the function returns nonzero line width, a line longer than that width is also broken.

       unsignedMDrawControl::orientation_reversed If nonzero, draw an M-text to the right of a specified
       position.

       unsignedMDrawControl::enable_bidi If nonzero, reorder glyphs correctly for bidi text.

       unsignedMDrawControl::ignore_formatting_char If nonzero, don't draw characters whose general category
       (in Unicode) is Cf (Other, format).

       unsignedMDrawControl::fixed_width If nonzero, draw glyphs suitable for a terminal. Not yet implemented.

       unsignedMDrawControl::anti_alias If nonzero, draw glyphs with anti-aliasing if a backend font driver
       supports it.

       unsignedMDrawControl::disable_overlapping_adjustment If nonzero, disable the adjustment of glyph
       positions to avoid horizontal overlapping at font boundary.

       unsignedintMDrawControl::min_line_ascent If nonzero, the values are minimum line ascent pixels.

       unsignedintMDrawControl::min_line_descent If nonzero, the values are minimum line descent pixels.

       unsignedintMDrawControl::max_line_ascent If nonzero, the values are maximum line ascent pixels.

       unsignedintMDrawControl::max_line_descent If nonzero, the values are maximum line descent pixels.

       unsignedintMDrawControl::max_line_width If nonzero, the value specifies how many pixels each line can
       occupy on the display. The value zero means that there is no limit. It is ignored if <format> is
       non-NULL.

       unsignedintMDrawControl::tab_width If nonzero, the value specifies the distance between tab stops in
       columns (the width of one column is the width of a space in the default font of the frame). The value
       zero means

       8.

       void(*MDrawControl::format)(intline,inty,int*indent,int*width) If non-NULL, the value is a
       function that calculates the indentation and width limit of each line based on the line number  LINE  and
       the  coordinate  Y. The function store the indentation and width limit at the place pointed by INDENT and
       WIDTH respectively.

       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,intpos,intfrom,intto,intline,inty)Ifnon-NULL,thevalueisafunctionthatcalculatesalinebreakingpositionwhenalineistoolongtofitwithinthewidthlimit.POSisthepositionofthecharacternexttothelastonethatfitswithinthelimit.FROMisthepositionofthefirstcharacteroftheline,andTOisthepositionofthelastcharacterdisplayedonthelineiftherewerenotwidthlimit.LINEandYarethesameastheargumentsto<format>.

       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.

       intMDrawControl::with_cursor If nonzero, show the cursor according to <cursor_width>.

       intMDrawControl::cursor_pos Specifies the character position to display a cursor. If it is greater  than
       the  maximum  character position, the cursor is displayed next to the last character of an M-text. If the
       value is negative, even if <cursor_width> is nonzero, cursor is not displayed.

       intMDrawControl::cursor_width If nonzero, display a cursor at the character  position  <cursor_pos>.  If
       the value is positive, it is the pixel width of the cursor. If the value is negative, the cursor width is
       the same as the underlining glyph(s).

       intMDrawControl::cursor_bidi If nonzero and <cursor_width> is also nonzero, display double bar cursors;
       at the character position <cursor_pos> and at the logically previous character.  Both  cursors  have  one
       pixel width with horizontal fringes at upper or lower positions.

       intMDrawControl::partial_update  If  nonzero, on drawing partial text, pixels of surrounding texts that
       intrude into the drawing area are also drawn. For  instance,  some  CVC  sequence  of  Thai  text  (C  is
       consonant, V is upper vowel) is drawn so that V is placed over the middle of two Cs. If this CVC sequence
       is already drawn and only the last C is drawn again (for instance by updating cursor position), the right
       half  of V is erased if this member is zero. By setting this member to nonzero, even with such a drawing,
       we can keep this CVC sequence correctly displayed.

       intMDrawControl::disable_caching If nonzero, don't cache the result of any  drawing  information  of  an
       M-text.

       MDrawRegionMDrawControl::clip_regionIfnon-NULL,limitthedrawingeffecttothespecifiedregion.MDrawMetric
       Type of metric for glyphs and texts.

       FIELDDOCUMENTATION:intMDrawMetric::x X coordinates of a glyph or a text.

       intMDrawMetric::y Y coordinates of a glyph or a text.

       unsignedintMDrawMetric::width Pixel width of a glyph or a text.

       unsignedintMDrawMetric::height Pixel height of a glyph or a text.

   MDrawGlyphInfo
       Type of information about a glyph.

       FIELDDOCUMENTATION:intMDrawGlyphInfo::from Start position of character range corresponding to the glyph.

       intMDrawGlyphInfo::to End position of character range corresponding to the glyph.

       intMDrawGlyphInfo::line_from Start position of character range corresponding to the line of the glyph.

       intMDrawGlyphInfo::line_to End position of character range corresponding to the line of the glyph.

       intMDrawGlyphInfo::x X coordinates of the glyph.

       intMDrawGlyphInfo::y Y coordinates of the glyph.

       MDrawMetricMDrawGlyphInfo::metricsMetricoftheglyph.MFont*MDrawGlyphInfo::fontFontusedfortheglyph.SettoNULLifnofontisfoundfortheglyph.intMDrawGlyphInfo::prev_from Character ranges corresponding to logically previous glyphs. Note that we
       do not need the members prev_to because it must be the same as the member <from>.

       intMDrawGlyphInfo::next_to Character ranges corresponding to logically next glyphs. Note that we do not
       need the members next_from because it must be the same as the member <to> respectively.

       intMDrawGlyphInfo::left_from Start position of character ranges corresponding to visually left glyphs.

       intMDrawGlyphInfo::left_to End position of character ranges corresponding to visually left glyphs.

       intMDrawGlyphInfo::right_from Start position of character ranges corresponding to visually right glyphs.

       intMDrawGlyphInfo::right_to End position of character ranges corresponding to visually left glyphs.

       intMDrawGlyphInfo::logical_width Logical width of the glyph. Nominal distance to the next glyph.

   MDrawGlyph
       Type of information about a glyph metric and font.

       FIELDDOCUMENTATION:intMDrawGlyph::from Character range corresponding to the glyph.

       intMDrawGlyph::tointMDrawGlyph::glyph_code Font glyph code of the glyph.

       intMDrawGlyph::x_advance Logical width of the glyph. Nominal distance to the next glyph.

       intMDrawGlyph::y_advance Logical height of the glyph. Nominal distance to the next glyph.

       intMDrawGlyph::x_off X offset relative to the glyph position.

       intMDrawGlyph::y_off Y offset relative to the glyph position.

       intMDrawGlyph::lbearing Metric of the glyph (left-bearing).

       intMDrawGlyph::rbearing Metric of the glyph (right-bearing).

       intMDrawGlyph::ascent Metric of the glyph (ascent).

       intMDrawGlyph::descent Metric of the glyph (descent).

       MFont*MDrawGlyph::fontFontusedfortheglyph.SettoNULLifnofontisfoundfortheglyph.MSymbolMDrawGlyph::font_type Type of the font. One of Mx, Mfreetype, Mxft.

       void*MDrawGlyph::fontp Pointer to the font structure. The actual type is (XFontStruct *) if <font_type>
       member is Mx, FT_Face if <font_type> member is Mfreetype, and (XftFont *) if <font_type> member is Mxft.

Detailed Description

       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.

Name

       m17nDraw_-_Dra -  - Drawing M-texts on a window.

Synopsis

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

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

   Variables
       int mdraw_line_break_option
           Option of line breaking for drawing text.

Typedef Documentation

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

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

Variable Documentation

intmdraw_line_break_option
       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().

See Also