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