File: group__m17nDraw.html

package info (click to toggle)
m17n-docs 1.6.2-2.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 22,492 kB
  • sloc: sh: 1,032; javascript: 635; makefile: 406; ansic: 206; perl: 108
file content (936 lines) | stat: -rw-r--r-- 62,030 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>The m17n Library: Drawing</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Drawing<br/>
<small>
[<a class="el" href="group__m17nGUI.html">GUI API</a>]</small>
</h1>
<p>Drawing M-texts on a window.  
<a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMDrawControl.html">MDrawControl</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of a text drawing control.  <a href="structMDrawControl.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMDrawMetric.html">MDrawMetric</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of metric for glyphs and texts.  <a href="structMDrawMetric.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMDrawGlyphInfo.html">MDrawGlyphInfo</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of information about a glyph.  <a href="structMDrawGlyphInfo.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMDrawGlyph.html">MDrawGlyph</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of information about a glyph metric and font.  <a href="structMDrawGlyph.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Window system dependent type for a window.  <a href="#ga7cf712e335916cc72a77aca96cf327fb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga9818c0695d9162a9637fa4e98a1d477d">MDrawRegion</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Window system dependent type for a region.  <a href="#ga9818c0695d9162a9637fa4e98a1d477d"></a><br/></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08">mdraw_text</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a> win, int x, int y, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Draw an M-text on a window.  <a href="#ga02f9efd2c5d1bdd9d7a6ab18475bbd08"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#gab2de737f283237157b9035961f5a4fa6">mdraw_image_text</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a> win, int x, int y, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Draw an M-text on a window as an image.  <a href="#gab2de737f283237157b9035961f5a4fa6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a">mdraw_text_with_control</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a> win, int x, int y, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to, <a class="el" href="structMDrawControl.html">MDrawControl</a> *control)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Draw an M-text on a window with fine control.  <a href="#ga43ad1fe4a4a8db80a46450dfa250777a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga4f5a3138a20bef57e8660975200a4604">mdraw_text_extents</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to, <a class="el" href="structMDrawControl.html">MDrawControl</a> *control, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *overall_ink_return, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *overall_logical_return, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *overall_line_return)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute text pixel width.  <a href="#ga4f5a3138a20bef57e8660975200a4604"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#gae31ef0340c582c208f07f702f816977f">mdraw_text_per_char_extents</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to, <a class="el" href="structMDrawControl.html">MDrawControl</a> *control, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *ink_array_return, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *logical_array_return, int array_size, int *num_chars_return, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *overall_ink_return, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *overall_logical_return)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute the text dimensions of each character of M-text.  <a href="#gae31ef0340c582c208f07f702f816977f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga30321da41dd8785e54627e845a26cf00">mdraw_coordinates_position</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to, int x_offset, int y_offset, <a class="el" href="structMDrawControl.html">MDrawControl</a> *control)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the character position nearest to the coordinates.  <a href="#ga30321da41dd8785e54627e845a26cf00"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga0b79b3b695577bee9c0d41d4947e7a16">mdraw_glyph_info</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int pos, <a class="el" href="structMDrawControl.html">MDrawControl</a> *control, <a class="el" href="structMDrawGlyphInfo.html">MDrawGlyphInfo</a> *info)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute information about a glyph.  <a href="#ga0b79b3b695577bee9c0d41d4947e7a16"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga5ad6646874580721d879c82a8a5dbafc">mdraw_glyph_list</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int from, int to, <a class="el" href="structMDrawControl.html">MDrawControl</a> *control, <a class="el" href="structMDrawGlyph.html">MDrawGlyph</a> *glyphs, int array_size, int *num_glyphs_return)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute information about glyph sequence.  <a href="#ga5ad6646874580721d879c82a8a5dbafc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga41ee093d2d8b2d6a8c499ac8802871d6">mdraw_text_items</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a> win, int x, int y, <a class="el" href="structMDrawTextItem.html">MDrawTextItem</a> *items, int nitems)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Draw one or more textitems.  <a href="#ga41ee093d2d8b2d6a8c499ac8802871d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga457d91ccebabb26e1d7ab27f616cecb5">mdraw_default_line_break</a> (<a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, int pos, int from, int to, int line, int y)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate a line breaking position.  <a href="#ga457d91ccebabb26e1d7ab27f616cecb5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#gae05aed269fc5fe20557a297f439a88ea">mdraw_per_char_extents</a> (<a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *frame, <a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *array_return, <a class="el" href="structMDrawMetric.html">MDrawMetric</a> *overall_return)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain per character dimension information.  <a href="#gae05aed269fc5fe20557a297f439a88ea"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#ga74e7bee7646b408dbf11b4866afb1098">mdraw_clear_cache</a> (<a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *mt)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">clear cached information.  <a href="#ga74e7bee7646b408dbf11b4866afb1098"></a><br/></td></tr>
<tr><td colspan="2"><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDraw.html#gaae4c0c421e284fc8084998d20e4a40c5">mdraw_line_break_option</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Option of line breaking for drawing text.  <a href="#gaae4c0c421e284fc8084998d20e4a40c5"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Drawing M-texts on a window. </p>
<p>The m17n GUI API provides functions to draw M-texts.</p>
<p>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.</p>
<p>The drawing format of M-texts can be controlled in a variety of ways, which provides powerful 2-dimensional layout facility. </p>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga7cf712e335916cc72a77aca96cf327fb"></a><!-- doxytag: member="m17n&#45;gui.h::MDrawWindow" ref="ga7cf712e335916cc72a77aca96cf327fb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void* <a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Window system dependent type for a window. </p>
<p>The type <a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb" title="Window system dependent type for a window.">MDrawWindow</a> is for a window; a rectangular area that works in several ways like a miniature screen.</p>
<p>What it actually points depends on a window system. A program that uses the m17n-X library must coerce the type <code>Drawable</code> to this type. </p>

