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