File: group__m17nFontset.html

package info (click to toggle)
m17n-docs 1.2.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 14,708 kB
  • ctags: 1,682
  • sloc: sh: 4,456; makefile: 294
file content (360 lines) | stat: -rw-r--r-- 19,698 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2004
  National Institute of Advanced Industrial Science and Technology (AIST)
This file is part of the m17n library documentation.
See the end for copying conditions.
-->
<html><head><meta http-equiv="Content-Type" content="text/html;charset="UTF-8">
<title>The m17n Library</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#ffffff">

<a name="top-of-page"></a>

<hr><center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; 
<a class="qindex" href="modules.html">Modules</a> &nbsp; 
<!-- <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; -->
<a class="qindex" href="annotated.html">Data Structures</a> &nbsp; 
<!-- <a class="qindex" href="files.html">File List</a> &nbsp;  -->
<!-- <a class="qindex" href="functions.html">Data Fields</a> &nbsp; -->
<a class="qindex" href="globals.html">Globals</a> &nbsp; 
<a class="qindex" href="pages.html">Appendix</a> &nbsp; 
</center>

<hr>
<!-- Generated by Doxygen 1.3.9.1 -->
<h1>Fontset<br>
<small>
[<a class="el" href="group__m17nGUI.html">GUI API</a>]</small>
</h1>A fontset is an object that maps a character to fonts.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="group__m17nFontset.html#ga0">MFontset</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a></td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nFontset.html#ga1">mfontset</a> (char *name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a fontset.  <a href="#ga1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nFontset.html#ga2">mfontset_name</a> (<a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *fontset)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the name of a fontset.  <a href="#ga2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nFontset.html#ga3">mfontset_copy</a> (<a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *fontset, char *name)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Make a copy of a fontset.  <a href="#ga3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nFontset.html#ga4">mfontset_modify_entry</a> (<a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *fontset, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> language, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> script, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> charset, <a class="el" href="group__m17nFont.html#ga0">MFont</a> *spec, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> layouter_name, int how)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Modify the contents of a fontset.  <a href="#ga4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nPlist.html#ga0">MPlist</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nFontset.html#ga5">mfontset_lookup</a> (<a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *fontset, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> script, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> language, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> charset)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Lookup a fontset.  <a href="#ga5"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A <em>fontset</em> is an object of the type <code>MFontset</code>. When drawing an M-text, a fontset provides rules to select a font for each character in the M-text according to the following information.<p>
<ul>
<li>The script character property of a character. </li>
<li>The language text property of a character. </li>
<li>The charset text property of a character.</li>
</ul>
The documentation of <a class="el" href="group__m17nDraw.html#ga2">mdraw_text()</a> describes how that information is used. <hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="m17n-gui.h::MFontset"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">typedef struct <a class="el" href="group__m17nFontset.html#ga0">MFontset</a> <a class="el" href="group__m17nFontset.html#ga0">MFontset</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga1" doxytag="m17n-gui.h::mfontset"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> * mfontset           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>name</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__m17nFontset.html#ga1">mfontset()</a> function returns a pointer to a fontset object of name <b>name</b>. If <b>name</b> is <code>NULL</code>, it returns a pointer to the default fontset.<p>
If no fontset has the name <b>name</b>, a new one is created. At that time, if there exists a data &lt;<code>fontset</code>, <b>name&gt;</b> in the m17n database, the fontset contents are initialized according to the data. If no such data exists, the fontset contents are left vacant.<p>
The macro <a class="el" href="group__m17nIntro.html#ga5">M17N_INIT()</a> creates the default fontset. An application program can modify it before the first call of <a class="el" href="group__m17nFrame.html#ga14">mframe()</a>.<p>
<dl compact><dt><b>Return value:</b></dt><dd>This function returns a pointer to the found or newly created fontset. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga2" doxytag="m17n-gui.h::mfontset_name"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> mfontset_name           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>fontset</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__m17nFontset.html#ga2">mfontset_name()</a> function returns the name of fontset <b>fontset</b>.     </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="m17n-gui.h::mfontset_copy"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> * mfontset_copy           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>fontset</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char *&nbsp;</td>
          <td class="mdname" nowrap> <em>name</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__m17nFontset.html#ga3">mfontset_copy()</a> function makes a copy of fontset <b>fontset</b>, gives it a name <b>name</b>, and returns a pointer to the created copy. <b>name</b> must not be a name of existing fontset. In such case, this function returns NULL without making a copy.     </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="m17n-gui.h::mfontset_modify_entry"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">int mfontset_modify_entry           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>fontset</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>script</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>language</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>charset</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nFont.html#ga0">MFont</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>spec</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>layouter_name</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>how</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__m17nFontset.html#ga4">mfontset_modify_entry()</a> function associates, in fontset <b>fontset</b>, a copy of <b>font</b> with the <b>script</b> / <b>language</b> pair or with <b>charset</b>.<p>