</div>
</div>
<a class="anchor" id="ga9818c0695d9162a9637fa4e98a1d477d"></a><!-- doxytag: member="m17n&#45;gui.h::MDrawRegion" ref="ga9818c0695d9162a9637fa4e98a1d477d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void* <a class="el" href="group__m17nDraw.html#ga9818c0695d9162a9637fa4e98a1d477d">MDrawRegion</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Window system dependent type for a region. </p>
<p>The type <a class="el" href="group__m17nDraw.html#ga9818c0695d9162a9637fa4e98a1d477d" title="Window system dependent type for a region.">MDrawRegion</a> is for a region; an arbitrary set of pixels on the screen (typically a rectangular area).</p>
<p>What it actually points depends on a window system. A program that uses the m17n-X library must coerce the type <code>Region</code> to this type. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga02f9efd2c5d1bdd9d7a6ab18475bbd08"></a><!-- doxytag: member="draw.c::mdraw_text" ref="ga02f9efd2c5d1bdd9d7a6ab18475bbd08" args="(MFrame *frame, MDrawWindow win, int x, int y, MText *mt, int from, int to)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_text </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a>&nbsp;</td>
          <td class="paramname"> <em>win</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Draw an M-text on a window. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08" title="Draw an M-text on a window.">mdraw_text()</a> function draws the text between <b>from</b> and <b>to</b> of M-text <b>mt</b> on window <b>win</b> of frame <b>frame</b> at coordinate (<b>x</b>, <b>y</b>).</p>
