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