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