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