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