<p>The appearance of the text (size, style, color, etc) is specified by the value of the text property whose key is <code>Mface</code>. If the M-text or a part of the M-text does not have such a text property, the default face of <b>frame</b> is used.</p>
<p>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:</p>
<ol>
<li>
<p class="startli">Search the text properties given to the character for the one whose key is <code>Mcharset</code>; its value should be either a symbol specifying a charset or <a class="el" href="group__m17nSymbol.html#ga0346fc05efcccc8f11271b51c0fe3eeb" title="Symbol whose name is &quot;nil&quot;.">Mnil</a>. If the value is <a class="el" href="group__m17nSymbol.html#ga0346fc05efcccc8f11271b51c0fe3eeb" title="Symbol whose name is &quot;nil&quot;.">Mnil</a>, proceed to the next step.</p>
<p>Otherwise, search the mapping table of the fontset for the charset. If no entry is found proceed to the next step.</p>
<p>If an entry is found, use one of the fonts in the entry that has a glyph for the character and that matches best with the face properties. If no such font exists, proceed to the next step.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">Get the character property "script" of the character. If it is inherited, get the script property from the previous characters. If there is no previous character, or none of them has the script property other than inherited, proceed to the next step.</p>
<p>Search the text properties given to the character for the one whose key is <code>Mlanguage</code>; its value should be either a symbol specifying a language or <code>Mnil</code>.</p>
<p>Search the mapping table of the fontset for the combination of the script and language. If no entry is found, proceed to the next step.</p>
<p>If an entry is found, use one of the fonts in the entry that has a glyph for the character and that matches best with the face properties. If no such font exists, proceed to the next step.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">Search the fall-back table of the fontset for a font that has a glyph of the character. If such a font is found, use that font.</p>
<p class="endli"></p>
</li>
</ol>
<p>If no font is found by the algorithm above, this function draws an empty box for the character.</p>
<p>This function draws only the glyph foreground. To specify the background color, use <a class="el" href="group__m17nDraw.html#gab2de737f283237157b9035961f5a4fa6" title="Draw an M-text on a window as an image.">mdraw_image_text()</a> or <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a>.</p>
<p>This function is the counterpart of <code>XDrawString()</code>, <code>XmbDrawString()</code>, and <code>XwcDrawString()</code> functions in the X Window System.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08" title="Draw an M-text on a window.">mdraw_text()</a> returns 0. If an error is detected, it returns -1 and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>.</dd></dl>
<dl class="user"><dt><b>Errors:</b></dt><dd><code>MERROR_RANGE</code> </dd></dl>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nDraw.html#gab2de737f283237157b9035961f5a4fa6" title="Draw an M-text on a window as an image.">mdraw_image_text()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="gab2de737f283237157b9035961f5a4fa6"></a><!-- doxytag: member="draw.c::mdraw_image_text" ref="gab2de737f283237157b9035961f5a4fa6" args="(MFrame *frame, MDrawWindow win, int x, int y, MText *mt, int from, int to)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_image_text </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a>&nbsp;</td>
          <td class="paramname"> <em>win</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Draw an M-text on a window as an image. </p>
<p>The <a class="el" href="group__m17nDraw.html#gab2de737f283237157b9035961f5a4fa6" title="Draw an M-text on a window as an image.">mdraw_image_text()</a> function draws the text between <b>from</b> and <b>to</b> of M-text <b>mt</b> as image on window <b>win</b> of frame <b>frame</b> at coordinate (<b>x</b>, <b>y</b>).</p>
<p>The way to draw a text is the same as in <a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08" title="Draw an M-text on a window.">mdraw_text()</a> except that this function also draws the background with the color specified by faces.</p>
<p>This function is the counterpart of <code>XDrawImageString()</code>, <code>XmbDrawImageString()</code>, and <code>XwcDrawImageString()</code> functions in the X Window System.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nDraw.html#gab2de737f283237157b9035961f5a4fa6" title="Draw an M-text on a window as an image.">mdraw_image_text()</a> returns 0. If an error is detected, it returns -1 and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>.</dd></dl>
<dl class="user"><dt><b>Errors:</b></dt><dd><code>MERROR_RANGE</code> </dd></dl>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08" title="Draw an M-text on a window.">mdraw_text()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga43ad1fe4a4a8db80a46450dfa250777a"></a><!-- doxytag: member="draw.c::mdraw_text_with_control" ref="ga43ad1fe4a4a8db80a46450dfa250777a" args="(MFrame *frame, MDrawWindow win, int x, int y, MText *mt, int from, int to, MDrawControl *control)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_text_with_control </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a>&nbsp;</td>
          <td class="paramname"> <em>win</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawControl.html">MDrawControl</a> *&nbsp;</td>
          <td class="paramname"> <em>control</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Draw an M-text on a window with fine control. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a> function draws the text between <b>from</b> and <b>to</b> of M-text <b>mt</b> on windows <b>win</b> of frame <b>frame</b> at coordinate (<b>x</b>, <b>y</b>).</p>
