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