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