<p>The way to draw a text is the same as in <a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08" title="Draw an M-text on a window.">mdraw_text()</a> except that this function also follows what specified in the drawing control object <b>control</b>.</p>
<p>For instance, if &lt;two_dimensional&gt; of <b>control</b> 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 @ <a class="el" href="structMDrawControl.html" title="Type of a text drawing control.">MDrawControl</a> for more detail. </p>

</div>
</div>
<a class="anchor" id="ga4f5a3138a20bef57e8660975200a4604"></a><!-- doxytag: member="draw.c::mdraw_text_extents" ref="ga4f5a3138a20bef57e8660975200a4604" args="(MFrame *frame, MText *mt, int from, int to, MDrawControl *control, MDrawMetric *overall_ink_return, MDrawMetric *overall_logical_return, MDrawMetric *overall_line_return)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_text_extents </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawControl.html">MDrawControl</a> *&nbsp;</td>
          <td class="paramname"> <em>control</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>overall_ink_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>overall_logical_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>overall_line_return</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compute text pixel width. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga4f5a3138a20bef57e8660975200a4604" title="Compute text pixel width.">mdraw_text_extents()</a> function computes the width of text between <b>from</b> and <b>to</b> of M-text <b>mt</b> when it is drawn on a window of frame <b>frame</b> using the <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a> function with the drawing control object <b>control</b>.</p>
<p>If <b>overall_ink_return</b> is not <code>NULL</code>, this function also computes the bounding box of character ink of the M-text, and stores the results in the members of the structure pointed to by <b>overall_ink_return</b>. If the M-text has a face specifying a surrounding box, the box is included in the bounding box.</p>
<p>If <b>overall_logical_return</b> is not <code>NULL</code>, this function also computes the bounding box that provides minimum spacing to other graphical features (such as surrounding box) for the M-text, and stores the results in the members of the structure pointed to by <b>overall_logical_return</b>.</p>
<p>If <b>overall_line_return</b> is not <code>NULL</code>, this function also computes the bounding box that provides minimum spacing to the other M-text drawn, and stores the results in the members of the structure pointed to by <b>overall_line_return</b>. This is a union of <b>overall_ink_return</b> and <b>overall_logical_return</b> if the members min_line_ascent, min_line_descent, max_line_ascent, and max_line_descent of <b>control</b> are all zero.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>This function returns the width of the text to be drawn in the unit of pixels. If <b>control-&gt;two_dimensional</b> is nonzero and the text is drawn in multiple physical lines, it returns the width of the widest line. If an error occurs, it returns -1 and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>.</dd></dl>
<dl class="user"><dt><b>Errors:</b></dt><dd><code>MERROR_RANGE</code> </dd></dl>

</div>
</div>
<a class="anchor" id="gae31ef0340c582c208f07f702f816977f"></a><!-- doxytag: member="draw.c::mdraw_text_per_char_extents" ref="gae31ef0340c582c208f07f702f816977f" args="(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)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_text_per_char_extents </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawControl.html">MDrawControl</a> *&nbsp;</td>
          <td class="paramname"> <em>control</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>ink_array_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>logical_array_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>array_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>num_chars_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>overall_ink_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>overall_logical_return</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compute the text dimensions of each character of M-text. </p>
