*** empty log message ***
[m17n/m17n-lib.git] / src / ChangeLog
1 2005-08-18  Kenichi Handa  <handa@m17n.org>
2
3         * font-ft.c: Mostly re-written.
4
5         * font-flt.c (FontLayoutCmdOTF): This type deleted.
6         (FontLayoutCmd): Type of the member otf changed..
7         (load_otf_command): Adjusted for the format change of otf command.
8         (load_command): Likewise.
9         (free_flt_command): Unref cmd->body.otf.
10         (run_otf): Ajusted for the type change of otf_cmd.
11         (run_command): Ajusted for the type change of otf_cmd.  On
12         debugging, print ctx->combining_code.
13         (mfont__flt_run): Initialize ctx's members code_offset,
14         combining_code, and left_padding to 0.
15
16         * face.h (struct MRealizedFace): New member font.
17         (mface__realize): Prototype adjusted.
18
19         * face.c (find_realized_face): New arg font.
20         (find_realized_face): Adjusted for the change of MFont.
21         (mface__init): Call M17N_OBJECT_ADD_ARRAY.
22         (mface__fini): Don't call mdebug__report_object.
23         (mface__realize): New arg font.
24         (mface__for_chars): Adjusted for the change of mfont__encode_char.
25         Optimize the latin case.
26         (mface__free_realized): Free rface->font.
27         (mface__update_frame_face): Adjusted for the change of mface__realize.
28         (mface_equal): New function.
29
30         * draw.c (Mcommon): New variable.
31         (visual_order): Args to mfont__encode_char changed.
32         (compose_glyph_string): Handle Mfont text property.
33         (layout_glyphs): Adjusted for the change of MFont.
34         (mdraw__init): Initialize Mcommon.
35         (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
36
37         * font.h (enum MFontType): Members completely changed.
38         (enum MFontProperty): Move MFONT_SIZE to the tail.
39         (enum MFontSource): New enum.
40         (struct MFont): New members type, source, sizes, file, capability,
41         and encoding.
42         (struct MRealizedFont): Type of member font changed. Members
43         score, status, and encoding deleted.
44         (MFontScore): New type.
45         (MFontList): Member changed.
46         (struct MFontDriver): New member has_char.  Types of members
47         changed.
48         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
49         (Mapple_roman): Extern them.
50         (OTF_Tag): Typedefed if not HAVE_OTF.
51         (enum MFontOpenTypeTable): New enum.
52         (MFontCapability): New type.
53         (mfont__ft_drive_otf): Prototype adjusted.
54         (mfont__score): Extern deleted.
55         (mfont__merge): Extern it.
56         (mfont__has_char): Extern it.
57         (mfont__encode_char): Prototype adjusted.
58         (mfont__open): Extern it.
59         (mfont__set_spec): Prototype adjusted.
60         (mfont__get_capability): Extern it.
61
62         * font.c: Include "fontset.h".
63         (M_font_capability, M_font_list, M_font_list_len): New variables.
64         (font_score_priority): Change order of initial elements.
65         (font_score_shift_bits): Fix array size.
66         (common_weight): Add "thin", "semibold", and "heavy".
67         (common_stretch): Add "ultracondensed", "extracondensed",
68         "extraexpanded", and "utltraexpand".
69         (font_weight_regular, font_weight_normal, font_weight_medium): New
70         variables.
71         (gen_font_name): This function deleted.
72         (find_encoding): Set font->encoding.
73         (OTF_tag): New function.
74         (otf_script_list): New variable.
75         (load_otf_script_list): New function.
76         (find_script_from_otf_tag): New function.
77         (xlfd_parse_name): Set font->type and font->source.
78         (mfont__free_realized): Free chains rfonts.
79         (font_score): Renamed from mfont__score.
80         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
81         (Mapple_roman): New variables.
82         (mfont__init): Initilize new variables.  Initalize
83         default_encoding.encoding_name and
84         default_encoding.encoding_charset to Municode_full and
85         mcharset__unicode.  Use SAFE* macros for allocating filepath
86         buffer.
87         (mfont__fini): Free otf_script_list.
88         (mfont__id): New function.
89         (mfont__match_p): Check also capability member of MFont.
90         (mfont__merge): New funciton.
91         (mfont__set_spec_from_face): Set type and source members.
92         (mfont__set_spec_from_plist): Set capability and type members.
93         (mfont__select): Argument changed.
94         (mfont__available): New function.
95         (compare_font_score): New function.
96         (mfont__list): New function.
97         (mfont__open): Return a realized font.
98         (mfont__resize): Adjusted for the change of MFont.
99         (mfont__has_char): New function.
100         (mfont__encode_char): Argument changed.
101         (mfont__set_spec): Argument changed.
102         (free_font_capability): New function.
103         (mfont__get_capability): New function.
104         (MFontfile): New variable.
105         (mfont_get_prop): Adjusted for the change of MFont.
106         (mfont_put_prop): Likewise.
107         (mfont_set_selection_priority): Fix the way of setting
108         font_score_priority[].
109         (mfont_find): Use mfont__list instead of mfont__select.
110         (mfont_resize_ratio): Adjusted for the change of MFont.
111         (mfont_list): Use mfont__list.
112         (mfont_check): New function.
113         (font_score): Make it static.
114
115         * fontset.h (mfont__realize_fontset): Prototype adjusted.
116         (mfont__lookup_fontset): Likewise.
117
118         * fontset.c (struct MFontset): Delete member font_spec_list.
119         (struct MRealizedFontset): Type of member spec changed.  New
120         member request.
121         (load_font_group): Arg spec_list deleted.
122         (load_fontset_contents): Adjusted for the change of fontset_def.
123         (free_fontset): Fix the way of freeing fontset elements.
124         (realize_fontset_elements): Argument changed.
125         (get_per_script): New function.
126         (free_realized_fontset_elements): Fix the way of feeing rfontset
127         elements.
128         (update_fontset_elements): Fix args to realize_fontset_elements.
129         (mfont__realize_fontset): New arg spec.
130         (try_font_list): New function.
131         (try_font_group): New arg request.  Use try_font_list.
132         (mfont__lookup_fontset): New arg ignore_fallback.  Fix arg to
133         try_font_group.
134         (mfontset): Adjusted for the change of MFontset.
135         (mfontset_copy): Likewise.  Don't share plists.
136         (mfontset_modify_entry): Adjusted for the change of MFontset.
137         (mfontset_lookup): Call get_per_script.
138         (mdebug_dump_fontset): Print also the address of fonts.
139
140         * input.c (shift_state): Don't reset ic_info->vars.
141         (take_action_list): Call MDEBUG_PRINT fore calling
142         take_action_list.
143
144         * internal-gui.h (MFontDriver): Don't typedef it here.
145
146         * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
147         (MXFont): This type deleted.
148         (MFontX): New type.
149         (struct _MFontX): New struct.
150         (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
151         (MDisplayInfo): Member base_font_list deleted.
152         (DEFAULT_FONT): Definition changed.
153         (FALLBACK_FONT): This maclr deleted.
154         (free_display_info): Adjusted for the change of MDisplayInfo.
155         (free_device): Argument to mfont__free_realized changed.
156         (xfont_driver): Adjusted for the change of MFontDriver.
157         (xfont_registry_list): Use MFontX instead of MXFont.
158         (MRealizedFontX): Renamed from MXFontInfo.
159         (xfont_select): Return the font found first.
160         (close_xfont): Change MXFontInfo to MRealizedFontX.
161         (xfont_open): Return the realized font.
162         (xfont_find_metric): Get xfont from rfont->fontp.
163         (xfont_has_char): New function.
164         (xfont_encode_char): Adjusted for the argument change.
165         (xfont_render): Get xfont from rfont->fontp.
166         (xfont_list): Adjusted for the argument change.
167         (MRealizedFontXft): Renamed from MXftFontInfo.
168         (xft_driver): Ajusted for the change of MFontDriver.
169         (close_xft): Change MXtfFontInfo to MRealizedFontXft
170         (xft_open_font): Argument changed.
171         (xft_open): Argument changed.  Return the realized font.
172         (xft_find_metric): Get xft_font from rfont->fontp.
173         (xft_has_char, xft_encode_char): New functions.
174         (xft_render): Change MXftFontInfo to MRealizedFontXft.  Open a
175         font if not yet opened.
176         (device_open): Don't set frame->font.
177
178         * m17n-gd.c (gd_font_driver): Adjusted for the change of
179         MFontDriver.
180         (gd_font_open): New function.
181         (gd_render): Don't use the local variable ft_info.
182         (device_init): Adjusted for the change of gd_font_driver.
183
184         * textprop.c (mtext__prop_init): Initialize text_property_table.
185         Call M17N_OBJECT_ADD_ARRAY.
186         (mtext__prop_fini): Don't call mdebug__report_object.
187
188         * plist.c (mplist__init): Initialize plist_table.
189         (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
190         (mplist__fini): Don't call mdebug__report_object.
191
192         * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
193         (mtext__fini): Don't call mdebug__report_object.
194         (MTEXT_FORMAT_UTF_16): Correct type.
195         (mtext_data): New function.
196         (mtext_text): Fix calculation of limit and args to
197         find_char_backward.
198
199         * language.c: Include "plist.h".
200         (M_script_lang_list): New variable.
201         (mlang__init): Read languages and their information from m17n
202         database.
203         (mlanguage__list): New function.
204         (Miso639_1, Miso639_2): New variables.
205
206         * language.h (mlanguage__list): Extern it.
207
208         * database.c (get_database_stream): Use SAFE_* macros for
209         allocating and freeing path.
210         (mdatabase__init): Likewise.
211
212         * symbol.c (msymbol__fini): Don't free symbols here.
213         (msymbol__free_table): New function.
214         (msymbol_is_managing_key): New function.
215
216         * symbol.h (msymbol__free_table): Extern it.
217         (msymbol__list): Extern it.
218
219         * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
220         New macros.
221         (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
222         (struct _M17NObjectArray): New member name and next.
223         (mdebug__add_object_array): Extern it.
224         (M17N_OBJECT_ADD_ARRAY): New macro.
225         (mdebug__report_object): Don't extern it.
226
227         * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
228
229         * m17n-gui.c (free_frame): Don't free frame->font.
230         (null_device_fini): Fix code for freeing
231         null_device.realized_font_list.
232         (m17n_fini_win): Free interface.
233         (mframe): Cast the return value of dlsym.  Set frame->font here.
234         (mframe_get_prop): Check frame->rface->rfont before accessing the
235         member font.
236
237         * m17n-gui.h (Mfontfile): Extern it.
238         (mfont_check): Extern it.
239         (mface_equal): Extern it.
240
241         * m17n-core.c: Include "symbol.h".
242         (report_header_printed): This variable deleted.
243         (object_array_root): New variable.
244         (report_object_array): New function.
245         (mdebug__report_object): This function deleted.
246         (mdebug__add_object_array): New function.
247         (m17n_init_core): Call mchartable_init () before mtext_init ().
248         (m17n_fini_core): Call report_object_array (if necessary) and
249         msymbol__free_atable at the end.
250
251         * m17n-core.h (msymbol_is_managing_key): Extern it.
252         (mtext_data): Extern it.
253         (MTEXT_FORMAT_UTF_16): Correct type.
254         (M17NLIB_MINOR_VERSION): Changed to 3.
255         (M17NLIB_VERSION_NAME): Changed to "1.3.0".
256         
257         * chartab.c (mchartable__init): Initalize chartable_table.count.
258         (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
259         mdebug__report_object.
260
261 2005-05-26  Kenichi Handa  <handa@m17n.org>
262
263         * m17n.h (Miso639_1, Miso639_2): Extern them.
264
265         * symbol.h (msymbol__list): Extern it.
266
267         * symbol.c (msymbol__list): New function.
268
269 2005-05-19  Kenichi Handa  <handa@m17n.org>
270
271         * input-gui.c (minput__win_init): Don't change the value of
272         minput_driver.
273
274 2005-05-16  Kenichi Handa  <handa@m17n.org>
275
276         * m17n-core.c (m17n_object): Be sure to initialize all members.
277
278         * font-ft.c (fc_decode_prop): Fix args to msymbol.
279
280 2005-05-09  Kenichi Handa  <handa@m17n.org>
281
282         * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
283
284 2005-04-27  Kenichi Handa  <handa@m17n.org>
285
286         * language.c (mlang__init): Add "an" (Aragonese).
287
288         * word-thai.c: Add support for libthai.
289         (mtext__word_thai_init): Initialize wordseg library conditionaly.
290         (mtext__word_thai_fini): Finalize wordseg library conditionaly.
291
292         * mtext.c: Include "word-thai.h" conditionaly.
293         (mtext__init): Call mtext__word_thai_init conditionaly.
294         (mtext__fini): Call mtext__word_thai_fini conditionaly.
295
296         * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
297         not WORDCUT_LD_FLAGS.
298
299 2005-04-19  Kenichi Handa  <handa@m17n.org>
300
301         * word-thai.c (wordseg_propertize): Always unref the attached
302         property.
303         (thai_wordseg): Don't unref the property.
304
305 2005-04-18  Kenichi Handa  <handa@m17n.org>
306
307         * word-thai.c: Include stdlib.h.
308         (wordseg_propertize): Add dummy function for the case that wordcut
309         library doesn't exist.
310         (wordseg_propertize): Fix for old wordcut library.
311
312 2005-04-16  Kenichi Handa  <handa@m17n.org>
313
314         * word-thai.c: Include <stdio.h>.
315
316 2005-04-15  Kenichi Handa  <handa@m17n.org>
317
318         * draw.c: Include mtext.h.
319         (linebreak_table, M_break_at_space, M_break_at_word)
320         (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
321         (compose_glyph_string): Check POS before getting Mface text
322         property.
323         (truncate_gstring): Give correct TO arg to line_break function.
324         (GET_LB_TYPE): New macro.
325         (find_break_backward, find_break_forward): New functions.
326         (mdraw__init): Initialize the above new variables.
327         (mdraw__fini): Free linebreak_table.
328         (mdraw_default_line_break): Use find_break_backward and
329         find_break_forward.
330
331         * word-thai.c: New file.
332
333         * word-thai.h: New file.
334
335         * mtext.c: Include word-thai.h.
336         (wordseg_func_table): New variable.
337         (mtext__init): Initialize wordseg_func_table and call
338         mtext__word_thai_init.
339         (mtext__fini): Call mtext__word_thai_fini, free
340         wordseg_func_table.
341         (MTextWordsegFunc): New type.
342         (mtext__word_segment): New function.
343
344         * mtext.h (wordseg_func_table): Extern it.
345         (mtext__word_segment): Extern it.
346
347         * m17n.c (m17n_init): Fix typo (== -> =).
348
349         * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
350         (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
351
352         * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
353         (MTEXTPROP_VAL): New macros.
354
355         * input.c (DLOPEN_SHLIB_EXT): Don't define it.
356
357 2005-04-07  Kenichi Handa  <handa@m17n.org>
358
359         * database.c (load_chartable): Fix pursing of symbol name.
360
361 2005-03-24  Kenichi Handa  <handa@m17n.org>
362
363         * m17n.c (m17n_init): Fix typo (== -> =).
364
365 2005-03-11  Kenichi Handa  <handa@m17n.org>
366
367         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
368
369         * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
370
371         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
372         first.
373
374 2005-03-09  handa  <handa@m17n.org>
375
376         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
377         calling m17n_init ().
378
379         * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
380         calling m17n_init_core ().
381
382 2005-02-28  Kenichi Handa  <handa@m17n.org>
383
384         * font-flt.c (mfont__flt_run): Add resulting code sequence in
385         debug info.
386
387 2005-02-17  Kenichi Handa  <handa@m17n.org>
388
389         * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
390         (M_description, M_command, M_variable): New variables.
391         (load_im_info_keys): New variables.
392         (load_im_info, check_command_keyseq, get_description_advance)
393         (parse_command_list, get_command_list, parse_variable_list)
394         (get_variable_list, input_method_hook): New functions.
395         (command_list, variable_list): New variables.
396         (minput__init): Put input_method_hook to Minput_method.
397         Initialize M_description, M_command, M_variable, Mdetail_text,
398         load_im_info_keys, command_list, variable_list.
399         (minput__fini): Unref command_list, variable_list, load_im_info_keys.
400         (Mdetail_text): New variable.
401         (minput_get_description, minput_get_commands)
402         (minput_assign_command_keys, minput_get_variables)
403         (minput_set_variable): New functions.
404
405         * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
406         (minput_assign_command_keys, minput_get_variables)
407         (minput_set_variable): Extern them.
408
409         * plist.c (UNGETC): Just decrement st->p.
410         (read_mtext_element): New arg skip.
411         (read_integer_element): Likewise.
412         (read_symbol_element): Likewise.
413         (read_element): New arg KEYS.
414         (mplist__from_plist): Don't increment ref-count of NULL object.
415         (mplist__from_file): New arg KEYS.
416         (mplist_put): Don't increment ref-count of NULL object.
417         (mplist_add): Likewise.
418         (mplist_push): Likewise.
419         (mplist_set): Likewise.  Call M17N_OBJECT_UNREF unconditionally.
420
421         * plist.h (mplist__from_file): Prototype adjusted.
422
423         * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
424         (get_database_stream): New function.
425         (load_database): Use get_database_stream.
426         (M_database_hook): New variable
427         (mdatabase__init): Initialize M_database_hook.
428         (mdatabase__load_for_keys): New function.
429         (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
430         function.
431         (mdatabase_define): Free mdb->extra_info if necessary.
432
433         * database.h (mdatabase__dir_list, M_database_hook)
434         (mdatabase__load_for_keys): Extern them.
435         (MDatabaseHookFunc): New type.
436
437         * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
438
439 2004-12-27  Kenichi Handa  <handa@m17n.org>
440
441         * Version 1.2.0 released.
442
443 2004-12-27  Kenichi Handa  <handa@m17n.org>
444
445         * input.c (minput_filter): Don't reset ic->xxx_changed.
446
447         * mtext.c (mtext_from_data): Fix documentation.
448
449 2004-12-25  Kenichi Handa  <handa@m17n.org>
450
451         * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
452         (M17NLIB_VERSION_NAME): Update to "1.2.".
453
454 2004-12-24  Kenichi Handa  <handa@m17n.org>
455
456         * input.c (reset_ic): Set key_unhandled to 0.
457
458 2004-12-21  Kenichi Handa  <handa@m17n.org>
459
460         * m17n-gui.h (mfont_from_spec): Delete extern.
461
462         * input-gui.c (win_callback): Handle Minput_reset.
463         (minput__win_init): Register reset_ic as a callback for
464         Minput_reset.
465
466         * input.c (reset_ic): New arg IGNORE which is ignored.  Caller
467         changed.  At first, shift to the initial state.
468         (minput__init): Initialize Minput_reset.  Register reset_ic as a
469         callback for Minput_reset.
470         (Minput_reset): New variable.
471         (minput_filter): Always set ic->xxx_changed to 0.
472         (minput_reset_ic): New function.
473         (integer_value): Fix typo ('>' -> '<') and calculation of length
474         of preedit text.
475
476         * m17n-core.c (merror_code): Change type to `int'.
477
478         * m17n-misc.h (merror_code): Adjust type.
479
480         * m17n.h (Minput_reset, minput_reset_ic): Extern them.
481
482         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
483         (mtext_change_prop): Delete extern.
484
485         * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
486         to `int'.  Move the documents to m17n-core.h.
487
488 2004-12-13  Kenichi Handa  <handa@m17n.org>
489
490         * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
491         (MTextProperty): Document it.
492
493 2004-12-09  Kenichi Handa  <handa@m17n.org>
494
495         * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
496
497 2004-12-03  Kenichi Handa  <handa@m17n.org>
498
499         * internal.h (m17n__core_initialized, m17n__shell_initialized,
500         m17n__gui_initialized): New externs.
501
502         * m17n-core.h (enum M17NStatus): New enum.
503         (m17n_status): Extern it.
504
505         * m17n-core.c (core_initialized): Delete this variable.
506         (m17n__core_initialized, m17n__shell_initialized,
507         m17n__gui_initialized): New variables.
508         (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
509         instead of core_initialized.
510         (m17n_status): New function.
511
512         * m17n.c (shell_initialized): Delete this variable.
513         (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
514         shell_initialized.
515
516         * m17n-gui.h (m17n_init_win): Adjust the prototype.
517
518         * m17n-gui.c (win_initialized): Delete this variable.
519         (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
520         instead of gui_initialized.
521
522 2004-11-19  Kenichi Handa  <handa@m17n.org>
523
524         * input.c (reset_ic): Check if ic_info->state is NULL.
525         (filter): If ic_info->state is NULL, return 0.
526         (load_input_method): Don't unref `maps' it it's not created.
527
528 2004-11-15  Kenichi Handa  <handa@m17n.org>
529
530         * input.c (find_candidates_group): If INDEX is -1, find the last
531         candidate group.
532         (take_action_list): If the previous of the first candidate is
533         requested, select the last candidate.
534
535 2004-11-08  Kenichi Handa  <handa@m17n.org>
536
537         * m17n-X.c (device_open): Try at most 32 fonts to find a
538         non-autoscaled font.
539
540         * font.c (xlfd_parse_name): Fix previous change.
541
542 2004-11-05  Kenichi Handa  <handa@m17n.org>
543
544         * font.c: (commont_style): Include dummy elements "slanted" and
545         "rslanted" to prefer "o" to "r" if "i" is requested.
546
547         * font-ft.c (ft_to_prop): Fix "oblique" entry.
548
549 2004-10-29  Kenichi Handa  <handa@m17n.org>
550
551         * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
552
553         * m17n-X.c (MXFont): Change type of the member `sizes' to int.
554         New members smallest and larger.
555         (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
556         (xfont_registry_list): Likewise.
557         (xfont_select): Likewise.
558         
559
560 2004-10-28  Kenichi Handa  <handa@m17n.org>
561
562         * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
563         font name comparison.
564         (xfont_select): Fix logic for selecting a larger size font.
565
566 2004-10-25  Kenichi Handa  <handa@m17n.org>
567
568         * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
569         ">" actions.
570
571 2004-10-22  Kenichi Handa  <handa@m17n.org>
572
573         * input.c (update_candidate): Renamed from udpate_candidate.
574         (take_action_list): Show more debugging info on arithmetic commands.
575
576         * m17n-X.c (device_open): Fix previous change.
577
578         * draw.c (compose_glyph_string): Don't get face property at the
579         end of M-text.
580
581 2004-10-21  Kenichi Handa  <handa@m17n.org>
582
583         * draw.c (compose_glyph_string): Fix for the case of category
584         being Mnil.
585
586 2004-10-19  Kenichi Handa  <handa@m17n.org>
587
588         * input.c (mdebug_mask): New variable.
589         (shift_state): Print debug information.
590         (take_action_list): Likewise.
591         (handle_key): Likewise.
592
593 2004-10-14  Kenichi Handa  <handa@m17n.org>
594
595         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
596
597 2004-10-13  Kenichi Handa  <handa@m17n.org>
598
599         * m17n-X.c (device_open): Be sure to register at least one font
600         driver.
601
602         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
603         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
604
605 2004-10-12  Kenichi Handa  <handa@m17n.org>
606
607         * draw.c (alloc_gstring): Fix previous change.
608
609         * font-ft.c (ft_list_generic): Fix for the case of not
610         HAVE_FONTCONFIG.
611
612         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
613
614         * font.c (mfont_list): If no font is found, return NULL.
615         (load_font_encoding_table): Put entries of nil registry first.
616         (find_encoding): Adjust for the above change.
617
618 2004-10-11  Kenichi Handa  <handa@m17n.org>
619
620         * m17n-gui.h (mfont_list): Adjust prototype.
621
622         * m17n-X.c (xfont_list): New arg maxnum.
623
624         * font.h (struct MFontDriver): Change prototype of <list>.
625
626         * font-ft.c (fc_generic_family_list): Delete it.
627         (Mserif, Msans_serif, Mmonospace): Delete them.
628         (M_generic_family_info): New variable.
629         (enum GenericFamilyType): New enum.
630         (struct GenericFamilyInfo): New struct.
631         (generic_family_table): New variable.
632         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
633         iso8859-1.
634         (add_font_info): Get style here.
635         (ft_list_family): Don't initialize fc_config here.  Don't list
636         generic families.
637         (ft_list_generic): New function.
638         (ft_select): Pay attention to generic familes here.
639         (ft_open): Fix calculation of ascent and descent.
640         (ft_list): Pay attention to generic families.
641         (mfont__ft_init): Initialize M_generic_family_info,
642         generic_family_table, and fc_config..
643         (mfont__ft_fini): Finalize generic_family_table.
644
645         * draw.c (compose_glyph_string): Use more constant font for
646         glyphs.  Adjust for the member change in MGlyph.
647         (layout_glyph_string): Adjust for the member change in MGlyph.
648         (alloc_gstring): Intilize scracth_glyph to avoid
649         compose_glyph_string on it.
650         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
651         (mdraw_coordinates_position): Fix previous change.
652
653         * internal-gui.h (glyph_category): New enum.
654         (MGlyph): Change type of <category> to enum glyph_category.
655
656         * face.c (mface__realize): Delete args langauge and charset.
657         (mface__for_chars): Fix for the case that glyphs have different
658         rfaces.
659         (mface__update_frame_face): Adjust for mface__realize change.
660
661         * face.h (mface__realize): Adjust prototype.
662
663 2004-10-05  Kenichi Handa  <handa@m17n.org>
664
665         * language.c (mlang__init): Add Akan.
666
667 2004-10-04  Kenichi Handa  <handa@m17n.org>
668
669         * font-ft.c (add_font_info): Add instead of push the element.
670         (ft_list_family): For generic fonts, try all
671         substituted. families.
672
673         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
674         (run_rule): Don't update cluster range here.
675         (run_command): Update cluster range on appending a glyph.
676         (run_otf): Update cluster range for glyphs generated by OTF.
677
678 2004-10-02  Kenichi Handa  <handa@m17n.org>
679
680         * m17n-X.c (device_open): Handle Mfont key in PLIST.
681
682 2004-09-30  Kenichi Handa  <handa@m17n.org>
683
684         * font-ft.c (ft_select): Ignore family on calling mfont__score.
685
686 2004-09-30  Kenichi Handa  <handa@m17n.org>
687
688         * font.h: Include <fontconfig/fontconfig.h>.
689         (MFTInfo): New member langset.
690         (mfont__encoding_list): Extern it.
691
692         * font.c (mfont__encoding_list): New function.
693         (mdebug_dump_font_list): New function.
694
695         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
696         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
697         variables.
698         (ft_family_list): New variable.
699         (set_font_info): New arg basep.  Callers changed.
700         (fc_list): Check the return value of FcPatternGetString.
701         (add_font_info): New arg plist.  Callers changed. Update
702         ft_family_list.
703         (ft_list_family): New function (merged fc_list and ft_list_all).
704         (ft_select): Use ft_list_family.
705         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
706         typo (== -> !=).
707         (mfont__ft_init): Initialize above new variables.
708         (mfont__ft_fini): Free ft_family_list.
709         (STRDUP_LOWER): New macro.
710         (set_font_info): Use STRDUP_LOWER.
711         (ft_list_family): Avoid duplicate addition of font path.  Use
712         STRDUP_LOWER.
713         (fc_decode_prop): Fix typo.
714
715         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
716         (xfont_registry_list): Change argument disp_info to frame.
717         Callers changed.
718         (xfont_list_all): New function.
719         (xfont_list): If FONT is not NULL, check all fonts.
720
721 2004-09-28  Kenichi Handa  <handa@m17n.org>
722
723         * m17n-X.c (MXFont, MXFontList): New types.
724         (MDisplayInfo): Delete members font_registry_list,
725         iso8859_1_family_list, iso10646_1_family_list, new members
726         font_list, base_font_list.
727         (free_display_info): Adusted for the change of MDisplayInfo.
728         (xfont_driver): Initialize with xfont_list.
729         (font_compare): New function.
730         (build_font_list): Deleted.
731         (xfont_registry_list): New function.
732         (xfont_select): Use xfont_registry_list.
733         (xfont_list): New function.
734         (device_open): Adusted for the change of MDisplayInfo.
735
736         * font-ft.c (add_font_info): New arg languages.  Callers changed.
737         (fc_list): Get languages from fonts..
738         (ft_list_all): Renamed from ft_list.  Callers changed.
739         (ft_list): New function.
740         (mfont__ft_driver): Initalize with ft_list.
741
742         * font.c (mfont_list): New function.
743
744         * font.h (struct MFontDriver): New member `list'.
745         (MFTInfo): New member languages.
746
747         * m17n-gui.h (mfont_list): Extern it.
748
749 2004-09-27  Kenichi Handa  <handa@m17n.org>
750
751         * internal-gui.h (struct MGlyphString): Delete members mt,
752         sub_width, sub_lbrearing, sub_rbearing, and region.
753
754         * draw.c (MSubTextExtents): New type.
755         (layout_glyphs): New arg extents.  Set its members.
756         (layout_glyph_string): Adjusted for the above change.
757         (alloc_gstring): Don't set gstring->mt.
758         (truncate_gstring): Call line_break function with mt instead of
759         gstring->mt.
760
761 2004-09-22  Kenichi Handa  <handa@m17n.org>
762
763         * mtext.c (count_utf_16_chars): Count each code of invalid
764         surrogates as one.
765
766 2004-09-19  Kenichi Handa  <handa@m17n.org>
767
768         * mtext.c (default_utf_16, default_utf_32): Rename them to
769         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
770         changed.
771
772         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
773         them.
774
775 2004-09-13  Kenichi Handa  <handa@m17n.org>
776
777         * draw.c (Mlatin): Don't declare it here.
778         (visual_order): Fix reordering of combining characters.
779         (compose_glyph_string): Fix detection of script.
780         (layout_glyphs): Don't fix reordering of combining characters
781         here.
782         (layout_glyph_string): Pay attention to
783         control->disable_overlapping_adjustment.
784         (truncate_gstring): Include at least on character in a line.
785         (get_gstring): Always scan one full line.
786         (mdraw__init): Don't initialize Mlatin here.
787         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
788         have a font, use ascent/descent of an ASCII font.  Allow
789         ink_array_return and logical_array_return to be NULL.
790         (mdraw_coordinates_position): Fix iteration.
791
792         * font-ft.c (MFTtoProp): Member completely changed.
793         (ft_to_prop): Adjusted for the above change.
794         (ft_to_prop_size): Likewise.
795         (set_font_info): Adjusted for the change of MFTtoProp.
796         (fc_generic_family_list): New variable.
797         (fc_list): Add special handling of generic font names.
798         (mfont__ft_init): Adjusted for the change of MFTtoProp.
799         Initialize fc_generic_family_list.
800         (mfont__ft_fini): Don't free ft_to_prop.  Free
801         fc_generic_family_list.
802         (FC_vs_M17N_font_prop): New type.
803         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
804         (fc_decode_prop, fc_encode_prop): New functions.
805         (mfont__ft_parse_name): Use fc_decode_prop.
806         (mfont__ft_unparse_name): Use fc_encode_prop.
807
808         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
809         (MWDevice): Add member realized_font_list.
810         (free_display_info): Don't free disp_info->realized_font_list.
811         (free_device): Free device->realized_fontset_list.
812         (xft_find_metric): Use gstring->frame instead of rfont->frame.
813         (device_open): Don't initialize disp_info->realized_font_list.
814         (device_open): Initialize device->realized_font_list and set it to
815         frame->realized_font_list.
816
817         * fontset.c (try_font_group): New function.
818         (mfont__lookup_fontset): Use try_font_group.
819
820         * font.c (common_weight): Change the order of "regular".
821
822         * face.c (Mlatin): Don't make it static.
823         (mface__realize): Be sure to set work_gstring.frame.
824         (mface__for_chars): Likewise.
825
826         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
827         MTEXT_FORMAT_UTF_8.
828
829         * internal-gui.h (Mlatin): Extern it.
830
831         * m17n-gui.h (MDrawControl): New member
832         disable_overlapping_adjustment.
833
834 2004-09-06  Kenichi Handa  <handa@m17n.org>
835
836         * font-flt.c (run_otf): Fix typo ('}'->']').
837
838         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
839         (COMBINING_PRECOMPUTED_P): New macros.
840
841         * draw.c (layout_glyphs): Handle precomputed combining code.
842
843         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
844         precomupted combining code.
845
846 2004-09-03  Kenichi Handa  <handa@m17n.org>
847
848         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
849         otf_gstring.glyphs.
850
851 2004-08-27  Kenichi Handa  <handa@m17n.org>
852
853         * face.c (mface_put_prop): If the new value is the same as the
854         current one, don't increment frame->tick.
855
856 2004-08-25  Kenichi Handa  <handa@m17n.org>
857
858         * fontset.c (mfontset): Initialize font_spec_list member.
859         (mfontset_copy): Load fontset if necessary.
860
861         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
862         'metrics' to for C++.
863
864         * draw.c (mdraw_glyph_info): Adjusted for the member name change
865         (this -> metics).
866
867 2004-08-16  Kenichi Handa  <handa@m17n.org>
868
869         * Version 1.1.0 released.
870
871 2004-08-13  Kenichi Handa  <handa@m17n.org>
872
873         * language.c (mlang__init): Add Dhivehi.
874
875         * m17n-gui.c (Mx, Mfreetype): Delete it.
876         (m17n_init_win): Don't initialize Mx and Mfreetype here.
877
878         * m17n-gui.h (Mfreetype, Mxft): Extern them.
879         (mfont_resize_ratio): Extern it.
880         (MDrawGlyphInfo): New member logical_width;
881         (MDrawGlyph): New type.
882         (mdraw_glyph_list): Prototype adjusted.
883
884         * m17n-X.c (xfont_open): Set type and fontp members.
885         (xft_open): Likewise.
886
887         * internal-gui.h (Mx, Mfreetype): Delete extern.
888
889         * font.h (struct MRealizedFont): New member type and fontp.
890
891         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
892         (Mx, Mfreetype): Declare here.
893         (Mxft): New variable.
894         (mfont_resize_ratio): New function.
895
896         * font-ft.c (ft_open): Set type and fontp members.
897
898         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
899         glyph_code member.
900
901 2004-08-11  Kenichi Handa  <handa@m17n.org>
902
903         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
904         FT_LOAD_DEFAULT.
905
906 2004-08-06  Kenichi Handa  <handa@m17n.org>
907
908         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
909         feature to apply.
910
911         * font-flt.c (run_otf): Print debugging information if necessary.
912
913 2004-08-05  Kenichi Handa  <handa@m17n.org>
914
915         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
916         positioning_type 5 and 6.  Switch simplified.
917
918 2004-08-04  Kenichi Handa  <handa@m17n.org>
919
920         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
921
922 2004-08-02  Kenichi Handa  <handa@m17n.org>
923
924         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
925         set val to 1 even if it is greater than 1.
926
927         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
928
929 2004-07-29  Kenichi Handa  <handa@m17n.org>
930
931         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
932         debugging information.
933
934         * internal.h (MDEBUG_PRINT5): New macro.
935
936         * draw.c (layout_glyphs): Don't combine a zero width glyph with
937         the previous one if the zero width glyph has left or right
938         padding.
939
940 2004-07-26  Kenichi Handa  <handa@m17n.org>
941
942         * m17n-X.c (xft_render): Pay attention to members left_padding and
943         right_padding of MGlyph.
944
945         * draw.c (visual_order): Allocate one more elements for arrays as
946         a workaround of fribidi bug.
947         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
948         instead of MGlyph->bidi_sensitive.
949         (layout_glyph_string): Pay attentinon to
950         control->orientation_reversed when padding at the head or tail.
951         Fix adjustment of space glyph width.
952         (get_gstring): If cursor_width or cursor_bidi is changed, don't
953         use a cache.
954
955         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
956         instead of MGlyph->bidi_sensitive.
957
958         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
959
960 2004-07-26  Kenichi Handa  <handa@m17n.org>
961
962         * draw.c (visual_order): Don't treat combined glyphs specially.
963         (layout_glyphs): Don't get metrics glyphs that are already ready.
964         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
965         width with the previous one. 
966         (draw_background): Fix bar cursor position on a r2l glyph.
967
968         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
969         (run_rule): Fix place of updating cluster_begin_pos and
970         cluster_end_pos here.
971         (run_otf): Don't set left_padding.
972
973         * font-ft.c (adjust_anchor): Type of argument `code' changed.
974         Caller changed.
975         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
976         Fix handling of GPOS.
977         (mfont__ft_drive_gpos): Delete this function.
978
979         * font.h (mfont__ft_drive_otf): Renamed back from
980         mfont__ft_drive_gsub.
981         (mfont__ft_drive_gpos): Delete extern.
982
983         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
984         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
985
986 2004-07-23  Kenichi Handa  <handa@m17n.org>
987
988         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
989         the same bidi level.
990
991         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
992
993 2004-07-22  Kenichi Handa  <handa@m17n.org>
994
995         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
996
997 2004-07-20  Kenichi Handa  <handa@m17n.org>
998
999         * draw.c (render_glyphs): Fix checking of g->code validity.
1000
1001         * face.c (mface__realize): Set g.type.
1002
1003 2004-07-18  Kenichi Handa  <handa@m17n.org>
1004
1005         * Makefile.am: Prepend ${top_srcdir} to all *.la in
1006         *_LIBADD/*_LDADD.
1007
1008         * m17n-gui.c (mframe): Print error message give by dlopen to
1009         stderr.
1010
1011 2004-07-16  Kenichi Handa  <handa@m17n.org>
1012
1013         * draw.c (compose_glyph_string): Improve the way of deciding a
1014         script.  For a character that doesn't have script property, use
1015         the last non-latin script.
1016
1017         * font-ft.c (fc_list): Cancel previous change.
1018         (mfont__ft_init): Add more entries in ft_to_prop_name.
1019
1020 2004-07-15  Kenichi Handa  <handa@m17n.org>
1021
1022         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1023         previous or next character glyphs.
1024
1025 2004-07-14  Kenichi Handa  <handa@m17n.org>
1026
1027         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1028         of type GLYPH_SPACE.
1029
1030         * fontset.c (mfont__lookup_fontset): If glyph type is
1031         GLYPH_SPACE, get codes for SPACE.
1032
1033         * internal-gui.h (Mfont): Delete extern.
1034
1035         * m17n-gui.h (Mfont): Delete duplicated extern.
1036
1037 2004-07-13  Kenichi Handa  <handa@m17n.org>
1038
1039         * font-ft.c (DEVICE_DELTA): New macro.
1040         (adjust_anchor): New function.
1041         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
1042         only GSUB.
1043         (mfont__ft_drive_gpos): New function.
1044
1045         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1046         (FontLayoutContext): Delete member `rfont'.
1047         (run_otf): Set g->otf_cmd.  Call 
1048         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
1049         only whne HAVE_OTF is defined.
1050
1051         * fontset.c: Include "config.h".
1052
1053         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1054         (MGlyph): New member otf_cmd.
1055
1056         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1057         (mfont__ft_drive_gpos): Extern it.
1058
1059         * face.c: Include "config.h".
1060
1061         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1062
1063         * input-gui.c: Include "config.h".
1064
1065         * plist.c: Include "config.h".
1066
1067 2004-07-06  Kenichi Handa  <handa@m17n.org>
1068
1069         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1070         internal-gui.h: Cancel previous changes.
1071
1072         * m17n-gd.h: Delete it.
1073
1074         * Makefile.am (libm17n_core_la_LIBADD): New variable.
1075         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1076         @XML2_LD_FLAGS@ to above.
1077         (libm17n_la_LIBADD): Add -ldl.
1078         (libm17n_la_LDFLAGS): Add -export-dynamic.
1079         (X_LD_FLAGS): Fix the order of linking.
1080         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1081         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1082         (libm17n_X_la_LDFLAGS): Add -module.
1083         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1084         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1085         (libm17n_gd_la_LDFLAGS): Add -module.
1086         (include_HEADERS): Delete m17n-gd.h.
1087
1088 2004-06-30  Kenichi Handa  <handa@m17n.org>
1089
1090         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1091         (MDeviceLibraryInterface): Delete it.
1092         (register_device_library): Delete it.
1093         (m17n__device_library_list): Renamed from device_library_list.
1094
1095         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1096         (m17n_init_win): Adjust prototype.
1097
1098         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1099         (m17n_init_gd): New function. 
1100
1101         * m17n-gd.h: New file.
1102
1103         * m17n-X.h: Include <m17n-gui.h>.
1104         (m17n_init_X): Extern it.
1105         (M17N_INIT): Redefine it.
1106
1107         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1108         (m17n_init_X): New function.
1109
1110         * internal-gui.h (m17n__device_library_list): Extern it.
1111         (struct MDeviceDriver): New members initialized, init, and fini.
1112
1113         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1114         @XFT2_LD_FLAGS@.
1115         (libm17n_X_la_LIBADD): Delete aboves.
1116         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1117         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1118         (libm17n_gd_la_LDFLAGS): Delete it.
1119         (include_HEADERS): Add m17n-gd.h.
1120
1121 2004-06-25  Kenichi Handa  <handa@m17n.org>
1122
1123         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1124         (libm17n_gd_la_LDFLAGS): Cancel previous change.
1125
1126         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1127
1128         * font-ft.c (fc_list): If FcFontList finds no font, try
1129         FcFontMatch.
1130
1131         * draw.c (compose_glyph_string): Terminate the last loop after
1132         doing default combining if necessary.
1133
1134 2004-06-24  Kenichi Handa  <handa@m17n.org>
1135
1136         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1137
1138         * character.c (mchar_define_property): Add const to an arg.
1139
1140         * charset.c (mchar_define_charset): Add const to an arg.
1141
1142         * coding.c (MCodingSystem): Add const to an arg or decoder.
1143         (finish_decoding): Add const to an arg.
1144         (decode_coding_charset, decode_coding_utf_8)
1145         (decode_coding_utf_16, decode_coding_utf_32)
1146         (decode_coding_iso_2022, decode_coding_sjis)
1147         (mconv_define_coding): Likewise.
1148
1149         * m17n-X.c (xft_find_metric): Delete unused variable.
1150
1151         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1152         prototypes.
1153
1154         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1155         prototypes.
1156
1157         * mtext.c (count_utf_8_chars, count_utf_16_chars)
1158         (mtext__from_data, mtext_from_data): Add `const' to an arg.
1159
1160         * mtext.h (mtext__from_data): Ajust prototype.
1161
1162 2004-06-23  Kenichi Handa  <handa@m17n.org>
1163
1164         * draw.c (compose_glyph_string): Always get glyph codes by
1165         mface__for_char.
1166         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1167         (mdraw_glyph_list): New function.
1168
1169         * font-flt.c (mfont__flt_run): Be sure to call
1170         rfont->driver->encode_char.
1171
1172         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1173         (ft_encode_char): Delete arg C.
1174         (ft_render): Don't call FT_Get_Char_Index.
1175
1176         * font.c (mfont__encodable_p): Delete it.
1177         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1178
1179         * font.h (struct MFontDriver): Delete arg C of encode_char.
1180         (mfont__encodable_p): Delete extern.
1181
1182         * m17n-X.c (xfont_encode_char): Delete arg C.
1183         (xft_find_metric): Don't cal FT_Get_Char_Index.
1184         (xft_render): Likewise.
1185
1186         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
1187         logical_width.
1188         (mdraw_glyph_list): Extern it.
1189
1190         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
1191
1192 2004-06-22  Kenichi Handa  <handa@m17n.org>
1193
1194         * m17n-gui.h (mfontset_lookup): Extern it.
1195
1196         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
1197
1198         * fontset.c (realize_fontset_elements)
1199         (free_realized_fontset_elements, update_fontset_elements): New
1200         functions.
1201         (mfont__realize_fontset): Call realize_fontset_elements.
1202         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
1203         (mfont__lookup_fontset): If a fontset was modified, update
1204         the realized fontset.
1205         (mfontset_modify_entry): Increment fontset->tick.
1206         (mfontset_lookup): New function.
1207
1208 2004-06-21  Kenichi Handa  <handa@m17n.org>
1209
1210         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
1211
1212         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
1213         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
1214         length of source text 0.
1215
1216 2004-06-21  Kenichi Handa  <handa@m17n.org>
1217
1218         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
1219         (compare): Pay attention to format other than utf-8.
1220         (copy): Delete this function.
1221         (count_by_utf_8, count_by_utf_16, insert): New functions.
1222         (count_utf_16_chars): Fix handling of a surrogate pair.
1223         (find_char_forward, find_char_backward): Likewise.
1224         (mtext__from_data): Delete unnecessary check.  Fix number of
1225         allocated bytes.
1226         (mtext_from_data): Don't count items.
1227         (mtext_ref_char): Optimize the code.
1228         (mtext_set_char): Pay attention to format other than utf-8.
1229         (mtext_cat_char): Likewise.
1230         (mtext_dup): Don't call copy, instead do allocation here.
1231         (mtext_cat): Call insert instead of copy.
1232         (mtext_ncat): Likewise.
1233         (mtext_cpy): Delete character at first and call insert instead of
1234         copy.
1235         (mtext_ncpy): Likewise.
1236         (mtext_copy): Likewise.
1237         (mtext_duplicate): Call insert instead of copy.
1238         (mtext_del): Pay attention to format other than utf-8.
1239         (mtext_ins): Simply call insert.
1240         (mtext_ins_char): Pay attention to format other than utf-8.
1241         (mtext_tok): Call insert instead of copy.
1242         (mtext_text): Call UNIT_BYTES.
1243
1244         * textprop.c (mtext__adjust_plist_for_change): New function.
1245
1246         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
1247         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
1248         (CHAR_UNITS_AT): Fix typo.
1249         (CHAR_UNITS_BY_HEAD): Fix typo.
1250         (STRING_CHAR_AND_UNITS): Fix typo.
1251
1252         * internal.h (MTEXT_READ_ONLY_P): New macro. 
1253
1254         * mtext.h (mtext__replace): Delete the extern.
1255         (mtext__adjust_foramt): Adjust prototype.
1256
1257         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
1258         if possible.  Otherwise make a copy of mmt.
1259
1260         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
1261         utf-8.
1262
1263 2004-06-18  Kenichi Handa  <handa@m17n.org>
1264
1265         * character.h (CHAR_STRING_UTF16): Fix syntax.
1266
1267 2004-06-16  Kenichi Handa  <handa@m17n.org>
1268
1269         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
1270         (libm17n_X_la_LIBADD): Delete it.
1271         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
1272
1273         * m17n-X.c (device_open): Add parens in `if' condition.
1274
1275         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
1276         (DEC_POSITION): Likewise.
1277         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
1278
1279 2004-06-15  Kenichi Handa  <handa@m17n.org>
1280
1281         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
1282         by language.
1283
1284         * draw.c (compose_glyph_string): If langauge is specified, call
1285         mface__for_chars even if a text is all latin.  Fix condition for
1286         setting non_ascii_found.
1287
1288         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
1289
1290         * m17n.h (minput_char_to_key): Delete extern.
1291
1292         * m17n-gui.h (minput_event_to_key): Cancel previous change.
1293
1294         * m17n-gui.c (null_device_open): Set several members of frame.
1295
1296 2004-06-14  Kenichi Handa  <handa@m17n.org>
1297
1298         * m17n-gui.h (minput_event_to_key): Delete extern.
1299
1300         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
1301
1302         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
1303
1304         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
1305
1306 2004-06-08  Kenichi Handa  <handa@m17n.org>
1307
1308         * character.c (mchar_put_prop): Don't increment the ref-count of
1309         record->table.
1310
1311 2004-06-04  Kenichi Handa  <handa@m17n.org>
1312
1313         * m17n-core.c (mdebug__register_object): New function.
1314         (mdebug__unregister_object): Likewise.
1315
1316         * internal.h (mdebug__register_object, mdebug__unregister_object):
1317         Extern them.
1318         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
1319         respectively.
1320
1321         * charset.c (mcharset__load_from_database): Don't call
1322         mconv__register_charset_coding here.
1323
1324         * coding.c (find_coding): Get a real name from an element of
1325         coding_definition_list.
1326         (mconv__register_charset_coding): Set the real name at the top of
1327         param.
1328         (mcoding__load_from_database): Likewise.
1329         (mconv_list_codings): Adjusted for the above change.
1330
1331 2004-06-03  Kenichi Handa  <handa@m17n.org>
1332
1333         * coding.c (find_coding): Find by canonicalized name.  Don't have
1334         to modify the element of coding_definition_list by
1335         mplist__from_plist.
1336         (mconv__define_coding_from_charset): Delete it.
1337         (mconv__register_charset_coding): Canonicalize sym.
1338         (mcoding__load_from_database): Register plist modified by
1339         mplist__from_plist.
1340
1341         * coding.h (mconv__define_coding_from_charset): Don't extern it.
1342
1343         * font-ft.c (ft_open): Fix setting of rfont->descent.
1344
1345 2004-06-02  Kenichi Handa  <handa@m17n.org>
1346
1347         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
1348         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
1349         (xlfd_unparse_name): Renamed from xfont_build_name.
1350         (mfont__init): Initialized Mfontconfig.
1351         (mfont__free_realized): Unconditionally unref rfont->info.
1352         (mfont__select): Free `this' if it's not best.
1353         (mfont__open): Don't check frame->realized_font_list.
1354         (mfont__parse_name_into_font): New function.
1355         (Mfontconfig): New variable.
1356         (mfont_from_name): Call mfont_parse_name.
1357         (mfont_name): Call mfont_unparse_name.
1358         (mdebug_dump_font): Likewise.
1359
1360         * font.h (struct MFontDriver): Delete members parse_name and
1361         build_name.
1362         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
1363         (mfont__parse_name_into_font): Extern it.
1364
1365         * font-ft.c: Include "symbol.h".
1366         (close_ft): Unconditionally free filename and charmap_list of
1367         ft_into.
1368         (ft_open): Duplicate base->filename.  Increment ref-count of
1369         ft_info->charmap_list.  Free ft_info->charmap_list and
1370         ft_info->filename on error.
1371         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
1372
1373         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
1374         xfont_build_name.
1375         (enum xlfd_field_idx): Moved to font.c.
1376         (split_font_name, build_font_name): Likewise.
1377         (build_font_list): Call mfont__parse_name_info_font.
1378         (xfont_open): Call mfont__unparse_name.  Free name.
1379         (xfont_parse_name, xfont_build_name): Moved to font.c
1380         (xft_select): Prototype deleted.
1381         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
1382         Call mfont_pase_name.
1383
1384         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
1385         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
1386         (mframe): Likewise.
1387
1388         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
1389         Extern them.
1390
1391         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
1392
1393 2004-06-01  Kenichi Handa  <handa@m17n.org>
1394
1395         * fontset.c (mfontset_modify_entry): Pay attention to the case
1396         that fontset->font_spec_list is NULL.
1397
1398 2004-05-31  Kenichi Handa  <handa@m17n.org>
1399
1400         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
1401
1402         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
1403
1404         * font.c (mfont__select): Print score the a font for debugging.
1405
1406         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
1407
1408         * coding.c (reset_coding_sjis): Check kanji and kana instead of
1409         kanji_sym and kana_sym.
1410
1411 2004-05-28  Kenichi Handa  <handa@m17n.org>
1412
1413         * Makefile.am (VINFO): New variable.
1414         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
1415         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
1416
1417 2004-05-27  Kenichi Handa  <handa@m17n.org>
1418
1419         The following chanages are to make device dependent functions
1420         accessible only from MDeviceDriver structure, and to add GD and
1421         null device drivers.  Font drivers get also device dependent.
1422
1423         * m17n.c (m17n_init): Increament shell_initialized.
1424         (m17n_fini): Decremented shell_initialized.
1425
1426         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
1427
1428         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
1429         (Mwidget, Mcolormap, Mx): Extern them.
1430
1431         * m17n-gui.c: Include <dlfcn.h> and "config.h".
1432         (free_frame): Call frame->driver->close instead of
1433         mwin__close_device.
1434         (DLOPEN_SHLIB_EXT): New macro.
1435         (MDeviceLibraryInterface): New type.
1436         (device_library_list): New variable.
1437         (register_device_library): New function.
1438         (null_device): New variable.
1439         (null_device_close, null_device_get_prop)
1440         (null_device_realize_face, null_device_free_realized_face): New
1441         function.
1442         (null_driver): New variable.
1443         (null_device_init, null_device_fini, null_device_open): New
1444         functions.
1445         (null_interface): New variable.
1446         (Mfreetype, Mdevice): Declare them.
1447         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
1448         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
1449         Mwin__Close_Device.  Register drivers for Mx and Mgd.
1450         (m17n_fini_win): Decremented win_initialized.  Call "fini"
1451         function of all opened devices.  Don't call mwin__fini.
1452         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
1453         Declare them here.
1454         (mframe): Handle Mdevice key of PLIST.
1455         (mframe_get_prop): Call frame->device->get_prop instead of
1456         mwin__device_get_prop.
1457
1458         * m17n-gd.c: New file.
1459
1460         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
1461         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
1462
1463         * m17n-core.c (m17n_init_core): Increate core_initialized.
1464         (m17n_fini_core): Decremented core_initialized.
1465
1466         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
1467         (Mcolormap): Don't extern them here.
1468
1469         * m17n-X.c (FRAME_DEVICE): New macro.
1470         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
1471         (free_display_info): Use MPLIST_DO.
1472         (free_device): Free rface->info.
1473         (xft_close): Delete it.
1474         (device_init): Renamed from mwin__init.
1475         (device_fini): Renamed from mwin__fini.
1476         (device_open): Renamed from mwin__open_device.
1477         (x_driver): New variable.
1478         (MXFontInfo): Delete member frame, add member display.
1479         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
1480         Don't declare them here.
1481
1482         * internal-gui.h (MDeviceType): New enum.
1483         (MWDefice): Delete it.
1484         (struct MFrame): Change type of device to void *.  New members
1485         device_type, driver, font_driver_list.
1486         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
1487         (MDeviceDriver): New type.
1488         (Mx, Mgd, Mfreetype): Extern them.
1489         (mwin__XXX): Delete all of them.
1490
1491         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
1492         mwin__XXX.
1493         (win_destroy_ic): Likewise.
1494         (adjust_window_and_draw): Likewise.
1495         (win_callback): Likewise.
1496         (Mxim): Declare it here.
1497         (minput_event_to_key): Call M_CHECK_READABLE.
1498
1499         * fontset.c (mfont__lookup_fontset): Delete local variable
1500         font_group.
1501
1502         * font.h (struct MFontDriver): Delete member close, add members
1503         parse_name and build_name.
1504         (mfont__driver_list): Delete extern.
1505         (mfont__close): Delete extern.
1506
1507         * font.c (mfont__init): Don't set mfont__driver_list.
1508         (mfont__fini): Don't unref mfont__driver_list.
1509         (mfont__select): Try font drivers in frame->font_driver_list.  Set
1510         driver member of a realized font.
1511         (mfont__close): Delete it.
1512         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
1513         functions of the default frame.
1514
1515         * font-ft.c (close_ft): Check ft_info->ft_face and work
1516         differently.
1517         (add_font_info): Allocate ft_info by M17N_OBJECT.
1518         (ft_close): Delete it.
1519         (mfont__ft_driver): Don't set ft_close.
1520         (ft_select): Increment ref-count of best_font.
1521         (ft_open): Decremented ref-count of base.  On error, call
1522         FT_Done_Face and free ft_info.
1523         (ft_find_metric): Always use XXX_MONO in load_flags.
1524         (ft_render): Fix setting of width.  Call
1525         frame->driver->draw_points instead of mwin__draw_points.
1526         (ft_to_prop): Don't set mfont__driver_list.
1527         (mfont__ft_fini): Just unref ft_info.
1528
1529         * face.c (mface__init): Exchange foreground and background of
1530         mface__default.  Call mface_put_prop to set hline of
1531         mface_underline,
1532         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
1533         (mface__free_realized): Don't call mwin__free_realized_face.
1534
1535         * draw.c (Mdepth): Don't declare it here.
1536         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
1537         (render_glyphs, render_glyph_string): Likewise.
1538         (mdraw__init): Don't set Mdepth.
1539         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
1540         M_CHECK_WRITABLE.
1541         (mdraw_text_per_char_extents): Return 0 on success and -1 on
1542         error.
1543         (mdraw_text_items): Check FRAME is writable.
1544         (mdraw_per_char_extents): Implement body.
1545
1546         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
1547         libm17n-gd.la.
1548         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
1549         (GUI_SOURCES): Delete it.
1550         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
1551         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
1552         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
1553         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
1554         (linkgui_LDADD): Set to libm17n-gui.la
1555         (linkgui_LDFLAGS): New target.
1556         (SRC): Include ${libm17n_gui_la_SOURCES} and
1557         ${libm17n_gd_la_SOURCES}.
1558
1559 2004-05-24  Kenichi Handa  <handa@m17n.org>
1560
1561         * draw.c (draw_background): Don't draw background even if
1562         rface->face.property[MFACE_BACKGROUND] is not Mnil.
1563
1564 2004-05-22  Kenichi Handa  <handa@m17n.org>
1565
1566         * m17n-X.c (xft_open_font): Fix anti_alias setting.
1567
1568 2004-05-20  Kenichi Handa  <handa@m17n.org>
1569
1570         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
1571
1572         * m17n-gui.c: Include "plist.h".
1573         (mframe): If PLIST is NULL, initialize it to emply plist.
1574
1575         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
1576         (xft_driver): New variable.
1577         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
1578         (xft_find_metric, xft_render): New function.
1579         (mwin__init): Adjusted for the new mfont__driver_list.
1580         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
1581         generated face to PARAM.
1582         (mwin__realize_face): Fix setting of box colors.  Don't call hook
1583         function here.
1584         (mwin__draw_hline): New function.
1585         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
1586         (mwin__xft_render): Delete these function.
1587
1588         * internal-gui.h (struct MFrame): New member tick.
1589         (struct MGlyphString): New member tick.
1590         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
1591         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
1592         (mwin__xft_render): Delete extern.
1593
1594         * fontset.c (mfont__lookup_fontset): Make the code simpler.
1595         (mfontset): Always increment the reference count of returned
1596         object.
1597
1598         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
1599         (MFTInfo): Moved to font.h.
1600         (ft_iso8859_1_font_list): Delete this variable.
1601         (set_font_info): Don't set font->property[MFONT_TYPE].
1602         (set_font_info): Don't udpate ft_iso8859_1_font_list.
1603         (add_font_info): Change type to void.
1604         (fc_list): Change anme from xft_list.  Caller changed.  Include
1605         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
1606         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
1607         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
1608         (close_ft): Don't call mwin__xft_close.  Unref
1609         ft_info->extra_info.
1610         (ft_open): Don't setup ft_info->fontname.  Don't call
1611         mwin__xft_open.
1612         (ft_find_metric): Don't call mwin__xft_get_metric.
1613         (ft_encode_char): Call rfont->driver->open instead of ft_open.
1614         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
1615         (mfont__ft_init): Adjusted for new mfont__driver_list.
1616         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
1617
1618         * font.c (mfont__driver_list): Make it MPlist.
1619         (mfont__init): Adjust initialization of mfont__driver_list.
1620         (mfont__fini): Free mfont__driver_list.
1621         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
1622         (mfont__select): Adjusted for the new mfont__driver_list.
1623
1624         * font.h (enum MFontProperty): Delete MFONT_TYPE.
1625         (mfont__drirver_list): Adjust prototype.
1626         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
1627
1628         * face.h (struct MFace): Delete member realized_face_list, add
1629         member frame_list.
1630         (struct MRealizedFace): Delete member need_update
1631         andnofont_rface, add member non_ascii_list.
1632         (mface__update_frame_face): Extern it.
1633
1634         * face.c (hline_prop_list, box_prop_list, noop_hook): New
1635         variables.
1636         (get_hline_create, get_box_create): New functions.
1637         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
1638         Use memcmp.
1639         (free_face): Cancep previous change.  Free face->frame_list.
1640         (serialize_hline): Do nothing if hline->width is zero.
1641         (serialize_box): Do nothing if box->width is zero.
1642         (mface__init): Setup all properties of mface__default.
1643         (mface__fini): Free hline_prop_list and box_prop_list.
1644         (mface__realize): Cancel previous change.  Update
1645         face->frame_list.  Setup rface->non_ascii_list.
1646         (mface__for_chars): Update rface->non_ascii_list.
1647         (mface__free_realized): Free rface->non_ascii_list.
1648         (mface__update_frame_face): New function.
1649         (mface): Initialize face->frame_list.
1650         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
1651         properties.
1652         (mface_merge): Likewise.
1653         (mface_put_prop): If key is Mhline or Mbox, get value by
1654         get_hline_create or get_box_create respectively.
1655         (mface_put_prop): Update frame->tick and call
1656         mface__update_frame_face if necessary.
1657         (mface_update): Do nothing if func is noop_hook.
1658
1659         * draw.c (render_glyphs): If a font is not found, use
1660         mwin__draw_empty_boxes.
1661         (alloc_gstring): Initialize gstring->tick.
1662         (get_gstring): Check gstring->tick.
1663
1664 2004-05-17  Kenichi Handa  <handa@m17n.org>
1665
1666         * face.c (find_realized_face): Return value changed.  If RFONT is
1667         NULL, avoid unnecessary checking.
1668         (free_face): Free face->realized_face_list.
1669         (mface__realize): Adjusted for the change of find_realized_face.
1670         If it returns a realized face that needs update, free it and
1671         realize a new one.  Push a new realized face to
1672         frame->realized_face_list instead of appending.
1673         (mface__for_chars): Adjusted for the change of find_realized_face.
1674         Short cut if the required font is in rface->ascii_rface.
1675         (mface_put_prop): Free old value if necessary.  Set need_update
1676         member of realized faces to 1.
1677
1678         * face.h (struct MFace): Delete member tick, add member
1679         realized_face_list.
1680         (struct MRealizedFace): Delete member tick, add member
1681         need_update.
1682
1683 2004-05-13  Kenichi Handa  <handa@m17n.org>
1684
1685         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
1686
1687 2004-05-12  Kenichi Handa  <handa@m17n.org>
1688
1689         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
1690
1691         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
1692         parse it XftNameParse.
1693
1694         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
1695         (all_fonts_scaned): New variable.
1696         (set_font_info): FAMILY may be Mnil.
1697         (add_font_info): Argument changed.
1698         (xft_list): Call add_font_info in it.
1699         (ft_list): Likewise.
1700         (ft_select): Make it work in the case family is Mnil.
1701         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
1702         (mfont__ft_fini): Set all_fonts_scaned to 0.
1703
1704         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
1705         that is failed to open.
1706
1707 2004-05-10  Kenichi Handa  <handa@m17n.org>
1708
1709         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
1710         device's depth is 1 (i.e. monochrome).
1711
1712         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
1713         to work around the problem of libtool.
1714
1715         * font-ft.c: Include <freetype/ftbdf.h>.
1716         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
1717         variables.
1718         (mfont__ft_init): Initialize them.
1719         (ft_iso8859_1_font_list): New variable.
1720         (set_font_info): Detect a font containing iso8859-1 glyphs and
1721         register it in ft_iso8859_1_font_list.  If the font is not
1722         scalable, assume it as BDF or PCF font and setup SIZE and RESY
1723         properties of the font from its properties.
1724         (add_font_list): If the font is not scalable, check if it is BDF
1725         or PCF font.  If not, ignore it.
1726         (ft_select): If FAMILY is Mnil, return NULL only if the requested
1727         registry is not iso8859-1.
1728         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
1729         ft_iso8859_1_font_list.
1730         (ft_find_metric): If the font is not scalable, assume it as BDF
1731         or PCF, and get a metric from its properties.
1732         (mfont__ft_fini): Free ft_iso8859_1_font_list.
1733
1734 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
1735
1736         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
1737         (libm17n_la_LDFLAGS): Delete it.
1738         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
1739         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
1740
1741 2004-05-06  Kenichi Handa  <handa@m17n.org>
1742
1743         * draw.c (compose_glyph_string): Fix previous change.
1744
1745 2004-04-30  Kenichi Handa  <handa@m17n.org>
1746
1747         * font-ft.c (ft_list): Delete unused variable `result'.
1748         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
1749
1750 2004-04-27  Kenichi Handa  <handa@m17n.org>
1751
1752         * m17n-X.c: Include config.h
1753         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
1754         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
1755         (MWDevice) [HAVE_XFT2]: New member xft_draw.
1756         (FRAME_CMAP, FRAME_VISUAL): New macros.
1757         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
1758         (xfont_driver): Make it static.
1759         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
1760         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
1761         info->xft_color_back.
1762         (MXftFontInfo) [HAVE_XFT2]: New type.
1763         (mwin__xft_close) [HAVE_XFT2]: New function.
1764         (mwin__xft_open) [HAVE_XFT2]: New function.
1765         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
1766         (mwin__xft_render) [HAVE_XFT2]: New function.
1767
1768         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
1769         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
1770         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
1771         externs.
1772
1773         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
1774
1775         * font-ft.c: Don't include FT_FREETYPE_H here.
1776         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
1777         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
1778         (MFTInfo): New member charmap_index.
1779         (MFTInfo) [HAVE_XFT2]: New member xft_info.
1780         (check_otf_filename): Renamed from check_filename.  Return value
1781         changed.
1782         (ft_set_property): This function deleted.
1783         (set_font_info): New function.
1784         (add_font_list): Argument changed.  Add multiple fonts.
1785         (xft_list) [HAVE_XFT2]: New function.
1786         (ft_list) [not HAVE_XFT2]: New function.
1787         (ft_select): Add code for Xft.
1788         (close_ft): Likewise.
1789         (ft_open): Likewise.
1790         (ft_find_metric): Likewise.
1791         (ft_encode_char): Likewise.
1792         (ft_render): Likewise.
1793
1794         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
1795
1796 2004-04-26  Kenichi Handa  <handa@m17n.org>
1797
1798         * textprop.c (mtext_attach_property): Declare the return type as
1799         `int'.
1800
1801 2004-04-21  Kenichi Handa  <handa@m17n.org>
1802
1803         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
1804
1805 2004-04-09  Kenichi Handa  <handa@m17n.org>
1806
1807         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
1808         seq_to.
1809         (load_command): Setup above members.
1810
1811 2004-04-05  Kenichi Handa  <handa@m17n.org>
1812
1813         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
1814
1815 2004-03-30  Kenichi Handa  <handa@m17n.org>
1816
1817         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
1818         >= 0x10000.
1819
1820         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
1821         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
1822
1823 2004-03-29  Kenichi Handa  <handa@m17n.org>
1824
1825         * Version 1.0 Patch Level 2 released.
1826
1827 2004-03-29  Kenichi Handa  <handa@m17n.org>
1828
1829         * charset.c (make_charset): Set charset->fully_loaded and
1830         charset->simple correctly.  Don't try to get charset->min_char and
1831         charset->max_char for a charset of method subset and superset.
1832         Don't load a mapping file here.
1833         (mcharset__init): Set unified_max.
1834         (mcharset__load_from_database): Free a working plist.
1835
1836         * coding.c (mcoding__fini): Free all malloced data.
1837
1838         * input-gui.c (win_create_ic): Set control.as_image for preediting
1839         to 0.
1840
1841         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
1842         `count') to initialize the array.
1843
1844         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
1845         M17N_OBJECT_UNREF.
1846
1847         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
1848         rectangle.
1849         (mwin__create_window): Fix bug of setting a background pixel of a
1850         new window.
1851         (mwin__adjust_window): Clear the window before drawing.
1852
1853         * m17n-core.c (mdebug__report_object): Free array->objectes if
1854         necessary.
1855         (m17n_init_core): Don't set report_header_printed to 0 here.
1856         Fix debugging information.
1857         (m17n_fini_core): Set report_header_printed to 0 here.
1858
1859         * m17n-core.h (mplist_deserialize): Extern it.
1860
1861         * m17n-gui.c (m17n_fini_win): Fix debugging information.
1862
1863         * m17n.c (m17n_fini): Fix debugging information.
1864
1865         * mtext.c (mtext__adjust_foramt): New function.
1866
1867         * mtext.h (mtext__adjust_foramt): Extern it.
1868
1869         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
1870
1871         * plist.h (mplist__deserialize): Don't extern it.
1872
1873         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
1874         elements of symbol_table to NULL.  Report about created and freed
1875         symbols if MDEBUG_FINI is set.
1876
1877 2004-03-22  Kenichi Handa  <handa@m17n.org>
1878
1879         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
1880
1881         * m17n.c (m17n_init): Fix the way of checking merror_code.
1882
1883         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
1884
1885 2004-03-22  Kenichi Handa  <handa@m17n.org>
1886
1887         * fontset.c (realize_font_group): Adjust the font size by
1888         mfont__resize before selecting a font.
1889
1890         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
1891
1892 2004-03-19  Kenichi Handa  <handa@m17n.org>
1893
1894         * Version 1.0 Patch Level 1 released.
1895
1896 2004-03-19  Kenichi Handa  <handa@m17n.org>
1897
1898         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
1899
1900         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
1901
1902 2004-03-19  Kenichi Handa  <handa@m17n.org>
1903
1904         Re-apply the changes forgotten in the released version.
1905
1906         * charset.c (mcharset__load_from_database): Call
1907         mchar_define_charset.
1908
1909         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
1910         (mconv_encode_range): Put Mcoding text property.
1911
1912 2004-03-18  Kenichi Handa  <handa@m17n.org>
1913
1914         * draw.c (Mdepth): New variable.
1915         (visual_order): Delete unused local var `pos'.
1916         (compose_glyph_string): Fix for the case that gstring->glyphs is
1917         realloced.  Stop generating glyphs at TO.  Fix handling of
1918         control charaters.
1919         (layout_glyphs): Get metrics of all glyphs in advance.  Set
1920         lbearing and rbearing of base of composition glyph correctly.
1921         Handle left-overhang glyphs correctly.
1922         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
1923         changed.
1924         (dump_combining_code): Change the defualt off_x character to ".".
1925         (mdraw__init): Initialize Mdepth.
1926
1927         * face.c (work_gstring): New variable
1928         (mface__init): Initialize work_gstring.
1929         (mface__fini): Free work_gstring.glyphs.
1930         (mface__realize): Don't handle videomode property here.  Adjusted
1931         for the change of mfont__get_metric.
1932         (mface__for_chars): Adjusted for the change of mfont__get_metric.
1933
1934         * face.h (enum face_gc): Moved to m17n-X.c.
1935
1936         * font.h (struct MFontDriver): Arguments of find_metric changed.
1937         (mfont__select): Prototype adjusted.
1938         (mfont__get_metric): Likewise.
1939         (mfont__ft_drive_otf): Likewise.
1940         (mfont__flt_run): Likewise.
1941         
1942         * font.c (mfont__select): New argument layouter.  If layouter is
1943         different in the registered font, make a new copy of realized
1944         font.
1945         (mfont__get_metric): Argument changed.  Get metrics of multiple
1946         glyphs.
1947         (mfont_find): Call mfont__select with layouter as Mnil.
1948
1949         * font-flt.c (FontLayoutContext): New member rfont.
1950         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
1951         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
1952
1953         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
1954         multiple glyphs.
1955         (NUM_POINTS): New macro.
1956         (MPointTable): New type.
1957         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
1958         (mfont__ft_drive_otf): New argument rfont.
1959
1960         * fontset.c (realize_font_group): Adjusted for the changed of
1961         mfont__select.
1962         (check_fontset_element): This function deleted.
1963
1964         * input-gui.c (adjust_window_and_draw): Locate a preedit window
1965         off the parent window if the preedit text is zero length.
1966
1967         * internal-gui.h (struct MFrame): New members foreground,
1968         background, videomode, font.
1969         (struct MGlyphString): New member anti_alias.
1970         (MDrawPoint): New type.
1971         (mwin__draw_bitmap): Prototype deleted.
1972         (mwin__draw_points): Prototype added.
1973
1974         * m17n-gui.h (MDrawControl): New member anti_alias.
1975
1976         * m17n-gui.c (free_frame): Free frame->font.
1977         (mframe): Set the fontset of frame->face to the default fontset.
1978
1979         * m17n-X.c (RGB_GC): New type.
1980         (enum gc_index): Renamed from enum face_gc.  Member names changed.
1981         (GCInfo): New typel
1982         (struct MWDevice): Members foreground and background deleted.  New
1983         member scratch_gc, gc_list.
1984         (DEFAULT_FONT, FALLBACK_FONT): New macros.
1985         (free_device): Free GCs in device->gc_list.
1986         (get_rgb_gc): New function.
1987         (get_gc): Renamed and argument changed from get_color.
1988         (get_gc_for_anti_alias): New function.
1989         (xfont_find_metric): Arguments changed.  Get metrics of multiple
1990         glyphs.
1991         (set_region): Argument changed.  Caller changed.
1992         (xfont_render): Allways set a font in gc.
1993         (x_error_handler, x_io_error_handler): Define only if
1994         X_SET_ERROR_HANDLER is defined.
1995         (mwin__open_device): Create device->scratch_gc.  Set members
1996         foreground, background, and videomode of frame.  Call
1997         XSetErrorHandler and XSetIOErrorHandler only if
1998         X_SET_ERROR_HANDLER is defined.
1999         (struct gc_list): Deleted.
2000         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2001         (mwin__realize_face): Adjusted for the change of the format of
2002         rface->info and the charge of set_region.
2003         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2004         (mwin__draw_box): Likewise.
2005         (mwin__draw_bitmap): This function deleted.
2006         (mwin__draw_points): New function.
2007         (mwin__verify_region): Adjusted for the change of the format of
2008         rface->info and the charge of set_region.
2009         (mwin__create_window): Inherit backgound pixel from parent.
2010         (mwin__dump_gc): Adjusted for the change of the format of
2011         rface->info.
2012
2013 2004-03-16  Kenichi Handa  <handa@m17n.org>
2014
2015         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2016
2017         * input.c (M_key_alias): New variable.
2018         (handle_key): Try M_key_alias property of a key too.
2019         (minput__init): Initialize M_key_alias.  Give that property to
2020         symbols in one_char_symbol.  Fix bug of initializing
2021         one_char_symbol.
2022
2023         * draw.c (compose_glyph_string): Don't handle
2024         ignore_formatting_char here.  Include formatting characters in the
2025         range processed by a FTL.
2026         (layout_glyph_string): Handle ignore_formatting_char here.
2027
2028 2004-03-12  Kenichi Handa  <handa@m17n.org>
2029
2030         * input-gui.c (win_create_ic): Enable bidi in status control.
2031
2032         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2033
2034 2004-03-09  Kenichi Handa  <handa@m17n.org>
2035
2036         * input.c (load_input_method): If title is not specified, use the
2037         input method name as title.
2038
2039         * m17n-X.c (get_color): Make it static.
2040         (xim_create_ic, xim_destroy_ic, x_error_handler)
2041         (x_io_error_handler): Likewise.
2042
2043 2004-03-01  Kenichi Handa  <handa@m17n.org>
2044
2045         * Version 1.0 released.
2046
2047 \f
2048 Copyright (C) 2003, 2004
2049   National Institute of Advanced Industrial Science and Technology (AIST)
2050   Registration Number H15PRO112
2051
2052 This file is part of the m17n library.
2053
2054 The m17n library is free software; you can redistribute it and/or
2055 modify it under the terms of the GNU Lesser General Public License
2056 as published by the Free Software Foundation; either version 2.1 of
2057 the License, or (at your option) any later version.
2058
2059 The m17n library is distributed in the hope that it will be useful,
2060 but WITHOUT ANY WARRANTY; without even the implied warranty of
2061 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2062 Lesser General Public License for more details.
2063
2064 You should have received a copy of the GNU Lesser General Public
2065 License along with the m17n library; if not, write to the Free
2066 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2067 02111-1307, USA.