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