<p>The <a class="el" href="group__m17nDraw.html#gae31ef0340c582c208f07f702f816977f" title="Compute the text dimensions of each character of M-text.">mdraw_text_per_char_extents()</a> function computes the drawn metric of each character between <b>from</b> and <b>to</b> of M-text <b>mt</b> assuming that they are drawn on a window of frame <b>frame</b> using the <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a> function with the drawing control object <b>control</b>.</p>
<p><b>array_size</b> specifies the size of <b>ink_array_return</b> and <b>logical_array_return</b>. Each successive element of <b>ink_array_return</b> and <b>logical_array_return</b> 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 <b>ink_array_return</b> and <b>logical_array_return</b> that have been set is returned to <b>num_chars_return</b>.</p>
<p>If <b>array_size</b> is too small to return all metrics, the function returns -1 and store the requested size in <b>num_chars_return</b>. Otherwise, it returns zero.</p>
<p>If pointer <b>overall_ink_return</b> and <b>overall_logical_return</b> are not <code>NULL</code>, this function also computes the metrics of the overall text and stores the results in the members of the structure pointed to by <b>overall_ink_return</b> and <b>overall_logical_return</b>.</p>
<p>If <b>control-&gt;two_dimensional</b> is nonzero, this function computes only the metrics of characters in the first line. </p>

</div>
</div>
<a class="anchor" id="ga30321da41dd8785e54627e845a26cf00"></a><!-- doxytag: member="draw.c::mdraw_coordinates_position" ref="ga30321da41dd8785e54627e845a26cf00" args="(MFrame *frame, MText *mt, int from, int to, int x_offset, int y_offset, MDrawControl *control)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_coordinates_position </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawControl.html">MDrawControl</a> *&nbsp;</td>
          <td class="paramname"> <em>control</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the character position nearest to the coordinates. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga30321da41dd8785e54627e845a26cf00" title="Return the character position nearest to the coordinates.">mdraw_coordinates_position()</a> function checks which character is to be drawn at coordinate (<b>x</b>, <b>y</b>) when the text between <b>from</b> and <b>to</b> of M-text <b>mt</b> is drawn at the coordinate (0, 0) using the <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a> function with the drawing control object <b>control</b>. Here, the character position means the number of characters that precede the character in question in <b>mt</b>, that is, the character position of the first character is 0.</p>
<p><b>frame</b> is used only to get the default face information.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the glyph image of a character covers coordinate (<b>x</b>, <b>y</b>), <a class="el" href="group__m17nDraw.html#ga30321da41dd8785e54627e845a26cf00" title="Return the character position nearest to the coordinates.">mdraw_coordinates_position()</a> returns the character position of that character.<br/>
<br/>
 If <b>y</b> is less than the minimum Y-coordinate of the drawn area, it returns <b>from</b>.<br/>
<br/>
 If <b>y</b> is greater than the maximum Y-coordinate of the drawn area, it returns <b>to</b>.<br/>
<br/>
 If <b>y</b> fits in with the drawn area but <b>x</b> is less than the minimum X-coordinate, it returns the character position of the first character drawn on the line <b>y</b>.<br/>
<br/>
 If <b>y</b> fits in with the drawn area but <b>x</b> is greater than the maximum X-coordinate, it returns the character position of the last character drawn on the line <b>y</b>. </dd></dl>

</div>
</div>
<a class="anchor" id="ga0b79b3b695577bee9c0d41d4947e7a16"></a><!-- doxytag: member="draw.c::mdraw_glyph_info" ref="ga0b79b3b695577bee9c0d41d4947e7a16" args="(MFrame *frame, MText *mt, int from, int pos, MDrawControl *control, MDrawGlyphInfo *info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_glyph_info </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawControl.html">MDrawControl</a> *&nbsp;</td>
          <td class="paramname"> <em>control</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawGlyphInfo.html">MDrawGlyphInfo</a> *&nbsp;</td>
          <td class="paramname"> <em>info</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compute information about a glyph. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga0b79b3b695577bee9c0d41d4947e7a16" title="Compute information about a glyph.">mdraw_glyph_info()</a> function computes information about a glyph that covers a character at position <b>pos</b> of the M-text <b>mt</b> assuming that the text is drawn from the character at <b>from</b> of <b>mt</b> on a window of frame <b>frame</b> using the <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a> function with the drawing control object <b>control</b>.</p>
