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