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