<p>The information is stored in the members of <b>info</b>.</p>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="structMDrawGlyphInfo.html" title="Type of information about a glyph.">MDrawGlyphInfo</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga5ad6646874580721d879c82a8a5dbafc"></a><!-- doxytag: member="draw.c::mdraw_glyph_list" ref="ga5ad6646874580721d879c82a8a5dbafc" args="(MFrame *frame, MText *mt, int from, int to, MDrawControl *control, MDrawGlyph *glyphs, int array_size, int *num_glyphs_return)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_glyph_list </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawControl.html">MDrawControl</a> *&nbsp;</td>
          <td class="paramname"> <em>control</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawGlyph.html">MDrawGlyph</a> *&nbsp;</td>
          <td class="paramname"> <em>glyphs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>array_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>num_glyphs_return</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compute information about glyph sequence. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga5ad6646874580721d879c82a8a5dbafc" title="Compute information about glyph sequence.">mdraw_glyph_list()</a> function computes information about glyphs corresponding to the text between <b>from</b> and <b>to</b> of M-text <b>mt</b> when it is drawn on a window of frame <b>frame</b> using the <a class="el" href="group__m17nDraw.html#ga43ad1fe4a4a8db80a46450dfa250777a" title="Draw an M-text on a window with fine control.">mdraw_text_with_control()</a> function with the drawing control object <b>control</b>. <b>glyphs</b> is an array of objects to store the information, and <b>array_size</b> is the array size.</p>
<p>If <b>array_size</b> is large enough to cover all glyphs, it stores the number of actually filled elements in the place pointed by <b>num_glyphs_return</b>, and returns 0.</p>
<p>Otherwise, it stores the required array size in the place pointed by <b>num_glyphs_return</b>, and returns -1.</p>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="structMDrawGlyph.html" title="Type of information about a glyph metric and font.">MDrawGlyph</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga41ee093d2d8b2d6a8c499ac8802871d6"></a><!-- doxytag: member="draw.c::mdraw_text_items" ref="ga41ee093d2d8b2d6a8c499ac8802871d6" args="(MFrame *frame, MDrawWindow win, int x, int y, MDrawTextItem *items, int nitems)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mdraw_text_items </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nDraw.html#ga7cf712e335916cc72a77aca96cf327fb">MDrawWindow</a>&nbsp;</td>
          <td class="paramname"> <em>win</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawTextItem.html">MDrawTextItem</a> *&nbsp;</td>
          <td class="paramname"> <em>items</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nitems</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Draw one or more textitems. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga41ee093d2d8b2d6a8c499ac8802871d6" title="Draw one or more textitems.">mdraw_text_items()</a> function draws one or more M-texts on window <b>win</b> of frame <b>frame</b> at coordinate (<b>x</b>, <b>y</b>). <b>items</b> is an array of the textitems to be drawn and <b>nitems</b> is the number of textitems in the array.</p>
<dl class="user"><dt><b>See Also:</b></dt><dd>MTextItem, <a class="el" href="group__m17nDraw.html#ga02f9efd2c5d1bdd9d7a6ab18475bbd08" title="Draw an M-text on a window.">mdraw_text()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="ga457d91ccebabb26e1d7ab27f616cecb5"></a><!-- doxytag: member="draw.c::mdraw_default_line_break" ref="ga457d91ccebabb26e1d7ab27f616cecb5" args="(MText *mt, int pos, int from, int to, int line, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mdraw_default_line_break </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calculate a line breaking position. </p>
<p>The function <a class="el" href="group__m17nDraw.html#ga457d91ccebabb26e1d7ab27f616cecb5" title="Calculate a line breaking position.">mdraw_default_line_break()</a> calculates a line breaking position based on the line number <b>line</b> and the coordinate <b>y</b>, when a line is too long to fit within the width limit. <b>pos</b> is the position of the character next to the last one that fits within the limit. <b>from</b> is the position of the first character of the line, and <b>to</b> is the position of the last character displayed on the line if there were not width limit. <b>line</b> and <b>y</b> 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.</p>
<dl class="user"><dt><b>Return value: </b></dt><dd>This function returns a character position to break the line. </dd></dl>

