File: m17nDraw.3m17n

package info (click to toggle)
m17n-docs 1.6.2-2
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 22,492 kB
  • ctags: 1,495
  • sloc: sh: 1,032; makefile: 406; ansic: 206; perl: 108
file content (306 lines) | stat: -rw-r--r-- 10,182 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
.\" 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 <orientation_reversed> 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 <two_dimensional> 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 
<http://www.gnu.org/licenses/fdl.html>.