Each font in a fontset is associated with a particular script/language pair, with a particular charset, or with the symbol <code>Mnil</code>. The fonts that are associated with the same item make a group.<p>
If <b>script</b> is not <code>Mnil</code>, it must be a symbol identifying a script. In this case, <b>language</b> is either a symbol identifying a language or <code>Mnil</code>, and <b>font</b> is associated with the <b>script</b> / <b>language</b> pair.<p>
If <b>charset</b> is not <code>Mnil</code>, it must be a symbol representing a charset object. In this case, <b>font</b> is associated with that charset.<p>
If both <b>script</b> and <b>charset</b> are not <code>Mnil</code>, two copies of <b>font</b> are created. Then one is associated with the <b>script</b> / <b>language</b> pair and the other with that charset.<p>
If both <b>script</b> and <b>charset</b> are <code>Mnil</code>, <b>font</b> is associated with <code>Mnil</code>. This kind of fonts are called <em>fallback</em> <em>fonts</em>.<p>
The argument <b>how</b> specifies the priority of <b>font</b>. If <b>how</b> is positive, <b>font</b> has the highest priority in the group of fonts that are associated with the same item. If <b>how</b> is negative, <b>font</b> has the lowest priority. If <b>how</b> is zero, <b>font</b> becomes the only available font for the associated item; all the other fonts are removed from the group.<p>
If <b>layouter_name</b> is not <code>Mnil</code>, it must be a symbol representing a flt. In that case, if <b>font</b> is selected for drawing an M-text, that font layout table is used to generate a glyph code sequence from a character sequence.<p>
<dl compact><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nFontset.html#ga4">mfontset_modify_entry()</a> returns 0. Otherwise it returns -1 and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga0">merror_code</a>.</dd></dl>
<dl compact><dt><b>Errors:</b></dt><dd><code>MERROR_SYMBOL</code> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga5" doxytag="m17n-gui.h::mfontset_lookup"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nPlist.html#ga0">MPlist</a> * mfontset_lookup           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__m17nFontset.html#ga0">MFontset</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>fontset</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>script</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>language</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>charset</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The <a class="el" href="group__m17nFontset.html#ga5">mfontset_lookup()</a> function lookups <b>fontset</b> and returns a plist that describes the contents of <b>fontset</b> corresponding to the specified script, language, and charset.<p>
If <b>script</b> is <code>Mt</code>, keys of the returned plist are script name symbols for which some fonts are specified and values are NULL.<p>
If <b>scirpt</b> is a script symbol, the returned plist is decided by <b>language</b>.<p>
If <b>language</b> is <code>Mt</code>, keys of the plist are language name symbols for which some fonts are specified and values are NULL. A key may be <code>Mt</code> which means some fallback fonts are specified for the script.<p>
If <b>language</b> is a language name symbol, the plist is a <code>FONT-GROUP</code> for the specified script and langauge.<p>
If <b>langauge</b> is <code>Mt</code>, the plist is fallback <code>FONT-GROUP</code> for the script.<p>
If <b>script</b> is <code>Mnil</code>, the returned plist is decided as below.<p>
If <b>charset</b> is <code>Mt</code>, keys of the returned plist are charset name symbols for which some fonts are specified and values are NULL.<p>
If <b>charset</b> is a charset symbol, the plist is a <code>FONT-GROUP</code> for the charset.<p>
If <b>charset</b> is <code>Mnil</code>, the plist is a fallback <code>FONT-GROUP</code>.<p>
<code>FONT-GROUP</code> is a plist whose keys are FLT name symbols (<code>Mt</code> if no FLT is associated with the font) and values are pointers to <a class="el" href="group__m17nFont.html#ga0">MFont</a>.<p>
<dl compact><dt><b>Return value:</b></dt><dd>It returns a plist describing the contents of a fontset. The plist should be freed by <a class="el" href="group__m17nObject.html#ga2">m17n_object_unref()</a>. </dd></dl>
    </td>
  </tr>
</table>
<hr>
<center>
<a href="#top-of-page">Top of this page</a><br><br>

<a class="qindex" href="index.html">Main Page</a> &nbsp; 
<a class="qindex" href="modules.html">Modules</a> &nbsp; 
<!-- <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; -->
<a class="qindex" href="annotated.html">Data Structures</a> &nbsp; 
<!-- <a class="qindex" href="files.html">File List</a> &nbsp;  -->
<!-- <a class="qindex" href="functions.html">Data Fields</a> &nbsp; -->
<a class="qindex" href="globals.html">Globals</a> &nbsp; 
<a class="qindex" href="pages.html">Appendix</a> &nbsp; 
</center>
<hr>
<ADDRESS>
<a href="http://www.m17n.org/m17n-lib/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="mulemark" border=0></a>
<A HREF="mailto:mule-aist@m17n.org">mule-aist@m17n.org</a>

</ADDRESS>
</body>
</HTML>

<!-- Copyright information

Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2004
  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, Front-Cover Texts "The m17n library documentation",
and no Back-Cover Texts.  A copy of the license is included in the
appendix entitled "GNU Free Documentation License".
-->