</div>
</div>
<a class="anchor" id="gae05aed269fc5fe20557a297f439a88ea"></a><!-- doxytag: member="draw.c::mdraw_per_char_extents" ref="gae05aed269fc5fe20557a297f439a88ea" args="(MFrame *frame, MText *mt, MDrawMetric *array_return, MDrawMetric *overall_return)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mdraw_per_char_extents </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nFrame.html#gabb36d3a69526a891ce7534bda63a2687">MFrame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>array_return</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMDrawMetric.html">MDrawMetric</a> *&nbsp;</td>
          <td class="paramname"> <em>overall_return</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Obtain per character dimension information. </p>
<p>The <a class="el" href="group__m17nDraw.html#gae05aed269fc5fe20557a297f439a88ea" title="Obtain per character dimension information.">mdraw_per_char_extents()</a> function computes the text dimension of each character in M-text <b>mt</b>. The faces given as text properties in <b>mt</b> and the default face of frame <b>frame</b> determine the fonts to draw the text. Each successive element in <b>array_return</b> 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 <b>mt</b>. The number of elements of <b>array_return</b> must be equal to or greater than the number of characters in <b>mt</b>.</p>
<p>If pointer <b>overall_return</b> is not <code>NULL</code>, this function also computes the extents of the overall text and stores the results in the members of the structure pointed to by <b>overall_return</b>. </p>

</div>
</div>
<a class="anchor" id="ga74e7bee7646b408dbf11b4866afb1098"></a><!-- doxytag: member="draw.c::mdraw_clear_cache" ref="ga74e7bee7646b408dbf11b4866afb1098" args="(MText *mt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mdraw_clear_cache </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nMtext.html#gae8bba45315c15c8f79ec4a73ebc52aec">MText</a> *&nbsp;</td>
          <td class="paramname"> <em>mt</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>clear cached information. </p>
<p>The <a class="el" href="group__m17nDraw.html#ga74e7bee7646b408dbf11b4866afb1098" title="clear cached information.">mdraw_clear_cache()</a> function clear cached information on M-text <b>mt</b> that was attached by any of the drawing functions. When the behavior of `format' or `line_break' member functions of <a class="el" href="structMDrawControl.html" title="Type of a text drawing control.">MDrawControl</a> is changed, the cache must be cleared.</p>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="structMDrawControl.html" title="Type of a text drawing control.">MDrawControl</a> </dd></dl>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="gaae4c0c421e284fc8084998d20e4a40c5"></a><!-- doxytag: member="draw.c::mdraw_line_break_option" ref="gaae4c0c421e284fc8084998d20e4a40c5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__m17nDraw.html#gaae4c0c421e284fc8084998d20e4a40c5">mdraw_line_break_option</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Option of line breaking for drawing text. </p>
<p>The variable <a class="el" href="group__m17nDraw.html#gaae4c0c421e284fc8084998d20e4a40c5" title="Option of line breaking for drawing text.">mdraw_line_break_option</a> specifies line breaking options by logical-or of the members of <a class="el" href="group__m17nMtext.html#ga23c3bd3e53aa9ba5aec709a939865022" title="Enumeration for specifying a set of line breaking option.">MTextLineBreakOption</a>. It controls the line breaking algorithm of the function <a class="el" href="group__m17nDraw.html#ga457d91ccebabb26e1d7ab27f616cecb5" title="Calculate a line breaking position.">mdraw_default_line_break()</a>. </p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr>

<ADDRESS>
<a href="http://www.m17n.org/m17n-lib-en/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="m17n-lib Home" border=0></a>
</ADDRESS>
</body>
</HTML>

<!-- Copyright information

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