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