*** empty log message ***
[m17n/m17n-lib.git] / src / ChangeLog
1 2006-07-06  Kenichi Handa  <handa@m17n.org>
2
3         * fontset.c (mfont__lookup_fontset): Don't ignore family and
4         foundry of face.
5
6 2006-07-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
7
8         * database.c: Update comments.
9
10 2006-07-05  Kenichi Handa  <handa@m17n.org>
11
12         * database.c (PATH_MAX): Define it if not yet defined.
13         (PATH_SEPARATOR, USE_GEN_PATH, GEN_PATH, GEN_PATH_FROM_MT): New
14         macros.
15         (get_database_filename): Use GEN_PATH.
16         (get_dir_info): Don't include the last '/' in directory name.
17         (register_database): New function.
18         (update_database_list): Use register_database.  Search all
19         directories in mdatabase__dir_list for wildcard databases.
20         (mdatabase__init): Check "~/.m17n.d".
21
22 2006-07-03  Kenichi Handa  <handa@m17n.org>
23
24         * input-gui.c (win_callback): If is ic->candidate_show zero, don't
25         push reverse property.
26
27         * plist.c (dump_plist_element): Fix previous change.
28
29 2006-06-28  Kenichi Handa  <handa@m17n.org>
30
31         * font.c (xlfd_unparse_name): Suppress the heading '-' if not
32         necessary.
33
34         * draw.c (MbidiNSM): New variable.
35         (visual_order) [! HAVE_FRIBIDI]: Clear levels at first.  Pay
36         attention to bidi type NSM.
37         (mdraw__init): Initialize MbibiNSM.
38
39         * language.c (mscript__char_list): Fix finding a char-list element.
40
41         * plist.c (dump_string): Return number of printed characters.
42         (dump_plist_element): Print elements more compactly.
43
44 2006-06-23  Kenichi Handa  <handa@m17n.org>
45
46         * Makefile.am (BUILD_LIBS): Don't increment it conditionally.
47         (include_HEADERS): Likewise.
48
49 2006-06-23  TAKAHASHI Naoto  <ntakahas@m17n.org>
50
51         * language.c: Update documentation.
52
53 2006-06-23  Kenichi Handa  <handa@m17n.org>
54
55         * font-ft.c (struct MFontFT): Delete member lang.
56         (free_ft_info): Don't unref member lang.  Destroy members langset
57         and charset.
58         (fc_parse_pattern): Last argument changed to MFontFT *.  Callers
59         changed.  Set members langset and charset.
60         (fc_init_font_list, fc_list_pattern, fc_build_charset): New
61         functions.
62         (ft_init_font_list, ft_has_char_list_p, ft_list_char_list): New
63         functions.
64         (ft_list_family) [HAVE_FONTCONFIG]: Include FC_CHARSET on objset.
65         (ft_list_family) [! HAVE_FONTCONFIG]: Call ft_init_font_list.
66         (ft_list_language) [HAVE_FONTCONFIG]: Check representative
67         characters at first.  If it fails, try listing by language names.
68         (ft_list_language) [! HAVE_FONTCONFIG]: Call ft_list_char_list.
69         (ft_check_language): Renamed from ft_check_lang.  Adjusted for the
70         change of MFontCapability.
71         (ft_list_capability): Likewise.  Try listing by languages, then by
72         scripts.  Check OTF at last.
73         (ft_check_script): New function.
74         (ft_select): Adjusted for the check of MFontCapability.
75         (ft_list_family_names): New function.
76         (ft_check_capability): If cap->script is not Mnil, call
77         ft_check_script.
78         (mfont__ft_driver): Initialize with ft_list_family_names.
79
80         * font.h (struct MFontDriver): New member list_fmaily_names.
81         (struct): Change member "MSymbol *lang" to "MSymbol language".
82
83         * font.c: Include "language.h".
84         (Motf): New variable.
85         (otf_script_list, load_otf_script_list): Delete it.
86         (find_script_from_otf_tag): Delete it.
87         (merge_capability): New function.
88         (mfont__init): Init Motf.
89         (mfont__fini): Don't unref otf_script_list.
90         (free_font_capability): Check cap->script_tag to determine if
91         OTF-related capability is set.
92         (mfont__get_capability): Call mscript__from_otf_tag.  Adjusted for
93         the change of type MFontCapability.
94         (mfont_put_prop): Call merge_capability for Mlanguage, Mscript,
95         and Motf properties.
96         (mfont_list): Call merge_capability for LANGUAGE arg.
97         (mfont_list_family_names): New function.
98
99         * input-gui.c: Typo in comments fixed.
100
101         * input.c: Typo in comments fixed.
102
103         * language.h (mlanguage__list): Delete it.
104         (mscript__char_list, mscript__otf_tag, mscript__from_otf_tag): New
105         functions.
106
107         * language.c: Include "mtext.h".
108         (M_script_lang_list): Delete it.
109         (language_list, script_list): New variables.
110         (load_lang_script_list, init_language_list, init_script_list): New
111         functions.
112         (mlang__init): Don't load language database here.
113         (mlang__fini): Unref language_list and script_list if not NULL.
114         (mlanguage__list): Delete it.
115         (mlanguage__info, mscript__info, mscript__char_list)
116         (mscript__otf_tag, mscript__from_otf_tag): New functions.
117         (mlanguage_list, mlanguage_code, mlanguage_name, mlanguage_text)
118         (mscript_list, mscript_language_list): New functions.
119
120         * m17n-gui.h (mfont_list_family_names): Extern it.
121
122         * m17n.h (mlanguage_list, mlanguage_code, mlanguage_name)
123         (mlanguage_text, mscript_list, mscript_language_list): Extern
124         them.
125
126 2006-06-21  Kenichi Handa  <handa@m17n.org>
127
128         * m17n-X.c (xfont_driver): Initialize with
129         xfont_list_family_names.
130         (xfont_list_family_names): New function.
131         (xft_driver): Initialize with NULL for list_family_names member.
132         (device_init): Set list_family_names member of xft_driver to that
133         of mfont__ft_driver.
134
135 2006-06-06  Kenichi Handa  <handa@m17n.org>
136
137         * fontset.c (mfont__lookup_fontset): Don't set *num to 1 if it is 0.
138
139 2006-03-24  Kenichi Handa  <handa@m17n.org>
140
141         * font-ft.c (ft_open): Improve debug message.
142
143         * fontset.c (mfontset__get_font): Fix for the case that no font in
144         per_script list is available.
145
146 2006-02-06  Kenichi Handa  <handa@m17n.org>
147
148         * Version 1.3.3 released.
149
150 2006-02-22  Kenichi Handa  <handa@m17n.org>
151
152         * textprop.c: Fix some typos in documentation.
153
154         * plist.c: Fix some typos in documentation.
155
156         * m17n-core.h: Fix some typos in documentation.
157         (M17NLIB_PATCH_LEVEL): Updated to 3.
158         (M17NLIB_VERSION_NAME): Updated to "1.3.3".
159
160         * symbol.c: Fix some typos in documentation.
161
162         * mtext.c: Fix some typos in documentation.
163
164         * input.c: Fix several typos in documentation.
165
166 2006-02-06  Kenichi Handa  <handa@m17n.org>
167
168         * Version 1.3.2 released.
169
170 2006-02-03  Kenichi Handa  <handa@m17n.org>
171
172         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 2.
173         (M17NLIB_VERSION_NAME): Updated to "1.3.2".
174
175         * font.c (xlfd_parse_name): Fix handling of the name "nil".
176
177         * draw.c (layout_glyphs): Fix handling left_padding of
178         composition's base.
179
180         * m17n-gd.c (read_rgb_txt): Support HTML 4.0 color names.
181
182 2006-02-02  Kenichi Handa  <handa@m17n.org>
183
184         * Makefile.am (include_HEADERS): Add m17n-gui.h and m17n-X.h only
185         if WITH_GUI is true.
186
187 2006-01-25  Kenichi Handa  <handa@m17n.org>
188
189         * input.c (resolve_expression): If the value of PLIST is a plist,
190         but the first element is not symbol, return 0.
191
192 2006-01-17  Kenichi Handa  <handa@m17n.org>
193
194         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha only if
195         HAVE_GD is 2 or the greater.
196
197 2006-01-16  Kenichi Handa  <handa@m17n.org>
198
199         * Version 1.3.1 released.
200
201 2006-01-16  Kenichi Handa  <handa@m17n.org>
202
203         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha instead of
204         simulating anti-aliasing.
205
206         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 1.
207         (M17NLIB_VERSION_NAME): Updated to "1.3.1".
208
209 2006-01-12  Kenichi Handa  <handa@m17n.org>
210
211         * input.c (get_surrounding_text): Always pop ic->plist.
212         (reset_ic): Don't reset ic->plist.
213
214 2006-01-10  Kenichi Handa  <handa@m17n.org>
215
216         * input.c (preedit_commit): For debugging, print only commiting
217         charactes.  Don't set ic->candidate_show to 0.
218         (handle_key): Don't run branch-actions just by shifting to the
219         current state.
220         (reset_ic): Reset state_key_head and key_head of ic_info to 0.
221         Reset vars and plist.
222
223 2006-01-07  Kenichi Handa  <handa@m17n.org>
224
225         * input.c (load_branch): Confirm that maps is not NULL.
226
227 2006-01-05  Kenichi Handa  <handa@m17n.org>
228
229         * input-gui.c (win_filter): Try to convert arg to key only when
230         arg is not NULL.
231
232         * plist.c (read_integer_element): If '#' and '-' are followed by
233         non-integer-constituent, read them as a part of a symbol.
234         (read_symbol_element): New arg C.
235         (read_element): Adjust args to read_symbol_element.
236
237         * input.c (load_macros): On overwriting a macro, free the old
238         definition.
239         (minput__init): Store Mmap in load_im_info_keys.
240         (minput_get_title_icon): If the input method has no title, be sure
241         to return NULL.
242         (minput_get_description): If the input method has no description,
243         be sure to return NULL.
244         (minput_get_variables): Fix documentation.
245         (handle_key): Pay attention to the case that key is Mnil.
246         (filter): Likewise.  Fix handling of such symbol as S-A.
247
248 2005-12-22  Kenichi Handa  <handa@m17n.org>
249
250         * Version 1.3.0 released.
251
252 2005-12-22  Kenichi Handa  <handa@m17n.org>
253
254         * font-ft.c (ft_list): If the specified font has no property,
255         return all fonts.
256
257 2005-12-20  Kenichi Handa  <handa@m17n.org>
258
259         * character.c (mchar_get_prop): Check char_prop_list.
260         (mchar_put_prop, mchar_get_prop_table): Likewise.
261
262 2005-12-18  Kenichi Handa  <handa@m17n.org>
263
264         * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
265         file name sans language.
266
267 2005-12-16  TAKAHASHI Naoto  <ntakahas@m17n.org>
268
269         * input.c: Fix typo in comments.
270
271 2005-12-14  Kenichi Handa  <handa@m17n.org>
272
273         * input.c (minput_get_title_icon): Check the default icon for the
274         input method.
275
276 2005-12-13  Kenichi Handa  <handa@m17n.org>
277
278         * input.c (Mless_equal, Mgreater_equal): New variables.
279         (parse_expression, resolve_expression, parse_action_list)
280         (take_action_list): Handle the aboves.
281         (filter): Treat key S-X as X.
282         (minput__init): Initialize Mless_equal and Mgreater_equal.
283         (minput_get_title_icon): New function.
284
285         * m17n.h (minput_get_title_icon): Extern it.
286
287         * database.c (get_database_filename): Return a filename instead of
288         file pointer.
289         (load_database): Adjusted for the above change.
290         (mdatabase__load_for_keys): Likewise.
291         (mdatabase__find_file): New function.
292
293         * database.h (mdatabase__find_file): Extern it.
294
295         * font.h (mfont__resize): Delete extern.
296
297         * font.c (mfont__list): Check resize ratio.
298         (mfont__resize): Delete it.
299         (mfont_resize_ratio): Include the code of mfont__resize.
300
301         * font-ft.c (ft_open): Check resize ratio.
302
303         * m17n-X.c (xfont_open): Check resize ratio.
304         (xft_open): Likewise.
305
306 2005-12-07  Kenichi Handa  <handa@m17n.org>
307
308         * input.c (take_action_list): If take_action_list return -1,
309         return -1.
310         (handle_key): Likewise.
311
312         * face.c (mface__for_chars): When font is specified and layouter
313         is found for it, if the layouter doesn't support one of a
314         character, use a face sans layouter for it.
315
316 2005-12-06  Kenichi Handa  <handa@m17n.org>
317
318         * fontset.c (mfont__lookup_fontset): If only a fallback font is
319         found, don't use it for more than one character.
320
321 2005-12-05  Kenichi Handa  <handa@m17n.org>
322
323         * face.c (mface__realize): Set rfont->layouter to Mnil.
324         (mface__for_chars): Fix handling of layouter.
325
326         * character.h (mchar__define_prop): Extern it.
327
328         * database.c (update_database_list): Call mchar__define_prop if
329         necessary.
330
331         * character.c (mchar__init): Don't call mchar_define_property.
332         Instead just initialize property keys.
333         (mchar__fini): Free char_prop_list only if it's not NULL.
334         (mchar__define_prop): New function.
335         (mchar_define_property): Call mchar__define_prop.
336
337         * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
338         mplist__fini.
339
340 2005-12-02  Kenichi Handa  <handa@m17n.org>
341
342         * language.c (mlang__init): Handle extra chars.
343
344         * m17n-gui.h (mfont_check): Adjust prototype.
345
346         * m17n-X.c (xfont_driver): Specify xfont_check_capability.
347         (xfont_check_capability): New function.
348         (xft_driver): Specify xft_check_capability.
349         (xft_check_capability): New function.
350
351         * font-ft.c (M0_3): Delete it.
352         (M0): New variable.
353         (ft_get_charmaps): Refer to M0.
354         (fc_parse_pattern): Fix previous change.
355         (ft_list_language): Check also extra chars.
356         (ft_check_otf): Define it even if HAVE_OTF is undef.
357         (ft_check_lang): Check the result of FcLangSetHasLang against
358         FcLangDifferentLang.  Check also extra chars.
359         (ft_list_capability): Delete ifdef HAVE_OTF.
360         (ft_select): Likewise.
361         (ft_open): Improve debug information.
362         (ft_check_capability): New function.
363         (mfont__ft_driver): Specify ft_check_capability.
364         (mfont__ft_init): Initialize M0.
365
366         * fontset.c (get_font_from_group): New function.
367         (mfontset__get_font): New function.
368
369         * fontset.h (mfontset__get_font): Extern it.
370
371         * font.c (OTF_tag): Define it if HAVE_OTF is undef.
372         (mfont__fini): Delete ifdef HAVE_OTF.
373         (free_font_capability): Likewise.
374         (mfont__get_capability): Likewise.
375         (mfont__check_capability): New function.
376         (mfont_check): Change the order of arguments.  Use
377         mfontset__get_font.
378
379         * font.h (struct MFontDriver): New member check_capability.
380         (MFontCapability): Delete ifdef HAVE_OTF.
381         (mfont__check_capability): Extern it.
382
383         * face.c (mface__realize): Fix handling of FONT arg.
384         (mface__for_chars): Fix handling of explicitly specified font.
385
386 2005-11-25  Kenichi Handa  <handa@m17n.org>
387
388         * font-flt.c (run_command): Print debug info for
389         left/rigth_padding
390
391         * draw.c (layout_glyphs): Fix handling of left/right_padding.
392
393         * face.c (mface__for_chars): Check rfont before accessing the
394         members.
395
396 2005-11-21  Kenichi Handa  <handa@m17n.org>
397
398         * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
399         WITH_GUI.
400
401         * fontset.c (fontset_table): New variable.
402         (free_fontset): Call M17N_OBJECT_UNREGISTER.
403         (mfont__fontset_init): Add fontset_table as an object array.
404         (mfont__realize_fontset): Ref FONTSET.
405         (mfont__free_realized_fontset): Unref REALIZED->fontset.
406         (mfontset): Call M17N_OBJECT_REGISTER.
407         (mfontset_copy): Likewise.
408
409         * input.c (handle_key): For debugging, print information about
410         alias key.
411         (filter): Add an alias for Meta and Alt modifiers.
412         (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
413         variables.
414         (minput__init): Initialize them.
415         (parse_expression): New function.
416         (resolve_expression): New function.
417         (parse_action_list): Handle expressions by parse_expression.
418         (take_action_list): Handle expressions by resolve_expression.
419         (parse_nested_list_value): Fix previous change.
420         (resolve_command): Fix handling of the return value of
421         get_nested_list.
422
423 2005-11-18  Kenichi Handa  <handa@m17n.org>
424
425         * font-ft.c (ft_check_otf, otf_script_list): Define only when
426         HAVE_OTF is defined.
427         (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
428         defined.
429         (ft_select): Likewise.
430
431         * font.c (mfont_list): Fix for the case that FONT is NULL.
432         (OTF_tag): Delete it.
433         (load_otf_script_list): Define only when HAVE_OTF is defined.
434         (mfont__fini): Unref otf_script_list only when HAVE_OTF is
435         defined.
436
437         * draw.c (truncate_gstring): Be sure to truncate at
438         glapheme-cluster boundary.
439
440 2005-11-11  Kenichi Handa  <handa@m17n.org>
441
442         * input.c (delete_surrounding_text): Clear cache if necessary.
443
444 2005-11-09  Kenichi Handa  <handa@m17n.org>
445
446         * draw.c (compose_glyph_string): Update prev->rface->rfont if the
447         glyph prev is also supported by the current flt.
448
449 2005-11-08  Kenichi Handa  <handa@m17n.org>
450
451         * m17n-X.c (xft_render): Cancel previous change.
452
453 2005-11-07  Kenichi Handa  <handa@m17n.org>
454
455         * input.c: Include <stdlib.h>.
456         (get_surrounding_text, delete_surrounding_text)
457         (get_preceding_char, get_following_char): New functions.
458         (integer_value): New arg surrounding.  If it is nonzero, try to
459         get a surrounding character.  Callers changed.
460         (take_action_list): Check `value' before setting an element.
461         (destroy_ic): Unref ic_info->preceding_text and
462         ic_info->following_text.
463         (minput__init): Initialize Minput_get_surrounding_text and
464         Minput_delete_surrounding_text.
465         (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
466         variables.
467         (filter): Unref ic_info->preceding_text and
468         ic_info->following_text.
469
470         * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
471         Extern them.
472
473         * input.h (MInputContextInfo): New members preceding_text and
474         following_text.
475
476 2005-11-04  Kenichi Handa  <handa@m17n.org>
477
478         * input.c (parse_nested_list_value): Fix handling of the global
479         definition.
480         (get_nested_list): Get global definitions by load_partial_im_info.
481         (preedit_commit): Set ic->candidates_changed to bitwise or of enum
482         MInputCandidatesChanged.
483         (take_action_list): Likewise.
484         (reset_ic): Likewise.
485         (create_ic): Don't pay special attention to
486         Mcandidates_group_size.
487         (load_partial_im_info): Call mdatabase_find with correct 4th arg.
488         (minput_set_variable): Get a definition of varible by
489         mplist_find_by_value, not mplist_get.
490
491         * m17n.h (enum MInputCandidatesChanged): New enum.
492
493 2005-11-01  Kenichi Handa  <handa@m17n.org>
494
495         * m17n-X.c (xft_render): Check xft_draw's drawable before changing
496         it.
497         (mwin__destroy_window): If xft_draw's drawable is win, change it
498         to device->drawable before destroying win.
499
500 2005-10-31  Kenichi Handa  <handa@m17n.org>
501
502         * input.c (load_im_info): Fix adding of state.
503
504         * m17n-core.c (m17n_fini_core): Fix reporting of module
505         finalization.
506
507         * m17n.c (m17n_fini): Fix reporting of module finalization.
508
509         * m17n-gui.c (m17n_init_win): Fix reporting of module
510         finalization.
511
512 2005-10-29  Kenichi Handa  <handa@m17n.org>
513
514         * input.c (get_candidate_list): Fix the timing of referring plist.
515
516 2005-10-28  Kenichi Handa  <handa@m17n.org>
517
518         * input.c (load_branch): Ignore an undefined map name.
519         (load_im_info): Set im_info->title from `name' only if it's not
520         Mnil.
521         (shift_state): Always update ic->status.
522         (adjust_candidates): Renamed from adjust_candidate_command.
523         Argument changed.  Caller changed.
524         (get_candidate_list, regularize_action): New functions.
525         (take_action_list): Use them.  On handling Munhandle, don't set
526         ic_info->used to 0.
527         (handle_key): If KEY is not handled by MAP, and MAP has
528         branch_actions, perform them.
529
530         * database.c (mdatabase__fini): Free dir_info->filename;
531
532 2005-10-20  Kenichi Handa  <handa@m17n.org>
533
534         * input.c (marker_code): Accept '@@'.
535         (integer_value): Handle '@@'.
536         (parse_action_list): Accept a symbol argument.
537         (take_action_list): Resolve the symbol argument.  Handle the
538         integer argument.
539
540 2005-10-18  Kenichi Handa  <handa@m17n.org>
541
542         * input.c: Include "charset.h".
543         (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
544         variables.
545         (MIMState): New member (M17NObject control).
546         (lookup_nested_list, set_nested_list, parse_nested_list_value)
547         (get_nested_list, resolve_variable): New functions.
548         (integer_value): New arg (MPlist **value).  Set it to the plist
549         element containing the value.
550         (resolve_command): New function.
551         (load_translation): New arg (MPlist *map_actions).
552         (load_branch): New args language and name.  If `keylist' is a
553         symbol, resolved that as a command name.
554         (free_map): New arg top.  Free map->map_actions only if top is
555         nonzero.
556         (free_state): New function.
557         (load_state): New arg name.
558         (im_info_list): New variable.
559         (free_im_info, get_im_info_by_tags): New functions.
560         (load_im_info): Arg key changed to plist.  Handle `include'.
561         Return (MInputMethodInfo *).
562         (preedit_commit): Ref ic->candidate_list.
563         (get_select_charset, adjust_candidate_command): New functions.
564         (take_action_list): Handle `include'.  Adjust candidate action
565         properly.  Handle control variables `candidates-charset' and
566         `candidates-group-size'.
567         (open_im): Use get_im_info.
568         (create_ic): Get global variables.
569         (load_partial_im_info): New function.
570         (get_im_info): New function.
571         (check_command_keyseq, check_command_list, check_variable_list):
572         New functions.
573         (minput__init): Don't handle M_database_hook and Mdetail_text.
574         Initialize M_candidates, Mcandidates_group_size,
575         Mcandidates_charset.
576         (parse_variable_list, get_variable_list, parse_command_list)
577         (get_command_list): Delete them.
578         (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
579         (minput__fini): Simply unref command_list and variable_list.
580         (minput_get_description): Adjusted for the new form of description.
581         (minput_get_commands): Use get_nested_list.
582         (minput_assign_command_keys): Likewise.
583         (minput_get_variables, minput_set_variable): Likewise.
584
585         * input.h (MInputMethodInfo): New members im and maps.
586
587         * database.h (M_database_hook): Delete extern.
588         (MDatabaseHookFunc): Delete extern.
589         (mdatabase__check): Extern it.
590
591         * database.c: Include <glob.h>.
592         (MAX_TIME): New macro.
593         (Masterisk): New variable.
594         (get_database_stream): Argument changed to (MDatabaseInfo *).
595         Callers changed.
596         (get_dir_info): Renamed from duplicate_dirname.  Callers changed.
597         (find_database): New function.
598         (update_database_list): New function.
599         (mdatabase__init): Initialize Masterisk.  Setup mdb_list by
600         calling update_database_list.
601         (mdatabase__check): New function.
602         (mdatabase_find): Use update_database and find_database.  Don't
603         handle MDatabaseHookFunc.
604         (mdatabase_list): Call update_database at first.
605         (mdatabase_define): Adjusted for the change of mdb->extra_info.
606         (MDatabaseList): New type.
607
608         * plist.h (mplist_conv, mplist__pop_unref): Extern them.
609
610         * m17n.h (Mdetail_text): Delete extern.
611
612         * m17n-core.h (mplist_conc): Delete extern.
613
614         * plist.c (mplist__conc): Renamed from mplist_conc.  Don't ref
615         tail.
616         (mplist_conc): Renamed to mplist__conc.
617         (mplist__pop_unref): New function.
618
619 2005-10-14  Kenichi Handa  <handa@m17n.org>
620
621         * plist.c (read_mtext_element): Ignore the sequence of '\\' and
622         newline.
623         (read_element): If keys is an empty plist, return any element
624         found first.
625         (dump_plist_element): Check if plist is nested.
626         (mplist_conc): Always ref tail.
627         (mplist_set): If key is a managing key, ref val in advance.
628
629         * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
630         (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
631         (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
632         macros.
633
634         * fontset.c (free_fontset): Unref fontset_list if necessary.
635         (mfont__fontset_fini): Don't free fontset_list.  Unref
636         default_fontset.
637         (mfont__realize_fontset): Initialize request.
638         (mfontset): Ref default_fontset or fontset only if necessary.
639         (mfontset_copy): Don't ref copy.
640
641         * draw.c (render_glyphs): Check gend->type before checking
642         gend->to.
643
644         * font-ft.c (mfont__ft_fini): Unref ft_default_list.  Set all
645         unrefed plists to NULL.
646
647 2005-10-04  Kenichi Handa  <handa@m17n.org>
648
649         * textprop.c (mtext_serialize): Be sure to make mt
650         MTEXT_FORMAT_UTF_8 and NULL terminated.
651
652         * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
653
654         * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
655
656 2005-10-03  Kenichi Handa  <handa@m17n.org>
657
658         * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
659         is not at the beginning of line.
660
661 2005-09-22  Kenichi Handa  <handa@m17n.org>
662
663         * input.c: Include <sys/stat.h> and <unistd.h>.
664         (Minclude, Mcommit, Munhandle): New variables.
665         (minput__init): Initialize them.  Push only Mstate to
666         load_im_info_keys.   Add aliases C-lowercase for C-uppercase.
667         (parse_action_list): Allow integer arg for undo.  Handle Mcommit
668         and Munhandle.
669         (load_input_method): Handle "include" directive.  If no states are
670         loaded, return -1.
671         (shift_state): If state_name is Mt, shift back to the previous
672         state.  Call preedit_commit to commit preedit text.
673         (preedit_commit): New function.
674         (take_action_list): Improve debug printing.  Handle commit and
675         unhandle commands.
676         (handle_key): Check the return value of take_action_list.  Don't
677         take branch_actions just after changing to the root map.
678         (reset_ic): Reset all ic_info members.
679         (filter): When a key is not handled, just move ic_info->keys
680         instead fo calling reset_ic.
681         (load_im_info): If key is not Mstate, push Mmap to
682         load_im_info_keys.
683         (MDatabaseStatList): New type.
684         (imdir_stat_list): New variable.
685         (input_method_hook): Don't cancel the hook.  Check the
686         modification time of directories.
687         (minput__fini): Free imdir_stat_list;
688
689         * input.h (MInputContextInfo): New member prev_state.
690
691         * m17n-core.h (mplist_conc): Extern it.
692
693         * plist.c (mplist_conc): New function.
694
695         * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
696
697         * font.h (MRealizedFont): New member average_width.
698
699         * font-ft.c (ft_open): Set rface->average_width.
700
701         * font.c (xlfd_unparse_name): Print '*' before registry name.
702
703         * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
704         (xfont_open): Set rfont->average_width.
705         (xft_open): Likewise.
706         (device_open): Initialize disp_info->AVERAGE_WIDTH.
707
708         * internal-gui.h (struct MFrame): New member average_width.
709
710         * m17n-gui.c (mframe): Fix setting of frame->rfont.
711         (mframe_get_prop): Return the average_width of a font.
712
713         * face.c (mface__realize): Set rface->average_width.
714         (mface__update_frame_face): Set frame->average_width.
715
716         * face.h (MRealizedFace): New member average_width.
717
718 2005-09-19  Kenichi Handa  <handa@m17n.org>
719
720         * font.c (xlfd_unparse_name): New arg full_xlfd.
721         (mfont__encode_char): Use shortcut only for X core fonts.
722         (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
723         (mfont_put_prop): Handle `language' property.
724         (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
725         Print file can capability info too.
726
727         * m17n-core.c (mdebug__output): New variable.
728         (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
729         (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
730         (m17n_fini_core): Close mdebug__output if it's not stderr.
731
732         * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
733         (xfont_open): Handle baseline_offset.
734         (xfont_find_metric): Likewise.
735         (xfont_render): Likewise.
736         (xft_open): Likewise.
737         (xft_render): Likewise.
738
739         * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
740         (mdebug__output): Extern it.
741         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
742         (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
743         (MDEBUG_DUMP): New macro.
744         (MDEBUG_PRINT_TIME): Print to medebug__output.
745
746         * font.h (MRealizedFont): New member baseline_offset.
747
748         * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
749         characters.
750         (fc_weight_table): Add FC_WEIGHT_REGULAR.
751         (ft_list_family): Check alias.
752         (ft_list_language): If language is "en", don't try to the second
753         step.
754         (ft_default_list): New variable.
755         (ft_list_default): New function.
756         (ft_select): If family is not specified, try only the default
757         fonts.  Treat the weights normal and medium same.
758         (ft_open): Fix debug message.  If registry is not specified, try
759         unicode-bmp.  Handle _MULE_BASELINE_OFFSET property of BDF fonts.
760         (ft_find_metric): Likewise.
761         (ft_render): Likewise.
762         (ft_list): Fix debug message.  Accept the registring iso8859-1.
763         If family is not specified, try only the default fonts.
764
765         * face.c (mface__realize): Fix logic of opening a font.
766
767 2005-09-16  Kenichi Handa  <handa@m17n.org>
768
769         * face.c (mface__realize): 
770
771         * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
772         Extern them.
773
774         * input.c (shift_state): Fix the condition of taking init actions.
775         (take_action_list): Fix handling of pushback action.
776         (handle_key): Don't change key while checking its alias.
777         (minput__init): Initialize new variables.
778         (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
779         variables.
780
781 2005-09-12  Kenichi Handa  <handa@m17n.org>
782
783         * mtext.c (mtext__uppercase): Add proper open/close parens.
784         (mtext_titlecase): Add proper casting.
785
786         * input.c (parse_action_list): Handle the case that the arg is a
787         key sequence (MText or MPlist).
788         (take_action_list): Likewise.
789         (shift_state): Shorter debug message.
790         (handle_key): Terminate a debug message by "\n".
791         (reset_ic): Don't take initial actions here.
792         (minput_open_im): Print a debug message.
793         (minput_close_im): Likewise.
794         (minput_create_ic): Likewise.
795         (minput_destroy_ic): Likewise.
796
797 2005-09-09  TAKAHASHI Naoto  <ntakahas@m17n.org>
798
799         * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
800         Change API.
801
802 2005-09-07  TAKAHASHI Naoto  <ntakahas@m17n.org>
803         * character.c: Add "cased", "soft-dotted", and "case-mapping" in
804         mchar__init ().
805
806         * character.c: Add Japanese documentation for
807         mchar_get_prop_table ().
808
809 2005-09-06  TAKAHASHI Naoto  <ntakahas@m17n.org>
810
811         * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
812         (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
813         (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
814         New variables.
815         (init_case_conversion): New function.
816         (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
817         (uppercase_precheck, lowercase_precheck, final_sigma)
818         (after_soft_dotted, more_above, before_dot, after_i)
819         (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
820
821 2005-09-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
822
823         * plist.c (read_mtext_element): Fix previous change.
824
825 2005-09-05  Kenichi Handa  <handa@m17n.org>
826
827         * plist.c (read_mtext_element): Handle \uXXXX notation.
828
829         * internal.h (MTABLE_MALLOC): Don't use a local variable.
830         (MTABLE_ALLOCA): Change the name of local variable.
831
832         * m17n-gd.c (device_open): Define it even if HAVE_GD nor
833         HAVE_FREETYPE are defined.
834
835         * m17n-X.c: Check HAVE_X11.
836
837         * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
838         directory listing libraries.
839         (noinst_PROGRAMS): Define it only in maintainer mode.
840
841 2005-09-02  Kenichi Handa  <handa@m17n.org>
842
843         * m17n-gui.h (mdraw_line_break_option): Extern it.
844
845         * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
846         end of the first glyph.
847         (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
848         them.
849         (mdraw_line_break_option): New variable.
850         (mdraw_default_line_break): Use mtext_line_break.
851
852         * mtext.h (wordseg_func_table): Don't extern it.
853         (mtext__wseg_fini): Extern it.
854
855         * mtext.c: Don't include word-thai.h.
856         (wordseg_func_table): Delete this variable.
857         (mtext__init): Don't initialize above.  Don't call
858         mtext__word_thai_init.
859         (mtext__fini): Don't free wordseg_func_table.  Call
860         mtext__wseg_fini instead fo mtext__word_thai_fini.
861         (MTextWordsegFunc): Don't typedef it.
862         (mtext__word_segment): Moved to mtext-wseg.c.
863
864         * m17n-core.h (enum MTextLineBreakOption): New enum.
865         (mtext_line_break): Extern it.
866
867         * mtext-wseg.c: New file.
868
869         * mtext-lbrk.c: New file.
870
871         * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
872         add mtext-lbrk.c and mtext-wseg.c.
873
874         * textprop.c (mtext__adjust_plist_for_change): Pay attention for
875         the case that head is NULL.
876
877 2005-09-01  Kenichi Handa  <handa@m17n.org>
878
879         * word-thai.c (wordseg_propertize): If the property value is nil,
880         don't make the property no-merge.
881         (thai_wordseg): Don't require *from and *to are set a priori.  Pay
882         attention to the case that they are NULL.
883         (mtext__word_thai_init): Make the name of Mthai_wordseg starts
884         with two spaces.
885
886         * character.c (mchar_get_prop_table): New function.
887
888         * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
889
890         * m17n-core.h (mtext_insert, mtext_replace): Extern them.
891         (mchar_get_prop_table): Extern it.
892
893         * textprop.c (prepare_to_modify): New arg deleting.  Callers changed.
894         (mtext__adjust_plist_for_change): Argument changed.  Callers changed.
895
896         * internal.h (enum MTextCoverage): New enum.
897         (MText): New member coverage.
898
899         * mtext.c (FORMAT_COVERAGE): New macro.
900         (insert): Copy mt2->coverage.
901         (mtext__from_data): Initialize mt->coverage.
902         (mtext__adjust_format): Update mt->coverage.
903         (mtext): Initialize mt->coverage.
904         (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
905         Update mt->coverage if necessary.
906         (mtext_duplicate): Copy mt->coverage.
907         (mtext_insert, mtext_replace): New functions.
908         (mtext_dup): Use mtext_duplicate.
909         (mtext__word_segment): Don't set *from and *to if a word
910         segmentation funcion is not found.
911         (mtext_ins_char): Fix typo.
912
913 2005-08-25  Kenichi Handa  <handa@m17n.org>
914
915         * font.h (MFont): New member for_full_width.
916
917         * font.c (compare_font_score): Prefer a font of not
918         for_full_width.
919
920         * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
921         registry charset of a font is one of CJK charsets.
922
923         * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
924         supports some of CJK.
925
926 2005-08-24  Kenichi Handa  <handa@m17n.org>
927
928         * m17n-gui.h (Mascent, Mdescent): Don't extern them.
929
930         * m17n-gui.c (null_device_open): Check Mresolution param and set
931         frame->dpi.
932
933         * m17n-gd.c (device_open): Check Mresolution param and set
934         frame->dpi.
935
936         * m17n-X.c (MWDevice): New member resy.
937         (xfont_open): Set ascent, descent, and max_advance members of
938         rfont.
939         (xft_open): Likewise.
940         (device_open): Compare also screen_num to find a device.  Set
941         device->resy and frame->dpi.
942
943         * internal-gui.h (MFrame): New member dpi.
944
945         * font.h (MRealizedFont): New member max_advance.
946
947         * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
948         (mfont__init): Don't initialize Mascent, Mdescent.
949         (Mascent, Mdescent): Delete these variables.
950         (mfont_get_prop): Fix previous change.  Check Mfont_ascent and
951         Mfont_descent instead of Mascent and Mdescent.
952         (mfont_put_prop): Allow negative size.
953         (mfont_find): Handle the case of spec->size < 0.  Fix previous
954         change.
955         (mfont_list): Handle the case of spec->size < 0.
956         (mfont_check): Likewise.
957
958         * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
959         (fc_get_pattern): Handle the case of font->size < 0.
960         (ft_open): Set ascent, descent, and max_advance members of rfont.
961         (ft_find_metric): Improve rounding.
962         (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
963         FC_SIZE.
964
965         * face.c (mface__realize): Handle the case of font->size < 0.
966
967 2005-08-22  Kenichi Handa  <handa@m17n.org>
968
969         * coding.c (MConverterStatus): Change the member buf to union.
970         (mconv_buffer_converter): Add const to the arg buf.
971         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
972         (mconv_decode): Adjusted for the change of MConverterStatus.
973         (mconv_encode_range): Likewise.
974
975         * m17n.h (mconv_buffer_converter): Prototype adjusted.
976         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
977
978 2005-08-20  Kenichi Handa  <handa@m17n.org>
979
980         * m17n-gui.h (mfont_from_name): Prototype adjusted.
981         (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
982
983         * m17n-X.c (xfont_open): Set members ascent, descent, and
984         max_advance of rfont.
985         (xft_open): Likewise.
986
987         * font-ft.c (ft_open): Set members ascent, descent, and max_advance
988         of rfont.
989         (mfont__ft_parse_name): Add const to the arg name.
990
991         * font.c (xlfd_parse_name): Add const to the arg name.  Call
992         mfont__set_property instead of mfont_set_spec.  Set font->spacing.
993         (xlfd_unparse_name): Handle spacing.
994         (mfont__init): Initialize new variables.
995         (mfont__id): Handle spacing.
996         (mfont__merge): Likewise.
997         (mfont__set_spec): This function deleted.
998         (mfont__parse_name_into_font): Add const to the arg name.  Fix the
999         condition of calling mfont__ft_parse_name.
1000         (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
1001         (mfont_get_prop): Handle properties spacing, ascent, descent,
1002         and max-advance.
1003         (mfont_find): Return a realized font.
1004         (mfont_from_name): Add const to the arg name.
1005
1006         * font.h (enum MFontProperty): New member MFONT_SPACING.
1007         (enum MFontSpacing): New enum.
1008         (MFont): New members spacing and max_advance.
1009         (mfont__ft_parse_name): Prototype adjusted.
1010         (mfont__set_spec): Extern deleted.
1011         (mfont__parse_name_into_font): Prototype adjusted.
1012
1013 2005-08-19  Kenichi Handa  <handa@m17n.org>
1014
1015         * m17n-gui.h (mfont_parse_name): Prototype adjusted.
1016
1017         * font.c (mfont_list): If FONT is null, use a temporary font.
1018         (mfont_parse_name): Add const to the arg name.
1019
1020 2005-08-18  Kenichi Handa  <handa@m17n.org>
1021
1022         * word-thai.c: Surround code by #ifdef and #endif to escape from
1023         doxygen.
1024
1025         * font-ft.c: Mostly re-written.
1026
1027         * font-flt.c (FontLayoutCmdOTF): This type deleted.
1028         (FontLayoutCmd): Type of the member otf changed..
1029         (load_otf_command): Adjusted for the format change of otf command.
1030         (load_command): Likewise.
1031         (free_flt_command): Unref cmd->body.otf.
1032         (run_otf): Ajusted for the type change of otf_cmd.
1033         (run_command): Ajusted for the type change of otf_cmd.  On
1034         debugging, print ctx->combining_code.
1035         (mfont__flt_run): Initialize ctx's members code_offset,
1036         combining_code, and left_padding to 0.
1037
1038         * face.h (struct MRealizedFace): New member font.
1039         (mface__realize): Prototype adjusted.
1040
1041         * face.c (find_realized_face): New arg font.
1042         (find_realized_face): Adjusted for the change of MFont.
1043         (mface__init): Call M17N_OBJECT_ADD_ARRAY.
1044         (mface__fini): Don't call mdebug__report_object.
1045         (mface__realize): New arg font.
1046         (mface__for_chars): Adjusted for the change of mfont__encode_char.
1047         Optimize the latin case.
1048         (mface__free_realized): Free rface->font.
1049         (mface__update_frame_face): Adjusted for the change of mface__realize.
1050         (mface_equal): New function.
1051
1052         * draw.c (Mcommon): New variable.
1053         (visual_order): Args to mfont__encode_char changed.
1054         (compose_glyph_string): Handle Mfont text property.
1055         (layout_glyphs): Adjusted for the change of MFont.
1056         (mdraw__init): Initialize Mcommon.
1057         (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
1058
1059         * font.h (enum MFontType): Members completely changed.
1060         (enum MFontProperty): Move MFONT_SIZE to the tail.
1061         (enum MFontSource): New enum.
1062         (struct MFont): New members type, source, sizes, file, capability,
1063         and encoding.
1064         (struct MRealizedFont): Type of member font changed. Members
1065         score, status, and encoding deleted.
1066         (MFontScore): New type.
1067         (MFontList): Member changed.
1068         (struct MFontDriver): New member has_char.  Types of members
1069         changed.
1070         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
1071         (Mapple_roman): Extern them.
1072         (OTF_Tag): Typedefed if not HAVE_OTF.
1073         (enum MFontOpenTypeTable): New enum.
1074         (MFontCapability): New type.
1075         (mfont__ft_drive_otf): Prototype adjusted.
1076         (mfont__score): Extern deleted.
1077         (mfont__merge): Extern it.
1078         (mfont__has_char): Extern it.
1079         (mfont__encode_char): Prototype adjusted.
1080         (mfont__open): Extern it.
1081         (mfont__set_spec): Prototype adjusted.
1082         (mfont__get_capability): Extern it.
1083
1084         * font.c: Include "fontset.h".
1085         (M_font_capability, M_font_list, M_font_list_len): New variables.
1086         (font_score_priority): Change order of initial elements.
1087         (font_score_shift_bits): Fix array size.
1088         (common_weight): Add "thin", "semibold", and "heavy".
1089         (common_stretch): Add "ultracondensed", "extracondensed",
1090         "extraexpanded", and "utltraexpand".
1091         (font_weight_regular, font_weight_normal, font_weight_medium): New
1092         variables.
1093         (gen_font_name): This function deleted.
1094         (find_encoding): Set font->encoding.
1095         (OTF_tag): New function.
1096         (otf_script_list): New variable.
1097         (load_otf_script_list): New function.
1098         (find_script_from_otf_tag): New function.
1099         (xlfd_parse_name): Set font->type and font->source.
1100         (mfont__free_realized): Free chains rfonts.
1101         (font_score): Renamed from mfont__score.
1102         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
1103         (Mapple_roman): New variables.
1104         (mfont__init): Initilize new variables.  Initalize
1105         default_encoding.encoding_name and
1106         default_encoding.encoding_charset to Municode_full and
1107         mcharset__unicode.  Use SAFE* macros for allocating filepath
1108         buffer.
1109         (mfont__fini): Free otf_script_list.
1110         (mfont__id): New function.
1111         (mfont__match_p): Check also capability member of MFont.
1112         (mfont__merge): New funciton.
1113         (mfont__set_spec_from_face): Set type and source members.
1114         (mfont__set_spec_from_plist): Set capability and type members.
1115         (mfont__select): Argument changed.
1116         (mfont__available): New function.
1117         (compare_font_score): New function.
1118         (mfont__list): New function.
1119         (mfont__open): Return a realized font.
1120         (mfont__resize): Adjusted for the change of MFont.
1121         (mfont__has_char): New function.
1122         (mfont__encode_char): Argument changed.
1123         (mfont__set_spec): Argument changed.
1124         (free_font_capability): New function.
1125         (mfont__get_capability): New function.
1126         (MFontfile): New variable.
1127         (mfont_get_prop): Adjusted for the change of MFont.
1128         (mfont_put_prop): Likewise.
1129         (mfont_set_selection_priority): Fix the way of setting
1130         font_score_priority[].
1131         (mfont_find): Use mfont__list instead of mfont__select.
1132         (mfont_resize_ratio): Adjusted for the change of MFont.
1133         (mfont_list): Use mfont__list.
1134         (mfont_check): New function.
1135         (font_score): Make it static.
1136
1137         * fontset.h (mfont__realize_fontset): Prototype adjusted.
1138         (mfont__lookup_fontset): Likewise.
1139
1140         * fontset.c (struct MFontset): Delete member font_spec_list.
1141         (struct MRealizedFontset): Type of member spec changed.  New
1142         member request.
1143         (load_font_group): Arg spec_list deleted.
1144         (load_fontset_contents): Adjusted for the change of fontset_def.
1145         (free_fontset): Fix the way of freeing fontset elements.
1146         (realize_fontset_elements): Argument changed.
1147         (get_per_script): New function.
1148         (free_realized_fontset_elements): Fix the way of feeing rfontset
1149         elements.
1150         (update_fontset_elements): Fix args to realize_fontset_elements.
1151         (mfont__realize_fontset): New arg spec.
1152         (try_font_list): New function.
1153         (try_font_group): New arg request.  Use try_font_list.
1154         (mfont__lookup_fontset): New arg ignore_fallback.  Fix arg to
1155         try_font_group.
1156         (mfontset): Adjusted for the change of MFontset.
1157         (mfontset_copy): Likewise.  Don't share plists.
1158         (mfontset_modify_entry): Adjusted for the change of MFontset.
1159         (mfontset_lookup): Call get_per_script.
1160         (mdebug_dump_fontset): Print also the address of fonts.
1161
1162         * input.c (shift_state): Don't reset ic_info->vars.
1163         (take_action_list): Call MDEBUG_PRINT fore calling
1164         take_action_list.
1165
1166         * internal-gui.h (MFontDriver): Don't typedef it here.
1167
1168         * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
1169         (MXFont): This type deleted.
1170         (MFontX): New type.
1171         (struct _MFontX): New struct.
1172         (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
1173         (MDisplayInfo): Member base_font_list deleted.
1174         (DEFAULT_FONT): Definition changed.
1175         (FALLBACK_FONT): This maclr deleted.
1176         (free_display_info): Adjusted for the change of MDisplayInfo.
1177         (free_device): Argument to mfont__free_realized changed.
1178         (xfont_driver): Adjusted for the change of MFontDriver.
1179         (xfont_registry_list): Use MFontX instead of MXFont.
1180         (MRealizedFontX): Renamed from MXFontInfo.
1181         (xfont_select): Return the font found first.
1182         (close_xfont): Change MXFontInfo to MRealizedFontX.
1183         (xfont_open): Return the realized font.
1184         (xfont_find_metric): Get xfont from rfont->fontp.
1185         (xfont_has_char): New function.
1186         (xfont_encode_char): Adjusted for the argument change.
1187         (xfont_render): Get xfont from rfont->fontp.
1188         (xfont_list): Adjusted for the argument change.
1189         (MRealizedFontXft): Renamed from MXftFontInfo.
1190         (xft_driver): Ajusted for the change of MFontDriver.
1191         (close_xft): Change MXtfFontInfo to MRealizedFontXft
1192         (xft_open_font): Argument changed.
1193         (xft_open): Argument changed.  Return the realized font.
1194         (xft_find_metric): Get xft_font from rfont->fontp.
1195         (xft_has_char, xft_encode_char): New functions.
1196         (xft_render): Change MXftFontInfo to MRealizedFontXft.  Open a
1197         font if not yet opened.
1198         (device_open): Don't set frame->font.
1199
1200         * m17n-gd.c (gd_font_driver): Adjusted for the change of
1201         MFontDriver.
1202         (gd_font_open): New function.
1203         (gd_render): Don't use the local variable ft_info.
1204         (device_init): Adjusted for the change of gd_font_driver.
1205
1206         * textprop.c (mtext__prop_init): Initialize text_property_table.
1207         Call M17N_OBJECT_ADD_ARRAY.
1208         (mtext__prop_fini): Don't call mdebug__report_object.
1209
1210         * plist.c (mplist__init): Initialize plist_table.
1211         (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
1212         (mplist__fini): Don't call mdebug__report_object.
1213
1214         * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
1215         (mtext__fini): Don't call mdebug__report_object.
1216         (MTEXT_FORMAT_UTF_16): Correct type.
1217         (mtext_data): New function.
1218         (mtext_text): Fix calculation of limit and args to
1219         find_char_backward.
1220
1221         * language.c: Include "plist.h".
1222         (M_script_lang_list): New variable.
1223         (mlang__init): Read languages and their information from m17n
1224         database.
1225         (mlanguage__list): New function.
1226         (Miso639_1, Miso639_2): New variables.
1227
1228         * language.h (mlanguage__list): Extern it.
1229
1230         * database.c (get_database_stream): Use SAFE_* macros for
1231         allocating and freeing path.
1232         (mdatabase__init): Likewise.
1233
1234         * symbol.c (msymbol__fini): Don't free symbols here.
1235         (msymbol__free_table): New function.
1236         (msymbol_is_managing_key): New function.
1237
1238         * symbol.h (msymbol__free_table): Extern it.
1239         (msymbol__list): Extern it.
1240
1241         * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
1242         New macros.
1243         (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
1244         (struct _M17NObjectArray): New member name and next.
1245         (mdebug__add_object_array): Extern it.
1246         (M17N_OBJECT_ADD_ARRAY): New macro.
1247         (mdebug__report_object): Don't extern it.
1248
1249         * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
1250
1251         * m17n-gui.c (free_frame): Don't free frame->font.
1252         (null_device_fini): Fix code for freeing
1253         null_device.realized_font_list.
1254         (m17n_fini_win): Free interface.
1255         (mframe): Cast the return value of dlsym.  Set frame->font here.
1256         (mframe_get_prop): Check frame->rface->rfont before accessing the
1257         member font.
1258
1259         * m17n-gui.h (Mfontfile): Extern it.
1260         (mfont_check): Extern it.
1261         (mface_equal): Extern it.
1262
1263         * m17n-core.c: Include "symbol.h".
1264         (report_header_printed): This variable deleted.
1265         (object_array_root): New variable.
1266         (report_object_array): New function.
1267         (mdebug__report_object): This function deleted.
1268         (mdebug__add_object_array): New function.
1269         (m17n_init_core): Call mchartable_init () before mtext_init ().
1270         (m17n_fini_core): Call report_object_array (if necessary) and
1271         msymbol__free_atable at the end.
1272
1273         * m17n-core.h (msymbol_is_managing_key): Extern it.
1274         (mtext_data): Extern it.
1275         (MTEXT_FORMAT_UTF_16): Correct type.
1276         (M17NLIB_MINOR_VERSION): Changed to 3.
1277         (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1278         
1279         * chartab.c (mchartable__init): Initalize chartable_table.count.
1280         (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1281         mdebug__report_object.
1282
1283 2005-05-26  Kenichi Handa  <handa@m17n.org>
1284
1285         * m17n.h (Miso639_1, Miso639_2): Extern them.
1286
1287         * symbol.h (msymbol__list): Extern it.
1288
1289         * symbol.c (msymbol__list): New function.
1290
1291 2005-05-19  Kenichi Handa  <handa@m17n.org>
1292
1293         * input-gui.c (minput__win_init): Don't change the value of
1294         minput_driver.
1295
1296 2005-05-16  Kenichi Handa  <handa@m17n.org>
1297
1298         * m17n-core.c (m17n_object): Be sure to initialize all members.
1299
1300         * font-ft.c (fc_decode_prop): Fix args to msymbol.
1301
1302 2005-05-09  Kenichi Handa  <handa@m17n.org>
1303
1304         * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1305
1306 2005-04-27  Kenichi Handa  <handa@m17n.org>
1307
1308         * language.c (mlang__init): Add "an" (Aragonese).
1309
1310         * word-thai.c: Add support for libthai.
1311         (mtext__word_thai_init): Initialize wordseg library conditionaly.
1312         (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1313
1314         * mtext.c: Include "word-thai.h" conditionaly.
1315         (mtext__init): Call mtext__word_thai_init conditionaly.
1316         (mtext__fini): Call mtext__word_thai_fini conditionaly.
1317
1318         * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1319         not WORDCUT_LD_FLAGS.
1320
1321 2005-04-19  Kenichi Handa  <handa@m17n.org>
1322
1323         * word-thai.c (wordseg_propertize): Always unref the attached
1324         property.
1325         (thai_wordseg): Don't unref the property.
1326
1327 2005-04-18  Kenichi Handa  <handa@m17n.org>
1328
1329         * word-thai.c: Include stdlib.h.
1330         (wordseg_propertize): Add dummy function for the case that wordcut
1331         library doesn't exist.
1332         (wordseg_propertize): Fix for old wordcut library.
1333
1334 2005-04-16  Kenichi Handa  <handa@m17n.org>
1335
1336         * word-thai.c: Include <stdio.h>.
1337
1338 2005-04-15  Kenichi Handa  <handa@m17n.org>
1339
1340         * draw.c: Include mtext.h.
1341         (linebreak_table, M_break_at_space, M_break_at_word)
1342         (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1343         (compose_glyph_string): Check POS before getting Mface text
1344         property.
1345         (truncate_gstring): Give correct TO arg to line_break function.
1346         (GET_LB_TYPE): New macro.
1347         (find_break_backward, find_break_forward): New functions.
1348         (mdraw__init): Initialize the above new variables.
1349         (mdraw__fini): Free linebreak_table.
1350         (mdraw_default_line_break): Use find_break_backward and
1351         find_break_forward.
1352
1353         * word-thai.c: New file.
1354
1355         * word-thai.h: New file.
1356
1357         * mtext.c: Include word-thai.h.
1358         (wordseg_func_table): New variable.
1359         (mtext__init): Initialize wordseg_func_table and call
1360         mtext__word_thai_init.
1361         (mtext__fini): Call mtext__word_thai_fini, free
1362         wordseg_func_table.
1363         (MTextWordsegFunc): New type.
1364         (mtext__word_segment): New function.
1365
1366         * mtext.h (wordseg_func_table): Extern it.
1367         (mtext__word_segment): Extern it.
1368
1369         * m17n.c (m17n_init): Fix typo (== -> =).
1370
1371         * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1372         (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1373
1374         * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1375         (MTEXTPROP_VAL): New macros.
1376
1377         * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1378
1379 2005-04-07  Kenichi Handa  <handa@m17n.org>
1380
1381         * database.c (load_chartable): Fix pursing of symbol name.
1382
1383 2005-03-24  Kenichi Handa  <handa@m17n.org>
1384
1385         * m17n.c (m17n_init): Fix typo (== -> =).
1386
1387 2005-03-11  Kenichi Handa  <handa@m17n.org>
1388
1389         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1390
1391         * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1392
1393         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1394         first.
1395
1396 2005-03-09  handa  <handa@m17n.org>
1397
1398         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1399         calling m17n_init ().
1400
1401         * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1402         calling m17n_init_core ().
1403
1404 2005-02-28  Kenichi Handa  <handa@m17n.org>
1405
1406         * font-flt.c (mfont__flt_run): Add resulting code sequence in
1407         debug info.
1408
1409 2005-02-17  Kenichi Handa  <handa@m17n.org>
1410
1411         * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1412         (M_description, M_command, M_variable): New variables.
1413         (load_im_info_keys): New variables.
1414         (load_im_info, check_command_keyseq, get_description_advance)
1415         (parse_command_list, get_command_list, parse_variable_list)
1416         (get_variable_list, input_method_hook): New functions.
1417         (command_list, variable_list): New variables.
1418         (minput__init): Put input_method_hook to Minput_method.
1419         Initialize M_description, M_command, M_variable, Mdetail_text,
1420         load_im_info_keys, command_list, variable_list.
1421         (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1422         (Mdetail_text): New variable.
1423         (minput_get_description, minput_get_commands)
1424         (minput_assign_command_keys, minput_get_variables)
1425         (minput_set_variable): New functions.
1426
1427         * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1428         (minput_assign_command_keys, minput_get_variables)
1429         (minput_set_variable): Extern them.
1430
1431         * plist.c (UNGETC): Just decrement st->p.
1432         (read_mtext_element): New arg skip.
1433         (read_integer_element): Likewise.
1434         (read_symbol_element): Likewise.
1435         (read_element): New arg KEYS.
1436         (mplist__from_plist): Don't increment ref-count of NULL object.
1437         (mplist__from_file): New arg KEYS.
1438         (mplist_put): Don't increment ref-count of NULL object.
1439         (mplist_add): Likewise.
1440         (mplist_push): Likewise.
1441         (mplist_set): Likewise.  Call M17N_OBJECT_UNREF unconditionally.
1442
1443         * plist.h (mplist__from_file): Prototype adjusted.
1444
1445         * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1446         (get_database_stream): New function.
1447         (load_database): Use get_database_stream.
1448         (M_database_hook): New variable
1449         (mdatabase__init): Initialize M_database_hook.
1450         (mdatabase__load_for_keys): New function.
1451         (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1452         function.
1453         (mdatabase_define): Free mdb->extra_info if necessary.
1454
1455         * database.h (mdatabase__dir_list, M_database_hook)
1456         (mdatabase__load_for_keys): Extern them.
1457         (MDatabaseHookFunc): New type.
1458
1459         * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1460
1461 2004-12-27  Kenichi Handa  <handa@m17n.org>
1462
1463         * Version 1.2.0 released.
1464
1465 2004-12-27  Kenichi Handa  <handa@m17n.org>
1466
1467         * input.c (minput_filter): Don't reset ic->xxx_changed.
1468
1469         * mtext.c (mtext_from_data): Fix documentation.
1470
1471 2004-12-25  Kenichi Handa  <handa@m17n.org>
1472
1473         * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1474         (M17NLIB_VERSION_NAME): Update to "1.2.".
1475
1476 2004-12-24  Kenichi Handa  <handa@m17n.org>
1477
1478         * input.c (reset_ic): Set key_unhandled to 0.
1479
1480 2004-12-21  Kenichi Handa  <handa@m17n.org>
1481
1482         * m17n-gui.h (mfont_from_spec): Delete extern.
1483
1484         * input-gui.c (win_callback): Handle Minput_reset.
1485         (minput__win_init): Register reset_ic as a callback for
1486         Minput_reset.
1487
1488         * input.c (reset_ic): New arg IGNORE which is ignored.  Caller
1489         changed.  At first, shift to the initial state.
1490         (minput__init): Initialize Minput_reset.  Register reset_ic as a
1491         callback for Minput_reset.
1492         (Minput_reset): New variable.
1493         (minput_filter): Always set ic->xxx_changed to 0.
1494         (minput_reset_ic): New function.
1495         (integer_value): Fix typo ('>' -> '<') and calculation of length
1496         of preedit text.
1497
1498         * m17n-core.c (merror_code): Change type to `int'.
1499
1500         * m17n-misc.h (merror_code): Adjust type.
1501
1502         * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1503
1504         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1505         (mtext_change_prop): Delete extern.
1506
1507         * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1508         to `int'.  Move the documents to m17n-core.h.
1509
1510 2004-12-13  Kenichi Handa  <handa@m17n.org>
1511
1512         * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1513         (MTextProperty): Document it.
1514
1515 2004-12-09  Kenichi Handa  <handa@m17n.org>
1516
1517         * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1518
1519 2004-12-03  Kenichi Handa  <handa@m17n.org>
1520
1521         * internal.h (m17n__core_initialized, m17n__shell_initialized,
1522         m17n__gui_initialized): New externs.
1523
1524         * m17n-core.h (enum M17NStatus): New enum.
1525         (m17n_status): Extern it.
1526
1527         * m17n-core.c (core_initialized): Delete this variable.
1528         (m17n__core_initialized, m17n__shell_initialized,
1529         m17n__gui_initialized): New variables.
1530         (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1531         instead of core_initialized.
1532         (m17n_status): New function.
1533
1534         * m17n.c (shell_initialized): Delete this variable.
1535         (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1536         shell_initialized.
1537
1538         * m17n-gui.h (m17n_init_win): Adjust the prototype.
1539
1540         * m17n-gui.c (win_initialized): Delete this variable.
1541         (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1542         instead of gui_initialized.
1543
1544 2004-11-19  Kenichi Handa  <handa@m17n.org>
1545
1546         * input.c (reset_ic): Check if ic_info->state is NULL.
1547         (filter): If ic_info->state is NULL, return 0.
1548         (load_input_method): Don't unref `maps' it it's not created.
1549
1550 2004-11-15  Kenichi Handa  <handa@m17n.org>
1551
1552         * input.c (find_candidates_group): If INDEX is -1, find the last
1553         candidate group.
1554         (take_action_list): If the previous of the first candidate is
1555         requested, select the last candidate.
1556
1557 2004-11-08  Kenichi Handa  <handa@m17n.org>
1558
1559         * m17n-X.c (device_open): Try at most 32 fonts to find a
1560         non-autoscaled font.
1561
1562         * font.c (xlfd_parse_name): Fix previous change.
1563
1564 2004-11-05  Kenichi Handa  <handa@m17n.org>
1565
1566         * font.c: (commont_style): Include dummy elements "slanted" and
1567         "rslanted" to prefer "o" to "r" if "i" is requested.
1568
1569         * font-ft.c (ft_to_prop): Fix "oblique" entry.
1570
1571 2004-10-29  Kenichi Handa  <handa@m17n.org>
1572
1573         * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1574
1575         * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1576         New members smallest and larger.
1577         (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1578         (xfont_registry_list): Likewise.
1579         (xfont_select): Likewise.
1580         
1581
1582 2004-10-28  Kenichi Handa  <handa@m17n.org>
1583
1584         * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1585         font name comparison.
1586         (xfont_select): Fix logic for selecting a larger size font.
1587
1588 2004-10-25  Kenichi Handa  <handa@m17n.org>
1589
1590         * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1591         ">" actions.
1592
1593 2004-10-22  Kenichi Handa  <handa@m17n.org>
1594
1595         * input.c (update_candidate): Renamed from udpate_candidate.
1596         (take_action_list): Show more debugging info on arithmetic commands.
1597
1598         * m17n-X.c (device_open): Fix previous change.
1599
1600         * draw.c (compose_glyph_string): Don't get face property at the
1601         end of M-text.
1602
1603 2004-10-21  Kenichi Handa  <handa@m17n.org>
1604
1605         * draw.c (compose_glyph_string): Fix for the case of category
1606         being Mnil.
1607
1608 2004-10-19  Kenichi Handa  <handa@m17n.org>
1609
1610         * input.c (mdebug_mask): New variable.
1611         (shift_state): Print debug information.
1612         (take_action_list): Likewise.
1613         (handle_key): Likewise.
1614
1615 2004-10-14  Kenichi Handa  <handa@m17n.org>
1616
1617         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1618
1619 2004-10-13  Kenichi Handa  <handa@m17n.org>
1620
1621         * m17n-X.c (device_open): Be sure to register at least one font
1622         driver.
1623
1624         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
1625         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1626
1627 2004-10-12  Kenichi Handa  <handa@m17n.org>
1628
1629         * draw.c (alloc_gstring): Fix previous change.
1630
1631         * font-ft.c (ft_list_generic): Fix for the case of not
1632         HAVE_FONTCONFIG.
1633
1634         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1635
1636         * font.c (mfont_list): If no font is found, return NULL.
1637         (load_font_encoding_table): Put entries of nil registry first.
1638         (find_encoding): Adjust for the above change.
1639
1640 2004-10-11  Kenichi Handa  <handa@m17n.org>
1641
1642         * m17n-gui.h (mfont_list): Adjust prototype.
1643
1644         * m17n-X.c (xfont_list): New arg maxnum.
1645
1646         * font.h (struct MFontDriver): Change prototype of <list>.
1647
1648         * font-ft.c (fc_generic_family_list): Delete it.
1649         (Mserif, Msans_serif, Mmonospace): Delete them.
1650         (M_generic_family_info): New variable.
1651         (enum GenericFamilyType): New enum.
1652         (struct GenericFamilyInfo): New struct.
1653         (generic_family_table): New variable.
1654         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1655         iso8859-1.
1656         (add_font_info): Get style here.
1657         (ft_list_family): Don't initialize fc_config here.  Don't list
1658         generic families.
1659         (ft_list_generic): New function.
1660         (ft_select): Pay attention to generic familes here.
1661         (ft_open): Fix calculation of ascent and descent.
1662         (ft_list): Pay attention to generic families.
1663         (mfont__ft_init): Initialize M_generic_family_info,
1664         generic_family_table, and fc_config..
1665         (mfont__ft_fini): Finalize generic_family_table.
1666
1667         * draw.c (compose_glyph_string): Use more constant font for
1668         glyphs.  Adjust for the member change in MGlyph.
1669         (layout_glyph_string): Adjust for the member change in MGlyph.
1670         (alloc_gstring): Intilize scracth_glyph to avoid
1671         compose_glyph_string on it.
1672         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1673         (mdraw_coordinates_position): Fix previous change.
1674
1675         * internal-gui.h (glyph_category): New enum.
1676         (MGlyph): Change type of <category> to enum glyph_category.
1677
1678         * face.c (mface__realize): Delete args langauge and charset.
1679         (mface__for_chars): Fix for the case that glyphs have different
1680         rfaces.
1681         (mface__update_frame_face): Adjust for mface__realize change.
1682
1683         * face.h (mface__realize): Adjust prototype.
1684
1685 2004-10-05  Kenichi Handa  <handa@m17n.org>
1686
1687         * language.c (mlang__init): Add Akan.
1688
1689 2004-10-04  Kenichi Handa  <handa@m17n.org>
1690
1691         * font-ft.c (add_font_info): Add instead of push the element.
1692         (ft_list_family): For generic fonts, try all
1693         substituted. families.
1694
1695         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1696         (run_rule): Don't update cluster range here.
1697         (run_command): Update cluster range on appending a glyph.
1698         (run_otf): Update cluster range for glyphs generated by OTF.
1699
1700 2004-10-02  Kenichi Handa  <handa@m17n.org>
1701
1702         * m17n-X.c (device_open): Handle Mfont key in PLIST.
1703
1704 2004-09-30  Kenichi Handa  <handa@m17n.org>
1705
1706         * font-ft.c (ft_select): Ignore family on calling mfont__score.
1707
1708 2004-09-30  Kenichi Handa  <handa@m17n.org>
1709
1710         * font.h: Include <fontconfig/fontconfig.h>.
1711         (MFTInfo): New member langset.
1712         (mfont__encoding_list): Extern it.
1713
1714         * font.c (mfont__encoding_list): New function.
1715         (mdebug_dump_font_list): New function.
1716
1717         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1718         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1719         variables.
1720         (ft_family_list): New variable.
1721         (set_font_info): New arg basep.  Callers changed.
1722         (fc_list): Check the return value of FcPatternGetString.
1723         (add_font_info): New arg plist.  Callers changed. Update
1724         ft_family_list.
1725         (ft_list_family): New function (merged fc_list and ft_list_all).
1726         (ft_select): Use ft_list_family.
1727         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
1728         typo (== -> !=).
1729         (mfont__ft_init): Initialize above new variables.
1730         (mfont__ft_fini): Free ft_family_list.
1731         (STRDUP_LOWER): New macro.
1732         (set_font_info): Use STRDUP_LOWER.
1733         (ft_list_family): Avoid duplicate addition of font path.  Use
1734         STRDUP_LOWER.
1735         (fc_decode_prop): Fix typo.
1736
1737         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1738         (xfont_registry_list): Change argument disp_info to frame.
1739         Callers changed.
1740         (xfont_list_all): New function.
1741         (xfont_list): If FONT is not NULL, check all fonts.
1742
1743 2004-09-28  Kenichi Handa  <handa@m17n.org>
1744
1745         * m17n-X.c (MXFont, MXFontList): New types.
1746         (MDisplayInfo): Delete members font_registry_list,
1747         iso8859_1_family_list, iso10646_1_family_list, new members
1748         font_list, base_font_list.
1749         (free_display_info): Adusted for the change of MDisplayInfo.
1750         (xfont_driver): Initialize with xfont_list.
1751         (font_compare): New function.
1752         (build_font_list): Deleted.
1753         (xfont_registry_list): New function.
1754         (xfont_select): Use xfont_registry_list.
1755         (xfont_list): New function.
1756         (device_open): Adusted for the change of MDisplayInfo.
1757
1758         * font-ft.c (add_font_info): New arg languages.  Callers changed.
1759         (fc_list): Get languages from fonts..
1760         (ft_list_all): Renamed from ft_list.  Callers changed.
1761         (ft_list): New function.
1762         (mfont__ft_driver): Initalize with ft_list.
1763
1764         * font.c (mfont_list): New function.
1765
1766         * font.h (struct MFontDriver): New member `list'.
1767         (MFTInfo): New member languages.
1768
1769         * m17n-gui.h (mfont_list): Extern it.
1770
1771 2004-09-27  Kenichi Handa  <handa@m17n.org>
1772
1773         * internal-gui.h (struct MGlyphString): Delete members mt,
1774         sub_width, sub_lbrearing, sub_rbearing, and region.
1775
1776         * draw.c (MSubTextExtents): New type.
1777         (layout_glyphs): New arg extents.  Set its members.
1778         (layout_glyph_string): Adjusted for the above change.
1779         (alloc_gstring): Don't set gstring->mt.
1780         (truncate_gstring): Call line_break function with mt instead of
1781         gstring->mt.
1782
1783 2004-09-22  Kenichi Handa  <handa@m17n.org>
1784
1785         * mtext.c (count_utf_16_chars): Count each code of invalid
1786         surrogates as one.
1787
1788 2004-09-19  Kenichi Handa  <handa@m17n.org>
1789
1790         * mtext.c (default_utf_16, default_utf_32): Rename them to
1791         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
1792         changed.
1793
1794         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1795         them.
1796
1797 2004-09-13  Kenichi Handa  <handa@m17n.org>
1798
1799         * draw.c (Mlatin): Don't declare it here.
1800         (visual_order): Fix reordering of combining characters.
1801         (compose_glyph_string): Fix detection of script.
1802         (layout_glyphs): Don't fix reordering of combining characters
1803         here.
1804         (layout_glyph_string): Pay attention to
1805         control->disable_overlapping_adjustment.
1806         (truncate_gstring): Include at least on character in a line.
1807         (get_gstring): Always scan one full line.
1808         (mdraw__init): Don't initialize Mlatin here.
1809         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
1810         have a font, use ascent/descent of an ASCII font.  Allow
1811         ink_array_return and logical_array_return to be NULL.
1812         (mdraw_coordinates_position): Fix iteration.
1813
1814         * font-ft.c (MFTtoProp): Member completely changed.
1815         (ft_to_prop): Adjusted for the above change.
1816         (ft_to_prop_size): Likewise.
1817         (set_font_info): Adjusted for the change of MFTtoProp.
1818         (fc_generic_family_list): New variable.
1819         (fc_list): Add special handling of generic font names.
1820         (mfont__ft_init): Adjusted for the change of MFTtoProp.
1821         Initialize fc_generic_family_list.
1822         (mfont__ft_fini): Don't free ft_to_prop.  Free
1823         fc_generic_family_list.
1824         (FC_vs_M17N_font_prop): New type.
1825         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1826         (fc_decode_prop, fc_encode_prop): New functions.
1827         (mfont__ft_parse_name): Use fc_decode_prop.
1828         (mfont__ft_unparse_name): Use fc_encode_prop.
1829
1830         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1831         (MWDevice): Add member realized_font_list.
1832         (free_display_info): Don't free disp_info->realized_font_list.
1833         (free_device): Free device->realized_fontset_list.
1834         (xft_find_metric): Use gstring->frame instead of rfont->frame.
1835         (device_open): Don't initialize disp_info->realized_font_list.
1836         (device_open): Initialize device->realized_font_list and set it to
1837         frame->realized_font_list.
1838
1839         * fontset.c (try_font_group): New function.
1840         (mfont__lookup_fontset): Use try_font_group.
1841
1842         * font.c (common_weight): Change the order of "regular".
1843
1844         * face.c (Mlatin): Don't make it static.
1845         (mface__realize): Be sure to set work_gstring.frame.
1846         (mface__for_chars): Likewise.
1847
1848         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1849         MTEXT_FORMAT_UTF_8.
1850
1851         * internal-gui.h (Mlatin): Extern it.
1852
1853         * m17n-gui.h (MDrawControl): New member
1854         disable_overlapping_adjustment.
1855
1856 2004-09-06  Kenichi Handa  <handa@m17n.org>
1857
1858         * font-flt.c (run_otf): Fix typo ('}'->']').
1859
1860         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1861         (COMBINING_PRECOMPUTED_P): New macros.
1862
1863         * draw.c (layout_glyphs): Handle precomputed combining code.
1864
1865         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1866         precomupted combining code.
1867
1868 2004-09-03  Kenichi Handa  <handa@m17n.org>
1869
1870         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1871         otf_gstring.glyphs.
1872
1873 2004-08-27  Kenichi Handa  <handa@m17n.org>
1874
1875         * face.c (mface_put_prop): If the new value is the same as the
1876         current one, don't increment frame->tick.
1877
1878 2004-08-25  Kenichi Handa  <handa@m17n.org>
1879
1880         * fontset.c (mfontset): Initialize font_spec_list member.
1881         (mfontset_copy): Load fontset if necessary.
1882
1883         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1884         'metrics' to for C++.
1885
1886         * draw.c (mdraw_glyph_info): Adjusted for the member name change
1887         (this -> metics).
1888
1889 2004-08-16  Kenichi Handa  <handa@m17n.org>
1890
1891         * Version 1.1.0 released.
1892
1893 2004-08-13  Kenichi Handa  <handa@m17n.org>
1894
1895         * language.c (mlang__init): Add Dhivehi.
1896
1897         * m17n-gui.c (Mx, Mfreetype): Delete it.
1898         (m17n_init_win): Don't initialize Mx and Mfreetype here.
1899
1900         * m17n-gui.h (Mfreetype, Mxft): Extern them.
1901         (mfont_resize_ratio): Extern it.
1902         (MDrawGlyphInfo): New member logical_width;
1903         (MDrawGlyph): New type.
1904         (mdraw_glyph_list): Prototype adjusted.
1905
1906         * m17n-X.c (xfont_open): Set type and fontp members.
1907         (xft_open): Likewise.
1908
1909         * internal-gui.h (Mx, Mfreetype): Delete extern.
1910
1911         * font.h (struct MRealizedFont): New member type and fontp.
1912
1913         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1914         (Mx, Mfreetype): Declare here.
1915         (Mxft): New variable.
1916         (mfont_resize_ratio): New function.
1917
1918         * font-ft.c (ft_open): Set type and fontp members.
1919
1920         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
1921         glyph_code member.
1922
1923 2004-08-11  Kenichi Handa  <handa@m17n.org>
1924
1925         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1926         FT_LOAD_DEFAULT.
1927
1928 2004-08-06  Kenichi Handa  <handa@m17n.org>
1929
1930         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1931         feature to apply.
1932
1933         * font-flt.c (run_otf): Print debugging information if necessary.
1934
1935 2004-08-05  Kenichi Handa  <handa@m17n.org>
1936
1937         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
1938         positioning_type 5 and 6.  Switch simplified.
1939
1940 2004-08-04  Kenichi Handa  <handa@m17n.org>
1941
1942         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1943
1944 2004-08-02  Kenichi Handa  <handa@m17n.org>
1945
1946         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1947         set val to 1 even if it is greater than 1.
1948
1949         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1950
1951 2004-07-29  Kenichi Handa  <handa@m17n.org>
1952
1953         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1954         debugging information.
1955
1956         * internal.h (MDEBUG_PRINT5): New macro.
1957
1958         * draw.c (layout_glyphs): Don't combine a zero width glyph with
1959         the previous one if the zero width glyph has left or right
1960         padding.
1961
1962 2004-07-26  Kenichi Handa  <handa@m17n.org>
1963
1964         * m17n-X.c (xft_render): Pay attention to members left_padding and
1965         right_padding of MGlyph.
1966
1967         * draw.c (visual_order): Allocate one more elements for arrays as
1968         a workaround of fribidi bug.
1969         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1970         instead of MGlyph->bidi_sensitive.
1971         (layout_glyph_string): Pay attentinon to
1972         control->orientation_reversed when padding at the head or tail.
1973         Fix adjustment of space glyph width.
1974         (get_gstring): If cursor_width or cursor_bidi is changed, don't
1975         use a cache.
1976
1977         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1978         instead of MGlyph->bidi_sensitive.
1979
1980         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1981
1982 2004-07-26  Kenichi Handa  <handa@m17n.org>
1983
1984         * draw.c (visual_order): Don't treat combined glyphs specially.
1985         (layout_glyphs): Don't get metrics glyphs that are already ready.
1986         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
1987         width with the previous one. 
1988         (draw_background): Fix bar cursor position on a r2l glyph.
1989
1990         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1991         (run_rule): Fix place of updating cluster_begin_pos and
1992         cluster_end_pos here.
1993         (run_otf): Don't set left_padding.
1994
1995         * font-ft.c (adjust_anchor): Type of argument `code' changed.
1996         Caller changed.
1997         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1998         Fix handling of GPOS.
1999         (mfont__ft_drive_gpos): Delete this function.
2000
2001         * font.h (mfont__ft_drive_otf): Renamed back from
2002         mfont__ft_drive_gsub.
2003         (mfont__ft_drive_gpos): Delete extern.
2004
2005         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
2006         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
2007
2008 2004-07-23  Kenichi Handa  <handa@m17n.org>
2009
2010         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
2011         the same bidi level.
2012
2013         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
2014
2015 2004-07-22  Kenichi Handa  <handa@m17n.org>
2016
2017         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
2018
2019 2004-07-20  Kenichi Handa  <handa@m17n.org>
2020
2021         * draw.c (render_glyphs): Fix checking of g->code validity.
2022
2023         * face.c (mface__realize): Set g.type.
2024
2025 2004-07-18  Kenichi Handa  <handa@m17n.org>
2026
2027         * Makefile.am: Prepend ${top_srcdir} to all *.la in
2028         *_LIBADD/*_LDADD.
2029
2030         * m17n-gui.c (mframe): Print error message give by dlopen to
2031         stderr.
2032
2033 2004-07-16  Kenichi Handa  <handa@m17n.org>
2034
2035         * draw.c (compose_glyph_string): Improve the way of deciding a
2036         script.  For a character that doesn't have script property, use
2037         the last non-latin script.
2038
2039         * font-ft.c (fc_list): Cancel previous change.
2040         (mfont__ft_init): Add more entries in ft_to_prop_name.
2041
2042 2004-07-15  Kenichi Handa  <handa@m17n.org>
2043
2044         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
2045         previous or next character glyphs.
2046
2047 2004-07-14  Kenichi Handa  <handa@m17n.org>
2048
2049         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
2050         of type GLYPH_SPACE.
2051
2052         * fontset.c (mfont__lookup_fontset): If glyph type is
2053         GLYPH_SPACE, get codes for SPACE.
2054
2055         * internal-gui.h (Mfont): Delete extern.
2056
2057         * m17n-gui.h (Mfont): Delete duplicated extern.
2058
2059 2004-07-13  Kenichi Handa  <handa@m17n.org>
2060
2061         * font-ft.c (DEVICE_DELTA): New macro.
2062         (adjust_anchor): New function.
2063         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
2064         only GSUB.
2065         (mfont__ft_drive_gpos): New function.
2066
2067         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
2068         (FontLayoutContext): Delete member `rfont'.
2069         (run_otf): Set g->otf_cmd.  Call 
2070         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
2071         only whne HAVE_OTF is defined.
2072
2073         * fontset.c: Include "config.h".
2074
2075         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
2076         (MGlyph): New member otf_cmd.
2077
2078         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
2079         (mfont__ft_drive_gpos): Extern it.
2080
2081         * face.c: Include "config.h".
2082
2083         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
2084
2085         * input-gui.c: Include "config.h".
2086
2087         * plist.c: Include "config.h".
2088
2089 2004-07-06  Kenichi Handa  <handa@m17n.org>
2090
2091         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
2092         internal-gui.h: Cancel previous changes.
2093
2094         * m17n-gd.h: Delete it.
2095
2096         * Makefile.am (libm17n_core_la_LIBADD): New variable.
2097         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
2098         @XML2_LD_FLAGS@ to above.
2099         (libm17n_la_LIBADD): Add -ldl.
2100         (libm17n_la_LDFLAGS): Add -export-dynamic.
2101         (X_LD_FLAGS): Fix the order of linking.
2102         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
2103         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
2104         (libm17n_X_la_LDFLAGS): Add -module.
2105         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
2106         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
2107         (libm17n_gd_la_LDFLAGS): Add -module.
2108         (include_HEADERS): Delete m17n-gd.h.
2109
2110 2004-06-30  Kenichi Handa  <handa@m17n.org>
2111
2112         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
2113         (MDeviceLibraryInterface): Delete it.
2114         (register_device_library): Delete it.
2115         (m17n__device_library_list): Renamed from device_library_list.
2116
2117         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
2118         (m17n_init_win): Adjust prototype.
2119
2120         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
2121         (m17n_init_gd): New function. 
2122
2123         * m17n-gd.h: New file.
2124
2125         * m17n-X.h: Include <m17n-gui.h>.
2126         (m17n_init_X): Extern it.
2127         (M17N_INIT): Redefine it.
2128
2129         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
2130         (m17n_init_X): New function.
2131
2132         * internal-gui.h (m17n__device_library_list): Extern it.
2133         (struct MDeviceDriver): New members initialized, init, and fini.
2134
2135         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
2136         @XFT2_LD_FLAGS@.
2137         (libm17n_X_la_LIBADD): Delete aboves.
2138         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
2139         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
2140         (libm17n_gd_la_LDFLAGS): Delete it.
2141         (include_HEADERS): Add m17n-gd.h.
2142
2143 2004-06-25  Kenichi Handa  <handa@m17n.org>
2144
2145         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
2146         (libm17n_gd_la_LDFLAGS): Cancel previous change.
2147
2148         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
2149
2150         * font-ft.c (fc_list): If FcFontList finds no font, try
2151         FcFontMatch.
2152
2153         * draw.c (compose_glyph_string): Terminate the last loop after
2154         doing default combining if necessary.
2155
2156 2004-06-24  Kenichi Handa  <handa@m17n.org>
2157
2158         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
2159
2160         * character.c (mchar_define_property): Add const to an arg.
2161
2162         * charset.c (mchar_define_charset): Add const to an arg.
2163
2164         * coding.c (MCodingSystem): Add const to an arg or decoder.
2165         (finish_decoding): Add const to an arg.
2166         (decode_coding_charset, decode_coding_utf_8)
2167         (decode_coding_utf_16, decode_coding_utf_32)
2168         (decode_coding_iso_2022, decode_coding_sjis)
2169         (mconv_define_coding): Likewise.
2170
2171         * m17n-X.c (xft_find_metric): Delete unused variable.
2172
2173         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
2174         prototypes.
2175
2176         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
2177         prototypes.
2178
2179         * mtext.c (count_utf_8_chars, count_utf_16_chars)
2180         (mtext__from_data, mtext_from_data): Add `const' to an arg.
2181
2182         * mtext.h (mtext__from_data): Ajust prototype.
2183
2184 2004-06-23  Kenichi Handa  <handa@m17n.org>
2185
2186         * draw.c (compose_glyph_string): Always get glyph codes by
2187         mface__for_char.
2188         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
2189         (mdraw_glyph_list): New function.
2190
2191         * font-flt.c (mfont__flt_run): Be sure to call
2192         rfont->driver->encode_char.
2193
2194         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
2195         (ft_encode_char): Delete arg C.
2196         (ft_render): Don't call FT_Get_Char_Index.
2197
2198         * font.c (mfont__encodable_p): Delete it.
2199         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
2200
2201         * font.h (struct MFontDriver): Delete arg C of encode_char.
2202         (mfont__encodable_p): Delete extern.
2203
2204         * m17n-X.c (xfont_encode_char): Delete arg C.
2205         (xft_find_metric): Don't cal FT_Get_Char_Index.
2206         (xft_render): Likewise.
2207
2208         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
2209         logical_width.
2210         (mdraw_glyph_list): Extern it.
2211
2212         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
2213
2214 2004-06-22  Kenichi Handa  <handa@m17n.org>
2215
2216         * m17n-gui.h (mfontset_lookup): Extern it.
2217
2218         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
2219
2220         * fontset.c (realize_fontset_elements)
2221         (free_realized_fontset_elements, update_fontset_elements): New
2222         functions.
2223         (mfont__realize_fontset): Call realize_fontset_elements.
2224         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
2225         (mfont__lookup_fontset): If a fontset was modified, update
2226         the realized fontset.
2227         (mfontset_modify_entry): Increment fontset->tick.
2228         (mfontset_lookup): New function.
2229
2230 2004-06-21  Kenichi Handa  <handa@m17n.org>
2231
2232         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
2233
2234         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
2235         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
2236         length of source text 0.
2237
2238 2004-06-21  Kenichi Handa  <handa@m17n.org>
2239
2240         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
2241         (compare): Pay attention to format other than utf-8.
2242         (copy): Delete this function.
2243         (count_by_utf_8, count_by_utf_16, insert): New functions.
2244         (count_utf_16_chars): Fix handling of a surrogate pair.
2245         (find_char_forward, find_char_backward): Likewise.
2246         (mtext__from_data): Delete unnecessary check.  Fix number of
2247         allocated bytes.
2248         (mtext_from_data): Don't count items.
2249         (mtext_ref_char): Optimize the code.
2250         (mtext_set_char): Pay attention to format other than utf-8.
2251         (mtext_cat_char): Likewise.
2252         (mtext_dup): Don't call copy, instead do allocation here.
2253         (mtext_cat): Call insert instead of copy.
2254         (mtext_ncat): Likewise.
2255         (mtext_cpy): Delete character at first and call insert instead of
2256         copy.
2257         (mtext_ncpy): Likewise.
2258         (mtext_copy): Likewise.
2259         (mtext_duplicate): Call insert instead of copy.
2260         (mtext_del): Pay attention to format other than utf-8.
2261         (mtext_ins): Simply call insert.
2262         (mtext_ins_char): Pay attention to format other than utf-8.
2263         (mtext_tok): Call insert instead of copy.
2264         (mtext_text): Call UNIT_BYTES.
2265
2266         * textprop.c (mtext__adjust_plist_for_change): New function.
2267
2268         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
2269         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
2270         (CHAR_UNITS_AT): Fix typo.
2271         (CHAR_UNITS_BY_HEAD): Fix typo.
2272         (STRING_CHAR_AND_UNITS): Fix typo.
2273
2274         * internal.h (MTEXT_READ_ONLY_P): New macro. 
2275
2276         * mtext.h (mtext__replace): Delete the extern.
2277         (mtext__adjust_foramt): Adjust prototype.
2278
2279         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2280         if possible.  Otherwise make a copy of mmt.
2281
2282         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2283         utf-8.
2284
2285 2004-06-18  Kenichi Handa  <handa@m17n.org>
2286
2287         * character.h (CHAR_STRING_UTF16): Fix syntax.
2288
2289 2004-06-16  Kenichi Handa  <handa@m17n.org>
2290
2291         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2292         (libm17n_X_la_LIBADD): Delete it.
2293         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2294
2295         * m17n-X.c (device_open): Add parens in `if' condition.
2296
2297         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2298         (DEC_POSITION): Likewise.
2299         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2300
2301 2004-06-15  Kenichi Handa  <handa@m17n.org>
2302
2303         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2304         by language.
2305
2306         * draw.c (compose_glyph_string): If langauge is specified, call
2307         mface__for_chars even if a text is all latin.  Fix condition for
2308         setting non_ascii_found.
2309
2310         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2311
2312         * m17n.h (minput_char_to_key): Delete extern.
2313
2314         * m17n-gui.h (minput_event_to_key): Cancel previous change.
2315
2316         * m17n-gui.c (null_device_open): Set several members of frame.
2317
2318 2004-06-14  Kenichi Handa  <handa@m17n.org>
2319
2320         * m17n-gui.h (minput_event_to_key): Delete extern.
2321
2322         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2323
2324         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2325
2326         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2327
2328 2004-06-08  Kenichi Handa  <handa@m17n.org>
2329
2330         * character.c (mchar_put_prop): Don't increment the ref-count of
2331         record->table.
2332
2333 2004-06-04  Kenichi Handa  <handa@m17n.org>
2334
2335         * m17n-core.c (mdebug__register_object): New function.
2336         (mdebug__unregister_object): Likewise.
2337
2338         * internal.h (mdebug__register_object, mdebug__unregister_object):
2339         Extern them.
2340         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2341         respectively.
2342
2343         * charset.c (mcharset__load_from_database): Don't call
2344         mconv__register_charset_coding here.
2345
2346         * coding.c (find_coding): Get a real name from an element of
2347         coding_definition_list.
2348         (mconv__register_charset_coding): Set the real name at the top of
2349         param.
2350         (mcoding__load_from_database): Likewise.
2351         (mconv_list_codings): Adjusted for the above change.
2352
2353 2004-06-03  Kenichi Handa  <handa@m17n.org>
2354
2355         * coding.c (find_coding): Find by canonicalized name.  Don't have
2356         to modify the element of coding_definition_list by
2357         mplist__from_plist.
2358         (mconv__define_coding_from_charset): Delete it.
2359         (mconv__register_charset_coding): Canonicalize sym.
2360         (mcoding__load_from_database): Register plist modified by
2361         mplist__from_plist.
2362
2363         * coding.h (mconv__define_coding_from_charset): Don't extern it.
2364
2365         * font-ft.c (ft_open): Fix setting of rfont->descent.
2366
2367 2004-06-02  Kenichi Handa  <handa@m17n.org>
2368
2369         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2370         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2371         (xlfd_unparse_name): Renamed from xfont_build_name.
2372         (mfont__init): Initialized Mfontconfig.
2373         (mfont__free_realized): Unconditionally unref rfont->info.
2374         (mfont__select): Free `this' if it's not best.
2375         (mfont__open): Don't check frame->realized_font_list.
2376         (mfont__parse_name_into_font): New function.
2377         (Mfontconfig): New variable.
2378         (mfont_from_name): Call mfont_parse_name.
2379         (mfont_name): Call mfont_unparse_name.
2380         (mdebug_dump_font): Likewise.
2381
2382         * font.h (struct MFontDriver): Delete members parse_name and
2383         build_name.
2384         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2385         (mfont__parse_name_into_font): Extern it.
2386
2387         * font-ft.c: Include "symbol.h".
2388         (close_ft): Unconditionally free filename and charmap_list of
2389         ft_into.
2390         (ft_open): Duplicate base->filename.  Increment ref-count of
2391         ft_info->charmap_list.  Free ft_info->charmap_list and
2392         ft_info->filename on error.
2393         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2394
2395         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2396         xfont_build_name.
2397         (enum xlfd_field_idx): Moved to font.c.
2398         (split_font_name, build_font_name): Likewise.
2399         (build_font_list): Call mfont__parse_name_info_font.
2400         (xfont_open): Call mfont__unparse_name.  Free name.
2401         (xfont_parse_name, xfont_build_name): Moved to font.c
2402         (xft_select): Prototype deleted.
2403         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2404         Call mfont_pase_name.
2405
2406         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2407         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2408         (mframe): Likewise.
2409
2410         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2411         Extern them.
2412
2413         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2414
2415 2004-06-01  Kenichi Handa  <handa@m17n.org>
2416
2417         * fontset.c (mfontset_modify_entry): Pay attention to the case
2418         that fontset->font_spec_list is NULL.
2419
2420 2004-05-31  Kenichi Handa  <handa@m17n.org>
2421
2422         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2423
2424         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2425
2426         * font.c (mfont__select): Print score the a font for debugging.
2427
2428         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2429
2430         * coding.c (reset_coding_sjis): Check kanji and kana instead of
2431         kanji_sym and kana_sym.
2432
2433 2004-05-28  Kenichi Handa  <handa@m17n.org>
2434
2435         * Makefile.am (VINFO): New variable.
2436         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2437         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2438
2439 2004-05-27  Kenichi Handa  <handa@m17n.org>
2440
2441         The following chanages are to make device dependent functions
2442         accessible only from MDeviceDriver structure, and to add GD and
2443         null device drivers.  Font drivers get also device dependent.
2444
2445         * m17n.c (m17n_init): Increament shell_initialized.
2446         (m17n_fini): Decremented shell_initialized.
2447
2448         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2449
2450         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2451         (Mwidget, Mcolormap, Mx): Extern them.
2452
2453         * m17n-gui.c: Include <dlfcn.h> and "config.h".
2454         (free_frame): Call frame->driver->close instead of
2455         mwin__close_device.
2456         (DLOPEN_SHLIB_EXT): New macro.
2457         (MDeviceLibraryInterface): New type.
2458         (device_library_list): New variable.
2459         (register_device_library): New function.
2460         (null_device): New variable.
2461         (null_device_close, null_device_get_prop)
2462         (null_device_realize_face, null_device_free_realized_face): New
2463         function.
2464         (null_driver): New variable.
2465         (null_device_init, null_device_fini, null_device_open): New
2466         functions.
2467         (null_interface): New variable.
2468         (Mfreetype, Mdevice): Declare them.
2469         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
2470         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2471         Mwin__Close_Device.  Register drivers for Mx and Mgd.
2472         (m17n_fini_win): Decremented win_initialized.  Call "fini"
2473         function of all opened devices.  Don't call mwin__fini.
2474         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2475         Declare them here.
2476         (mframe): Handle Mdevice key of PLIST.
2477         (mframe_get_prop): Call frame->device->get_prop instead of
2478         mwin__device_get_prop.
2479
2480         * m17n-gd.c: New file.
2481
2482         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2483         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2484
2485         * m17n-core.c (m17n_init_core): Increate core_initialized.
2486         (m17n_fini_core): Decremented core_initialized.
2487
2488         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2489         (Mcolormap): Don't extern them here.
2490
2491         * m17n-X.c (FRAME_DEVICE): New macro.
2492         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2493         (free_display_info): Use MPLIST_DO.
2494         (free_device): Free rface->info.
2495         (xft_close): Delete it.
2496         (device_init): Renamed from mwin__init.
2497         (device_fini): Renamed from mwin__fini.
2498         (device_open): Renamed from mwin__open_device.
2499         (x_driver): New variable.
2500         (MXFontInfo): Delete member frame, add member display.
2501         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2502         Don't declare them here.
2503
2504         * internal-gui.h (MDeviceType): New enum.
2505         (MWDefice): Delete it.
2506         (struct MFrame): Change type of device to void *.  New members
2507         device_type, driver, font_driver_list.
2508         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2509         (MDeviceDriver): New type.
2510         (Mx, Mgd, Mfreetype): Extern them.
2511         (mwin__XXX): Delete all of them.
2512
2513         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2514         mwin__XXX.
2515         (win_destroy_ic): Likewise.
2516         (adjust_window_and_draw): Likewise.
2517         (win_callback): Likewise.
2518         (Mxim): Declare it here.
2519         (minput_event_to_key): Call M_CHECK_READABLE.
2520
2521         * fontset.c (mfont__lookup_fontset): Delete local variable
2522         font_group.
2523
2524         * font.h (struct MFontDriver): Delete member close, add members
2525         parse_name and build_name.
2526         (mfont__driver_list): Delete extern.
2527         (mfont__close): Delete extern.
2528
2529         * font.c (mfont__init): Don't set mfont__driver_list.
2530         (mfont__fini): Don't unref mfont__driver_list.
2531         (mfont__select): Try font drivers in frame->font_driver_list.  Set
2532         driver member of a realized font.
2533         (mfont__close): Delete it.
2534         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2535         functions of the default frame.
2536
2537         * font-ft.c (close_ft): Check ft_info->ft_face and work
2538         differently.
2539         (add_font_info): Allocate ft_info by M17N_OBJECT.
2540         (ft_close): Delete it.
2541         (mfont__ft_driver): Don't set ft_close.
2542         (ft_select): Increment ref-count of best_font.
2543         (ft_open): Decremented ref-count of base.  On error, call
2544         FT_Done_Face and free ft_info.
2545         (ft_find_metric): Always use XXX_MONO in load_flags.
2546         (ft_render): Fix setting of width.  Call
2547         frame->driver->draw_points instead of mwin__draw_points.
2548         (ft_to_prop): Don't set mfont__driver_list.
2549         (mfont__ft_fini): Just unref ft_info.
2550
2551         * face.c (mface__init): Exchange foreground and background of
2552         mface__default.  Call mface_put_prop to set hline of
2553         mface_underline,
2554         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2555         (mface__free_realized): Don't call mwin__free_realized_face.
2556
2557         * draw.c (Mdepth): Don't declare it here.
2558         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2559         (render_glyphs, render_glyph_string): Likewise.
2560         (mdraw__init): Don't set Mdepth.
2561         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2562         M_CHECK_WRITABLE.
2563         (mdraw_text_per_char_extents): Return 0 on success and -1 on
2564         error.
2565         (mdraw_text_items): Check FRAME is writable.
2566         (mdraw_per_char_extents): Implement body.
2567
2568         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2569         libm17n-gd.la.
2570         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2571         (GUI_SOURCES): Delete it.
2572         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2573         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2574         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2575         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2576         (linkgui_LDADD): Set to libm17n-gui.la
2577         (linkgui_LDFLAGS): New target.
2578         (SRC): Include ${libm17n_gui_la_SOURCES} and
2579         ${libm17n_gd_la_SOURCES}.
2580
2581 2004-05-24  Kenichi Handa  <handa@m17n.org>
2582
2583         * draw.c (draw_background): Don't draw background even if
2584         rface->face.property[MFACE_BACKGROUND] is not Mnil.
2585
2586 2004-05-22  Kenichi Handa  <handa@m17n.org>
2587
2588         * m17n-X.c (xft_open_font): Fix anti_alias setting.
2589
2590 2004-05-20  Kenichi Handa  <handa@m17n.org>
2591
2592         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2593
2594         * m17n-gui.c: Include "plist.h".
2595         (mframe): If PLIST is NULL, initialize it to emply plist.
2596
2597         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2598         (xft_driver): New variable.
2599         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2600         (xft_find_metric, xft_render): New function.
2601         (mwin__init): Adjusted for the new mfont__driver_list.
2602         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
2603         generated face to PARAM.
2604         (mwin__realize_face): Fix setting of box colors.  Don't call hook
2605         function here.
2606         (mwin__draw_hline): New function.
2607         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2608         (mwin__xft_render): Delete these function.
2609
2610         * internal-gui.h (struct MFrame): New member tick.
2611         (struct MGlyphString): New member tick.
2612         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2613         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2614         (mwin__xft_render): Delete extern.
2615
2616         * fontset.c (mfont__lookup_fontset): Make the code simpler.
2617         (mfontset): Always increment the reference count of returned
2618         object.
2619
2620         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2621         (MFTInfo): Moved to font.h.
2622         (ft_iso8859_1_font_list): Delete this variable.
2623         (set_font_info): Don't set font->property[MFONT_TYPE].
2624         (set_font_info): Don't udpate ft_iso8859_1_font_list.
2625         (add_font_info): Change type to void.
2626         (fc_list): Change anme from xft_list.  Caller changed.  Include
2627         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2628         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
2629         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2630         (close_ft): Don't call mwin__xft_close.  Unref
2631         ft_info->extra_info.
2632         (ft_open): Don't setup ft_info->fontname.  Don't call
2633         mwin__xft_open.
2634         (ft_find_metric): Don't call mwin__xft_get_metric.
2635         (ft_encode_char): Call rfont->driver->open instead of ft_open.
2636         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
2637         (mfont__ft_init): Adjusted for new mfont__driver_list.
2638         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2639
2640         * font.c (mfont__driver_list): Make it MPlist.
2641         (mfont__init): Adjust initialization of mfont__driver_list.
2642         (mfont__fini): Free mfont__driver_list.
2643         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2644         (mfont__select): Adjusted for the new mfont__driver_list.
2645
2646         * font.h (enum MFontProperty): Delete MFONT_TYPE.
2647         (mfont__drirver_list): Adjust prototype.
2648         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
2649
2650         * face.h (struct MFace): Delete member realized_face_list, add
2651         member frame_list.
2652         (struct MRealizedFace): Delete member need_update
2653         andnofont_rface, add member non_ascii_list.
2654         (mface__update_frame_face): Extern it.
2655
2656         * face.c (hline_prop_list, box_prop_list, noop_hook): New
2657         variables.
2658         (get_hline_create, get_box_create): New functions.
2659         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
2660         Use memcmp.
2661         (free_face): Cancep previous change.  Free face->frame_list.
2662         (serialize_hline): Do nothing if hline->width is zero.
2663         (serialize_box): Do nothing if box->width is zero.
2664         (mface__init): Setup all properties of mface__default.
2665         (mface__fini): Free hline_prop_list and box_prop_list.
2666         (mface__realize): Cancel previous change.  Update
2667         face->frame_list.  Setup rface->non_ascii_list.
2668         (mface__for_chars): Update rface->non_ascii_list.
2669         (mface__free_realized): Free rface->non_ascii_list.
2670         (mface__update_frame_face): New function.
2671         (mface): Initialize face->frame_list.
2672         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
2673         properties.
2674         (mface_merge): Likewise.
2675         (mface_put_prop): If key is Mhline or Mbox, get value by
2676         get_hline_create or get_box_create respectively.
2677         (mface_put_prop): Update frame->tick and call
2678         mface__update_frame_face if necessary.
2679         (mface_update): Do nothing if func is noop_hook.
2680
2681         * draw.c (render_glyphs): If a font is not found, use
2682         mwin__draw_empty_boxes.
2683         (alloc_gstring): Initialize gstring->tick.
2684         (get_gstring): Check gstring->tick.
2685
2686 2004-05-17  Kenichi Handa  <handa@m17n.org>
2687
2688         * face.c (find_realized_face): Return value changed.  If RFONT is
2689         NULL, avoid unnecessary checking.
2690         (free_face): Free face->realized_face_list.
2691         (mface__realize): Adjusted for the change of find_realized_face.
2692         If it returns a realized face that needs update, free it and
2693         realize a new one.  Push a new realized face to
2694         frame->realized_face_list instead of appending.
2695         (mface__for_chars): Adjusted for the change of find_realized_face.
2696         Short cut if the required font is in rface->ascii_rface.
2697         (mface_put_prop): Free old value if necessary.  Set need_update
2698         member of realized faces to 1.
2699
2700         * face.h (struct MFace): Delete member tick, add member
2701         realized_face_list.
2702         (struct MRealizedFace): Delete member tick, add member
2703         need_update.
2704
2705 2004-05-13  Kenichi Handa  <handa@m17n.org>
2706
2707         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2708
2709 2004-05-12  Kenichi Handa  <handa@m17n.org>
2710
2711         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2712
2713         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2714         parse it XftNameParse.
2715
2716         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2717         (all_fonts_scaned): New variable.
2718         (set_font_info): FAMILY may be Mnil.
2719         (add_font_info): Argument changed.
2720         (xft_list): Call add_font_info in it.
2721         (ft_list): Likewise.
2722         (ft_select): Make it work in the case family is Mnil.
2723         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2724         (mfont__ft_fini): Set all_fonts_scaned to 0.
2725
2726         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2727         that is failed to open.
2728
2729 2004-05-10  Kenichi Handa  <handa@m17n.org>
2730
2731         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2732         device's depth is 1 (i.e. monochrome).
2733
2734         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2735         to work around the problem of libtool.
2736
2737         * font-ft.c: Include <freetype/ftbdf.h>.
2738         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2739         variables.
2740         (mfont__ft_init): Initialize them.
2741         (ft_iso8859_1_font_list): New variable.
2742         (set_font_info): Detect a font containing iso8859-1 glyphs and
2743         register it in ft_iso8859_1_font_list.  If the font is not
2744         scalable, assume it as BDF or PCF font and setup SIZE and RESY
2745         properties of the font from its properties.
2746         (add_font_list): If the font is not scalable, check if it is BDF
2747         or PCF font.  If not, ignore it.
2748         (ft_select): If FAMILY is Mnil, return NULL only if the requested
2749         registry is not iso8859-1.
2750         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2751         ft_iso8859_1_font_list.
2752         (ft_find_metric): If the font is not scalable, assume it as BDF
2753         or PCF, and get a metric from its properties.
2754         (mfont__ft_fini): Free ft_iso8859_1_font_list.
2755
2756 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
2757
2758         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2759         (libm17n_la_LDFLAGS): Delete it.
2760         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2761         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2762
2763 2004-05-06  Kenichi Handa  <handa@m17n.org>
2764
2765         * draw.c (compose_glyph_string): Fix previous change.
2766
2767 2004-04-30  Kenichi Handa  <handa@m17n.org>
2768
2769         * font-ft.c (ft_list): Delete unused variable `result'.
2770         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2771
2772 2004-04-27  Kenichi Handa  <handa@m17n.org>
2773
2774         * m17n-X.c: Include config.h
2775         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2776         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2777         (MWDevice) [HAVE_XFT2]: New member xft_draw.
2778         (FRAME_CMAP, FRAME_VISUAL): New macros.
2779         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2780         (xfont_driver): Make it static.
2781         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2782         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2783         info->xft_color_back.
2784         (MXftFontInfo) [HAVE_XFT2]: New type.
2785         (mwin__xft_close) [HAVE_XFT2]: New function.
2786         (mwin__xft_open) [HAVE_XFT2]: New function.
2787         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2788         (mwin__xft_render) [HAVE_XFT2]: New function.
2789
2790         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2791         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2792         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2793         externs.
2794
2795         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2796
2797         * font-ft.c: Don't include FT_FREETYPE_H here.
2798         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2799         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2800         (MFTInfo): New member charmap_index.
2801         (MFTInfo) [HAVE_XFT2]: New member xft_info.
2802         (check_otf_filename): Renamed from check_filename.  Return value
2803         changed.
2804         (ft_set_property): This function deleted.
2805         (set_font_info): New function.
2806         (add_font_list): Argument changed.  Add multiple fonts.
2807         (xft_list) [HAVE_XFT2]: New function.
2808         (ft_list) [not HAVE_XFT2]: New function.
2809         (ft_select): Add code for Xft.
2810         (close_ft): Likewise.
2811         (ft_open): Likewise.
2812         (ft_find_metric): Likewise.
2813         (ft_encode_char): Likewise.
2814         (ft_render): Likewise.
2815
2816         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2817
2818 2004-04-26  Kenichi Handa  <handa@m17n.org>
2819
2820         * textprop.c (mtext_attach_property): Declare the return type as
2821         `int'.
2822
2823 2004-04-21  Kenichi Handa  <handa@m17n.org>
2824
2825         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2826
2827 2004-04-09  Kenichi Handa  <handa@m17n.org>
2828
2829         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2830         seq_to.
2831         (load_command): Setup above members.
2832
2833 2004-04-05  Kenichi Handa  <handa@m17n.org>
2834
2835         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2836
2837 2004-03-30  Kenichi Handa  <handa@m17n.org>
2838
2839         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2840         >= 0x10000.
2841
2842         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2843         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2844
2845 2004-03-29  Kenichi Handa  <handa@m17n.org>
2846
2847         * Version 1.0 Patch Level 2 released.
2848
2849 2004-03-29  Kenichi Handa  <handa@m17n.org>
2850
2851         * charset.c (make_charset): Set charset->fully_loaded and
2852         charset->simple correctly.  Don't try to get charset->min_char and
2853         charset->max_char for a charset of method subset and superset.
2854         Don't load a mapping file here.
2855         (mcharset__init): Set unified_max.
2856         (mcharset__load_from_database): Free a working plist.
2857
2858         * coding.c (mcoding__fini): Free all malloced data.
2859
2860         * input-gui.c (win_create_ic): Set control.as_image for preediting
2861         to 0.
2862
2863         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2864         `count') to initialize the array.
2865
2866         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2867         M17N_OBJECT_UNREF.
2868
2869         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2870         rectangle.
2871         (mwin__create_window): Fix bug of setting a background pixel of a
2872         new window.
2873         (mwin__adjust_window): Clear the window before drawing.
2874
2875         * m17n-core.c (mdebug__report_object): Free array->objectes if
2876         necessary.
2877         (m17n_init_core): Don't set report_header_printed to 0 here.
2878         Fix debugging information.
2879         (m17n_fini_core): Set report_header_printed to 0 here.
2880
2881         * m17n-core.h (mplist_deserialize): Extern it.
2882
2883         * m17n-gui.c (m17n_fini_win): Fix debugging information.
2884
2885         * m17n.c (m17n_fini): Fix debugging information.
2886
2887         * mtext.c (mtext__adjust_foramt): New function.
2888
2889         * mtext.h (mtext__adjust_foramt): Extern it.
2890
2891         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2892
2893         * plist.h (mplist__deserialize): Don't extern it.
2894
2895         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
2896         elements of symbol_table to NULL.  Report about created and freed
2897         symbols if MDEBUG_FINI is set.
2898
2899 2004-03-22  Kenichi Handa  <handa@m17n.org>
2900
2901         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2902
2903         * m17n.c (m17n_init): Fix the way of checking merror_code.
2904
2905         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2906
2907 2004-03-22  Kenichi Handa  <handa@m17n.org>
2908
2909         * fontset.c (realize_font_group): Adjust the font size by
2910         mfont__resize before selecting a font.
2911
2912         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2913
2914 2004-03-19  Kenichi Handa  <handa@m17n.org>
2915
2916         * Version 1.0 Patch Level 1 released.
2917
2918 2004-03-19  Kenichi Handa  <handa@m17n.org>
2919
2920         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2921
2922         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2923
2924 2004-03-19  Kenichi Handa  <handa@m17n.org>
2925
2926         Re-apply the changes forgotten in the released version.
2927
2928         * charset.c (mcharset__load_from_database): Call
2929         mchar_define_charset.
2930
2931         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2932         (mconv_encode_range): Put Mcoding text property.
2933
2934 2004-03-18  Kenichi Handa  <handa@m17n.org>
2935
2936         * draw.c (Mdepth): New variable.
2937         (visual_order): Delete unused local var `pos'.
2938         (compose_glyph_string): Fix for the case that gstring->glyphs is
2939         realloced.  Stop generating glyphs at TO.  Fix handling of
2940         control charaters.
2941         (layout_glyphs): Get metrics of all glyphs in advance.  Set
2942         lbearing and rbearing of base of composition glyph correctly.
2943         Handle left-overhang glyphs correctly.
2944         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
2945         changed.
2946         (dump_combining_code): Change the defualt off_x character to ".".
2947         (mdraw__init): Initialize Mdepth.
2948
2949         * face.c (work_gstring): New variable
2950         (mface__init): Initialize work_gstring.
2951         (mface__fini): Free work_gstring.glyphs.
2952         (mface__realize): Don't handle videomode property here.  Adjusted
2953         for the change of mfont__get_metric.
2954         (mface__for_chars): Adjusted for the change of mfont__get_metric.
2955
2956         * face.h (enum face_gc): Moved to m17n-X.c.
2957
2958         * font.h (struct MFontDriver): Arguments of find_metric changed.
2959         (mfont__select): Prototype adjusted.
2960         (mfont__get_metric): Likewise.
2961         (mfont__ft_drive_otf): Likewise.
2962         (mfont__flt_run): Likewise.
2963         
2964         * font.c (mfont__select): New argument layouter.  If layouter is
2965         different in the registered font, make a new copy of realized
2966         font.
2967         (mfont__get_metric): Argument changed.  Get metrics of multiple
2968         glyphs.
2969         (mfont_find): Call mfont__select with layouter as Mnil.
2970
2971         * font-flt.c (FontLayoutContext): New member rfont.
2972         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2973         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
2974
2975         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
2976         multiple glyphs.
2977         (NUM_POINTS): New macro.
2978         (MPointTable): New type.
2979         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2980         (mfont__ft_drive_otf): New argument rfont.
2981
2982         * fontset.c (realize_font_group): Adjusted for the changed of
2983         mfont__select.
2984         (check_fontset_element): This function deleted.
2985
2986         * input-gui.c (adjust_window_and_draw): Locate a preedit window
2987         off the parent window if the preedit text is zero length.
2988
2989         * internal-gui.h (struct MFrame): New members foreground,
2990         background, videomode, font.
2991         (struct MGlyphString): New member anti_alias.
2992         (MDrawPoint): New type.
2993         (mwin__draw_bitmap): Prototype deleted.
2994         (mwin__draw_points): Prototype added.
2995
2996         * m17n-gui.h (MDrawControl): New member anti_alias.
2997
2998         * m17n-gui.c (free_frame): Free frame->font.
2999         (mframe): Set the fontset of frame->face to the default fontset.
3000
3001         * m17n-X.c (RGB_GC): New type.
3002         (enum gc_index): Renamed from enum face_gc.  Member names changed.
3003         (GCInfo): New typel
3004         (struct MWDevice): Members foreground and background deleted.  New
3005         member scratch_gc, gc_list.
3006         (DEFAULT_FONT, FALLBACK_FONT): New macros.
3007         (free_device): Free GCs in device->gc_list.
3008         (get_rgb_gc): New function.
3009         (get_gc): Renamed and argument changed from get_color.
3010         (get_gc_for_anti_alias): New function.
3011         (xfont_find_metric): Arguments changed.  Get metrics of multiple
3012         glyphs.
3013         (set_region): Argument changed.  Caller changed.
3014         (xfont_render): Allways set a font in gc.
3015         (x_error_handler, x_io_error_handler): Define only if
3016         X_SET_ERROR_HANDLER is defined.
3017         (mwin__open_device): Create device->scratch_gc.  Set members
3018         foreground, background, and videomode of frame.  Call
3019         XSetErrorHandler and XSetIOErrorHandler only if
3020         X_SET_ERROR_HANDLER is defined.
3021         (struct gc_list): Deleted.
3022         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
3023         (mwin__realize_face): Adjusted for the change of the format of
3024         rface->info and the charge of set_region.
3025         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
3026         (mwin__draw_box): Likewise.
3027         (mwin__draw_bitmap): This function deleted.
3028         (mwin__draw_points): New function.
3029         (mwin__verify_region): Adjusted for the change of the format of
3030         rface->info and the charge of set_region.
3031         (mwin__create_window): Inherit backgound pixel from parent.
3032         (mwin__dump_gc): Adjusted for the change of the format of
3033         rface->info.
3034
3035 2004-03-16  Kenichi Handa  <handa@m17n.org>
3036
3037         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
3038
3039         * input.c (M_key_alias): New variable.
3040         (handle_key): Try M_key_alias property of a key too.
3041         (minput__init): Initialize M_key_alias.  Give that property to
3042         symbols in one_char_symbol.  Fix bug of initializing
3043         one_char_symbol.
3044
3045         * draw.c (compose_glyph_string): Don't handle
3046         ignore_formatting_char here.  Include formatting characters in the
3047         range processed by a FTL.
3048         (layout_glyph_string): Handle ignore_formatting_char here.
3049
3050 2004-03-12  Kenichi Handa  <handa@m17n.org>
3051
3052         * input-gui.c (win_create_ic): Enable bidi in status control.
3053
3054         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
3055
3056 2004-03-09  Kenichi Handa  <handa@m17n.org>
3057
3058         * input.c (load_input_method): If title is not specified, use the
3059         input method name as title.
3060
3061         * m17n-X.c (get_color): Make it static.
3062         (xim_create_ic, xim_destroy_ic, x_error_handler)
3063         (x_io_error_handler): Likewise.
3064
3065 2004-03-01  Kenichi Handa  <handa@m17n.org>
3066
3067         * Version 1.0 released.
3068
3069 \f
3070 Copyright (C) 2003, 2004
3071   National Institute of Advanced Industrial Science and Technology (AIST)
3072   Registration Number H15PRO112
3073
3074 This file is part of the m17n library.
3075
3076 The m17n library is free software; you can redistribute it and/or
3077 modify it under the terms of the GNU Lesser General Public License
3078 as published by the Free Software Foundation; either version 2.1 of
3079 the License, or (at your option) any later version.
3080
3081 The m17n library is distributed in the hope that it will be useful,
3082 but WITHOUT ANY WARRANTY; without even the implied warranty of
3083 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3084 Lesser General Public License for more details.
3085
3086 You should have received a copy of the GNU Lesser General Public
3087 License along with the m17n library; if not, write to the Free
3088 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
3089 02111-1307, USA.