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