*** empty log message ***
[m17n/m17n-lib.git] / src / ChangeLog
1 2004-10-19  Kenichi Handa  <handa@m17n.org>
2
3         * input.c (mdebug_mask): New variable.
4         (shift_state): Print debug information.
5         (take_action_list): Likewise.
6         (handle_key): Likewise.
7
8 2004-10-14  Kenichi Handa  <handa@m17n.org>
9
10         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
11
12 2004-10-13  Kenichi Handa  <handa@m17n.org>
13
14         * m17n-X.c (device_open): Be sure to register at least one font
15         driver.
16
17         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
18         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
19
20 2004-10-12  Kenichi Handa  <handa@m17n.org>
21
22         * draw.c (alloc_gstring): Fix previous change.
23
24         * font-ft.c (ft_list_generic): Fix for the case of not
25         HAVE_FONTCONFIG.
26
27         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
28
29         * font.c (mfont_list): If no font is found, return NULL.
30         (load_font_encoding_table): Put entries of nil registry first.
31         (find_encoding): Adjust for the above change.
32
33 2004-10-11  Kenichi Handa  <handa@m17n.org>
34
35         * m17n-gui.h (mfont_list): Adjust prototype.
36
37         * m17n-X.c (xfont_list): New arg maxnum.
38
39         * font.h (struct MFontDriver): Change prototype of <list>.
40
41         * font-ft.c (fc_generic_family_list): Delete it.
42         (Mserif, Msans_serif, Mmonospace): Delete them.
43         (M_generic_family_info): New variable.
44         (enum GenericFamilyType): New enum.
45         (struct GenericFamilyInfo): New struct.
46         (generic_family_table): New variable.
47         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
48         iso8859-1.
49         (add_font_info): Get style here.
50         (ft_list_family): Don't initialize fc_config here.  Don't list
51         generic families.
52         (ft_list_generic): New function.
53         (ft_select): Pay attention to generic familes here.
54         (ft_open): Fix calculation of ascent and descent.
55         (ft_list): Pay attention to generic families.
56         (mfont__ft_init): Initialize M_generic_family_info,
57         generic_family_table, and fc_config..
58         (mfont__ft_fini): Finalize generic_family_table.
59
60         * draw.c (compose_glyph_string): Use more constant font for
61         glyphs.  Adjust for the member change in MGlyph.
62         (layout_glyph_string): Adjust for the member change in MGlyph.
63         (alloc_gstring): Intilize scracth_glyph to avoid
64         compose_glyph_string on it.
65         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
66         (mdraw_coordinates_position): Fix previous change.
67
68         * internal-gui.h (glyph_category): New enum.
69         (MGlyph): Change type of <category> to enum glyph_category.
70
71         * face.c (mface__realize): Delete args langauge and charset.
72         (mface__for_chars): Fix for the case that glyphs have different
73         rfaces.
74         (mface__update_frame_face): Adjust for mface__realize change.
75
76         * face.h (mface__realize): Adjust prototype.
77
78 2004-10-05  Kenichi Handa  <handa@m17n.org>
79
80         * language.c (mlang__init): Add Akan.
81
82 2004-10-04  Kenichi Handa  <handa@m17n.org>
83
84         * font-ft.c (add_font_info): Add instead of push the element.
85         (ft_list_family): For generic fonts, try all
86         substituted. families.
87
88         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
89         (run_rule): Don't update cluster range here.
90         (run_command): Update cluster range on appending a glyph.
91         (run_otf): Update cluster range for glyphs generated by OTF.
92
93 2004-10-02  Kenichi Handa  <handa@m17n.org>
94
95         * m17n-X.c (device_open): Handle Mfont key in PLIST.
96
97 2004-09-30  Kenichi Handa  <handa@m17n.org>
98
99         * font-ft.c (ft_select): Ignore family on calling mfont__score.
100
101 2004-09-30  Kenichi Handa  <handa@m17n.org>
102
103         * font.h: Include <fontconfig/fontconfig.h>.
104         (MFTInfo): New member langset.
105         (mfont__encoding_list): Extern it.
106
107         * font.c (mfont__encoding_list): New function.
108         (mdebug_dump_font_list): New function.
109
110         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
111         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
112         variables.
113         (ft_family_list): New variable.
114         (set_font_info): New arg basep.  Callers changed.
115         (fc_list): Check the return value of FcPatternGetString.
116         (add_font_info): New arg plist.  Callers changed. Update
117         ft_family_list.
118         (ft_list_family): New function (merged fc_list and ft_list_all).
119         (ft_select): Use ft_list_family.
120         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
121         typo (== -> !=).
122         (mfont__ft_init): Initialize above new variables.
123         (mfont__ft_fini): Free ft_family_list.
124         (STRDUP_LOWER): New macro.
125         (set_font_info): Use STRDUP_LOWER.
126         (ft_list_family): Avoid duplicate addition of font path.  Use
127         STRDUP_LOWER.
128         (fc_decode_prop): Fix typo.
129
130         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
131         (xfont_registry_list): Change argument disp_info to frame.
132         Callers changed.
133         (xfont_list_all): New function.
134         (xfont_list): If FONT is not NULL, check all fonts.
135
136 2004-09-28  Kenichi Handa  <handa@m17n.org>
137
138         * m17n-X.c (MXFont, MXFontList): New types.
139         (MDisplayInfo): Delete members font_registry_list,
140         iso8859_1_family_list, iso10646_1_family_list, new members
141         font_list, base_font_list.
142         (free_display_info): Adusted for the change of MDisplayInfo.
143         (xfont_driver): Initialize with xfont_list.
144         (font_compare): New function.
145         (build_font_list): Deleted.
146         (xfont_registry_list): New function.
147         (xfont_select): Use xfont_registry_list.
148         (xfont_list): New function.
149         (device_open): Adusted for the change of MDisplayInfo.
150
151         * font-ft.c (add_font_info): New arg languages.  Callers changed.
152         (fc_list): Get languages from fonts..
153         (ft_list_all): Renamed from ft_list.  Callers changed.
154         (ft_list): New function.
155         (mfont__ft_driver): Initalize with ft_list.
156
157         * font.c (mfont_list): New function.
158
159         * font.h (struct MFontDriver): New member `list'.
160         (MFTInfo): New member languages.
161
162         * m17n-gui.h (mfont_list): Extern it.
163
164 2004-09-27  Kenichi Handa  <handa@m17n.org>
165
166         * internal-gui.h (struct MGlyphString): Delete members mt,
167         sub_width, sub_lbrearing, sub_rbearing, and region.
168
169         * draw.c (MSubTextExtents): New type.
170         (layout_glyphs): New arg extents.  Set its members.
171         (layout_glyph_string): Adjusted for the above change.
172         (alloc_gstring): Don't set gstring->mt.
173         (truncate_gstring): Call line_break function with mt instead of
174         gstring->mt.
175
176 2004-09-22  Kenichi Handa  <handa@m17n.org>
177
178         * mtext.c (count_utf_16_chars): Count each code of invalid
179         surrogates as one.
180
181 2004-09-19  Kenichi Handa  <handa@m17n.org>
182
183         * mtext.c (default_utf_16, default_utf_32): Rename them to
184         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
185         changed.
186
187         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
188         them.
189
190 2004-09-13  Kenichi Handa  <handa@m17n.org>
191
192         * draw.c (Mlatin): Don't declare it here.
193         (visual_order): Fix reordering of combining characters.
194         (compose_glyph_string): Fix detection of script.
195         (layout_glyphs): Don't fix reordering of combining characters
196         here.
197         (layout_glyph_string): Pay attention to
198         control->disable_overlapping_adjustment.
199         (truncate_gstring): Include at least on character in a line.
200         (get_gstring): Always scan one full line.
201         (mdraw__init): Don't initialize Mlatin here.
202         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
203         have a font, use ascent/descent of an ASCII font.  Allow
204         ink_array_return and logical_array_return to be NULL.
205         (mdraw_coordinates_position): Fix iteration.
206
207         * font-ft.c (MFTtoProp): Member completely changed.
208         (ft_to_prop): Adjusted for the above change.
209         (ft_to_prop_size): Likewise.
210         (set_font_info): Adjusted for the change of MFTtoProp.
211         (fc_generic_family_list): New variable.
212         (fc_list): Add special handling of generic font names.
213         (mfont__ft_init): Adjusted for the change of MFTtoProp.
214         Initialize fc_generic_family_list.
215         (mfont__ft_fini): Don't free ft_to_prop.  Free
216         fc_generic_family_list.
217         (FC_vs_M17N_font_prop): New type.
218         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
219         (fc_decode_prop, fc_encode_prop): New functions.
220         (mfont__ft_parse_name): Use fc_decode_prop.
221         (mfont__ft_unparse_name): Use fc_encode_prop.
222
223         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
224         (MWDevice): Add member realized_font_list.
225         (free_display_info): Don't free disp_info->realized_font_list.
226         (free_device): Free device->realized_fontset_list.
227         (xft_find_metric): Use gstring->frame instead of rfont->frame.
228         (device_open): Don't initialize disp_info->realized_font_list.
229         (device_open): Initialize device->realized_font_list and set it to
230         frame->realized_font_list.
231
232         * fontset.c (try_font_group): New function.
233         (mfont__lookup_fontset): Use try_font_group.
234
235         * font.c (common_weight): Change the order of "regular".
236
237         * face.c (Mlatin): Don't make it static.
238         (mface__realize): Be sure to set work_gstring.frame.
239         (mface__for_chars): Likewise.
240
241         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
242         MTEXT_FORMAT_UTF_8.
243
244         * internal-gui.h (Mlatin): Extern it.
245
246         * m17n-gui.h (MDrawControl): New member
247         disable_overlapping_adjustment.
248
249 2004-09-06  Kenichi Handa  <handa@m17n.org>
250
251         * font-flt.c (run_otf): Fix typo ('}'->']').
252
253         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
254         (COMBINING_PRECOMPUTED_P): New macros.
255
256         * draw.c (layout_glyphs): Handle precomputed combining code.
257
258         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
259         precomupted combining code.
260
261 2004-09-03  Kenichi Handa  <handa@m17n.org>
262
263         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
264         otf_gstring.glyphs.
265
266 2004-08-27  Kenichi Handa  <handa@m17n.org>
267
268         * face.c (mface_put_prop): If the new value is the same as the
269         current one, don't increment frame->tick.
270
271 2004-08-25  Kenichi Handa  <handa@m17n.org>
272
273         * fontset.c (mfontset): Initialize font_spec_list member.
274         (mfontset_copy): Load fontset if necessary.
275
276         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
277         'metrics' to for C++.
278
279         * draw.c (mdraw_glyph_info): Adjusted for the member name change
280         (this -> metics).
281
282 2004-08-16  Kenichi Handa  <handa@m17n.org>
283
284         * Version 1.1.0 released.
285
286 2004-08-13  Kenichi Handa  <handa@m17n.org>
287
288         * language.c (mlang__init): Add Dhivehi.
289
290         * m17n-gui.c (Mx, Mfreetype): Delete it.
291         (m17n_init_win): Don't initialize Mx and Mfreetype here.
292
293         * m17n-gui.h (Mfreetype, Mxft): Extern them.
294         (mfont_resize_ratio): Extern it.
295         (MDrawGlyphInfo): New member logical_width;
296         (MDrawGlyph): New type.
297         (mdraw_glyph_list): Prototype adjusted.
298
299         * m17n-X.c (xfont_open): Set type and fontp members.
300         (xft_open): Likewise.
301
302         * internal-gui.h (Mx, Mfreetype): Delete extern.
303
304         * font.h (struct MRealizedFont): New member type and fontp.
305
306         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
307         (Mx, Mfreetype): Declare here.
308         (Mxft): New variable.
309         (mfont_resize_ratio): New function.
310
311         * font-ft.c (ft_open): Set type and fontp members.
312
313         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
314         glyph_code member.
315
316 2004-08-11  Kenichi Handa  <handa@m17n.org>
317
318         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
319         FT_LOAD_DEFAULT.
320
321 2004-08-06  Kenichi Handa  <handa@m17n.org>
322
323         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
324         feature to apply.
325
326         * font-flt.c (run_otf): Print debugging information if necessary.
327
328 2004-08-05  Kenichi Handa  <handa@m17n.org>
329
330         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
331         positioning_type 5 and 6.  Switch simplified.
332
333 2004-08-04  Kenichi Handa  <handa@m17n.org>
334
335         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
336
337 2004-08-02  Kenichi Handa  <handa@m17n.org>
338
339         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
340         set val to 1 even if it is greater than 1.
341
342         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
343
344 2004-07-29  Kenichi Handa  <handa@m17n.org>
345
346         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
347         debugging information.
348
349         * internal.h (MDEBUG_PRINT5): New macro.
350
351         * draw.c (layout_glyphs): Don't combine a zero width glyph with
352         the previous one if the zero width glyph has left or right
353         padding.
354
355 2004-07-26  Kenichi Handa  <handa@m17n.org>
356
357         * m17n-X.c (xft_render): Pay attention to members left_padding and
358         right_padding of MGlyph.
359
360         * draw.c (visual_order): Allocate one more elements for arrays as
361         a workaround of fribidi bug.
362         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
363         instead of MGlyph->bidi_sensitive.
364         (layout_glyph_string): Pay attentinon to
365         control->orientation_reversed when padding at the head or tail.
366         Fix adjustment of space glyph width.
367         (get_gstring): If cursor_width or cursor_bidi is changed, don't
368         use a cache.
369
370         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
371         instead of MGlyph->bidi_sensitive.
372
373         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
374
375 2004-07-26  Kenichi Handa  <handa@m17n.org>
376
377         * draw.c (visual_order): Don't treat combined glyphs specially.
378         (layout_glyphs): Don't get metrics glyphs that are already ready.
379         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
380         width with the previous one. 
381         (draw_background): Fix bar cursor position on a r2l glyph.
382
383         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
384         (run_rule): Fix place of updating cluster_begin_pos and
385         cluster_end_pos here.
386         (run_otf): Don't set left_padding.
387
388         * font-ft.c (adjust_anchor): Type of argument `code' changed.
389         Caller changed.
390         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
391         Fix handling of GPOS.
392         (mfont__ft_drive_gpos): Delete this function.
393
394         * font.h (mfont__ft_drive_otf): Renamed back from
395         mfont__ft_drive_gsub.
396         (mfont__ft_drive_gpos): Delete extern.
397
398         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
399         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
400
401 2004-07-23  Kenichi Handa  <handa@m17n.org>
402
403         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
404         the same bidi level.
405
406         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
407
408 2004-07-22  Kenichi Handa  <handa@m17n.org>
409
410         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
411
412 2004-07-20  Kenichi Handa  <handa@m17n.org>
413
414         * draw.c (render_glyphs): Fix checking of g->code validity.
415
416         * face.c (mface__realize): Set g.type.
417
418 2004-07-18  Kenichi Handa  <handa@m17n.org>
419
420         * Makefile.am: Prepend ${top_srcdir} to all *.la in
421         *_LIBADD/*_LDADD.
422
423         * m17n-gui.c (mframe): Print error message give by dlopen to
424         stderr.
425
426 2004-07-16  Kenichi Handa  <handa@m17n.org>
427
428         * draw.c (compose_glyph_string): Improve the way of deciding a
429         script.  For a character that doesn't have script property, use
430         the last non-latin script.
431
432         * font-ft.c (fc_list): Cancel previous change.
433         (mfont__ft_init): Add more entries in ft_to_prop_name.
434
435 2004-07-15  Kenichi Handa  <handa@m17n.org>
436
437         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
438         previous or next character glyphs.
439
440 2004-07-14  Kenichi Handa  <handa@m17n.org>
441
442         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
443         of type GLYPH_SPACE.
444
445         * fontset.c (mfont__lookup_fontset): If glyph type is
446         GLYPH_SPACE, get codes for SPACE.
447
448         * internal-gui.h (Mfont): Delete extern.
449
450         * m17n-gui.h (Mfont): Delete duplicated extern.
451
452 2004-07-13  Kenichi Handa  <handa@m17n.org>
453
454         * font-ft.c (DEVICE_DELTA): New macro.
455         (adjust_anchor): New function.
456         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
457         only GSUB.
458         (mfont__ft_drive_gpos): New function.
459
460         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
461         (FontLayoutContext): Delete member `rfont'.
462         (run_otf): Set g->otf_cmd.  Call 
463         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
464         only whne HAVE_OTF is defined.
465
466         * fontset.c: Include "config.h".
467
468         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
469         (MGlyph): New member otf_cmd.
470
471         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
472         (mfont__ft_drive_gpos): Extern it.
473
474         * face.c: Include "config.h".
475
476         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
477
478         * input-gui.c: Include "config.h".
479
480         * plist.c: Include "config.h".
481
482 2004-07-06  Kenichi Handa  <handa@m17n.org>
483
484         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
485         internal-gui.h: Cancel previous changes.
486
487         * m17n-gd.h: Delete it.
488
489         * Makefile.am (libm17n_core_la_LIBADD): New variable.
490         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
491         @XML2_LD_FLAGS@ to above.
492         (libm17n_la_LIBADD): Add -ldl.
493         (libm17n_la_LDFLAGS): Add -export-dynamic.
494         (X_LD_FLAGS): Fix the order of linking.
495         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
496         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
497         (libm17n_X_la_LDFLAGS): Add -module.
498         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
499         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
500         (libm17n_gd_la_LDFLAGS): Add -module.
501         (include_HEADERS): Delete m17n-gd.h.
502
503 2004-06-30  Kenichi Handa  <handa@m17n.org>
504
505         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
506         (MDeviceLibraryInterface): Delete it.
507         (register_device_library): Delete it.
508         (m17n__device_library_list): Renamed from device_library_list.
509
510         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
511         (m17n_init_win): Adjust prototype.
512
513         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
514         (m17n_init_gd): New function. 
515
516         * m17n-gd.h: New file.
517
518         * m17n-X.h: Include <m17n-gui.h>.
519         (m17n_init_X): Extern it.
520         (M17N_INIT): Redefine it.
521
522         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
523         (m17n_init_X): New function.
524
525         * internal-gui.h (m17n__device_library_list): Extern it.
526         (struct MDeviceDriver): New members initialized, init, and fini.
527
528         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
529         @XFT2_LD_FLAGS@.
530         (libm17n_X_la_LIBADD): Delete aboves.
531         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
532         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
533         (libm17n_gd_la_LDFLAGS): Delete it.
534         (include_HEADERS): Add m17n-gd.h.
535
536 2004-06-25  Kenichi Handa  <handa@m17n.org>
537
538         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
539         (libm17n_gd_la_LDFLAGS): Cancel previous change.
540
541         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
542
543         * font-ft.c (fc_list): If FcFontList finds no font, try
544         FcFontMatch.
545
546         * draw.c (compose_glyph_string): Terminate the last loop after
547         doing default combining if necessary.
548
549 2004-06-24  Kenichi Handa  <handa@m17n.org>
550
551         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
552
553         * character.c (mchar_define_property): Add const to an arg.
554
555         * charset.c (mchar_define_charset): Add const to an arg.
556
557         * coding.c (MCodingSystem): Add const to an arg or decoder.
558         (finish_decoding): Add const to an arg.
559         (decode_coding_charset, decode_coding_utf_8)
560         (decode_coding_utf_16, decode_coding_utf_32)
561         (decode_coding_iso_2022, decode_coding_sjis)
562         (mconv_define_coding): Likewise.
563
564         * m17n-X.c (xft_find_metric): Delete unused variable.
565
566         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
567         prototypes.
568
569         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
570         prototypes.
571
572         * mtext.c (count_utf_8_chars, count_utf_16_chars)
573         (mtext__from_data, mtext_from_data): Add `const' to an arg.
574
575         * mtext.h (mtext__from_data): Ajust prototype.
576
577 2004-06-23  Kenichi Handa  <handa@m17n.org>
578
579         * draw.c (compose_glyph_string): Always get glyph codes by
580         mface__for_char.
581         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
582         (mdraw_glyph_list): New function.
583
584         * font-flt.c (mfont__flt_run): Be sure to call
585         rfont->driver->encode_char.
586
587         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
588         (ft_encode_char): Delete arg C.
589         (ft_render): Don't call FT_Get_Char_Index.
590
591         * font.c (mfont__encodable_p): Delete it.
592         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
593
594         * font.h (struct MFontDriver): Delete arg C of encode_char.
595         (mfont__encodable_p): Delete extern.
596
597         * m17n-X.c (xfont_encode_char): Delete arg C.
598         (xft_find_metric): Don't cal FT_Get_Char_Index.
599         (xft_render): Likewise.
600
601         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
602         logical_width.
603         (mdraw_glyph_list): Extern it.
604
605         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
606
607 2004-06-22  Kenichi Handa  <handa@m17n.org>
608
609         * m17n-gui.h (mfontset_lookup): Extern it.
610
611         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
612
613         * fontset.c (realize_fontset_elements)
614         (free_realized_fontset_elements, update_fontset_elements): New
615         functions.
616         (mfont__realize_fontset): Call realize_fontset_elements.
617         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
618         (mfont__lookup_fontset): If a fontset was modified, update
619         the realized fontset.
620         (mfontset_modify_entry): Increment fontset->tick.
621         (mfontset_lookup): New function.
622
623 2004-06-21  Kenichi Handa  <handa@m17n.org>
624
625         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
626
627         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
628         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
629         length of source text 0.
630
631 2004-06-21  Kenichi Handa  <handa@m17n.org>
632
633         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
634         (compare): Pay attention to format other than utf-8.
635         (copy): Delete this function.
636         (count_by_utf_8, count_by_utf_16, insert): New functions.
637         (count_utf_16_chars): Fix handling of a surrogate pair.
638         (find_char_forward, find_char_backward): Likewise.
639         (mtext__from_data): Delete unnecessary check.  Fix number of
640         allocated bytes.
641         (mtext_from_data): Don't count items.
642         (mtext_ref_char): Optimize the code.
643         (mtext_set_char): Pay attention to format other than utf-8.
644         (mtext_cat_char): Likewise.
645         (mtext_dup): Don't call copy, instead do allocation here.
646         (mtext_cat): Call insert instead of copy.
647         (mtext_ncat): Likewise.
648         (mtext_cpy): Delete character at first and call insert instead of
649         copy.
650         (mtext_ncpy): Likewise.
651         (mtext_copy): Likewise.
652         (mtext_duplicate): Call insert instead of copy.
653         (mtext_del): Pay attention to format other than utf-8.
654         (mtext_ins): Simply call insert.
655         (mtext_ins_char): Pay attention to format other than utf-8.
656         (mtext_tok): Call insert instead of copy.
657         (mtext_text): Call UNIT_BYTES.
658
659         * textprop.c (mtext__adjust_plist_for_change): New function.
660
661         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
662         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
663         (CHAR_UNITS_AT): Fix typo.
664         (CHAR_UNITS_BY_HEAD): Fix typo.
665         (STRING_CHAR_AND_UNITS): Fix typo.
666
667         * internal.h (MTEXT_READ_ONLY_P): New macro. 
668
669         * mtext.h (mtext__replace): Delete the extern.
670         (mtext__adjust_foramt): Adjust prototype.
671
672         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
673         if possible.  Otherwise make a copy of mmt.
674
675         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
676         utf-8.
677
678 2004-06-18  Kenichi Handa  <handa@m17n.org>
679
680         * character.h (CHAR_STRING_UTF16): Fix syntax.
681
682 2004-06-16  Kenichi Handa  <handa@m17n.org>
683
684         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
685         (libm17n_X_la_LIBADD): Delete it.
686         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
687
688         * m17n-X.c (device_open): Add parens in `if' condition.
689
690         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
691         (DEC_POSITION): Likewise.
692         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
693
694 2004-06-15  Kenichi Handa  <handa@m17n.org>
695
696         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
697         by language.
698
699         * draw.c (compose_glyph_string): If langauge is specified, call
700         mface__for_chars even if a text is all latin.  Fix condition for
701         setting non_ascii_found.
702
703         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
704
705         * m17n.h (minput_char_to_key): Delete extern.
706
707         * m17n-gui.h (minput_event_to_key): Cancel previous change.
708
709         * m17n-gui.c (null_device_open): Set several members of frame.
710
711 2004-06-14  Kenichi Handa  <handa@m17n.org>
712
713         * m17n-gui.h (minput_event_to_key): Delete extern.
714
715         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
716
717         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
718
719         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
720
721 2004-06-08  Kenichi Handa  <handa@m17n.org>
722
723         * character.c (mchar_put_prop): Don't increment the ref-count of
724         record->table.
725
726 2004-06-04  Kenichi Handa  <handa@m17n.org>
727
728         * m17n-core.c (mdebug__register_object): New function.
729         (mdebug__unregister_object): Likewise.
730
731         * internal.h (mdebug__register_object, mdebug__unregister_object):
732         Extern them.
733         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
734         respectively.
735
736         * charset.c (mcharset__load_from_database): Don't call
737         mconv__register_charset_coding here.
738
739         * coding.c (find_coding): Get a real name from an element of
740         coding_definition_list.
741         (mconv__register_charset_coding): Set the real name at the top of
742         param.
743         (mcoding__load_from_database): Likewise.
744         (mconv_list_codings): Adjusted for the above change.
745
746 2004-06-03  Kenichi Handa  <handa@m17n.org>
747
748         * coding.c (find_coding): Find by canonicalized name.  Don't have
749         to modify the element of coding_definition_list by
750         mplist__from_plist.
751         (mconv__define_coding_from_charset): Delete it.
752         (mconv__register_charset_coding): Canonicalize sym.
753         (mcoding__load_from_database): Register plist modified by
754         mplist__from_plist.
755
756         * coding.h (mconv__define_coding_from_charset): Don't extern it.
757
758         * font-ft.c (ft_open): Fix setting of rfont->descent.
759
760 2004-06-02  Kenichi Handa  <handa@m17n.org>
761
762         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
763         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
764         (xlfd_unparse_name): Renamed from xfont_build_name.
765         (mfont__init): Initialized Mfontconfig.
766         (mfont__free_realized): Unconditionally unref rfont->info.
767         (mfont__select): Free `this' if it's not best.
768         (mfont__open): Don't check frame->realized_font_list.
769         (mfont__parse_name_into_font): New function.
770         (Mfontconfig): New variable.
771         (mfont_from_name): Call mfont_parse_name.
772         (mfont_name): Call mfont_unparse_name.
773         (mdebug_dump_font): Likewise.
774
775         * font.h (struct MFontDriver): Delete members parse_name and
776         build_name.
777         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
778         (mfont__parse_name_into_font): Extern it.
779
780         * font-ft.c: Include "symbol.h".
781         (close_ft): Unconditionally free filename and charmap_list of
782         ft_into.
783         (ft_open): Duplicate base->filename.  Increment ref-count of
784         ft_info->charmap_list.  Free ft_info->charmap_list and
785         ft_info->filename on error.
786         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
787
788         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
789         xfont_build_name.
790         (enum xlfd_field_idx): Moved to font.c.
791         (split_font_name, build_font_name): Likewise.
792         (build_font_list): Call mfont__parse_name_info_font.
793         (xfont_open): Call mfont__unparse_name.  Free name.
794         (xfont_parse_name, xfont_build_name): Moved to font.c
795         (xft_select): Prototype deleted.
796         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
797         Call mfont_pase_name.
798
799         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
800         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
801         (mframe): Likewise.
802
803         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
804         Extern them.
805
806         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
807
808 2004-06-01  Kenichi Handa  <handa@m17n.org>
809
810         * fontset.c (mfontset_modify_entry): Pay attention to the case
811         that fontset->font_spec_list is NULL.
812
813 2004-05-31  Kenichi Handa  <handa@m17n.org>
814
815         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
816
817         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
818
819         * font.c (mfont__select): Print score the a font for debugging.
820
821         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
822
823         * coding.c (reset_coding_sjis): Check kanji and kana instead of
824         kanji_sym and kana_sym.
825
826 2004-05-28  Kenichi Handa  <handa@m17n.org>
827
828         * Makefile.am (VINFO): New variable.
829         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
830         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
831
832 2004-05-27  Kenichi Handa  <handa@m17n.org>
833
834         The following chanages are to make device dependent functions
835         accessible only from MDeviceDriver structure, and to add GD and
836         null device drivers.  Font drivers get also device dependent.
837
838         * m17n.c (m17n_init): Increament shell_initialized.
839         (m17n_fini): Decremented shell_initialized.
840
841         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
842
843         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
844         (Mwidget, Mcolormap, Mx): Extern them.
845
846         * m17n-gui.c: Include <dlfcn.h> and "config.h".
847         (free_frame): Call frame->driver->close instead of
848         mwin__close_device.
849         (DLOPEN_SHLIB_EXT): New macro.
850         (MDeviceLibraryInterface): New type.
851         (device_library_list): New variable.
852         (register_device_library): New function.
853         (null_device): New variable.
854         (null_device_close, null_device_get_prop)
855         (null_device_realize_face, null_device_free_realized_face): New
856         function.
857         (null_driver): New variable.
858         (null_device_init, null_device_fini, null_device_open): New
859         functions.
860         (null_interface): New variable.
861         (Mfreetype, Mdevice): Declare them.
862         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
863         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
864         Mwin__Close_Device.  Register drivers for Mx and Mgd.
865         (m17n_fini_win): Decremented win_initialized.  Call "fini"
866         function of all opened devices.  Don't call mwin__fini.
867         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
868         Declare them here.
869         (mframe): Handle Mdevice key of PLIST.
870         (mframe_get_prop): Call frame->device->get_prop instead of
871         mwin__device_get_prop.
872
873         * m17n-gd.c: New file.
874
875         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
876         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
877
878         * m17n-core.c (m17n_init_core): Increate core_initialized.
879         (m17n_fini_core): Decremented core_initialized.
880
881         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
882         (Mcolormap): Don't extern them here.
883
884         * m17n-X.c (FRAME_DEVICE): New macro.
885         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
886         (free_display_info): Use MPLIST_DO.
887         (free_device): Free rface->info.
888         (xft_close): Delete it.
889         (device_init): Renamed from mwin__init.
890         (device_fini): Renamed from mwin__fini.
891         (device_open): Renamed from mwin__open_device.
892         (x_driver): New variable.
893         (MXFontInfo): Delete member frame, add member display.
894         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
895         Don't declare them here.
896
897         * internal-gui.h (MDeviceType): New enum.
898         (MWDefice): Delete it.
899         (struct MFrame): Change type of device to void *.  New members
900         device_type, driver, font_driver_list.
901         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
902         (MDeviceDriver): New type.
903         (Mx, Mgd, Mfreetype): Extern them.
904         (mwin__XXX): Delete all of them.
905
906         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
907         mwin__XXX.
908         (win_destroy_ic): Likewise.
909         (adjust_window_and_draw): Likewise.
910         (win_callback): Likewise.
911         (Mxim): Declare it here.
912         (minput_event_to_key): Call M_CHECK_READABLE.
913
914         * fontset.c (mfont__lookup_fontset): Delete local variable
915         font_group.
916
917         * font.h (struct MFontDriver): Delete member close, add members
918         parse_name and build_name.
919         (mfont__driver_list): Delete extern.
920         (mfont__close): Delete extern.
921
922         * font.c (mfont__init): Don't set mfont__driver_list.
923         (mfont__fini): Don't unref mfont__driver_list.
924         (mfont__select): Try font drivers in frame->font_driver_list.  Set
925         driver member of a realized font.
926         (mfont__close): Delete it.
927         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
928         functions of the default frame.
929
930         * font-ft.c (close_ft): Check ft_info->ft_face and work
931         differently.
932         (add_font_info): Allocate ft_info by M17N_OBJECT.
933         (ft_close): Delete it.
934         (mfont__ft_driver): Don't set ft_close.
935         (ft_select): Increment ref-count of best_font.
936         (ft_open): Decremented ref-count of base.  On error, call
937         FT_Done_Face and free ft_info.
938         (ft_find_metric): Always use XXX_MONO in load_flags.
939         (ft_render): Fix setting of width.  Call
940         frame->driver->draw_points instead of mwin__draw_points.
941         (ft_to_prop): Don't set mfont__driver_list.
942         (mfont__ft_fini): Just unref ft_info.
943
944         * face.c (mface__init): Exchange foreground and background of
945         mface__default.  Call mface_put_prop to set hline of
946         mface_underline,
947         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
948         (mface__free_realized): Don't call mwin__free_realized_face.
949
950         * draw.c (Mdepth): Don't declare it here.
951         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
952         (render_glyphs, render_glyph_string): Likewise.
953         (mdraw__init): Don't set Mdepth.
954         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
955         M_CHECK_WRITABLE.
956         (mdraw_text_per_char_extents): Return 0 on success and -1 on
957         error.
958         (mdraw_text_items): Check FRAME is writable.
959         (mdraw_per_char_extents): Implement body.
960
961         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
962         libm17n-gd.la.
963         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
964         (GUI_SOURCES): Delete it.
965         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
966         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
967         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
968         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
969         (linkgui_LDADD): Set to libm17n-gui.la
970         (linkgui_LDFLAGS): New target.
971         (SRC): Include ${libm17n_gui_la_SOURCES} and
972         ${libm17n_gd_la_SOURCES}.
973
974 2004-05-24  Kenichi Handa  <handa@m17n.org>
975
976         * draw.c (draw_background): Don't draw background even if
977         rface->face.property[MFACE_BACKGROUND] is not Mnil.
978
979 2004-05-22  Kenichi Handa  <handa@m17n.org>
980
981         * m17n-X.c (xft_open_font): Fix anti_alias setting.
982
983 2004-05-20  Kenichi Handa  <handa@m17n.org>
984
985         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
986
987         * m17n-gui.c: Include "plist.h".
988         (mframe): If PLIST is NULL, initialize it to emply plist.
989
990         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
991         (xft_driver): New variable.
992         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
993         (xft_find_metric, xft_render): New function.
994         (mwin__init): Adjusted for the new mfont__driver_list.
995         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
996         generated face to PARAM.
997         (mwin__realize_face): Fix setting of box colors.  Don't call hook
998         function here.
999         (mwin__draw_hline): New function.
1000         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
1001         (mwin__xft_render): Delete these function.
1002
1003         * internal-gui.h (struct MFrame): New member tick.
1004         (struct MGlyphString): New member tick.
1005         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
1006         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
1007         (mwin__xft_render): Delete extern.
1008
1009         * fontset.c (mfont__lookup_fontset): Make the code simpler.
1010         (mfontset): Always increment the reference count of returned
1011         object.
1012
1013         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
1014         (MFTInfo): Moved to font.h.
1015         (ft_iso8859_1_font_list): Delete this variable.
1016         (set_font_info): Don't set font->property[MFONT_TYPE].
1017         (set_font_info): Don't udpate ft_iso8859_1_font_list.
1018         (add_font_info): Change type to void.
1019         (fc_list): Change anme from xft_list.  Caller changed.  Include
1020         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
1021         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
1022         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
1023         (close_ft): Don't call mwin__xft_close.  Unref
1024         ft_info->extra_info.
1025         (ft_open): Don't setup ft_info->fontname.  Don't call
1026         mwin__xft_open.
1027         (ft_find_metric): Don't call mwin__xft_get_metric.
1028         (ft_encode_char): Call rfont->driver->open instead of ft_open.
1029         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
1030         (mfont__ft_init): Adjusted for new mfont__driver_list.
1031         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
1032
1033         * font.c (mfont__driver_list): Make it MPlist.
1034         (mfont__init): Adjust initialization of mfont__driver_list.
1035         (mfont__fini): Free mfont__driver_list.
1036         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
1037         (mfont__select): Adjusted for the new mfont__driver_list.
1038
1039         * font.h (enum MFontProperty): Delete MFONT_TYPE.
1040         (mfont__drirver_list): Adjust prototype.
1041         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
1042
1043         * face.h (struct MFace): Delete member realized_face_list, add
1044         member frame_list.
1045         (struct MRealizedFace): Delete member need_update
1046         andnofont_rface, add member non_ascii_list.
1047         (mface__update_frame_face): Extern it.
1048
1049         * face.c (hline_prop_list, box_prop_list, noop_hook): New
1050         variables.
1051         (get_hline_create, get_box_create): New functions.
1052         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
1053         Use memcmp.
1054         (free_face): Cancep previous change.  Free face->frame_list.
1055         (serialize_hline): Do nothing if hline->width is zero.
1056         (serialize_box): Do nothing if box->width is zero.
1057         (mface__init): Setup all properties of mface__default.
1058         (mface__fini): Free hline_prop_list and box_prop_list.
1059         (mface__realize): Cancel previous change.  Update
1060         face->frame_list.  Setup rface->non_ascii_list.
1061         (mface__for_chars): Update rface->non_ascii_list.
1062         (mface__free_realized): Free rface->non_ascii_list.
1063         (mface__update_frame_face): New function.
1064         (mface): Initialize face->frame_list.
1065         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
1066         properties.
1067         (mface_merge): Likewise.
1068         (mface_put_prop): If key is Mhline or Mbox, get value by
1069         get_hline_create or get_box_create respectively.
1070         (mface_put_prop): Update frame->tick and call
1071         mface__update_frame_face if necessary.
1072         (mface_update): Do nothing if func is noop_hook.
1073
1074         * draw.c (render_glyphs): If a font is not found, use
1075         mwin__draw_empty_boxes.
1076         (alloc_gstring): Initialize gstring->tick.
1077         (get_gstring): Check gstring->tick.
1078
1079 2004-05-17  Kenichi Handa  <handa@m17n.org>
1080
1081         * face.c (find_realized_face): Return value changed.  If RFONT is
1082         NULL, avoid unnecessary checking.
1083         (free_face): Free face->realized_face_list.
1084         (mface__realize): Adjusted for the change of find_realized_face.
1085         If it returns a realized face that needs update, free it and
1086         realize a new one.  Push a new realized face to
1087         frame->realized_face_list instead of appending.
1088         (mface__for_chars): Adjusted for the change of find_realized_face.
1089         Short cut if the required font is in rface->ascii_rface.
1090         (mface_put_prop): Free old value if necessary.  Set need_update
1091         member of realized faces to 1.
1092
1093         * face.h (struct MFace): Delete member tick, add member
1094         realized_face_list.
1095         (struct MRealizedFace): Delete member tick, add member
1096         need_update.
1097
1098 2004-05-13  Kenichi Handa  <handa@m17n.org>
1099
1100         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
1101
1102 2004-05-12  Kenichi Handa  <handa@m17n.org>
1103
1104         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
1105
1106         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
1107         parse it XftNameParse.
1108
1109         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
1110         (all_fonts_scaned): New variable.
1111         (set_font_info): FAMILY may be Mnil.
1112         (add_font_info): Argument changed.
1113         (xft_list): Call add_font_info in it.
1114         (ft_list): Likewise.
1115         (ft_select): Make it work in the case family is Mnil.
1116         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
1117         (mfont__ft_fini): Set all_fonts_scaned to 0.
1118
1119         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
1120         that is failed to open.
1121
1122 2004-05-10  Kenichi Handa  <handa@m17n.org>
1123
1124         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
1125         device's depth is 1 (i.e. monochrome).
1126
1127         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
1128         to work around the problem of libtool.
1129
1130         * font-ft.c: Include <freetype/ftbdf.h>.
1131         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
1132         variables.
1133         (mfont__ft_init): Initialize them.
1134         (ft_iso8859_1_font_list): New variable.
1135         (set_font_info): Detect a font containing iso8859-1 glyphs and
1136         register it in ft_iso8859_1_font_list.  If the font is not
1137         scalable, assume it as BDF or PCF font and setup SIZE and RESY
1138         properties of the font from its properties.
1139         (add_font_list): If the font is not scalable, check if it is BDF
1140         or PCF font.  If not, ignore it.
1141         (ft_select): If FAMILY is Mnil, return NULL only if the requested
1142         registry is not iso8859-1.
1143         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
1144         ft_iso8859_1_font_list.
1145         (ft_find_metric): If the font is not scalable, assume it as BDF
1146         or PCF, and get a metric from its properties.
1147         (mfont__ft_fini): Free ft_iso8859_1_font_list.
1148
1149 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
1150
1151         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
1152         (libm17n_la_LDFLAGS): Delete it.
1153         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
1154         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
1155
1156 2004-05-06  Kenichi Handa  <handa@m17n.org>
1157
1158         * draw.c (compose_glyph_string): Fix previous change.
1159
1160 2004-04-30  Kenichi Handa  <handa@m17n.org>
1161
1162         * font-ft.c (ft_list): Delete unused variable `result'.
1163         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
1164
1165 2004-04-27  Kenichi Handa  <handa@m17n.org>
1166
1167         * m17n-X.c: Include config.h
1168         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
1169         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
1170         (MWDevice) [HAVE_XFT2]: New member xft_draw.
1171         (FRAME_CMAP, FRAME_VISUAL): New macros.
1172         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
1173         (xfont_driver): Make it static.
1174         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
1175         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
1176         info->xft_color_back.
1177         (MXftFontInfo) [HAVE_XFT2]: New type.
1178         (mwin__xft_close) [HAVE_XFT2]: New function.
1179         (mwin__xft_open) [HAVE_XFT2]: New function.
1180         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
1181         (mwin__xft_render) [HAVE_XFT2]: New function.
1182
1183         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
1184         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
1185         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
1186         externs.
1187
1188         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
1189
1190         * font-ft.c: Don't include FT_FREETYPE_H here.
1191         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
1192         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
1193         (MFTInfo): New member charmap_index.
1194         (MFTInfo) [HAVE_XFT2]: New member xft_info.
1195         (check_otf_filename): Renamed from check_filename.  Return value
1196         changed.
1197         (ft_set_property): This function deleted.
1198         (set_font_info): New function.
1199         (add_font_list): Argument changed.  Add multiple fonts.
1200         (xft_list) [HAVE_XFT2]: New function.
1201         (ft_list) [not HAVE_XFT2]: New function.
1202         (ft_select): Add code for Xft.
1203         (close_ft): Likewise.
1204         (ft_open): Likewise.
1205         (ft_find_metric): Likewise.
1206         (ft_encode_char): Likewise.
1207         (ft_render): Likewise.
1208
1209         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
1210
1211 2004-04-26  Kenichi Handa  <handa@m17n.org>
1212
1213         * textprop.c (mtext_attach_property): Declare the return type as
1214         `int'.
1215
1216 2004-04-21  Kenichi Handa  <handa@m17n.org>
1217
1218         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
1219
1220 2004-04-09  Kenichi Handa  <handa@m17n.org>
1221
1222         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
1223         seq_to.
1224         (load_command): Setup above members.
1225
1226 2004-04-05  Kenichi Handa  <handa@m17n.org>
1227
1228         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
1229
1230 2004-03-30  Kenichi Handa  <handa@m17n.org>
1231
1232         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
1233         >= 0x10000.
1234
1235         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
1236         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
1237
1238 2004-03-29  Kenichi Handa  <handa@m17n.org>
1239
1240         * Version 1.0 Patch Level 2 released.
1241
1242 2004-03-29  Kenichi Handa  <handa@m17n.org>
1243
1244         * charset.c (make_charset): Set charset->fully_loaded and
1245         charset->simple correctly.  Don't try to get charset->min_char and
1246         charset->max_char for a charset of method subset and superset.
1247         Don't load a mapping file here.
1248         (mcharset__init): Set unified_max.
1249         (mcharset__load_from_database): Free a working plist.
1250
1251         * coding.c (mcoding__fini): Free all malloced data.
1252
1253         * input-gui.c (win_create_ic): Set control.as_image for preediting
1254         to 0.
1255
1256         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
1257         `count') to initialize the array.
1258
1259         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
1260         M17N_OBJECT_UNREF.
1261
1262         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
1263         rectangle.
1264         (mwin__create_window): Fix bug of setting a background pixel of a
1265         new window.
1266         (mwin__adjust_window): Clear the window before drawing.
1267
1268         * m17n-core.c (mdebug__report_object): Free array->objectes if
1269         necessary.
1270         (m17n_init_core): Don't set report_header_printed to 0 here.
1271         Fix debugging information.
1272         (m17n_fini_core): Set report_header_printed to 0 here.
1273
1274         * m17n-core.h (mplist_deserialize): Extern it.
1275
1276         * m17n-gui.c (m17n_fini_win): Fix debugging information.
1277
1278         * m17n.c (m17n_fini): Fix debugging information.
1279
1280         * mtext.c (mtext__adjust_foramt): New function.
1281
1282         * mtext.h (mtext__adjust_foramt): Extern it.
1283
1284         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
1285
1286         * plist.h (mplist__deserialize): Don't extern it.
1287
1288         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
1289         elements of symbol_table to NULL.  Report about created and freed
1290         symbols if MDEBUG_FINI is set.
1291
1292 2004-03-22  Kenichi Handa  <handa@m17n.org>
1293
1294         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
1295
1296         * m17n.c (m17n_init): Fix the way of checking merror_code.
1297
1298         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
1299
1300 2004-03-22  Kenichi Handa  <handa@m17n.org>
1301
1302         * fontset.c (realize_font_group): Adjust the font size by
1303         mfont__resize before selecting a font.
1304
1305         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
1306
1307 2004-03-19  Kenichi Handa  <handa@m17n.org>
1308
1309         * Version 1.0 Patch Level 1 released.
1310
1311 2004-03-19  Kenichi Handa  <handa@m17n.org>
1312
1313         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
1314
1315         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
1316
1317 2004-03-19  Kenichi Handa  <handa@m17n.org>
1318
1319         Re-apply the changes forgotten in the released version.
1320
1321         * charset.c (mcharset__load_from_database): Call
1322         mchar_define_charset.
1323
1324         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
1325         (mconv_encode_range): Put Mcoding text property.
1326
1327 2004-03-18  Kenichi Handa  <handa@m17n.org>
1328
1329         * draw.c (Mdepth): New variable.
1330         (visual_order): Delete unused local var `pos'.
1331         (compose_glyph_string): Fix for the case that gstring->glyphs is
1332         realloced.  Stop generating glyphs at TO.  Fix handling of
1333         control charaters.
1334         (layout_glyphs): Get metrics of all glyphs in advance.  Set
1335         lbearing and rbearing of base of composition glyph correctly.
1336         Handle left-overhang glyphs correctly.
1337         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
1338         changed.
1339         (dump_combining_code): Change the defualt off_x character to ".".
1340         (mdraw__init): Initialize Mdepth.
1341
1342         * face.c (work_gstring): New variable
1343         (mface__init): Initialize work_gstring.
1344         (mface__fini): Free work_gstring.glyphs.
1345         (mface__realize): Don't handle videomode property here.  Adjusted
1346         for the change of mfont__get_metric.
1347         (mface__for_chars): Adjusted for the change of mfont__get_metric.
1348
1349         * face.h (enum face_gc): Moved to m17n-X.c.
1350
1351         * font.h (struct MFontDriver): Arguments of find_metric changed.
1352         (mfont__select): Prototype adjusted.
1353         (mfont__get_metric): Likewise.
1354         (mfont__ft_drive_otf): Likewise.
1355         (mfont__flt_run): Likewise.
1356         
1357         * font.c (mfont__select): New argument layouter.  If layouter is
1358         different in the registered font, make a new copy of realized
1359         font.
1360         (mfont__get_metric): Argument changed.  Get metrics of multiple
1361         glyphs.
1362         (mfont_find): Call mfont__select with layouter as Mnil.
1363
1364         * font-flt.c (FontLayoutContext): New member rfont.
1365         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
1366         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
1367
1368         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
1369         multiple glyphs.
1370         (NUM_POINTS): New macro.
1371         (MPointTable): New type.
1372         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
1373         (mfont__ft_drive_otf): New argument rfont.
1374
1375         * fontset.c (realize_font_group): Adjusted for the changed of
1376         mfont__select.
1377         (check_fontset_element): This function deleted.
1378
1379         * input-gui.c (adjust_window_and_draw): Locate a preedit window
1380         off the parent window if the preedit text is zero length.
1381
1382         * internal-gui.h (struct MFrame): New members foreground,
1383         background, videomode, font.
1384         (struct MGlyphString): New member anti_alias.
1385         (MDrawPoint): New type.
1386         (mwin__draw_bitmap): Prototype deleted.
1387         (mwin__draw_points): Prototype added.
1388
1389         * m17n-gui.h (MDrawControl): New member anti_alias.
1390
1391         * m17n-gui.c (free_frame): Free frame->font.
1392         (mframe): Set the fontset of frame->face to the default fontset.
1393
1394         * m17n-X.c (RGB_GC): New type.
1395         (enum gc_index): Renamed from enum face_gc.  Member names changed.
1396         (GCInfo): New typel
1397         (struct MWDevice): Members foreground and background deleted.  New
1398         member scratch_gc, gc_list.
1399         (DEFAULT_FONT, FALLBACK_FONT): New macros.
1400         (free_device): Free GCs in device->gc_list.
1401         (get_rgb_gc): New function.
1402         (get_gc): Renamed and argument changed from get_color.
1403         (get_gc_for_anti_alias): New function.
1404         (xfont_find_metric): Arguments changed.  Get metrics of multiple
1405         glyphs.
1406         (set_region): Argument changed.  Caller changed.
1407         (xfont_render): Allways set a font in gc.
1408         (x_error_handler, x_io_error_handler): Define only if
1409         X_SET_ERROR_HANDLER is defined.
1410         (mwin__open_device): Create device->scratch_gc.  Set members
1411         foreground, background, and videomode of frame.  Call
1412         XSetErrorHandler and XSetIOErrorHandler only if
1413         X_SET_ERROR_HANDLER is defined.
1414         (struct gc_list): Deleted.
1415         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
1416         (mwin__realize_face): Adjusted for the change of the format of
1417         rface->info and the charge of set_region.
1418         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
1419         (mwin__draw_box): Likewise.
1420         (mwin__draw_bitmap): This function deleted.
1421         (mwin__draw_points): New function.
1422         (mwin__verify_region): Adjusted for the change of the format of
1423         rface->info and the charge of set_region.
1424         (mwin__create_window): Inherit backgound pixel from parent.
1425         (mwin__dump_gc): Adjusted for the change of the format of
1426         rface->info.
1427
1428 2004-03-16  Kenichi Handa  <handa@m17n.org>
1429
1430         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
1431
1432         * input.c (M_key_alias): New variable.
1433         (handle_key): Try M_key_alias property of a key too.
1434         (minput__init): Initialize M_key_alias.  Give that property to
1435         symbols in one_char_symbol.  Fix bug of initializing
1436         one_char_symbol.
1437
1438         * draw.c (compose_glyph_string): Don't handle
1439         ignore_formatting_char here.  Include formatting characters in the
1440         range processed by a FTL.
1441         (layout_glyph_string): Handle ignore_formatting_char here.
1442
1443 2004-03-12  Kenichi Handa  <handa@m17n.org>
1444
1445         * input-gui.c (win_create_ic): Enable bidi in status control.
1446
1447         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
1448
1449 2004-03-09  Kenichi Handa  <handa@m17n.org>
1450
1451         * input.c (load_input_method): If title is not specified, use the
1452         input method name as title.
1453
1454         * m17n-X.c (get_color): Make it static.
1455         (xim_create_ic, xim_destroy_ic, x_error_handler)
1456         (x_io_error_handler): Likewise.
1457
1458 2004-03-01  Kenichi Handa  <handa@m17n.org>
1459
1460         * Version 1.0 released.
1461
1462 \f
1463 Copyright (C) 2003, 2004
1464   National Institute of Advanced Industrial Science and Technology (AIST)
1465   Registration Number H15PRO112
1466
1467 This file is part of the m17n library.
1468
1469 The m17n library is free software; you can redistribute it and/or
1470 modify it under the terms of the GNU Lesser General Public License
1471 as published by the Free Software Foundation; either version 2.1 of
1472 the License, or (at your option) any later version.
1473
1474 The m17n library is distributed in the hope that it will be useful,
1475 but WITHOUT ANY WARRANTY; without even the implied warranty of
1476 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1477 Lesser General Public License for more details.
1478
1479 You should have received a copy of the GNU Lesser General Public
1480 License along with the m17n library; if not, write to the Free
1481 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1482 02111-1307, USA.