*** empty log message ***
[m17n/m17n-lib.git] / src / ChangeLog
1 2009-12-03  Kenichi Handa  <handa@m17n.org>
2
3         * m17n-flt.c (run_stages): Reset category code if category-table
4         is changed.
5         (mflt_run): Don't set category code here.
6         (decode_packed_otf_tag): If no feature is applied, re-calculate
7         category code.
8         (run_command): On copy, don't re-calculate a category code.
9
10 2009-12-02  Kenichi Handa  <handa@m17n.org>
11
12         * m17n-flt.c (mflt_find): If FONT is specified but no flt is
13         found, return NULL.
14         (run_command): Don't set ENCODED and MEASURED of separator.
15
16 2009-11-30  Kenichi Handa  <handa@m17n.org>
17
18         * m17n-flt.c (load_otf_command): Check 4th char against '?'.
19         (load_command): Likewise.
20         (decode_packed_otf_tag): New arg CTX.  If CTX->in == gstring,
21         update CTX->encoded.  Caller changed.
22
23 2009-11-30  Kenichi Handa  <handa@m17n.org>
24
25         * font-ft.c (ft_drive_otf): Check if OUT is null or not.
26         (ft_drive_otf): Call OTF_drive_gsub_with_log and
27         OTF_drive_gpos_with_log.  Record the applied feature in
28         g->g.internal.
29
30         * font.c (mfont__get_glyph_id): Encode g->c instead of g->code.
31
32         * internal-flt.h (MAKE_COMBINING_CODE_BY_CLASS)
33         (COMBINING_BY_CLASS_P, COMBINING_CODE_CLASS)
34         (MAKE_PRECOMPUTED_COMBINDING_CODE, COMBINING_PRECOMPUTED_P):
35         Delete externs..
36         (PACK_OTF_TAG): Extern it.
37
38         * draw.c (reorder_combining_chars): Delete it.
39
40         * m17n-flt.h (mflt_font_id): Use type MFLFont.
41         (mflt_iterate_otf_feature): Likewise.
42
43         * m17n-flt.c (enum GlyphInfoMask): New member CategoryCodeMask and
44         CombinedMask.
45         (GET_CATEGORY_CODE, SET_CATEGORY_CODE, GET_COMBINED): New macros.
46         (SET_COMBINING_CODE): Set also CombinedMask.
47         (FontLayoutFeatureTable): Delete it.
48         (FeatureCodeTable): New type.
49         (FontLayoutCategory): Type of feature_table changed.
50         (load_category_table): Adjusted for the change of
51         FontLayoutCategory.
52         (unref_category_table): Likewise.
53         (gen_otf_tag): New member shift.  Caller changed.
54         (FontLayoutContext): New member category.
55         (run_rule): Compare g->c instead of g->code.
56         (decode_packed_otf_tag): New function.
57         (run_otf): Call decode_packed_otf_tag.  Don't reset combining-code
58         here.
59         (run_otf_category): New function.
60         (run_command): Set category-code if necessary.  Call
61         run_otf_category for FontLayoutCmdTypeOTFCategory.
62         (run_stages): Set ctx->category.  Get category from glyph if
63         possible.
64         (mflt_dump_gstring): New function.
65
66 2009-11-26  Kenichi Handa  <handa@m17n.org>
67
68         * m17n-flt.c (enum FontLayoutCmdType): New member
69         FontLayoutCmdTypeOTFCategory.
70         (FontLayoutFeatureTable): New type.
71         (FontLayoutCategory): New members feature_table_size and
72         feature_table.
73         (load_category_table): Handle feature_table.
74         (unref_category_table): Likewise.
75         (load_otf_command): Handle FontLayoutCmdTypeOTFCategory.
76         (load_command): Likewise.
77         (free_flt_command): Likewise.
78
79 2009-11-10  Kenichi Handa  <handa@m17n.org>
80
81         * draw.c (run_flt): Update category code of each glyph.
82
83 2009-11-07  Kenichi Handa  <handa@m17n.org>
84
85         * font-ft.c (ft_drive_otf): Don't accumulate anchor adjustments.
86
87 2009-11-05  Kenichi Handa  <handa@m17n.org>
88
89         * m17n-flt.c (run_otf): Fix updating of g->lbearing, etc.
90
91         * font-ft.c (ft_drive_otf): Use OTF_drive_gpos2 if possible.
92
93 2009-10-28  Kenichi Handa  <handa@m17n.org>
94
95         * fontset.c (mdebug_flag): New variable.
96         (mfont__lookup_fontset): Print debug info.
97
98         * m17n-core.c (m17n_init_core): Call SET_DEBUG_FLAG for
99         MDEBUG_FONTSET.
100
101         * internal.h (enum MDebugFlag): Add MDEBUG_FONTSET.
102
103         * language.c (mscript__from_otf_tag): Adjusted for the new format
104         of the database <standard script unicode>.
105
106 2009-10-22  Kenichi Handa  <handa@m17n.org>
107
108         * database.c (check_version): Fix the check.
109
110         * input.c (surrounding_pos): New arg *pos.
111         (integer_value): Fix handling of "@+0".
112         (take_action_list): Adjusted for the change of surrounding_pos.
113
114 2009-10-05  Kenichi Handa  <handa@m17n.org>
115
116         * m17n-flt.h: (mflt_iterate_otf_feature, mflt_font_id): Extern
117         them.
118
119         * m17n-flt.c (FontLayoutCategory): New typedef.
120         (FontLayoutStage): Type of the member `category' changed.
121         (struct _MFLT): Type of the member `coverage' changed.  New member
122         need_config and font_id.
123         (apply_otf_feature): New function.
124         (load_category_table): New arg FONT.  If FONT is non-NULL, call
125         apply_otf_feature.  Setup category->definition.
126         (ref_category_table): New macro.
127         (unref_category_table): New function.
128         (load_flt): Adjusted for the type change of category.
129         (free_flt_stage): New arg FLT.
130         (list_flt): Adjusted for the type change of category.
131         (run_stages): Adjusted for the type change of category.
132         (configure_category, configure_flt): New function.
133         (m17n_init_flt): Initialize mflt_iterate_otf_feature and
134         mflt_font_id to NULL.
135         (mflt_get): Skip the heading configured FLTs.
136         (mflt_find): Likewise.  If necessary, configure the found flt.
137         (mflt_run): Handle mflt_iterate_otf_feature and mflt_font_id.
138         Adjusted for the type change of category.
139         (mflt_iterate_otf_feature, mflt_font_id): New variable.
140
141         * m17n-X.c (xfont_open): Set rfont->id.
142         (xft_driver): Set xft_iterate_otf_feature.
143         (xft_open): Set rfont->id.
144         (xft_iterate_otf_feature): New function.
145
146         * font.h (struct MRealizedFont): New member id.
147         (struct MFontDriver): New member iterate_otf_feature.
148
149         * font.c (mfont__get_glyph_id): Pay attention to. mfont->source.
150
151         * font-ft.c (ft_open, ft_encapsulate): Set rfont->id.
152         (get_otf): New funcition.
153         (ft_check_otf, ft_drive_otf): Use get_otf.
154         (iterate_callback, ft_iterate_otf_feature): New functions.
155         (mfont__ft_driver): Set ft_iterate_otf_feature.
156
157         * draw.c: Docstring updated.
158         (font_id): New function.
159         (run_flt): Set mflt_font_id and mflt_iterate_otf_feature before
160         calling mflt_run.
161
162 2009-10-02  Kenichi Handa  <handa@m17n.org>
163
164         * m17n-flt.c (load_flt): Check the return value of
165         load_category_table.
166
167 2009-09-03  Kenichi Handa  <handa@m17n.org>
168
169         * m17n-flt.c (run_otf): Clear combining code for glyphs whose
170         positions are adjusted by GPOS table.
171
172 2009-08-13  Kenichi Handa  <handa@m17n.org>
173
174         * Version 1.5.5 released.
175
176 2009-08-13  Kenichi Handa  <handa@m17n.org>
177
178         * m17n-core.h (M17NLIB_PATCH_LEVEL):  Changed to 5.
179         (M17NLIB_VERSION_NAME): Changed to "1.5.5".
180
181 2009-03-03  Kenichi Handa  <handa@m17n.org>
182
183         * draw.c (compose_glyph_string): Check if category not Mnil.
184
185 2009-03-02  Kenichi Handa  <handa@m17n.org>
186
187         * Version 1.5.4 released.
188
189 2009-02-25  Kenichi Handa  <handa@m17n.org>
190
191         * m17n-core.c (report_object_array): For M-text and Plist, print
192         more information.
193
194         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 4.
195         (M17NLIB_VERSION_NAME): Changed to "1.5.4".
196
197         * input.c (get_candidate_list): Free unnecessary objects.
198         (take_action_list): Free plist.
199
200 2009-02-04  Kenichi Handa  <handa@m17n.org>
201
202         * coding.c (mcoding__init): Add "Shift_JIS" as an alias of "sjis".
203
204 2009-01-16  Kenichi Handa  <handa@m17n.org>
205
206         * m17n-core.h (Mcased, Msoft_dotted, Mcase_mapping, Mblock):
207         Extern them.
208
209         * character.c (Mcased, Msoft_dotted, Mcase_mapping, Mblock): New
210         variables.
211
212 2009-01-14  Kenichi Handa  <handa@m17n.org>
213
214         * coding.c (decode_coding_iso_2022): Check invocation status
215         before updating charset0 and charset1.
216
217         * symbol.c (msymbol__canonicalize): Handle "windows-XXXX".
218
219 2008-12-31  Kenichi Handa  <handa@m17n.org>
220
221         * m17n-flt.c (mflt_run): If g->encoded is set, don't clear
222         g->code.
223
224 2008-10-30  Andreas Schwab <schwab@suse.de>  (tiny change)
225
226         * face.c (mface_get_prop): Fix strict aliasing bug.
227         (mface_put_prop): Likewise.
228
229         * m17n-gui.c (mframe): Fix strict aliasing bug.
230
231 2008-10-20  Kenichi Handa  <handa@m17n.org>
232
233         * Version 1.5.3 released.
234
235 2008-10-06  Kenichi Handa  <handa@m17n.org>
236
237         * draw.c (mdraw__init): Use TRUE only when
238         FRIBIDI_INTERFACE_VERSION is less than 3.
239
240 2008-10-03  Kenichi Handa  <handa@m17n.org>
241
242         * database.c (mdatabase__find_file): Return a copy of filename if
243         it is absolute pathname.
244
245 2008-09-25  Kenichi Handa  <handa@m17n.org>
246
247         * input.c (load_macros): Don't parse the action list here.
248         (load_im_info): Parse action lists of all macros.
249
250 2008-09-24  Kenichi Handa  <handa@m17n.org>
251
252         * m17n-flt.c (mflt_find): Setup coverage of "combining" flt.
253
254 2008-09-19  Kenichi Handa  <handa@m17n.org>
255
256         * input.c (fully_initialize): Rename "@reload" to "-reload".
257
258 2008-09-17  Kenichi Handa  <handa@m17n.org>
259
260         * m17n-flt.c (run_stages): Fix combining with a variable width
261         font.
262
263 2008-08-04  Kenichi Handa  <handa@m17n.org>
264
265         * input.c (fully_initialize): Add more aliaese (e.g. C-M-1
266         vs. C-A-1).
267
268 2008-07-22  Kenichi Handa  <handa@m17n.org>
269
270         * input.c (fully_initialize): Fix previous change.
271
272 2008-07-19  Kenichi Handa  <handa@m17n.org>
273
274         * input.c (fully_initialize): Fix previous change.
275
276 2008-07-14  Kenichi Handa  <handa@m17n.org>
277
278         * font-ft.c (ft_list_family): New arg CHECK_ALIAS.  Callers changed.
279
280 2008-07-14  Kenichi Handa  <handa@m17n.org>
281
282         * input.c (fully_initialize): Handle C-M-1, etc.
283
284 2008-07-11  Kenichi Handa  <handa@m17n.org>
285
286         * input.c (minput_open_im): Check if the arg NAME is not Mnil.
287
288 2008-06-23  Kenichi Handa  <handa@m17n.org>
289
290         * Version 1.5.2 released.
291
292 2008-06-23  Kenichi Handa  <handa@m17n.org>
293
294         * m17n-core.h (M17NLIB_MINOR_VERSION): Changed to 5.
295         (M17NLIB_PATCH_LEVEL): Changed to 2.
296         (M17NLIB_VERSION_NAME): Changed "1.5.2".
297
298 2008-06-13  Kenichi Handa  <handa@m17n.org>
299
300         * input.c (minput_config_file): Comment fixed for man-page.
301
302 2008-06-13  Harshula  <harshula@gmail.com>  (tiny change)
303
304         * Makefile.am (libm17n_gd_la_LIBADD): Add @FREETYPE_LD_FLAGS@.
305
306 2008-05-24  Kenichi Handa  <handa@m17n.org>
307
308         * m17n-flt.c (mdebug_dump_flt): Change return value to (MFLT *).
309
310 2008-05-23  Kenichi Handa  <handa@m17n.org>
311
312         * Makefile.am (libm17n_gui_la_LIBADD): Include libm17n-core.la.
313         (libm17n_X_la_LIBADD): Include libm17n-core.la, libm17n.la, and
314         libm17n-flt.la.
315         (libm17n_gd_la_LIBADD): Likewise.
316
317         * input.c (take_action_list): Fix debug info.
318
319 2008-05-14  Kenichi Handa  <handa@m17n.org>
320
321         * m17n-flt.c (run_rule): Check SRC_REGEX at first.
322         (run_stages): Fix index of g_indices.
323
324 2008-04-03  Kenichi Handa  <handa@m17n.org>
325
326         * draw.c (compose_glyph_string): Don't run flt striding over the
327         cursor position.
328         (get_gstring): Don't use the cached gstring if cursor position is
329         changed.
330
331 2008-04-02  Kenichi Handa  <handa@m17n.org>
332
333         * input.c (integer_value): Delete the 3rd arg VALUE.
334         (resolve_expression): Adjust the call of integer_value.
335         (take_action_list): Likewise.
336
337 2008-03-06  Kenichi Handa  <handa@m17n.org>
338
339         * font-ft.c (ft_drive_otf): Don't ignore the otf-spec to apply all
340         features.
341
342 2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>
343
344         * Version 1.5.1 released.
345
346 2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>
347
348         * draw.c (mdraw_glyph_list): Refer to mfont__ft_driver only when
349         HAVE_FREETYPE is defined.
350
351         * font.h (OTF_Tag): Be sure that it is defined in any cases.
352
353 2008-01-30  Kenichi Handa  <handa@ni.aist.go.jp>
354
355         * font.h (enum MFontOpenTypeTable, MFontCapability): Define them
356         unconditionally.
357
358 2008-01-25  Kenichi Handa  <handa@ni.aist.go.jp>
359
360         * input.c (parse_action_list): Handle the case "(insert INTEGER)".
361
362 2008-01-25  Kenichi Handa  <handa@ni.aist.go.jp>
363
364         * input.c (parse_action_list): Check M_candidates.
365         (get_im_info): If key is Mnil, be sure to set im_info->states to a
366         plist.
367
368 2008-01-23  Kenichi Handa  <handa@ni.aist.go.jp>
369
370         * input.c (integer_value): Fix interpretation of "@-N".
371
372 2008-01-17  Kenichi Handa  <handa@ni.aist.go.jp>
373
374         * input.c (get_following_char): Fix interpretation of POS.
375         (get_following_char): Fix interpretation of "@+N".
376
377 2008-01-15  Kenichi Handa  <handa@ni.aist.go.jp>
378
379         * font-ft.c (ft_drive_otf): Don't refer to otf_gstring if HAVE_OTF
380         is not defined.
381
382         * Makefile.am (FLT_SOURCES): Include internal-flt.h.
383
384 2008-01-07  Kenichi Handa  <handa@ni.aist.go.jp>
385
386         * m17n-flt.c (UPDATE_CLUSTER_RANGE): Don't check if clustering
387         now.
388         (run_rule): Call UPDATE_CLUSTER_RANGE when necessary.
389         (run_command): Check if clustering now before calling
390         UPDATE_CLUSTER_RANGE.
391
392 2008-01-06  Kenichi Handa  <handa@m17n.org>
393
394         * font.c (mfont__get_glyph_id): Return -1 if some code is invalid.
395
396         * font-ft.c (ft_drive_otf): Fix checking of negative feature.
397
398         * m17n-X.c (xft_find_metric): Set g->g.measured.
399
400         * m17n-flt.c (Mequal): New variable.
401         (m17n_init_flt): Initialize it.
402         (FontLayoutCmdRule): Merge members supported_glyph and otf_spec
403         into a new member facility.
404         (load_command): Modify parsing of Mfont_facility.
405         (run_rule): Adjuted for the change of FontLayoutCmdRule.
406         (run_otf): Adjusted metrics if a->back is nonzero.
407
408 2007-12-28  Kenichi Handa  <handa@ni.aist.go.jp>
409
410         * Version 1.5.0 released.
411
412 2007-12-13  Kenichi Handa  <handa@ni.aist.go.jp>
413
414         * m17n-core.c (m17n_init_core): Handle the lang. env. MDEBUG_FLT.
415
416         * m17n-flt.c (mdebug_flag): Set to MDEBUG_FLT.
417         (run_rule): Check if a font has the specific glyph correctly.
418
419         * internal.h (enum MDebugFlag): Delete MDEBUG_FONT_OTF, change
420         MDEBUG_FONT_FLT to MDEBUG_FLT.
421
422         * font.c (mfont__get_glyph_id): Encode g->g.code (not g->g.c).
423
424         * font-flt.c: Delete it.
425
426 2007-12-08  Kenichi Handa  <handa@ni.aist.go.jp>
427
428         * m17n-flt.c (run_rule): Fix printing of debug info.  Don't update
429         TO for the rule of SRC_HAS_GLYPH.
430
431         * draw.c (run_flt): Argument changed.
432         (compose_glyph_string): Adjusted for the above change.
433
434 2007-12-07  Kenichi Handa  <handa@ni.aist.go.jp>
435
436         * plist.c (read_mtext_element): Don't free the malloced buffer.
437
438 2007-12-04  Kenichi Handa  <handa@ni.aist.go.jp>
439
440         * m17n-core.h (merror_code): Extern it.
441
442         * m17n-misc.h (merror_code): Don't extern it.
443
444         * m17n.h: Handle the case of _M17N_FLT_H_ being defined.
445
446         * m17n-flt.h: Handle the case of _M17N_H_ being defined.
447
448 2007-11-22  Kenichi Handa  <handa@ni.aist.go.jp>
449
450         * draw.c (compose_glyph_string): Check g->rface->layouter, not
451         g->rface->rfont->layouter.
452
453         * font-ft.c (ft_drive_otf): Fix setting of g->g.from and g->g.to.
454
455         * m17n-flt.c (FontLayoutContext): New member encoded_offset.
456         (run_rule): Use ctx->encoded_offset.
457         (run_command): Likewise.
458         (run_stages): Set ctx->encoded_offset.
459
460 2007-11-21  Kenichi Handa  <handa@ni.aist.go.jp>
461
462         * m17n-flt.c (enum GlyphInfoMask): Adjusted for the change of
463         bit-size of MFLTGlyph->internal.
464
465 2007-11-20  Kenichi Handa  <handa@ni.aist.go.jp>
466
467         * draw.c (visual_order): Exclude the last anchor glyph from the
468         iteration.
469
470         * m17n-flt.h (MFLTGlyph): New member <adjusted>.
471
472         * m17n-flt.c (run_otf): Set adjusted flag of glyphs if necessary.
473         (run_stages): Likewise.
474         (load_flt): Unref top after checking plist.
475
476         * m17n-X.c (xft_render): Check adjusted flag of glyphs.
477
478 2007-11-12  Kenichi Handa  <handa@ni.aist.go.jp>
479
480         * font-ft.c (ft_check_otf): Fix arg to OTF_check_features.
481
482         * m17n-flt.c (Mcombining): New variable.
483         (Mfont_facility): Renamed from Mfont_has.  Referrer changed.
484         (enum FontLayoutCmdRuleSrcType): Delete SRC_EXIST, add
485         SRC_HAS_GLYPH and SRC_OTF_SPEC.
486         (FontLayoutCmdRule): Delete src.exist, add src.supported_glyph and
487         src.otf_spec.
488         (load_command): Adjusted for the above changes.
489         (run_rule): Likewise.
490         (combining_code_from_class): Delete it.
491         (mflt_get): Check flt->name against Mcombining, not Mt.
492
493         * internal-flt.h (Mcombining): Extern it.
494
495         * draw.c (compose_glyph_string): Call run_flt with Mcombining for
496         combining characters.
497
498 2007-11-09  Kenichi Handa  <handa@ni.aist.go.jp>
499
500         * face.c (mface__realize): Reset measured flag before calling
501         mfont__get_metric.
502
503         * m17n-flt.c (run_stages): Fix handing of off_x and off_y.
504         (setup_combining_coverage): New function.
505         (setup_combining_flt): New function.
506         (mflt_get): If flt is not found, return NULL.  If name if Mt,
507         call setup_combining_flt.
508         (mflt_run): For debugging, print font family name.
509
510         * font-ft.c (ft_render): Fix handling of baseline_offset.
511         (ft_encapsulate): Set metrics in 26.6 fixed pixel.
512         (ft_render): Check pixel_mode to determine anti_alias.
513
514         * m17n-X.c (xfont_find_metric): Delete invalid "continue" line.
515         (xfont_find_metric): Set metrics in 26.6 fixed pixel.
516         (xfont_render): Set baseline_offset in pixel.
517         (xft_render): Fix handling of baseline_offset.
518
519         * draw.c (run_flt): Set font.font.family.
520         (compose_glyph_string): Fix handling of combining characters.
521
522         * fontset.c (try_font_list): Check if the named flt is surely
523         available.
524
525 2007-11-07  Kenichi Handa  <handa@ni.aist.go.jp>
526
527         * draw.c (analyse_bidi_level): New function.
528         (visual_order): Do reordering using the already decided
529         bidi-level.
530         (compose_glyph_string): Decide bidi-level before calling flt.
531
532         * m17n-flt.c (mflt_run): Fix typo.
533
534         * font-ft.c (ft_drive_otf): Fix indexing gstring->glyphs.
535
536 2007-11-06  Kenichi Handa  <handa@ni.aist.go.jp>
537
538         * draw.c (visual_order): Don't rely on the width of glyphs.
539         (run_flt): Fix culculation of g->g.to.
540
541         * m17n-flt.c (run_rule): Don't set error code here.
542         (run_cond): Likewise.
543         (run_otf): Fix culculation of xoff and yoff.
544         (run_command): Don't set error code here.
545         (PREV): New macro.
546         (NEXT): New macro.
547
548         * m17n-X.c (xfont_open): Keep rfont's metrics in 26.6 fixed pixels.
549         (xfont_find_metric): Set glyph's yadv to 0.
550         (xft_find_metric): Likewise.
551
552         * font-ft.c (ft_open): Keep rfont's metrics in 26.6 fixed pixels.
553         (ft_find_metric): Adjust glyph's metrics.
554         (ft_encapsulate): Keep rfont's metrics in 26.6 fixed pixels.
555         (ft_drive_otf): Set mark glyph's xadv to 0.
556
557         * face.c (mface__for_chars): Adjusts the unit of face's ascent and
558         descent.
559
560 2007-10-29  Kenichi Handa  <handa@m17n.org>
561
562         * m17n-flt.h (struct _MFLTOtfSpec): Adjusted for the new FLT handling.
563         (mflt_get): Adjusted for the argument change.
564         (mflt_name): Adjusted for the return value change.
565
566         * m17n-flt.c (Mgenerator, Mend): New variables.
567         (flt_min_coverage, flt_max_coverage): New variables.
568         (GCPY): New macro.
569         (GDUP): Use it.
570         (Mfont_has): Renamed from Mexist.  Referrers chagned.
571         (gen_otf_tag): Handle the trailing whitespaces.
572         (otf_count_features, otf_store_features): Fix for negative features.
573         (parse_otf_command): Adjusted for the change of MFLTOtfSpec.
574         (load_otf_command): Likewise.
575         (free_flt_command): Adjusted for the change of MFLTOtfSpec.
576         (load_flt): Argument changed.  Caller changed.
577         (free_flt_list): New function.
578         (run_rule): Adjusted for the change of FontLayoutContext.
579         (mflt_run): Adjusted for the change of FontLayoutContext.
580
581         * m17n-gui.c (m17n_init_win): Call m17n_init_flt.
582         (m17n_fini_win): Call m17n_fini_flt.
583
584         * m17n-gui.h: Include m17n-flt.h.
585
586         * m17n-gd.c: Adusted for the change of MGlyph.
587
588         * m17n-X.c: Adusted for the change of MGlyph.
589         (xft_check_otf, xft_drive_otf): New functions.
590
591         * internal-gui.h (MGlyph): Modified for new FLT handling.
592
593         * fontset.c (try_font_list): Adusted for the change of MGlyph.
594
595         * font-ft.c: Adjusted for the change of MGlyph.
596         (ft_check_cap_otf): Renamed from ft_check_otf.  Callers changed.
597         (get_glyph_metric): Deleted.
598         (ft_check_otf): New function.
599         (ft_drive_otf): New fucntion.
600
601         * font.c: Adjusted for the change of MGlyph.
602         (mfont__init): Don't call mfont__flt_init.
603         (mfont__fini): Don't call mfont__flt_fini.
604         (mfont__get_glyph_id, mfont__get_metrics): New functions.
605
606         * font.h (struct MRealizedFont): New members x_ppem and y_ppem.
607         (MFLTFontForRealized): New struct.
608         (struct MFontDriver): New members check_otf and drive_otf.
609         (mfont__get_glyph_id, mfont__get_metrics): Extern them.
610
611         * face.c: Adjusted for the change of MGlyph.
612
613         * draw.c: Adjusted for the change of MGlyph.
614
615         * m17n.c (m17n_init): Don't call mchar_init.
616
617         * m17n-core.c (m17n_init_core): Call mchar_init.
618
619         * m17n-core.h (mchartable_min_char, mchartable_max_char): Extern them.
620
621         * input.c: Include "m17n.h" instead of "m17n-gui.h".
622
623         * chartab.c (mchartable): Initialize table->min_char to -1.
624         (mchartable_min_char): New function.
625         (mchartable_max_char): New function.
626
627         * Makefile.am (GUI_SOURCES): Delete font-flt.c.
628         (libm17n_gui_la_LIBADD): Add ${top_builddir}/src/libm17n-flt.la.
629
630 2007-10-12  Kenichi Handa  <handa@m17n.org>
631
632         * m17n-core.h (Mcharset): Extern it.
633         Move detabase related declarations from m17n.h.
634
635         * m17n-flt.h: Include m17n-core.h instead of m17n.h.
636         (struct _MFLTOtfFeatures): New struct.
637         (struct _MFLTOtfSpec): Delete gsub, gpos, etc, add gsub_gpos.
638         (struct _MFLTFont): Delete otf, add check_otf.
639         (MCHAR_INVALID_CODE): Define it.
640
641         * plist.c (read_mtext_element): Simplify the code.
642
643         * m17n.h: Move database related declarations to m17n-core.h
644         (Mharset): Don't extern it.
645
646         * m17n.c (m17n_init): Don't call mdatabase__init.
647
648         * m17n-gd.c (read_rgb_txt): Check also /etc/X11/rgb.txt.  Downcase
649         color names.
650
651         * m17n-flt.c: Include m17n-core.h instead of m17n.h.
652         (Mexist): New variable.
653         (enum FontLayoutCmdRuleSrcType): New enum SRC_EXIST.
654         (FontLayoutCmdRule): New member src.exist.
655         (parse_otf_command): Handle gsub_count and gpos_count separately.
656         (load_otf_command): Adjusted for the change of MFLTOtfSpec.
657         (load_command): Handle the command "exist".
658         (free_flt_command): Adjusted for the change of MFLTOtfSpec.
659         (run_rule): Handle the case SRC_EXIST.
660         (run_otf): Adjusted for the change of MFLTOtfSpec.
661         (run_command): Check the range of FROM.
662         (check_otf_spec): Delete it.
663         (m17n_init_flt): Call m17n_init_core instead of m17n_init.
664         Initialize Mexist.
665         (m17n_fini_flt): Call m17n_fini_core instead of m17n_fiini.
666         (mflt_find): Call font->check_otf instead of check_otf_spec.
667         (mflt_run): Keep the metrics in 26.6 fixed point.
668
669         * m17n-core.c (mdatabase__finder, mdatabase__loader): Delete them.
670         (m17n_init_core): Call mdatabase__init.
671
672         * m17n-X.c (device_open): Use mplist_add, not mplist_push.
673
674         * internal.h (mdatabase__finder, mdatabase__loader): Delete externs
675         of them.
676
677         * font-flt.c (Mexist): New variable.
678         (enum FontLayoutCmdRuleSrcType): New enum SRC_EXIST.
679         (FontLayoutCmdRule): New member src.exist.
680         (load_category_table): Use isalnum, not isalpha.
681         (load_command): Check the command "exist".
682         (run_rule): Hande the case SRC_EXIST.
683         (run_command): Check the range of FROM.
684         (mfont__flt_init): Initialize Mexist.
685
686         * draw.c (layout_glyphs): Fix calculation of off_x and off_y.
687
688         * database.h (mdatabase__load_charset_func): Extern it.
689
690         * database.c: Include m17n-core.h instead of m17n.h.
691         (load_chartable): Use mtext__from_data.
692         (load_charset): Moved to charset.c
693         (load_database): Call mdatabase__load_charset_func instead of
694         load_charset.
695         (mdatabase__load_charset_func): New variable.
696         (mdatabase__init): Initialize mdatabase__load_charset_func and
697         Mcharset.  Don't set mdatabase__finder and mdatabase__loader.
698         (mdatabase__save): Use fwrite, not mconv_encode_stream.
699         (Mcharset): Declare it here.
700
701         * charset.c: Include "database.h.".
702         (load_charset): Moved from database.c.
703         (mcharset__init): Initialize mdatabase__load_charset_func, don't
704         initialize Mcharset.
705
706         * character.c (mchar_define_property): Call mdatabase_find directly.
707         (mchar_get_prop): Call mdatabase_add directly.
708         (mchar_put_prop): Call mdatabase_load directly.
709         (mchar_get_prop_table): Likewise.
710
711         * Makefile.am (libm17n_core_la_SOURCES): Add database.[ch].
712         (libm17n_la_SOURCES): Remove database.[ch].
713         (libm17n_flt_la_LIBADD): Delete libm17n.la, add libm17n-core.la.
714
715 2007-09-18  Kenichi Handa  <handa@m17n.org>
716
717         * face.c (mface__realize): Try Freetype based font at first.
718
719         * font.c: Include <ctype.h>
720
721 2007-09-16  Kenichi Handa  <handa@m17n.org>
722
723         * m17n-flt.c (load_flt): New arg full.  If full is zero, load only
724         coverage.
725         (run_otf): Call font->get_metrics, not font->get_metric.
726         (run_stages): Likewise.
727         (CHECK_FLT_COVERAGE): New macro.
728         (CHECK_FLT_STAGES): Call load_flt with the second arg 1.
729         (check_otf_spec): New function.
730         (m17n_fini_flt): Unref flt->coverage.
731         (mflt_find): Argument changed.
732         (mflt_name): New function.
733         (mflt_coverage): Use CHECK_FLT_COVERAGE.
734
735         * m17n-flt.h (MFLTFont): Member get_metrics renamed from get_metric.
736         (mflt_find): Prototype adjusted.
737         (mflt_name): Extern it.
738
739 2007-09-14  Kenichi Handa  <handa@m17n.org>
740
741         * m17n-flt.h (struct _MFLTGlyph): Change signedness of members.
742
743         * font-flt.c (run_otf): Make debug info printing comaptible with
744         that of m17n-flt.c.
745         (run_command): Likewise.
746         (mfont__flt_run): Likewise.
747
748         * m17n-flt.c (UPDATE_CLUSTER_RANGE): ctx->cluster_begin_idx is
749         invalid only when it's negative.
750         (run_otf): Likewise.
751         (run_command): Likewise.
752         (mflt_run): Initialize ctx.cluster_begin_idx to -1.
753
754 2007-09-10  Kenichi Handa  <handa@m17n.org>
755
756         * m17n-flt.h (struct _MFLTGlyph): New member encoded and measured.
757         (struct _MFLTFont): Prototype of get_glyph_id changed.
758
759         * m17n-flt.c (enum GlyphInfoMask): Delete EncodedMask and
760         PositionedMask.
761         (GAPPEND): Delete this macro.
762         (GET_ENCODED, SET_ENCODED, GET_MEASURED, SET_MEASURED): Adjusted
763         for the change of MFLTGlyph.  Caller changed.
764         (run_otf): Simply calls font->get_glyph_id.
765         (run_command): Reset g->encoded and g->measured for direct code.
766         (positioning): Delete this function.
767         (run_stages): Simply calls font->get_glyph_id and font->get_metric.
768
769 2007-09-07  Kenichi Handa  <handa@m17n.org>
770
771         * draw.c (compose_glyph_string): Improve script detection.
772
773 2007-09-06  Kenichi Handa  <handa@m17n.org>
774
775         * m17n-flt.h (mflt_get): Extern it.
776
777         * m17n-flt.c (run_stages): Call positioning only if
778         font->get_metric is non-NULL.
779         (CHECK_FLT_STAGES): Fix typo.
780         (mflt_get): New function.
781
782         * font-flt.c (mfont__flt_run): Improve debug info printing.
783
784 2007-09-04  Kenichi Handa  <handa@m17n.org>
785
786         * m17n-flt.c (MFontLayoutTable): Delete this type.
787         (struct _MFLT): New member mdb and coverage.
788         (list_flt): Set flt->mdb.
789         (load_generator): Argument and return value changed.  Caller
790         changed.
791         (get_font_layout_table): Delete this function.
792         (run_stages): Argument changed.  Caller changed.
793         (CHECK_FLT_STAGES): New macro.
794         (mfont__flt_encode_char): Argument changed.
795         (mflt_find): Likewise.
796         (mflt_coverage): New function.
797         (mflt_run): Argument changed.
798         (mdebug_dump_flt): Likewise.
799
800         * m17n-flt.h (mflt_coverage): Extern it.
801         (mflt_find): Prototype adjusted.
802
803 2007-09-03  Kenichi Handa  <handa@m17n.org>
804
805         * internal.h (MTABLE_CALLOC_SAFE, MSTRUCT_CALLOC_SAFE): New macros.
806
807         * database.c (mdatabase__props): New function.
808
809         * database.h (mdatabase__props): Extern it.
810
811         * m17n-flt.h (struct _MFLTGlyphString): Delete user_data, add
812         script and langsys.
813         (struct _MFLTFont): Add suitable_p.
814         (mflt_find): Extern it.
815
816         * m17n-flt.c: Include "database.h".
817         (struct _MFLT): New struct.
818         (list_flt): New function.
819         (load_flt): Don't update flt_list.
820         (get_font_layout_table): Use flt_list.
821         (m17n_init_flt): Don't initialize flt_list.
822         (m17n_fini_flt): Adjusted for the change of flt_list.
823         (mflt_find): New function.
824         (mflt_run): Fix debug printing.
825
826 2007-08-23  Kenichi Handa  <handa@m17n.org>
827
828         * m17n-flt.c (run_otf): Remove #ifdef HAVE_OTF and #endi.
829         (run_stages): Print separator in encoded string as "|".
830
831 2007-08-23  Kenichi Handa  <handa@m17n.org>
832
833         * font-flt.c (mfont__flt_run): Don't calculate a glyph metric if
834         the glyph is already handled by OTF.
835
836 2007-08-21  Kenichi Handa  <handa@m17n.org>
837
838         * font-ft.c (ft_check_capability): Check cap->script_tag at first.
839
840 2007-08-20  Kenichi Handa  <handa@m17n.org>
841
842         * font-flt.c (mfont__flt_run): Get glyph metrics before printing
843         debug information.
844
845 2007-08-17  Kenichi Handa  <handa@m17n.org>
846
847         * m17n-flt.h (struct _MFLTGlyphString): Member pointer renamed to
848         user_data.
849         (MFLTOtfSpec): Renamed from MFLT_OTF_Spec.
850         (MFLTFont): Prototype of the member drive_otf adjusted.
851
852         * m17n-flt.c (run_stages): Fix handling of padding.
853
854         * font-ft.c (get_glyph_metric): New function.
855         (DEVICE_DELTA): Return 26.6 fixed point value.
856         (adjust_anchor): Likewise.
857         (mfont__ft_drive_otf): Use get_glyph_metric.
858
859         * font-flt.c (mfont__flt_run): Pay attention to padding on
860         printing debug info.
861
862 2007-08-16  Kenichi Handa  <handa@m17n.org>
863
864         * m17n-flt.c (run_stages): Fix typo.
865
866         * font-ft.c (adjust_anchor): Argument changed.  Calculte based on
867         26.6 fixed point.
868         (mfont__ft_drive_otf): Don't call OTF_check_features for GPOS.
869         Adjusted for the argument change of adjust_anchor.  Calculte based
870         on 26.6 fixed point.
871
872 2007-08-15  Kenichi Handa  <handa@m17n.org>
873
874         * charset.c (mcharset__load_from_database): Set mdebug_flag
875         instead of mdebug_mask.
876
877         * coding.c (mcoding__load_from_database): Set mdebug_flag instead
878         of mdebug_mask.
879
880         * database.c (load_database): Set mdebug_flag instead of
881         mdebug_mask.
882         (mdatabase__load_for_keys): Likewise.
883
884         * draw.c: Include "internal-flt.h".
885         (dump_combining_code): Don't subtract 128 from combining code
886         off_x/y.
887
888         * font-flt.c: Include "internal-flt.h".  Set mdebug_flag instead
889         of mdebug_mask.
890         (run_rule): Print debug info only when MDEBUG_FLAG is greater than
891         2.
892         (run_cond): Likewise.
893         (run_otf): Likewise.
894         (run_command): Likewise.
895         (mfont__flt_run): Change format of debug info.
896
897         * font-ft.c: Include "internal-flt.h".
898         Set mdebug_flag instead of mdebug_mask.
899         (mfont__ft_drive_otf): Fix arg to OTF_check_features.
900
901         * input.c: Set mdebug_flag instead of mdebug_mask.
902         (shift_state): New MDEBUG_FLAG macro.
903         (preedit_commit): Likewise.
904         (filter): Likewise.
905
906         * internal-flt.h: New file.
907
908         * internal-gui.h (MAKE_COMBINING_CODE, COMBINING_CODE_OFF_Y)
909         (COMBINING_CODE_OFF_X, COMBINING_CODE_BASE_X)
910         (COMBINING_CODE_BASE_Y, COMBINING_CODE_ADD_X)
911         (COMBINING_CODE_ADD_Y, MAKE_COMBINING_CODE_BY_CLASS)
912         (COMBINING_BY_CLASS_P, COMBINING_CODE_CLASS)
913         (MAKE_PRECOMPUTED_COMBINDING_CODE, COMBINING_PRECOMPUTED_P): Move
914         these macros to internal-flt.h.
915
916         * internal.h (M17N_OBJECT_ADD_ARRAY): Adjusted for the change of
917         mdebug__flags.
918         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Likewise.
919         (enum MDebugMaskBit): Delete this enum.
920         (enum MDebugFlag): New enum.
921         (mdebug__flag): Don't extern it.
922         (mdebug__flags): Extern it.
923         (MDEBUG_FLAG): New macro.
924         (MDEBUG_PRINT0): Use the macro MDEBUG_FLAG.
925         (MDEBUG_DUMP, MDEBUG_PUSH_TIME, MDEBUG_POP_TIME)
926         (MDEBUG_PRINT_TIME): Likewise.
927
928         * m17n-X.c (xfont_open): Set mdebug_flag instead of mdebug_mask.
929         (xfont_list): Likewise.
930
931         * m17n-core.c (mdebug__flag): Delete this variable.
932         (mdebug__flags): New variable.
933         (SET_DEBUG_FLAG): Make it a function.
934         (m17n_init_core): Set mdebug_flag instead of mdebug_mask.
935         (m17n_fini_core): Likewise.
936
937         * m17n-gui.c (m17n_init_win): Set mdebug_flag instead of mdebug_mask.
938         (m17n_fini_win): Likewise.
939
940         * m17n-misc.h (enum MErrorCode): Add MERROR_FLT.
941
942         * m17n.c (m17n_init): Set mdebug_flag instead of mdebug_mask.
943         (m17n_fini): Likewise.
944
945         * symbol.c (msymbol__free_table): Adjusted for the change of
946         mdebug__flags.
947
948         * Makefile.am (BASICBUILDS): Add libm17n-flt.la.
949         (BASICHEADERS): Add m17n-flt.h.
950         (FLT_SOURCES): New variable.
951         (libm17n_flt_la_SOURCES, libm17n_flt_la_LIBADD)
952         (libm17n_flt_la_LDFLAGS): Likewise.
953
954         * m17n-flt.h: New file.
955
956         * m17n-flt.c: New file created by modifying font-flt.c.
957
958 2007-07-13  Kenichi Handa  <handa@m17n.org>
959
960         * Version 1.4.0 released.
961
962 2007-07-12  Kenichi Handa  <handa@m17n.org>
963
964         * input.c: Fix doxygen @ref commands.
965
966 2007-07-10  Kenichi Handa  <handa@m17n.org>
967
968         * m17n-core.h (M17NFunc): Fix typo of Doxygen directive.
969
970 2007-07-09  Kenichi Handa  <handa@m17n.org>
971
972         * m17n-core.h (M17N_BEGIN_HEADER, M17N_END_HEADER): New macros.
973
974         * m17n.h: Include m17n-core.h if not yet done.  Use macros
975         M17N_BEGIN_HEADER and M17N_END_HEADER.
976
977         * m17n-gui.h: Likewise.
978
979         * m17n-misc.h: Likewise.
980
981 2007-06-13  Kenichi Handa  <handa@m17n.org>
982
983         * font-flt.c (load_command): Prepend "^" in the regular expression.
984
985 2007-06-11  Kenichi Handa  <handa@m17n.org>
986
987         * language.c (mlanguage_name_list): Fix previous change.
988
989         * coding.c (mcoding__load_from_database): Add aliases in
990         coding_definition_list.
991
992 2007-06-10  Kenichi Handa  <handa@m17n.org>
993
994         * language.c (mlanguage_name_list): Fix previous change.
995
996 2007-06-08  Kenichi Handa  <handa@m17n.org>
997
998         * input.c (update_candidate): Copy candidate_list earlier.
999         (re_init_ic): Provide pseudo initialize state if none.
1000
1001 2007-06-05  Kenichi Handa  <handa@m17n.org>
1002
1003         * input.c (preedit_insert): Print debug information.
1004
1005         * database.c (expand_wildcard_database): New function.
1006         (mdatabase_list): Fix handling of wildcard database.
1007
1008         * language.c (load_lang_name): New function.
1009         (mlang__fini): Cancel the last two changes.
1010         (mlanguage_name_list): New arg script and territories.  Use
1011         load_lang_name.
1012
1013         * m17n.h (mlangauge_name_list): Adjusted.
1014
1015 2007-06-04  Kenichi Handa  <handa@m17n.org>
1016
1017         * input.c (open_im): Check if the input method has at least one
1018         state.
1019
1020 2007-06-01  Kenichi Handa  <handa@m17n.org>
1021
1022         * input.c (shift_state): Change the format of debug print.
1023         (preedit_commit): New arg need_prefix.  Caller changed.
1024         (update_candidate): Copy candidate_list.
1025         (take_action_list): Likewise.
1026         (handle_key): Change the format of debug print.
1027
1028         * font-flt.c (load_flt): Ignore unknown directives.
1029
1030 2007-05-25  Kenichi Handa  <handa@m17n.org>
1031
1032         * m17n-core.c (mdebug__unregister_object): Small optimization.
1033
1034         * database.c (find_file): Merged into get_database_file.
1035         (get_database_file): New arg result.  Caller changed.
1036         (mdatabase__check): Fix the logic.
1037
1038 2007-05-24  Kenichi Handa  <handa@m17n.org>
1039
1040         * database.c (find_database): If unprocessed wildcard database is
1041         found, register database filed and recursively call find_database.
1042         (free_db_info): Unref db_info->properties.
1043         (register_database): New arg properties.  Delete code for
1044         initializing mdatabase__list.
1045         (register_databases_in_files): Argument changed.  Caller changed.
1046         (mdatabase__update): Don't list files by glob here.
1047         (mdatabase_list): If unprocessed wildcard database is found,
1048         register database filed and recursively call mdatabase_list.
1049
1050         * database.h (enum MDatabaseStatus): New enum
1051         MDB_STATUS_AUTO_WILDCARD.
1052
1053         * input.c (load_branch): Fix previous change.
1054         (update_global_info): If the global database is not found, return -1.
1055
1056 2007-05-23  Kenichi Handa  <handa@m17n.org>
1057
1058         * database.c (Mversion): New variable.
1059         (mdatabase__init): Initialize it.
1060         (register_database): New arg properties.  Caller changed.
1061         (register_databases_in_files): Don't check version here.
1062         (mdatabase__update): Likewise.
1063
1064         * database.h (MDatabaseInfo): New member properties.
1065
1066 2007-05-21  Kenichi Handa  <handa@m17n.org>
1067
1068         * language.c: Include <ctype.h>
1069         (mlanguage__info): Use strncasecmp (not memcmp).
1070         (mlanguage_name): Downcase language name for backward
1071         compatibility.
1072
1073         * input.c (filter): Don't check Mlanguage property of
1074         ic->im->langauge.
1075
1076 2007-05-18  Kenichi Handa  <handa@m17n.org>
1077
1078         * language.c (mlanguage_name): Fix it to handle M-text English
1079         name.
1080
1081         * input.c (config_command): Set NAME before using it.
1082         (load_branch): Try to resolve a map name by variables.
1083
1084 2007-05-17  Kenichi Handa  <handa@m17n.org>
1085
1086         * language.c (mlang__fini): Fix previous change.
1087
1088 2007-05-16  Kenichi Handa  <handa@m17n.org>
1089
1090         * plist.c (free_plist): Cancel the last change.
1091         (write_element): Check if PLIST is nested.
1092         (mplist__from_plist): Label a plist as nested if appropriate.
1093         (mplist__from_alist): Label a plist as nested.
1094         (mplist__conc): Check the value of PL before referring it.  Label
1095         a plist as nested if appropriate.
1096         (mplist_copy): Label a plist as nested if appropriate.
1097         (mplist_put_func): Return Mnil if KEY is a managing key.
1098         (mplist_push): Label a plist as nested if appropriate.
1099
1100         * plist.h (MPLIST_SET_NESTED_P): Return 1 iff plist->control.flag
1101         is set as nested.
1102
1103         * language.c (mlang__fini): Unref each element of langname_list.
1104
1105 2007-05-14  Kenichi Handa  <handa@m17n.org>
1106
1107         * language.c: Include <string.h> and <locale.h>.
1108         (langname_list): New variable.
1109         (load_lang_script_list): Exclude invalid list elements.
1110         (mlang__init): Initialize langname_list.
1111         (mlang__fini): Unref langname_list.
1112         (mlanguage__info): Adjusted for the change of English
1113         name (symbol->M-text).
1114         (mlanguage_name): Label it as obsolete.
1115         (mlanguage_name_list): New function.
1116
1117         * m17n.h (mlanguage_name_list): Extern it.
1118
1119         * locale.c (make_locale): Fix setting of members of locale.
1120
1121         * plist.c (free_plist): Unref also nested plist.
1122
1123 2007-05-11  Kenichi Handa  <handa@m17n.org>
1124
1125         * coding.c (mconv_reset_converter): Set internal->used to 0.
1126
1127 2007-05-08  Kenichi Handa  <handa@m17n.org>
1128
1129         * input.c (check_description): Force copying the translated text.
1130
1131 2007-05-02  Kenichi Handa  <handa@m17n.org>
1132
1133         * input.c (minput_save_config): Unref unnecessary plist.  Use
1134         free_im_list to free im_config_list.
1135
1136 2007-04-20  Kenichi Handa  <handa@m17n.org>
1137
1138         * input.c (config_command): Fix previous change again.
1139         (config_variable): Likewise.
1140         (minput_config_command): Fix for the case of setting back to
1141         default.
1142         (minput_config_variable): Likewise.
1143         (minput_save_config): Include nil as documentation of customized
1144         command/variable.
1145
1146 2007-04-05  Kenichi Handa  <handa@m17n.org>
1147
1148         * input.c (config_command): Fix previous change.
1149         (config_variable): Likewise.
1150
1151         * plist.c (mplist_get_func): Fix for backward compatiblity.
1152
1153 2007-04-04  Kenichi Handa  <handa@m17n.org>
1154
1155         * input.c (minput_get_command, minput_config_command): Fix example
1156         codes.
1157
1158 2007-03-29  Kenichi Handa  <handa@m17n.org>
1159
1160         These changes are to avoid unsafe casting of a function pointer.
1161
1162         * face.h (enum MFaceProperty): Delete MFACE_HOOK_FUNC.
1163         (struct MFace): New member hook.
1164
1165         * face.c (serialize_face): Adjusted for the change of MFace.
1166         (deserialize_face): Likewise.
1167         (mface__init): Likewise.  Use msymbol_put_func.
1168         (mface__realize): Adjusted for the change of MFace.  Avoid
1169         compiler warning.
1170         (mface_get_prop): Adjusted for the change of MFace.
1171         (mface_put_prop): Likewise.
1172         (mface_get_hook): New function.
1173         (mface_put_hook): New function.
1174         (mface_update): Adjusted for the change of MFace.
1175
1176         * input-gui.c (win_callback): Use mplsit_get_func.
1177         (minput__win_init): Use mplsit_put_func.
1178
1179         * input.c (take_action_list): Use mplist_get_func.
1180         (init_ic_info): Likewise.
1181         (fini_ic_info): Likewise.
1182         (minput_callback): Likewise.
1183         (minput__init): Use mplist_put_func.
1184
1185         * language.c (mlang__init): Use msymbol_put_func.
1186
1187         * m17n-core.h (M17NFunc): New function type.
1188         (M17N_FUNC): New macro.
1189         (msymbol_put_func, msymbol_get_func): Extern them.
1190         (mplist_put_func, mplist_get_func): Extern them.
1191
1192         * m17n-gui.h (mface_get_hook, mface_put_hook): Extern them.
1193
1194         * m17n-gui.c (mframe): Add a proper casting.
1195
1196         * plist.h (struct MPlist): Make the member val a union.
1197         (MPLIST_VAL): Adjusted for the above change.
1198         (MPLIST_FUNC): New macro.
1199         (MPLIST_VAL_FUNC_P, MPLIST_SET_VAL_FUNC_P): New macros.
1200
1201         * plist.c (mplist_put_func, mplist_get_func): New functions.
1202
1203         * symbol.c (msymbol__fini): Use MPLIST_VAL.
1204         (msymbol_put_func, msymbol_get_func): New functions.
1205
1206         * textprop.c (mtext_serialize): Use msymbol_get_func.
1207         (mtext_deserialize): Likewise.
1208
1209 2007-03-28  Kenichi Handa  <handa@m17n.org>
1210
1211         * input.c (get_candidate_list): Avoid unnecessary unref.
1212
1213 2007-03-23  Kenichi Handa  <handa@m17n.org>
1214
1215         * database.c (mdatabase__update): Unref plist at the tail.
1216
1217 2007-03-21  Kenichi Handa  <handa@m17n.org>
1218
1219         * input.c (update_custom_info): Fix for the case "name == Mnil &&
1220         extra != Mnil".
1221         (config_command): Fix for the case that configuration is
1222         cancelled.
1223         (config_variable): Likewise.
1224         (minput_config_command): If keyseqlist is an empty list, cancel
1225         the customization.
1226         (minput_config_variable) If value is an empty list, cancel the
1227         customization.
1228         (minput_save_config): Handle cancellation of config and customize
1229         correctly.
1230
1231 2007-03-15  Kenichi Handa  <handa@m17n.org>
1232
1233         * input.c (minput_config_variable): Check custom->vars (not
1234         custom->cmds).
1235
1236 2007-03-01  Kenichi Handa  <handa@m17n.org>
1237
1238         * input.c (reload_im_info): Setup cmds, vars, and title of
1239         im_info.
1240         (check_variable_value): Fix the return value.
1241
1242         * database.c (mdatabase__check): If necessary, update database and
1243         find a new file.
1244
1245 2007-02-28  Kenichi Handa  <handa@m17n.org>
1246
1247         * database.c (get_dir_info): Set dir_info->status to
1248         MDB_STATUS_OUTDATED.
1249         (check_version): New function.
1250         (register_database): Don't call find_database.
1251         (register_databases_in_files): Don't register a database of
1252         invalid version.
1253         (mdatabase__update): Likewise.  Avoid unnecessary scanning.
1254
1255         * database.h (enum MDatabaseStatus): New membes MDB_STATUS_UPDATED
1256         and MDB_STATUS_OUTDATED.
1257
1258         * font.h (struct MFont): Types of members type, source, and
1259         spacing changed to unsigned.
1260
1261         * internal-gui.h (struct): Types of members category and type
1262         changed to unsigned.
1263
1264         * internal.h (struct MText): Types of members format and coverage
1265         changed to unsigned.
1266
1267         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 5.
1268         (M17NLIB_VERSION_NAME): Changed to "1.3.5".
1269
1270 2007-02-23  Kenichi Handa  <handa@m17n.org>
1271
1272         * input.c (Mpop): New variable.
1273         (fully_initialize): Initialize Mpop.
1274         (parse_action_list): Handle Mpop.
1275         (take_action_list): Likewise.
1276         (handle_key): When a key is unhandled, shift to the initial state
1277         only if the current state has no branch action.
1278
1279 2007-02-12  Kenichi Handa  <handa@m17n.org>
1280
1281         * input.c (get_preceding_char): Unref mt if necessary.
1282         (get_following_char): Likewise.
1283         (parse_action_list): Fix handling of `insert' action as
1284         candidates.
1285         (get_candidate_list): Fix for handling (("CANDIDATE1" ...)).
1286         (take_action_list): Check invalid candidate list.
1287
1288 2007-02-06  Kenichi Handa  <handa@m17n.org>
1289
1290         * input.c (integer_value): Check also ic->produced for @-N.
1291
1292 2007-01-26  Kenichi Handa  <handa@m17n.org>
1293
1294         * database.c (mdatabase__update): Check mdatabase__dir_list from
1295         the tail.
1296
1297         * font-ft.c (STRDUP_LOWER): Don't ignore the tailing spaces.
1298
1299 2007-01-12  Kenichi Handa  <handa@m17n.org>
1300
1301         * input.c (handle_key): Handle a branch action of the initial
1302         state correctly.
1303
1304 2007-01-10  Kenichi Handa  <handa@m17n.org>
1305
1306         * m17n-gd.c (gd_render): Delete superfluous line.
1307
1308 2006-12-26  Kenichi Handa  <handa@m17n.org>
1309
1310         * m17n.h (minput_callback): Extern it.
1311
1312         * input.h (minput__callback): Delte extern.
1313
1314         * input.c (get_surrounding_text): Adjusted for the change of
1315         minput__callback to minput_callback.
1316         (delete_surrounding_text): Likewise.
1317         (minput_create_ic): Likewise.
1318         (minput_destroy_ic): Likewise.
1319         (minput_filter): Likewise.
1320         (minput_set_spot): Likewise.
1321         (minput_toggle): Likewise.
1322         (minput_reset_ic): Likewise.
1323
1324         (preedit_commit): Reset ic->candidate_index, ic->candidate_from,
1325         and ic->candidate_to to 0.
1326         (minput_callback): Renamed from minput__callback.
1327
1328         * input-gui.c (win_callback): Adjusted for the change of
1329         minput__callback to minput_callback.
1330
1331 2006-12-15  Kenichi Handa  <handa@m17n.org>
1332
1333         * font-ft.c (ft_add_font): Fix typo.
1334
1335 2006-12-06  Kenichi Handa  <handa@m17n.org>
1336
1337         * Version 1.3.4 released.
1338
1339 2006-11-16  Kenichi Handa  <handa@m17n.org>
1340
1341         * input.c (parse_action_list): Allow (undo 0).
1342         (adjust_markers): New function.
1343         (preedit_insert, preedit_delete): Call adjust_markers.
1344         (preedit_replace): New function.
1345         (update_candidate): Call preedit_replace instead of preedit_insert
1346         and preedit_delete.
1347         (filter): When ic_info->commit_key_head is nonzero, shift input
1348         event keys even if there's no committed text.
1349
1350 2006-11-10  Kenichi Handa  <handa@m17n.org>
1351
1352         * input.h (MInputContextInfo): New member commit_key_head.
1353
1354         * input.c (preedit_commit): Update ic_info->commit_key_head.
1355         (take_action_list): Reset ic_info->commit_key_head on Mundo.
1356         (filter): When committed, shift keys by ic_info->commit_key_head.
1357
1358 2006-10-30  Kenichi Handa  <handa@m17n.org>
1359
1360         * input.c (preedit_delete): Fix typo.
1361         (take_action_list): Print more debugging information.  Allow
1362         variable in arg of 'select' and `pushback'.
1363
1364         * database.c (gen_database_name): Don't put extra space.
1365         (load_database): Print debugging information.
1366         (register_databases_in_files): New arg headlen.  Callers changed.
1367         (mdatabase__load_for_keys): Shorten debugging information.
1368         (mdatabase_load): Don't print debugging information here.
1369
1370 2006-10-27  Kenichi Handa  <handa@m17n.org>
1371
1372         * input.c (marker_code): New arg surrounding.  Callers changed.
1373         (surrounding_pos): Check if name[0] == '@'.
1374         (integer_value): Fix for the change semantics of `@-N' and `@+N'.
1375         (take_action_list): Likewise.
1376         (get_preceding_char): If POS is zero, always call
1377         get_surrounding_text.
1378
1379 2006-10-19  Kenichi Handa  <handa@m17n.org>
1380
1381         * input.c (load_variables): Fix setting of `global'.
1382
1383 2006-10-16  Kenichi Handa  <handa@m17n.org>
1384
1385         * draw.c (draw_background): Be sure to set *to_x.
1386         (render_glyph_string): If from == to, just return.
1387
1388 2006-10-18  Kenichi Handa  <handa@m17n.org>
1389
1390         * database.c (get_dir_info): Return NULL if the directory name is
1391         too long.
1392         (register_databases_in_files): Call register_database with
1393         MDB_STATUS_AUTO.
1394         (mdatabase__update): Fix logic.  Call register_database with
1395         MDB_STATUS_AUTO.
1396         (mdatabase_define): Call register_database with
1397         MDB_STATUS_EXPLICIT.
1398
1399         * input.c (delete_surrounding_text): Be sure to set members
1400         preceding_text and following_text to NULL.
1401         (shift_state): Save variable values in ic_info->vars_saved.
1402         (preedit_commit): Don't print debug information here.  Don't
1403         change ic_info->keys here.
1404         (get_candidate_list): Don't ref plist.
1405         (take_action_list): Don't unref return value of
1406         get_candidate_list.  For undo, reset ic->produced and recover
1407         ic_info->vars.  Be sure to set ic->candidate_list to NULL after
1408         unref it.
1409         (init_ic_info): Set ic_info->vars_saved.
1410         (fini_ic_info): Unref ic_info->vars_saved.
1411         (re_init_ic): Be sure to set ic->candidate_list to NULL after
1412         unref it.
1413         (filter): Be sure to set members preceding_text and following_text
1414         to NULL.  Print debug information about produced text.  Delete
1415         processed keys from ic_info->keys.
1416
1417         * input.h (MInputContextInfo): New member vars_saved.
1418
1419 2006-10-16  Kenichi Handa  <handa@m17n.org>
1420
1421         * database.c (mdatabase__update): Fix the way to get db_info.
1422
1423 2006-10-02  Kenichi Handa  <handa@m17n.org>
1424
1425         * font.h (struct MFont): New member `multiple_sizes'.  Bit-size of
1426         `size' changed to 24.
1427
1428         * font.c (xlfd_unparse_name): Adjusted for the change of
1429         MFont->size.
1430         (font_score): Likewise.
1431         (mfont__set_spec_from_face): Set spec->multiple_sizes to 0.
1432
1433         * m17n-X.c (MFontX, _MFontX): Deleted.
1434         (SET_SIZE, HAVE_SIZE): Deleted.
1435         (free_display_info): Adjusted for the change of
1436         disp_info->font_list format.
1437         (xfont_registry_list): Likewise.
1438         (xfont_open): Likewise.
1439         (xfont_list): Likewise.
1440         (xfont_encode_char): Ignore size to find a realized font.
1441         (MRealizedFontXft): Change the order of members to make it
1442         compatible with MRealizedFontFT.
1443
1444 2006-09-27  Kenichi Handa  <handa@m17n.org>
1445
1446         * font.c (mfont_match_p, mfont_open, mfont_encapsulate)
1447         (mfont_close): Add comments.
1448
1449         * mtext-lbrk.c (mtext_line_break): Add comment.
1450
1451 2006-09-26  Kenichi Handa  <handa@m17n.org>
1452
1453         * input.c (minput_get_description): Handle description about
1454         inclusion-only input methods.
1455
1456 2006-09-21  Kenichi Handa  <handa@m17n.org>
1457
1458         * input.c (M_gettext): New variable.
1459         (fully_initialize): Initialize M_gettext.
1460         (check_description): New function.
1461         (load_commands): Call check_description.
1462         (config_all_commands): Be sure to unref pl.
1463         (load_variables): Call check_description.
1464         (config_all_variables): Be sure to unref pl.
1465         (load_im_info): Call check_description.
1466
1467         * internal.h [ENABLE_NLS]: Include <libintl.h> and define _.
1468
1469         * m17n-core.c (m17n_init_core) [ENABLE_NLS]: Call bindtextdoman
1470         and bind_textdomain_codeset.
1471
1472         * Makefile.am (AM_CPPFLAGS): Add -DGETTEXTDIR=...
1473
1474 2006-09-15  Kenichi Handa  <handa@m17n.org>
1475
1476         * input.c (reload_im_info): Update custom and global info.
1477         (init_ic_info): Fix previous change.
1478
1479 2006-09-14  Kenichi Handa  <handa@m17n.org>
1480
1481         * database.c: Include <libgen.h>.
1482         (mdatabase__lock): Make a directory if necessary.
1483
1484         * input.c (resolve_command): Adjusted for the format change of
1485         configured_cmds member.
1486         (load_commands, load_variables): Fix for errornous data handling.
1487         (config_command, config_variable): New function.
1488         (config_all_commands, config_all_variables): Renamed from
1489         config_commands and config_variables.  Utilize the above function.
1490         (check_variable_value): Argument changed.  Callers changed.
1491         (load_im_info): Call config_all_commands and config_all_variables.
1492         (init_ic_info): Adjusted for the format change of configured_vars
1493         member.
1494         (minput__init): Initialize Mcustomized, Mconfigured, and
1495         Minherited.
1496         (Mcustomized, Mconfigured, Minherited): New variables.
1497         (minput_get_command): Be sure to return NULL if an input method
1498         use no local command.
1499         (minput_get_variable): Be sure to return NULL if an input method
1500         use no local variable.
1501         (minput_config_command, minput_config_variable)
1502         (minput_save_config): Adjusted for the format change of
1503         configured_cmds and configured_vars members.
1504         
1505         * plist.c (write_element): Delete superfluous ':'.
1506
1507 2006-09-13  Kenichi Handa  <handa@m17n.org>
1508
1509         * m17n.h (Minherited, Mcustomized, Mconfigured): Extern them.
1510         (minput_config_file): Extern it.
1511
1512         * draw.c (Minherited): Declaration moved to input.c.
1513         (mdraw__init): Don't initialize Minherited here.
1514
1515         * database.c (mdatabase__unlock): Be sure to unlink uniq file.
1516
1517 2006-09-07  Kenichi Handa  <handa@m17n.org>
1518
1519         * textprop.c (mtext_serialize): Call mplist__serialize with the
1520         arg pretty 0.
1521
1522         * plist.h (mplist__serialize): Prototype adjusted.
1523         (mplist__assq): Extern it.
1524
1525         * plist.c: Include <ctype.h>
1526         (PUTC, PUTS): New macros.
1527         (write_symbol): New function.
1528         (write_element): New arg indent.
1529         (dump_string, dump_plist_element): Delete them.
1530         (mplist__from_string): New arg pretty.
1531         (mplist__assq): New function.
1532         (mdebug_dump_plist): Use write_element.
1533
1534         * mtext.c (mtext_cat_char): Allocate more memory.
1535         (mdebug_dump_mtext): Don't escal a newline character.
1536
1537         * m17n.h (minput_get_command, minput_get_variable)
1538         (minput_config_command, minput_config_variable)
1539         (minput_save_config): Extern them.
1540
1541         * m17n-core.c: Include <string.h>.
1542         (m17n_init_core): If the env. var. MDEBUG_OUTPUT_FILE is "stdout",
1543         use the stream stdout instead of a file of that name.
1544
1545         * m17n-X.c (mwin__parse_event): Fix handling of Shift and Control
1546         modifiers.
1547
1548         * internal.h (MFAILP, MDEBUG_PRINT0): New macros.
1549         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
1550         (MDEBUG_PRINT4, MDEBUG_PRINT5): Use MDEBUG_PRINT0.
1551         (MDEBUG_DUMP): Flush the stream.
1552
1553         * input.h (struct _MInputMethodInfo): Delete member im.  New
1554         members mdb, language, name, extra, cmds, configured_cmds,
1555         bc_cmds, vars, configured_vars, bc_vars, description, and tick.
1556         (MInputContextInfo): New member tick.
1557
1558         * input.c: Big change to improve user-side input method
1559         customization.  Here, list just public API changes.
1560         (minput_get_commands, minput_get_variables)
1561         (minput_assign_command_keys, minput_set_variable): Label them
1562         obsolete.
1563         (minput_get_command, minput_get_variable)
1564         (minput_config_command, minput_config_variable)
1565         (minput_save_config): New functions.
1566         
1567         * database.h (PATH_MAX): Define it if not yet defined.
1568         (PATH_SEPARATOR): Likewise.
1569         (enum MDatabaseStatus): New enum.
1570         (struct MDatabaseInfo): Moved from database.c.  New members status,
1571         time, lock_file, and uniq_file.
1572         (mdatabase__update, mdatabase__file, mdatabase__lock, mdatabase__save)
1573         (mdatabase__unlock): Extern them.
1574
1575         * database.c: Include <time.h>.
1576         (MDB_DIR_LEN): Don't include the terminating '\0' in the length.
1577         (GEN_PATH): Args changed.  Callers changed.
1578         (struct MDatabaseInfo): Moved to database.h.
1579         (struct MDatabase, mdb_list): Deleted.
1580         (mdatabase__list): New var.
1581         (get_database_filename): Deleted.  Callers changed to use
1582         get_database_file.
1583         (find_file, get_database_file): New files.
1584         (get_dir_info): Initialize new members of MDatabaseInfo.
1585         (find_database): Arg chagnded.  Callers changed.
1586         (free_db_info, register_database, register_databases_in_files):
1587         New functions.
1588         (update_database_list): Deleted.
1589         (mdatabase__init): Initialize mdatabase__list instead of mdb_list.
1590         (mdatabase__fini): Finalize mdatabase__list instead of mdb_list.
1591         (mdatabase__update): New function.
1592         (mdatabase__check): Return value changed.
1593         (mdatabase__file, mdatabase__lock, mdatabase__save)
1594         (mdatabase__unlock): New functions.
1595
1596 2006-08-30  TAKAHASHI Naoto  <ntakahas@m17n.org>
1597
1598         * input.c (get_surrounding_text): Return -2 when surrounding text
1599         is unavailable.
1600         (get_following_char): Likewise.
1601         (get_preceding_char): Likewise.
1602         (minput__callback): Return 0 if there is a callback function,
1603         otherwise -1.
1604
1605 2006-08-17  Kenichi Handa  <handa@m17n.org>
1606
1607         * input.c (reset_ic): Use shift_state to setup the current state.
1608
1609 2006-08-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>  (tiny change)
1610
1611         * Makefile.am (libm17n_la_LIBADD, libm17n_gui_la_LIBADD)
1612         (libm17n_X_la_LIBADD, libm17n_gd_la_LIBADD, linkcore_LDADD)
1613         (linkshell_LDADD, linkgui_LDADD): Use ${top_builddir}.
1614
1615 2006-08-02  Kenichi Handa  <handa@m17n.org>
1616
1617         * plist.c (mdebug_dump_plist): Fix the 2nd arg to dump_plist_element.
1618
1619         * mtext.c (mdebug_dump_mtext): If not fullp, dump just text. 
1620
1621         * font-ft.c (ft_encapsulate): Add code for debugging.
1622         (mfont__ft_drive_otf): Be sure to encode character before getting
1623         metrics.
1624
1625 2006-07-21  Kenichi Handa  <handa@m17n.org>
1626
1627         * draw.c (mdraw_text_extents): Fix previous typo.
1628
1629 2006-07-19  Kenichi Handa  <handa@m17n.org>
1630
1631         * draw.c (gstring_width): New arg lbearing.
1632         (render_glyph_string): Adjusted for the change of gstring_width.
1633         (mdraw_text_extents): Fix lbearing of ink and line metrics.
1634
1635         * m17n-core.h (Mlanguage): Extern it.
1636
1637         * m17n.h (Mlanguage): Extern deleted. 
1638
1639         * mtext.c (mtext__init): Initialize Mlanguage.
1640         (Mlanguage): Declaration moved from locale.c
1641
1642         * locale.c (mlocale__init): Don't initialize Mlanguage here.
1643         (Mlanguage): Declaration moved to mtext.c.
1644
1645         * language.c (mlang__init): Don't initialize Mlanguage here.
1646
1647         * font.c (OTF_tag_name) [! HAVE_OTF]: New function.
1648
1649 2006-07-14  Kenichi Handa  <handa@m17n.org>
1650
1651         * font-ft.c: Use FT_BDF_H macro.  Include fontconfig/fcfreetype.h.
1652         (MRealizedFontFT): New member face_encapsulated.
1653         (free_ft_rfont): Pay attention to ft_rfont->face_encapsulated.
1654         (ft_gen_font): New function.
1655         (ft_add_font): Use ft_gen_font.
1656         (ft_list_script): Store lists in ft_script_list.
1657         (ft_check_otf): New arg ft_face.  Caller changed.
1658         (ft_check_language): Likewise.
1659         (ft_check_script): Likewise.
1660         (ft_encapsulate, ft_close): New functions.
1661         (mfont__ft_driver): Initialize members encapsulate and close.
1662         (mfont__ft_drive_otf): Use OTF_open_ft_face if it is available.
1663
1664         * font.h (struct MRealizedFont): New member encapsulating.
1665         (struct MFontDriver): New members encapsulate and close.
1666
1667         * font.c (mfont__match_p): If FONT is realized, check capability
1668         by font drivers's check_capability method.
1669         (mfont_match_p, mfont_open, mfont_encapsulate, mfont_close): New
1670         functions.
1671
1672         * m17n-X.c (xfont_list_family_names): Delete unused var.  Fix
1673         declarations of foundry and fam local vars.
1674         (xft_driver): Make it static.
1675
1676         * m17n-gui.h (mfont_match_p, mfont_open, mfont_encapsulate)
1677         (mfont_close): Extern them.
1678
1679         * m17n-gd.c (device_open): Don't specify foundry and family of the
1680         default face.
1681
1682 2006-07-11  Kenichi Handa  <handa@m17n.org>
1683
1684         * m17n-gui.c (m17n_fini_win): Set null_interface.handle to NULL;
1685
1686 2006-07-13  Kenichi Handa  <handa@m17n.org>
1687
1688         * font-ft.c (fc_build_charset): Return NULL if FcCharSet can't be
1689         created.
1690         (ft_check_script): Delete unused var.
1691         (ft_list_capability): Likewise.
1692
1693         * font.c (mfont__get_capability): Setup cap->otf.
1694         (Motf): Make it global.
1695         (mfont_get_prop): Accept Mlanguage, Mscript, and Motf as key arg.
1696
1697         * font.h (MFontCapability): New member otf.
1698
1699         * language.c (mlang__fini): Delete unused vars.
1700
1701         * m17n-gui.h (Motf): Extern it.
1702
1703         * database.c (update_database_list): Delete unused vars.
1704
1705 2006-07-07  Kenichi Handa  <handa@m17n.org>
1706
1707         * font-ft.c (DEVICE_DELTA): Fix typo.
1708
1709 2006-07-06  Kenichi Handa  <handa@m17n.org>
1710
1711         * fontset.c (mfont__lookup_fontset): Don't ignore family and
1712         foundry of face.
1713
1714 2006-07-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
1715
1716         * database.c: Update comments.
1717
1718 2006-07-05  Kenichi Handa  <handa@m17n.org>
1719
1720         * database.c (PATH_MAX): Define it if not yet defined.
1721         (PATH_SEPARATOR, USE_GEN_PATH, GEN_PATH, GEN_PATH_FROM_MT): New
1722         macros.
1723         (get_database_filename): Use GEN_PATH.
1724         (get_dir_info): Don't include the last '/' in directory name.
1725         (register_database): New function.
1726         (update_database_list): Use register_database.  Search all
1727         directories in mdatabase__dir_list for wildcard databases.
1728         (mdatabase__init): Check "~/.m17n.d".
1729
1730 2006-07-03  Kenichi Handa  <handa@m17n.org>
1731
1732         * input-gui.c (win_callback): If is ic->candidate_show zero, don't
1733         push reverse property.
1734
1735         * plist.c (dump_plist_element): Fix previous change.
1736
1737 2006-06-28  Kenichi Handa  <handa@m17n.org>
1738
1739         * font.c (xlfd_unparse_name): Suppress the heading '-' if not
1740         necessary.
1741
1742         * draw.c (MbidiNSM): New variable.
1743         (visual_order) [! HAVE_FRIBIDI]: Clear levels at first.  Pay
1744         attention to bidi type NSM.
1745         (mdraw__init): Initialize MbibiNSM.
1746
1747         * language.c (mscript__char_list): Fix finding a char-list element.
1748
1749         * plist.c (dump_string): Return number of printed characters.
1750         (dump_plist_element): Print elements more compactly.
1751
1752 2006-06-23  Kenichi Handa  <handa@m17n.org>
1753
1754         * Makefile.am (BUILD_LIBS): Don't increment it conditionally.
1755         (include_HEADERS): Likewise.
1756
1757 2006-06-23  TAKAHASHI Naoto  <ntakahas@m17n.org>
1758
1759         * language.c: Update documentation.
1760
1761 2006-06-23  Kenichi Handa  <handa@m17n.org>
1762
1763         * font-ft.c (struct MFontFT): Delete member lang.
1764         (free_ft_info): Don't unref member lang.  Destroy members langset
1765         and charset.
1766         (fc_parse_pattern): Last argument changed to MFontFT *.  Callers
1767         changed.  Set members langset and charset.
1768         (fc_init_font_list, fc_list_pattern, fc_build_charset): New
1769         functions.
1770         (ft_init_font_list, ft_has_char_list_p, ft_list_char_list): New
1771         functions.
1772         (ft_list_family) [HAVE_FONTCONFIG]: Include FC_CHARSET on objset.
1773         (ft_list_family) [! HAVE_FONTCONFIG]: Call ft_init_font_list.
1774         (ft_list_language) [HAVE_FONTCONFIG]: Check representative
1775         characters at first.  If it fails, try listing by language names.
1776         (ft_list_language) [! HAVE_FONTCONFIG]: Call ft_list_char_list.
1777         (ft_check_language): Renamed from ft_check_lang.  Adjusted for the
1778         change of MFontCapability.
1779         (ft_list_capability): Likewise.  Try listing by languages, then by
1780         scripts.  Check OTF at last.
1781         (ft_check_script): New function.
1782         (ft_select): Adjusted for the check of MFontCapability.
1783         (ft_list_family_names): New function.
1784         (ft_check_capability): If cap->script is not Mnil, call
1785         ft_check_script.
1786         (mfont__ft_driver): Initialize with ft_list_family_names.
1787
1788         * font.h (struct MFontDriver): New member list_fmaily_names.
1789         (struct): Change member "MSymbol *lang" to "MSymbol language".
1790
1791         * font.c: Include "language.h".
1792         (Motf): New variable.
1793         (otf_script_list, load_otf_script_list): Delete it.
1794         (find_script_from_otf_tag): Delete it.
1795         (merge_capability): New function.
1796         (mfont__init): Init Motf.
1797         (mfont__fini): Don't unref otf_script_list.
1798         (free_font_capability): Check cap->script_tag to determine if
1799         OTF-related capability is set.
1800         (mfont__get_capability): Call mscript__from_otf_tag.  Adjusted for
1801         the change of type MFontCapability.
1802         (mfont_put_prop): Call merge_capability for Mlanguage, Mscript,
1803         and Motf properties.
1804         (mfont_list): Call merge_capability for LANGUAGE arg.
1805         (mfont_list_family_names): New function.
1806
1807         * input-gui.c: Typo in comments fixed.
1808
1809         * input.c: Typo in comments fixed.
1810
1811         * language.h (mlanguage__list): Delete it.
1812         (mscript__char_list, mscript__otf_tag, mscript__from_otf_tag): New
1813         functions.
1814
1815         * language.c: Include "mtext.h".
1816         (M_script_lang_list): Delete it.
1817         (language_list, script_list): New variables.
1818         (load_lang_script_list, init_language_list, init_script_list): New
1819         functions.
1820         (mlang__init): Don't load language database here.
1821         (mlang__fini): Unref language_list and script_list if not NULL.
1822         (mlanguage__list): Delete it.
1823         (mlanguage__info, mscript__info, mscript__char_list)
1824         (mscript__otf_tag, mscript__from_otf_tag): New functions.
1825         (mlanguage_list, mlanguage_code, mlanguage_name, mlanguage_text)
1826         (mscript_list, mscript_language_list): New functions.
1827
1828         * m17n-gui.h (mfont_list_family_names): Extern it.
1829
1830         * m17n.h (mlanguage_list, mlanguage_code, mlanguage_name)
1831         (mlanguage_text, mscript_list, mscript_language_list): Extern
1832         them.
1833
1834 2006-06-21  Kenichi Handa  <handa@m17n.org>
1835
1836         * m17n-X.c (xfont_driver): Initialize with
1837         xfont_list_family_names.
1838         (xfont_list_family_names): New function.
1839         (xft_driver): Initialize with NULL for list_family_names member.
1840         (device_init): Set list_family_names member of xft_driver to that
1841         of mfont__ft_driver.
1842
1843 2006-06-06  Kenichi Handa  <handa@m17n.org>
1844
1845         * fontset.c (mfont__lookup_fontset): Don't set *num to 1 if it is 0.
1846
1847 2006-03-24  Kenichi Handa  <handa@m17n.org>
1848
1849         * font-ft.c (ft_open): Improve debug message.
1850
1851         * fontset.c (mfontset__get_font): Fix for the case that no font in
1852         per_script list is available.
1853
1854 2006-02-06  Kenichi Handa  <handa@m17n.org>
1855
1856         * Version 1.3.3 released.
1857
1858 2006-02-22  Kenichi Handa  <handa@m17n.org>
1859
1860         * textprop.c: Fix some typos in documentation.
1861
1862         * plist.c: Fix some typos in documentation.
1863
1864         * m17n-core.h: Fix some typos in documentation.
1865         (M17NLIB_PATCH_LEVEL): Updated to 3.
1866         (M17NLIB_VERSION_NAME): Updated to "1.3.3".
1867
1868         * symbol.c: Fix some typos in documentation.
1869
1870         * mtext.c: Fix some typos in documentation.
1871
1872         * input.c: Fix several typos in documentation.
1873
1874 2006-02-06  Kenichi Handa  <handa@m17n.org>
1875
1876         * Version 1.3.2 released.
1877
1878 2006-02-03  Kenichi Handa  <handa@m17n.org>
1879
1880         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 2.
1881         (M17NLIB_VERSION_NAME): Updated to "1.3.2".
1882
1883         * font.c (xlfd_parse_name): Fix handling of the name "nil".
1884
1885         * draw.c (layout_glyphs): Fix handling left_padding of
1886         composition's base.
1887
1888         * m17n-gd.c (read_rgb_txt): Support HTML 4.0 color names.
1889
1890 2006-02-02  Kenichi Handa  <handa@m17n.org>
1891
1892         * Makefile.am (include_HEADERS): Add m17n-gui.h and m17n-X.h only
1893         if WITH_GUI is true.
1894
1895 2006-01-25  Kenichi Handa  <handa@m17n.org>
1896
1897         * input.c (resolve_expression): If the value of PLIST is a plist,
1898         but the first element is not symbol, return 0.
1899
1900 2006-01-17  Kenichi Handa  <handa@m17n.org>
1901
1902         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha only if
1903         HAVE_GD is 2 or the greater.
1904
1905 2006-01-16  Kenichi Handa  <handa@m17n.org>
1906
1907         * Version 1.3.1 released.
1908
1909 2006-01-16  Kenichi Handa  <handa@m17n.org>
1910
1911         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha instead of
1912         simulating anti-aliasing.
1913
1914         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 1.
1915         (M17NLIB_VERSION_NAME): Updated to "1.3.1".
1916
1917 2006-01-12  Kenichi Handa  <handa@m17n.org>
1918
1919         * input.c (get_surrounding_text): Always pop ic->plist.
1920         (reset_ic): Don't reset ic->plist.
1921
1922 2006-01-10  Kenichi Handa  <handa@m17n.org>
1923
1924         * input.c (preedit_commit): For debugging, print only commiting
1925         charactes.  Don't set ic->candidate_show to 0.
1926         (handle_key): Don't run branch-actions just by shifting to the
1927         current state.
1928         (reset_ic): Reset state_key_head and key_head of ic_info to 0.
1929         Reset vars and plist.
1930
1931 2006-01-07  Kenichi Handa  <handa@m17n.org>
1932
1933         * input.c (load_branch): Confirm that maps is not NULL.
1934
1935 2006-01-05  Kenichi Handa  <handa@m17n.org>
1936
1937         * input-gui.c (win_filter): Try to convert arg to key only when
1938         arg is not NULL.
1939
1940         * plist.c (read_integer_element): If '#' and '-' are followed by
1941         non-integer-constituent, read them as a part of a symbol.
1942         (read_symbol_element): New arg C.
1943         (read_element): Adjust args to read_symbol_element.
1944
1945         * input.c (load_macros): On overwriting a macro, free the old
1946         definition.
1947         (minput__init): Store Mmap in load_im_info_keys.
1948         (minput_get_title_icon): If the input method has no title, be sure
1949         to return NULL.
1950         (minput_get_description): If the input method has no description,
1951         be sure to return NULL.
1952         (minput_get_variables): Fix documentation.
1953         (handle_key): Pay attention to the case that key is Mnil.
1954         (filter): Likewise.  Fix handling of such symbol as S-A.
1955
1956 2005-12-22  Kenichi Handa  <handa@m17n.org>
1957
1958         * Version 1.3.0 released.
1959
1960 2005-12-22  Kenichi Handa  <handa@m17n.org>
1961
1962         * font-ft.c (ft_list): If the specified font has no property,
1963         return all fonts.
1964
1965 2005-12-20  Kenichi Handa  <handa@m17n.org>
1966
1967         * character.c (mchar_get_prop): Check char_prop_list.
1968         (mchar_put_prop, mchar_get_prop_table): Likewise.
1969
1970 2005-12-18  Kenichi Handa  <handa@m17n.org>
1971
1972         * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
1973         file name sans language.
1974
1975 2005-12-16  TAKAHASHI Naoto  <ntakahas@m17n.org>
1976
1977         * input.c: Fix typo in comments.
1978
1979 2005-12-14  Kenichi Handa  <handa@m17n.org>
1980
1981         * input.c (minput_get_title_icon): Check the default icon for the
1982         input method.
1983
1984 2005-12-13  Kenichi Handa  <handa@m17n.org>
1985
1986         * input.c (Mless_equal, Mgreater_equal): New variables.
1987         (parse_expression, resolve_expression, parse_action_list)
1988         (take_action_list): Handle the aboves.
1989         (filter): Treat key S-X as X.
1990         (minput__init): Initialize Mless_equal and Mgreater_equal.
1991         (minput_get_title_icon): New function.
1992
1993         * m17n.h (minput_get_title_icon): Extern it.
1994
1995         * database.c (get_database_filename): Return a filename instead of
1996         file pointer.
1997         (load_database): Adjusted for the above change.
1998         (mdatabase__load_for_keys): Likewise.
1999         (mdatabase__find_file): New function.
2000
2001         * database.h (mdatabase__find_file): Extern it.
2002
2003         * font.h (mfont__resize): Delete extern.
2004
2005         * font.c (mfont__list): Check resize ratio.
2006         (mfont__resize): Delete it.
2007         (mfont_resize_ratio): Include the code of mfont__resize.
2008
2009         * font-ft.c (ft_open): Check resize ratio.
2010
2011         * m17n-X.c (xfont_open): Check resize ratio.
2012         (xft_open): Likewise.
2013
2014 2005-12-07  Kenichi Handa  <handa@m17n.org>
2015
2016         * input.c (take_action_list): If take_action_list return -1,
2017         return -1.
2018         (handle_key): Likewise.
2019
2020         * face.c (mface__for_chars): When font is specified and layouter
2021         is found for it, if the layouter doesn't support one of a
2022         character, use a face sans layouter for it.
2023
2024 2005-12-06  Kenichi Handa  <handa@m17n.org>
2025
2026         * fontset.c (mfont__lookup_fontset): If only a fallback font is
2027         found, don't use it for more than one character.
2028
2029 2005-12-05  Kenichi Handa  <handa@m17n.org>
2030
2031         * face.c (mface__realize): Set rfont->layouter to Mnil.
2032         (mface__for_chars): Fix handling of layouter.
2033
2034         * character.h (mchar__define_prop): Extern it.
2035
2036         * database.c (update_database_list): Call mchar__define_prop if
2037         necessary.
2038
2039         * character.c (mchar__init): Don't call mchar_define_property.
2040         Instead just initialize property keys.
2041         (mchar__fini): Free char_prop_list only if it's not NULL.
2042         (mchar__define_prop): New function.
2043         (mchar_define_property): Call mchar__define_prop.
2044
2045         * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
2046         mplist__fini.
2047
2048 2005-12-02  Kenichi Handa  <handa@m17n.org>
2049
2050         * language.c (mlang__init): Handle extra chars.
2051
2052         * m17n-gui.h (mfont_check): Adjust prototype.
2053
2054         * m17n-X.c (xfont_driver): Specify xfont_check_capability.
2055         (xfont_check_capability): New function.
2056         (xft_driver): Specify xft_check_capability.
2057         (xft_check_capability): New function.
2058
2059         * font-ft.c (M0_3): Delete it.
2060         (M0): New variable.
2061         (ft_get_charmaps): Refer to M0.
2062         (fc_parse_pattern): Fix previous change.
2063         (ft_list_language): Check also extra chars.
2064         (ft_check_otf): Define it even if HAVE_OTF is undef.
2065         (ft_check_lang): Check the result of FcLangSetHasLang against
2066         FcLangDifferentLang.  Check also extra chars.
2067         (ft_list_capability): Delete ifdef HAVE_OTF.
2068         (ft_select): Likewise.
2069         (ft_open): Improve debug information.
2070         (ft_check_capability): New function.
2071         (mfont__ft_driver): Specify ft_check_capability.
2072         (mfont__ft_init): Initialize M0.
2073
2074         * fontset.c (get_font_from_group): New function.
2075         (mfontset__get_font): New function.
2076
2077         * fontset.h (mfontset__get_font): Extern it.
2078
2079         * font.c (OTF_tag): Define it if HAVE_OTF is undef.
2080         (mfont__fini): Delete ifdef HAVE_OTF.
2081         (free_font_capability): Likewise.
2082         (mfont__get_capability): Likewise.
2083         (mfont__check_capability): New function.
2084         (mfont_check): Change the order of arguments.  Use
2085         mfontset__get_font.
2086
2087         * font.h (struct MFontDriver): New member check_capability.
2088         (MFontCapability): Delete ifdef HAVE_OTF.
2089         (mfont__check_capability): Extern it.
2090
2091         * face.c (mface__realize): Fix handling of FONT arg.
2092         (mface__for_chars): Fix handling of explicitly specified font.
2093
2094 2005-11-25  Kenichi Handa  <handa@m17n.org>
2095
2096         * font-flt.c (run_command): Print debug info for
2097         left/rigth_padding
2098
2099         * draw.c (layout_glyphs): Fix handling of left/right_padding.
2100
2101         * face.c (mface__for_chars): Check rfont before accessing the
2102         members.
2103
2104 2005-11-21  Kenichi Handa  <handa@m17n.org>
2105
2106         * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
2107         WITH_GUI.
2108
2109         * fontset.c (fontset_table): New variable.
2110         (free_fontset): Call M17N_OBJECT_UNREGISTER.
2111         (mfont__fontset_init): Add fontset_table as an object array.
2112         (mfont__realize_fontset): Ref FONTSET.
2113         (mfont__free_realized_fontset): Unref REALIZED->fontset.
2114         (mfontset): Call M17N_OBJECT_REGISTER.
2115         (mfontset_copy): Likewise.
2116
2117         * input.c (handle_key): For debugging, print information about
2118         alias key.
2119         (filter): Add an alias for Meta and Alt modifiers.
2120         (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
2121         variables.
2122         (minput__init): Initialize them.
2123         (parse_expression): New function.
2124         (resolve_expression): New function.
2125         (parse_action_list): Handle expressions by parse_expression.
2126         (take_action_list): Handle expressions by resolve_expression.
2127         (parse_nested_list_value): Fix previous change.
2128         (resolve_command): Fix handling of the return value of
2129         get_nested_list.
2130
2131 2005-11-18  Kenichi Handa  <handa@m17n.org>
2132
2133         * font-ft.c (ft_check_otf, otf_script_list): Define only when
2134         HAVE_OTF is defined.
2135         (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
2136         defined.
2137         (ft_select): Likewise.
2138
2139         * font.c (mfont_list): Fix for the case that FONT is NULL.
2140         (OTF_tag): Delete it.
2141         (load_otf_script_list): Define only when HAVE_OTF is defined.
2142         (mfont__fini): Unref otf_script_list only when HAVE_OTF is
2143         defined.
2144
2145         * draw.c (truncate_gstring): Be sure to truncate at
2146         glapheme-cluster boundary.
2147
2148 2005-11-11  Kenichi Handa  <handa@m17n.org>
2149
2150         * input.c (delete_surrounding_text): Clear cache if necessary.
2151
2152 2005-11-09  Kenichi Handa  <handa@m17n.org>
2153
2154         * draw.c (compose_glyph_string): Update prev->rface->rfont if the
2155         glyph prev is also supported by the current flt.
2156
2157 2005-11-08  Kenichi Handa  <handa@m17n.org>
2158
2159         * m17n-X.c (xft_render): Cancel previous change.
2160
2161 2005-11-07  Kenichi Handa  <handa@m17n.org>
2162
2163         * input.c: Include <stdlib.h>.
2164         (get_surrounding_text, delete_surrounding_text)
2165         (get_preceding_char, get_following_char): New functions.
2166         (integer_value): New arg surrounding.  If it is nonzero, try to
2167         get a surrounding character.  Callers changed.
2168         (take_action_list): Check `value' before setting an element.
2169         (destroy_ic): Unref ic_info->preceding_text and
2170         ic_info->following_text.
2171         (minput__init): Initialize Minput_get_surrounding_text and
2172         Minput_delete_surrounding_text.
2173         (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
2174         variables.
2175         (filter): Unref ic_info->preceding_text and
2176         ic_info->following_text.
2177
2178         * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
2179         Extern them.
2180
2181         * input.h (MInputContextInfo): New members preceding_text and
2182         following_text.
2183
2184 2005-11-04  Kenichi Handa  <handa@m17n.org>
2185
2186         * input.c (parse_nested_list_value): Fix handling of the global
2187         definition.
2188         (get_nested_list): Get global definitions by load_partial_im_info.
2189         (preedit_commit): Set ic->candidates_changed to bitwise or of enum
2190         MInputCandidatesChanged.
2191         (take_action_list): Likewise.
2192         (reset_ic): Likewise.
2193         (create_ic): Don't pay special attention to
2194         Mcandidates_group_size.
2195         (load_partial_im_info): Call mdatabase_find with correct 4th arg.
2196         (minput_set_variable): Get a definition of varible by
2197         mplist_find_by_value, not mplist_get.
2198
2199         * m17n.h (enum MInputCandidatesChanged): New enum.
2200
2201 2005-11-01  Kenichi Handa  <handa@m17n.org>
2202
2203         * m17n-X.c (xft_render): Check xft_draw's drawable before changing
2204         it.
2205         (mwin__destroy_window): If xft_draw's drawable is win, change it
2206         to device->drawable before destroying win.
2207
2208 2005-10-31  Kenichi Handa  <handa@m17n.org>
2209
2210         * input.c (load_im_info): Fix adding of state.
2211
2212         * m17n-core.c (m17n_fini_core): Fix reporting of module
2213         finalization.
2214
2215         * m17n.c (m17n_fini): Fix reporting of module finalization.
2216
2217         * m17n-gui.c (m17n_init_win): Fix reporting of module
2218         finalization.
2219
2220 2005-10-29  Kenichi Handa  <handa@m17n.org>
2221
2222         * input.c (get_candidate_list): Fix the timing of referring plist.
2223
2224 2005-10-28  Kenichi Handa  <handa@m17n.org>
2225
2226         * input.c (load_branch): Ignore an undefined map name.
2227         (load_im_info): Set im_info->title from `name' only if it's not
2228         Mnil.
2229         (shift_state): Always update ic->status.
2230         (adjust_candidates): Renamed from adjust_candidate_command.
2231         Argument changed.  Caller changed.
2232         (get_candidate_list, regularize_action): New functions.
2233         (take_action_list): Use them.  On handling Munhandle, don't set
2234         ic_info->used to 0.
2235         (handle_key): If KEY is not handled by MAP, and MAP has
2236         branch_actions, perform them.
2237
2238         * database.c (mdatabase__fini): Free dir_info->filename;
2239
2240 2005-10-20  Kenichi Handa  <handa@m17n.org>
2241
2242         * input.c (marker_code): Accept '@@'.
2243         (integer_value): Handle '@@'.
2244         (parse_action_list): Accept a symbol argument.
2245         (take_action_list): Resolve the symbol argument.  Handle the
2246         integer argument.
2247
2248 2005-10-18  Kenichi Handa  <handa@m17n.org>
2249
2250         * input.c: Include "charset.h".
2251         (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
2252         variables.
2253         (MIMState): New member (M17NObject control).
2254         (lookup_nested_list, set_nested_list, parse_nested_list_value)
2255         (get_nested_list, resolve_variable): New functions.
2256         (integer_value): New arg (MPlist **value).  Set it to the plist
2257         element containing the value.
2258         (resolve_command): New function.
2259         (load_translation): New arg (MPlist *map_actions).
2260         (load_branch): New args language and name.  If `keylist' is a
2261         symbol, resolved that as a command name.
2262         (free_map): New arg top.  Free map->map_actions only if top is
2263         nonzero.
2264         (free_state): New function.
2265         (load_state): New arg name.
2266         (im_info_list): New variable.
2267         (free_im_info, get_im_info_by_tags): New functions.
2268         (load_im_info): Arg key changed to plist.  Handle `include'.
2269         Return (MInputMethodInfo *).
2270         (preedit_commit): Ref ic->candidate_list.
2271         (get_select_charset, adjust_candidate_command): New functions.
2272         (take_action_list): Handle `include'.  Adjust candidate action
2273         properly.  Handle control variables `candidates-charset' and
2274         `candidates-group-size'.
2275         (open_im): Use get_im_info.
2276         (create_ic): Get global variables.
2277         (load_partial_im_info): New function.
2278         (get_im_info): New function.
2279         (check_command_keyseq, check_command_list, check_variable_list):
2280         New functions.
2281         (minput__init): Don't handle M_database_hook and Mdetail_text.
2282         Initialize M_candidates, Mcandidates_group_size,
2283         Mcandidates_charset.
2284         (parse_variable_list, get_variable_list, parse_command_list)
2285         (get_command_list): Delete them.
2286         (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
2287         (minput__fini): Simply unref command_list and variable_list.
2288         (minput_get_description): Adjusted for the new form of description.
2289         (minput_get_commands): Use get_nested_list.
2290         (minput_assign_command_keys): Likewise.
2291         (minput_get_variables, minput_set_variable): Likewise.
2292
2293         * input.h (MInputMethodInfo): New members im and maps.
2294
2295         * database.h (M_database_hook): Delete extern.
2296         (MDatabaseHookFunc): Delete extern.
2297         (mdatabase__check): Extern it.
2298
2299         * database.c: Include <glob.h>.
2300         (MAX_TIME): New macro.
2301         (Masterisk): New variable.
2302         (get_database_stream): Argument changed to (MDatabaseInfo *).
2303         Callers changed.
2304         (get_dir_info): Renamed from duplicate_dirname.  Callers changed.
2305         (find_database): New function.
2306         (update_database_list): New function.
2307         (mdatabase__init): Initialize Masterisk.  Setup mdb_list by
2308         calling update_database_list.
2309         (mdatabase__check): New function.
2310         (mdatabase_find): Use update_database and find_database.  Don't
2311         handle MDatabaseHookFunc.
2312         (mdatabase_list): Call update_database at first.
2313         (mdatabase_define): Adjusted for the change of mdb->extra_info.
2314         (MDatabaseList): New type.
2315
2316         * plist.h (mplist_conv, mplist__pop_unref): Extern them.
2317
2318         * m17n.h (Mdetail_text): Delete extern.
2319
2320         * m17n-core.h (mplist_conc): Delete extern.
2321
2322         * plist.c (mplist__conc): Renamed from mplist_conc.  Don't ref
2323         tail.
2324         (mplist_conc): Renamed to mplist__conc.
2325         (mplist__pop_unref): New function.
2326
2327 2005-10-14  Kenichi Handa  <handa@m17n.org>
2328
2329         * plist.c (read_mtext_element): Ignore the sequence of '\\' and
2330         newline.
2331         (read_element): If keys is an empty plist, return any element
2332         found first.
2333         (dump_plist_element): Check if plist is nested.
2334         (mplist_conc): Always ref tail.
2335         (mplist_set): If key is a managing key, ref val in advance.
2336
2337         * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
2338         (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
2339         (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
2340         macros.
2341
2342         * fontset.c (free_fontset): Unref fontset_list if necessary.
2343         (mfont__fontset_fini): Don't free fontset_list.  Unref
2344         default_fontset.
2345         (mfont__realize_fontset): Initialize request.
2346         (mfontset): Ref default_fontset or fontset only if necessary.
2347         (mfontset_copy): Don't ref copy.
2348
2349         * draw.c (render_glyphs): Check gend->type before checking
2350         gend->to.
2351
2352         * font-ft.c (mfont__ft_fini): Unref ft_default_list.  Set all
2353         unrefed plists to NULL.
2354
2355 2005-10-04  Kenichi Handa  <handa@m17n.org>
2356
2357         * textprop.c (mtext_serialize): Be sure to make mt
2358         MTEXT_FORMAT_UTF_8 and NULL terminated.
2359
2360         * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
2361
2362         * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
2363
2364 2005-10-03  Kenichi Handa  <handa@m17n.org>
2365
2366         * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
2367         is not at the beginning of line.
2368
2369 2005-09-22  Kenichi Handa  <handa@m17n.org>
2370
2371         * input.c: Include <sys/stat.h> and <unistd.h>.
2372         (Minclude, Mcommit, Munhandle): New variables.
2373         (minput__init): Initialize them.  Push only Mstate to
2374         load_im_info_keys.   Add aliases C-lowercase for C-uppercase.
2375         (parse_action_list): Allow integer arg for undo.  Handle Mcommit
2376         and Munhandle.
2377         (load_input_method): Handle "include" directive.  If no states are
2378         loaded, return -1.
2379         (shift_state): If state_name is Mt, shift back to the previous
2380         state.  Call preedit_commit to commit preedit text.
2381         (preedit_commit): New function.
2382         (take_action_list): Improve debug printing.  Handle commit and
2383         unhandle commands.
2384         (handle_key): Check the return value of take_action_list.  Don't
2385         take branch_actions just after changing to the root map.
2386         (reset_ic): Reset all ic_info members.
2387         (filter): When a key is not handled, just move ic_info->keys
2388         instead fo calling reset_ic.
2389         (load_im_info): If key is not Mstate, push Mmap to
2390         load_im_info_keys.
2391         (MDatabaseStatList): New type.
2392         (imdir_stat_list): New variable.
2393         (input_method_hook): Don't cancel the hook.  Check the
2394         modification time of directories.
2395         (minput__fini): Free imdir_stat_list;
2396
2397         * input.h (MInputContextInfo): New member prev_state.
2398
2399         * m17n-core.h (mplist_conc): Extern it.
2400
2401         * plist.c (mplist_conc): New function.
2402
2403         * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
2404
2405         * font.h (MRealizedFont): New member average_width.
2406
2407         * font-ft.c (ft_open): Set rface->average_width.
2408
2409         * font.c (xlfd_unparse_name): Print '*' before registry name.
2410
2411         * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
2412         (xfont_open): Set rfont->average_width.
2413         (xft_open): Likewise.
2414         (device_open): Initialize disp_info->AVERAGE_WIDTH.
2415
2416         * internal-gui.h (struct MFrame): New member average_width.
2417
2418         * m17n-gui.c (mframe): Fix setting of frame->rfont.
2419         (mframe_get_prop): Return the average_width of a font.
2420
2421         * face.c (mface__realize): Set rface->average_width.
2422         (mface__update_frame_face): Set frame->average_width.
2423
2424         * face.h (MRealizedFace): New member average_width.
2425
2426 2005-09-19  Kenichi Handa  <handa@m17n.org>
2427
2428         * font.c (xlfd_unparse_name): New arg full_xlfd.
2429         (mfont__encode_char): Use shortcut only for X core fonts.
2430         (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
2431         (mfont_put_prop): Handle `language' property.
2432         (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
2433         Print file can capability info too.
2434
2435         * m17n-core.c (mdebug__output): New variable.
2436         (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
2437         (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
2438         (m17n_fini_core): Close mdebug__output if it's not stderr.
2439
2440         * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
2441         (xfont_open): Handle baseline_offset.
2442         (xfont_find_metric): Likewise.
2443         (xfont_render): Likewise.
2444         (xft_open): Likewise.
2445         (xft_render): Likewise.
2446
2447         * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
2448         (mdebug__output): Extern it.
2449         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
2450         (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
2451         (MDEBUG_DUMP): New macro.
2452         (MDEBUG_PRINT_TIME): Print to medebug__output.
2453
2454         * font.h (MRealizedFont): New member baseline_offset.
2455
2456         * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
2457         characters.
2458         (fc_weight_table): Add FC_WEIGHT_REGULAR.
2459         (ft_list_family): Check alias.
2460         (ft_list_language): If language is "en", don't try to the second
2461         step.
2462         (ft_default_list): New variable.
2463         (ft_list_default): New function.
2464         (ft_select): If family is not specified, try only the default
2465         fonts.  Treat the weights normal and medium same.
2466         (ft_open): Fix debug message.  If registry is not specified, try
2467         unicode-bmp.  Handle _MULE_BASELINE_OFFSET property of BDF fonts.
2468         (ft_find_metric): Likewise.
2469         (ft_render): Likewise.
2470         (ft_list): Fix debug message.  Accept the registring iso8859-1.
2471         If family is not specified, try only the default fonts.
2472
2473         * face.c (mface__realize): Fix logic of opening a font.
2474
2475 2005-09-16  Kenichi Handa  <handa@m17n.org>
2476
2477         * face.c (mface__realize): 
2478
2479         * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
2480         Extern them.
2481
2482         * input.c (shift_state): Fix the condition of taking init actions.
2483         (take_action_list): Fix handling of pushback action.
2484         (handle_key): Don't change key while checking its alias.
2485         (minput__init): Initialize new variables.
2486         (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
2487         variables.
2488
2489 2005-09-12  Kenichi Handa  <handa@m17n.org>
2490
2491         * mtext.c (mtext__uppercase): Add proper open/close parens.
2492         (mtext_titlecase): Add proper casting.
2493
2494         * input.c (parse_action_list): Handle the case that the arg is a
2495         key sequence (MText or MPlist).
2496         (take_action_list): Likewise.
2497         (shift_state): Shorter debug message.
2498         (handle_key): Terminate a debug message by "\n".
2499         (reset_ic): Don't take initial actions here.
2500         (minput_open_im): Print a debug message.
2501         (minput_close_im): Likewise.
2502         (minput_create_ic): Likewise.
2503         (minput_destroy_ic): Likewise.
2504
2505 2005-09-09  TAKAHASHI Naoto  <ntakahas@m17n.org>
2506
2507         * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
2508         Change API.
2509
2510 2005-09-07  TAKAHASHI Naoto  <ntakahas@m17n.org>
2511         * character.c: Add "cased", "soft-dotted", and "case-mapping" in
2512         mchar__init ().
2513
2514         * character.c: Add Japanese documentation for
2515         mchar_get_prop_table ().
2516
2517 2005-09-06  TAKAHASHI Naoto  <ntakahas@m17n.org>
2518
2519         * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
2520         (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
2521         (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
2522         New variables.
2523         (init_case_conversion): New function.
2524         (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
2525         (uppercase_precheck, lowercase_precheck, final_sigma)
2526         (after_soft_dotted, more_above, before_dot, after_i)
2527         (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
2528
2529 2005-09-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
2530
2531         * plist.c (read_mtext_element): Fix previous change.
2532
2533 2005-09-05  Kenichi Handa  <handa@m17n.org>
2534
2535         * plist.c (read_mtext_element): Handle \uXXXX notation.
2536
2537         * internal.h (MTABLE_MALLOC): Don't use a local variable.
2538         (MTABLE_ALLOCA): Change the name of local variable.
2539
2540         * m17n-gd.c (device_open): Define it even if HAVE_GD nor
2541         HAVE_FREETYPE are defined.
2542
2543         * m17n-X.c: Check HAVE_X11.
2544
2545         * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
2546         directory listing libraries.
2547         (noinst_PROGRAMS): Define it only in maintainer mode.
2548
2549 2005-09-02  Kenichi Handa  <handa@m17n.org>
2550
2551         * m17n-gui.h (mdraw_line_break_option): Extern it.
2552
2553         * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
2554         end of the first glyph.
2555         (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
2556         them.
2557         (mdraw_line_break_option): New variable.
2558         (mdraw_default_line_break): Use mtext_line_break.
2559
2560         * mtext.h (wordseg_func_table): Don't extern it.
2561         (mtext__wseg_fini): Extern it.
2562
2563         * mtext.c: Don't include word-thai.h.
2564         (wordseg_func_table): Delete this variable.
2565         (mtext__init): Don't initialize above.  Don't call
2566         mtext__word_thai_init.
2567         (mtext__fini): Don't free wordseg_func_table.  Call
2568         mtext__wseg_fini instead fo mtext__word_thai_fini.
2569         (MTextWordsegFunc): Don't typedef it.
2570         (mtext__word_segment): Moved to mtext-wseg.c.
2571
2572         * m17n-core.h (enum MTextLineBreakOption): New enum.
2573         (mtext_line_break): Extern it.
2574
2575         * mtext-wseg.c: New file.
2576
2577         * mtext-lbrk.c: New file.
2578
2579         * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
2580         add mtext-lbrk.c and mtext-wseg.c.
2581
2582         * textprop.c (mtext__adjust_plist_for_change): Pay attention for
2583         the case that head is NULL.
2584
2585 2005-09-01  Kenichi Handa  <handa@m17n.org>
2586
2587         * word-thai.c (wordseg_propertize): If the property value is nil,
2588         don't make the property no-merge.
2589         (thai_wordseg): Don't require *from and *to are set a priori.  Pay
2590         attention to the case that they are NULL.
2591         (mtext__word_thai_init): Make the name of Mthai_wordseg starts
2592         with two spaces.
2593
2594         * character.c (mchar_get_prop_table): New function.
2595
2596         * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
2597
2598         * m17n-core.h (mtext_insert, mtext_replace): Extern them.
2599         (mchar_get_prop_table): Extern it.
2600
2601         * textprop.c (prepare_to_modify): New arg deleting.  Callers changed.
2602         (mtext__adjust_plist_for_change): Argument changed.  Callers changed.
2603
2604         * internal.h (enum MTextCoverage): New enum.
2605         (MText): New member coverage.
2606
2607         * mtext.c (FORMAT_COVERAGE): New macro.
2608         (insert): Copy mt2->coverage.
2609         (mtext__from_data): Initialize mt->coverage.
2610         (mtext__adjust_format): Update mt->coverage.
2611         (mtext): Initialize mt->coverage.
2612         (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
2613         Update mt->coverage if necessary.
2614         (mtext_duplicate): Copy mt->coverage.
2615         (mtext_insert, mtext_replace): New functions.
2616         (mtext_dup): Use mtext_duplicate.
2617         (mtext__word_segment): Don't set *from and *to if a word
2618         segmentation funcion is not found.
2619         (mtext_ins_char): Fix typo.
2620
2621 2005-08-25  Kenichi Handa  <handa@m17n.org>
2622
2623         * font.h (MFont): New member for_full_width.
2624
2625         * font.c (compare_font_score): Prefer a font of not
2626         for_full_width.
2627
2628         * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
2629         registry charset of a font is one of CJK charsets.
2630
2631         * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
2632         supports some of CJK.
2633
2634 2005-08-24  Kenichi Handa  <handa@m17n.org>
2635
2636         * m17n-gui.h (Mascent, Mdescent): Don't extern them.
2637
2638         * m17n-gui.c (null_device_open): Check Mresolution param and set
2639         frame->dpi.
2640
2641         * m17n-gd.c (device_open): Check Mresolution param and set
2642         frame->dpi.
2643
2644         * m17n-X.c (MWDevice): New member resy.
2645         (xfont_open): Set ascent, descent, and max_advance members of
2646         rfont.
2647         (xft_open): Likewise.
2648         (device_open): Compare also screen_num to find a device.  Set
2649         device->resy and frame->dpi.
2650
2651         * internal-gui.h (MFrame): New member dpi.
2652
2653         * font.h (MRealizedFont): New member max_advance.
2654
2655         * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
2656         (mfont__init): Don't initialize Mascent, Mdescent.
2657         (Mascent, Mdescent): Delete these variables.
2658         (mfont_get_prop): Fix previous change.  Check Mfont_ascent and
2659         Mfont_descent instead of Mascent and Mdescent.
2660         (mfont_put_prop): Allow negative size.
2661         (mfont_find): Handle the case of spec->size < 0.  Fix previous
2662         change.
2663         (mfont_list): Handle the case of spec->size < 0.
2664         (mfont_check): Likewise.
2665
2666         * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
2667         (fc_get_pattern): Handle the case of font->size < 0.
2668         (ft_open): Set ascent, descent, and max_advance members of rfont.
2669         (ft_find_metric): Improve rounding.
2670         (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
2671         FC_SIZE.
2672
2673         * face.c (mface__realize): Handle the case of font->size < 0.
2674
2675 2005-08-22  Kenichi Handa  <handa@m17n.org>
2676
2677         * coding.c (MConverterStatus): Change the member buf to union.
2678         (mconv_buffer_converter): Add const to the arg buf.
2679         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
2680         (mconv_decode): Adjusted for the change of MConverterStatus.
2681         (mconv_encode_range): Likewise.
2682
2683         * m17n.h (mconv_buffer_converter): Prototype adjusted.
2684         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
2685
2686 2005-08-20  Kenichi Handa  <handa@m17n.org>
2687
2688         * m17n-gui.h (mfont_from_name): Prototype adjusted.
2689         (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
2690
2691         * m17n-X.c (xfont_open): Set members ascent, descent, and
2692         max_advance of rfont.
2693         (xft_open): Likewise.
2694
2695         * font-ft.c (ft_open): Set members ascent, descent, and max_advance
2696         of rfont.
2697         (mfont__ft_parse_name): Add const to the arg name.
2698
2699         * font.c (xlfd_parse_name): Add const to the arg name.  Call
2700         mfont__set_property instead of mfont_set_spec.  Set font->spacing.
2701         (xlfd_unparse_name): Handle spacing.
2702         (mfont__init): Initialize new variables.
2703         (mfont__id): Handle spacing.
2704         (mfont__merge): Likewise.
2705         (mfont__set_spec): This function deleted.
2706         (mfont__parse_name_into_font): Add const to the arg name.  Fix the
2707         condition of calling mfont__ft_parse_name.
2708         (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
2709         (mfont_get_prop): Handle properties spacing, ascent, descent,
2710         and max-advance.
2711         (mfont_find): Return a realized font.
2712         (mfont_from_name): Add const to the arg name.
2713
2714         * font.h (enum MFontProperty): New member MFONT_SPACING.
2715         (enum MFontSpacing): New enum.
2716         (MFont): New members spacing and max_advance.
2717         (mfont__ft_parse_name): Prototype adjusted.
2718         (mfont__set_spec): Extern deleted.
2719         (mfont__parse_name_into_font): Prototype adjusted.
2720
2721 2005-08-19  Kenichi Handa  <handa@m17n.org>
2722
2723         * m17n-gui.h (mfont_parse_name): Prototype adjusted.
2724
2725         * font.c (mfont_list): If FONT is null, use a temporary font.
2726         (mfont_parse_name): Add const to the arg name.
2727
2728 2005-08-18  Kenichi Handa  <handa@m17n.org>
2729
2730         * word-thai.c: Surround code by #ifdef and #endif to escape from
2731         doxygen.
2732
2733         * font-ft.c: Mostly re-written.
2734
2735         * font-flt.c (FontLayoutCmdOTF): This type deleted.
2736         (FontLayoutCmd): Type of the member otf changed..
2737         (load_otf_command): Adjusted for the format change of otf command.
2738         (load_command): Likewise.
2739         (free_flt_command): Unref cmd->body.otf.
2740         (run_otf): Ajusted for the type change of otf_cmd.
2741         (run_command): Ajusted for the type change of otf_cmd.  On
2742         debugging, print ctx->combining_code.
2743         (mfont__flt_run): Initialize ctx's members code_offset,
2744         combining_code, and left_padding to 0.
2745
2746         * face.h (struct MRealizedFace): New member font.
2747         (mface__realize): Prototype adjusted.
2748
2749         * face.c (find_realized_face): New arg font.
2750         (find_realized_face): Adjusted for the change of MFont.
2751         (mface__init): Call M17N_OBJECT_ADD_ARRAY.
2752         (mface__fini): Don't call mdebug__report_object.
2753         (mface__realize): New arg font.
2754         (mface__for_chars): Adjusted for the change of mfont__encode_char.
2755         Optimize the latin case.
2756         (mface__free_realized): Free rface->font.
2757         (mface__update_frame_face): Adjusted for the change of mface__realize.
2758         (mface_equal): New function.
2759
2760         * draw.c (Mcommon): New variable.
2761         (visual_order): Args to mfont__encode_char changed.
2762         (compose_glyph_string): Handle Mfont text property.
2763         (layout_glyphs): Adjusted for the change of MFont.
2764         (mdraw__init): Initialize Mcommon.
2765         (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
2766
2767         * font.h (enum MFontType): Members completely changed.
2768         (enum MFontProperty): Move MFONT_SIZE to the tail.
2769         (enum MFontSource): New enum.
2770         (struct MFont): New members type, source, sizes, file, capability,
2771         and encoding.
2772         (struct MRealizedFont): Type of member font changed. Members
2773         score, status, and encoding deleted.
2774         (MFontScore): New type.
2775         (MFontList): Member changed.
2776         (struct MFontDriver): New member has_char.  Types of members
2777         changed.
2778         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
2779         (Mapple_roman): Extern them.
2780         (OTF_Tag): Typedefed if not HAVE_OTF.
2781         (enum MFontOpenTypeTable): New enum.
2782         (MFontCapability): New type.
2783         (mfont__ft_drive_otf): Prototype adjusted.
2784         (mfont__score): Extern deleted.
2785         (mfont__merge): Extern it.
2786         (mfont__has_char): Extern it.
2787         (mfont__encode_char): Prototype adjusted.
2788         (mfont__open): Extern it.
2789         (mfont__set_spec): Prototype adjusted.
2790         (mfont__get_capability): Extern it.
2791
2792         * font.c: Include "fontset.h".
2793         (M_font_capability, M_font_list, M_font_list_len): New variables.
2794         (font_score_priority): Change order of initial elements.
2795         (font_score_shift_bits): Fix array size.
2796         (common_weight): Add "thin", "semibold", and "heavy".
2797         (common_stretch): Add "ultracondensed", "extracondensed",
2798         "extraexpanded", and "utltraexpand".
2799         (font_weight_regular, font_weight_normal, font_weight_medium): New
2800         variables.
2801         (gen_font_name): This function deleted.
2802         (find_encoding): Set font->encoding.
2803         (OTF_tag): New function.
2804         (otf_script_list): New variable.
2805         (load_otf_script_list): New function.
2806         (find_script_from_otf_tag): New function.
2807         (xlfd_parse_name): Set font->type and font->source.
2808         (mfont__free_realized): Free chains rfonts.
2809         (font_score): Renamed from mfont__score.
2810         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
2811         (Mapple_roman): New variables.
2812         (mfont__init): Initilize new variables.  Initalize
2813         default_encoding.encoding_name and
2814         default_encoding.encoding_charset to Municode_full and
2815         mcharset__unicode.  Use SAFE* macros for allocating filepath
2816         buffer.
2817         (mfont__fini): Free otf_script_list.
2818         (mfont__id): New function.
2819         (mfont__match_p): Check also capability member of MFont.
2820         (mfont__merge): New funciton.
2821         (mfont__set_spec_from_face): Set type and source members.
2822         (mfont__set_spec_from_plist): Set capability and type members.
2823         (mfont__select): Argument changed.
2824         (mfont__available): New function.
2825         (compare_font_score): New function.
2826         (mfont__list): New function.
2827         (mfont__open): Return a realized font.
2828         (mfont__resize): Adjusted for the change of MFont.
2829         (mfont__has_char): New function.
2830         (mfont__encode_char): Argument changed.
2831         (mfont__set_spec): Argument changed.
2832         (free_font_capability): New function.
2833         (mfont__get_capability): New function.
2834         (MFontfile): New variable.
2835         (mfont_get_prop): Adjusted for the change of MFont.
2836         (mfont_put_prop): Likewise.
2837         (mfont_set_selection_priority): Fix the way of setting
2838         font_score_priority[].
2839         (mfont_find): Use mfont__list instead of mfont__select.
2840         (mfont_resize_ratio): Adjusted for the change of MFont.
2841         (mfont_list): Use mfont__list.
2842         (mfont_check): New function.
2843         (font_score): Make it static.
2844
2845         * fontset.h (mfont__realize_fontset): Prototype adjusted.
2846         (mfont__lookup_fontset): Likewise.
2847
2848         * fontset.c (struct MFontset): Delete member font_spec_list.
2849         (struct MRealizedFontset): Type of member spec changed.  New
2850         member request.
2851         (load_font_group): Arg spec_list deleted.
2852         (load_fontset_contents): Adjusted for the change of fontset_def.
2853         (free_fontset): Fix the way of freeing fontset elements.
2854         (realize_fontset_elements): Argument changed.
2855         (get_per_script): New function.
2856         (free_realized_fontset_elements): Fix the way of feeing rfontset
2857         elements.
2858         (update_fontset_elements): Fix args to realize_fontset_elements.
2859         (mfont__realize_fontset): New arg spec.
2860         (try_font_list): New function.
2861         (try_font_group): New arg request.  Use try_font_list.
2862         (mfont__lookup_fontset): New arg ignore_fallback.  Fix arg to
2863         try_font_group.
2864         (mfontset): Adjusted for the change of MFontset.
2865         (mfontset_copy): Likewise.  Don't share plists.
2866         (mfontset_modify_entry): Adjusted for the change of MFontset.
2867         (mfontset_lookup): Call get_per_script.
2868         (mdebug_dump_fontset): Print also the address of fonts.
2869
2870         * input.c (shift_state): Don't reset ic_info->vars.
2871         (take_action_list): Call MDEBUG_PRINT fore calling
2872         take_action_list.
2873
2874         * internal-gui.h (MFontDriver): Don't typedef it here.
2875
2876         * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
2877         (MXFont): This type deleted.
2878         (MFontX): New type.
2879         (struct _MFontX): New struct.
2880         (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
2881         (MDisplayInfo): Member base_font_list deleted.
2882         (DEFAULT_FONT): Definition changed.
2883         (FALLBACK_FONT): This maclr deleted.
2884         (free_display_info): Adjusted for the change of MDisplayInfo.
2885         (free_device): Argument to mfont__free_realized changed.
2886         (xfont_driver): Adjusted for the change of MFontDriver.
2887         (xfont_registry_list): Use MFontX instead of MXFont.
2888         (MRealizedFontX): Renamed from MXFontInfo.
2889         (xfont_select): Return the font found first.
2890         (close_xfont): Change MXFontInfo to MRealizedFontX.
2891         (xfont_open): Return the realized font.
2892         (xfont_find_metric): Get xfont from rfont->fontp.
2893         (xfont_has_char): New function.
2894         (xfont_encode_char): Adjusted for the argument change.
2895         (xfont_render): Get xfont from rfont->fontp.
2896         (xfont_list): Adjusted for the argument change.
2897         (MRealizedFontXft): Renamed from MXftFontInfo.
2898         (xft_driver): Ajusted for the change of MFontDriver.
2899         (close_xft): Change MXtfFontInfo to MRealizedFontXft
2900         (xft_open_font): Argument changed.
2901         (xft_open): Argument changed.  Return the realized font.
2902         (xft_find_metric): Get xft_font from rfont->fontp.
2903         (xft_has_char, xft_encode_char): New functions.
2904         (xft_render): Change MXftFontInfo to MRealizedFontXft.  Open a
2905         font if not yet opened.
2906         (device_open): Don't set frame->font.
2907
2908         * m17n-gd.c (gd_font_driver): Adjusted for the change of
2909         MFontDriver.
2910         (gd_font_open): New function.
2911         (gd_render): Don't use the local variable ft_info.
2912         (device_init): Adjusted for the change of gd_font_driver.
2913
2914         * textprop.c (mtext__prop_init): Initialize text_property_table.
2915         Call M17N_OBJECT_ADD_ARRAY.
2916         (mtext__prop_fini): Don't call mdebug__report_object.
2917
2918         * plist.c (mplist__init): Initialize plist_table.
2919         (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
2920         (mplist__fini): Don't call mdebug__report_object.
2921
2922         * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
2923         (mtext__fini): Don't call mdebug__report_object.
2924         (MTEXT_FORMAT_UTF_16): Correct type.
2925         (mtext_data): New function.
2926         (mtext_text): Fix calculation of limit and args to
2927         find_char_backward.
2928
2929         * language.c: Include "plist.h".
2930         (M_script_lang_list): New variable.
2931         (mlang__init): Read languages and their information from m17n
2932         database.
2933         (mlanguage__list): New function.
2934         (Miso639_1, Miso639_2): New variables.
2935
2936         * language.h (mlanguage__list): Extern it.
2937
2938         * database.c (get_database_stream): Use SAFE_* macros for
2939         allocating and freeing path.
2940         (mdatabase__init): Likewise.
2941
2942         * symbol.c (msymbol__fini): Don't free symbols here.
2943         (msymbol__free_table): New function.
2944         (msymbol_is_managing_key): New function.
2945
2946         * symbol.h (msymbol__free_table): Extern it.
2947         (msymbol__list): Extern it.
2948
2949         * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
2950         New macros.
2951         (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
2952         (struct _M17NObjectArray): New member name and next.
2953         (mdebug__add_object_array): Extern it.
2954         (M17N_OBJECT_ADD_ARRAY): New macro.
2955         (mdebug__report_object): Don't extern it.
2956
2957         * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
2958
2959         * m17n-gui.c (free_frame): Don't free frame->font.
2960         (null_device_fini): Fix code for freeing
2961         null_device.realized_font_list.
2962         (m17n_fini_win): Free interface.
2963         (mframe): Cast the return value of dlsym.  Set frame->font here.
2964         (mframe_get_prop): Check frame->rface->rfont before accessing the
2965         member font.
2966
2967         * m17n-gui.h (Mfontfile): Extern it.
2968         (mfont_check): Extern it.
2969         (mface_equal): Extern it.
2970
2971         * m17n-core.c: Include "symbol.h".
2972         (report_header_printed): This variable deleted.
2973         (object_array_root): New variable.
2974         (report_object_array): New function.
2975         (mdebug__report_object): This function deleted.
2976         (mdebug__add_object_array): New function.
2977         (m17n_init_core): Call mchartable_init () before mtext_init ().
2978         (m17n_fini_core): Call report_object_array (if necessary) and
2979         msymbol__free_atable at the end.
2980
2981         * m17n-core.h (msymbol_is_managing_key): Extern it.
2982         (mtext_data): Extern it.
2983         (MTEXT_FORMAT_UTF_16): Correct type.
2984         (M17NLIB_MINOR_VERSION): Changed to 3.
2985         (M17NLIB_VERSION_NAME): Changed to "1.3.0".
2986
2987         * chartab.c (mchartable__init): Initalize chartable_table.count.
2988         (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
2989         mdebug__report_object.
2990
2991 2005-05-26  Kenichi Handa  <handa@m17n.org>
2992
2993         * m17n.h (Miso639_1, Miso639_2): Extern them.
2994
2995         * symbol.h (msymbol__list): Extern it.
2996
2997         * symbol.c (msymbol__list): New function.
2998
2999 2005-05-19  Kenichi Handa  <handa@m17n.org>
3000
3001         * input-gui.c (minput__win_init): Don't change the value of
3002         minput_driver.
3003
3004 2005-05-16  Kenichi Handa  <handa@m17n.org>
3005
3006         * m17n-core.c (m17n_object): Be sure to initialize all members.
3007
3008         * font-ft.c (fc_decode_prop): Fix args to msymbol.
3009
3010 2005-05-09  Kenichi Handa  <handa@m17n.org>
3011
3012         * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
3013
3014 2005-04-27  Kenichi Handa  <handa@m17n.org>
3015
3016         * language.c (mlang__init): Add "an" (Aragonese).
3017
3018         * word-thai.c: Add support for libthai.
3019         (mtext__word_thai_init): Initialize wordseg library conditionaly.
3020         (mtext__word_thai_fini): Finalize wordseg library conditionaly.
3021
3022         * mtext.c: Include "word-thai.h" conditionaly.
3023         (mtext__init): Call mtext__word_thai_init conditionaly.
3024         (mtext__fini): Call mtext__word_thai_fini conditionaly.
3025
3026         * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
3027         not WORDCUT_LD_FLAGS.
3028
3029 2005-04-19  Kenichi Handa  <handa@m17n.org>
3030
3031         * word-thai.c (wordseg_propertize): Always unref the attached
3032         property.
3033         (thai_wordseg): Don't unref the property.
3034
3035 2005-04-18  Kenichi Handa  <handa@m17n.org>
3036
3037         * word-thai.c: Include stdlib.h.
3038         (wordseg_propertize): Add dummy function for the case that wordcut
3039         library doesn't exist.
3040         (wordseg_propertize): Fix for old wordcut library.
3041
3042 2005-04-16  Kenichi Handa  <handa@m17n.org>
3043
3044         * word-thai.c: Include <stdio.h>.
3045
3046 2005-04-15  Kenichi Handa  <handa@m17n.org>
3047
3048         * draw.c: Include mtext.h.
3049         (linebreak_table, M_break_at_space, M_break_at_word)
3050         (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
3051         (compose_glyph_string): Check POS before getting Mface text
3052         property.
3053         (truncate_gstring): Give correct TO arg to line_break function.
3054         (GET_LB_TYPE): New macro.
3055         (find_break_backward, find_break_forward): New functions.
3056         (mdraw__init): Initialize the above new variables.
3057         (mdraw__fini): Free linebreak_table.
3058         (mdraw_default_line_break): Use find_break_backward and
3059         find_break_forward.
3060
3061         * word-thai.c: New file.
3062
3063         * word-thai.h: New file.
3064
3065         * mtext.c: Include word-thai.h.
3066         (wordseg_func_table): New variable.
3067         (mtext__init): Initialize wordseg_func_table and call
3068         mtext__word_thai_init.
3069         (mtext__fini): Call mtext__word_thai_fini, free
3070         wordseg_func_table.
3071         (MTextWordsegFunc): New type.
3072         (mtext__word_segment): New function.
3073
3074         * mtext.h (wordseg_func_table): Extern it.
3075         (mtext__word_segment): Extern it.
3076
3077         * m17n.c (m17n_init): Fix typo (== -> =).
3078
3079         * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
3080         (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
3081
3082         * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
3083         (MTEXTPROP_VAL): New macros.
3084
3085         * input.c (DLOPEN_SHLIB_EXT): Don't define it.
3086
3087 2005-04-07  Kenichi Handa  <handa@m17n.org>
3088
3089         * database.c (load_chartable): Fix pursing of symbol name.
3090
3091 2005-03-24  Kenichi Handa  <handa@m17n.org>
3092
3093         * m17n.c (m17n_init): Fix typo (== -> =).
3094
3095 2005-03-11  Kenichi Handa  <handa@m17n.org>
3096
3097         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
3098
3099         * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
3100
3101         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
3102         first.
3103
3104 2005-03-09  handa  <handa@m17n.org>
3105
3106         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
3107         calling m17n_init ().
3108
3109         * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
3110         calling m17n_init_core ().
3111
3112 2005-02-28  Kenichi Handa  <handa@m17n.org>
3113
3114         * font-flt.c (mfont__flt_run): Add resulting code sequence in
3115         debug info.
3116
3117 2005-02-17  Kenichi Handa  <handa@m17n.org>
3118
3119         * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
3120         (M_description, M_command, M_variable): New variables.
3121         (load_im_info_keys): New variables.
3122         (load_im_info, check_command_keyseq, get_description_advance)
3123         (parse_command_list, get_command_list, parse_variable_list)
3124         (get_variable_list, input_method_hook): New functions.
3125         (command_list, variable_list): New variables.
3126         (minput__init): Put input_method_hook to Minput_method.
3127         Initialize M_description, M_command, M_variable, Mdetail_text,
3128         load_im_info_keys, command_list, variable_list.
3129         (minput__fini): Unref command_list, variable_list, load_im_info_keys.
3130         (Mdetail_text): New variable.
3131         (minput_get_description, minput_get_commands)
3132         (minput_assign_command_keys, minput_get_variables)
3133         (minput_set_variable): New functions.
3134
3135         * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
3136         (minput_assign_command_keys, minput_get_variables)
3137         (minput_set_variable): Extern them.
3138
3139         * plist.c (UNGETC): Just decrement st->p.
3140         (read_mtext_element): New arg skip.
3141         (read_integer_element): Likewise.
3142         (read_symbol_element): Likewise.
3143         (read_element): New arg KEYS.
3144         (mplist__from_plist): Don't increment ref-count of NULL object.
3145         (mplist__from_file): New arg KEYS.
3146         (mplist_put): Don't increment ref-count of NULL object.
3147         (mplist_add): Likewise.
3148         (mplist_push): Likewise.
3149         (mplist_set): Likewise.  Call M17N_OBJECT_UNREF unconditionally.
3150
3151         * plist.h (mplist__from_file): Prototype adjusted.
3152
3153         * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
3154         (get_database_stream): New function.
3155         (load_database): Use get_database_stream.
3156         (M_database_hook): New variable
3157         (mdatabase__init): Initialize M_database_hook.
3158         (mdatabase__load_for_keys): New function.
3159         (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
3160         function.
3161         (mdatabase_define): Free mdb->extra_info if necessary.
3162
3163         * database.h (mdatabase__dir_list, M_database_hook)
3164         (mdatabase__load_for_keys): Extern them.
3165         (MDatabaseHookFunc): New type.
3166
3167         * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
3168
3169 2004-12-27  Kenichi Handa  <handa@m17n.org>
3170
3171         * Version 1.2.0 released.
3172
3173 2004-12-27  Kenichi Handa  <handa@m17n.org>
3174
3175         * input.c (minput_filter): Don't reset ic->xxx_changed.
3176
3177         * mtext.c (mtext_from_data): Fix documentation.
3178
3179 2004-12-25  Kenichi Handa  <handa@m17n.org>
3180
3181         * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
3182         (M17NLIB_VERSION_NAME): Update to "1.2.".
3183
3184 2004-12-24  Kenichi Handa  <handa@m17n.org>
3185
3186         * input.c (reset_ic): Set key_unhandled to 0.
3187
3188 2004-12-21  Kenichi Handa  <handa@m17n.org>
3189
3190         * m17n-gui.h (mfont_from_spec): Delete extern.
3191
3192         * input-gui.c (win_callback): Handle Minput_reset.
3193         (minput__win_init): Register reset_ic as a callback for
3194         Minput_reset.
3195
3196         * input.c (reset_ic): New arg IGNORE which is ignored.  Caller
3197         changed.  At first, shift to the initial state.
3198         (minput__init): Initialize Minput_reset.  Register reset_ic as a
3199         callback for Minput_reset.
3200         (Minput_reset): New variable.
3201         (minput_filter): Always set ic->xxx_changed to 0.
3202         (minput_reset_ic): New function.
3203         (integer_value): Fix typo ('>' -> '<') and calculation of length
3204         of preedit text.
3205
3206         * m17n-core.c (merror_code): Change type to `int'.
3207
3208         * m17n-misc.h (merror_code): Adjust type.
3209
3210         * m17n.h (Minput_reset, minput_reset_ic): Extern them.
3211
3212         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
3213         (mtext_change_prop): Delete extern.
3214
3215         * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
3216         to `int'.  Move the documents to m17n-core.h.
3217
3218 2004-12-13  Kenichi Handa  <handa@m17n.org>
3219
3220         * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
3221         (MTextProperty): Document it.
3222
3223 2004-12-09  Kenichi Handa  <handa@m17n.org>
3224
3225         * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
3226
3227 2004-12-03  Kenichi Handa  <handa@m17n.org>
3228
3229         * internal.h (m17n__core_initialized, m17n__shell_initialized,
3230         m17n__gui_initialized): New externs.
3231
3232         * m17n-core.h (enum M17NStatus): New enum.
3233         (m17n_status): Extern it.
3234
3235         * m17n-core.c (core_initialized): Delete this variable.
3236         (m17n__core_initialized, m17n__shell_initialized,
3237         m17n__gui_initialized): New variables.
3238         (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
3239         instead of core_initialized.
3240         (m17n_status): New function.
3241
3242         * m17n.c (shell_initialized): Delete this variable.
3243         (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
3244         shell_initialized.
3245
3246         * m17n-gui.h (m17n_init_win): Adjust the prototype.
3247
3248         * m17n-gui.c (win_initialized): Delete this variable.
3249         (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
3250         instead of gui_initialized.
3251
3252 2004-11-19  Kenichi Handa  <handa@m17n.org>
3253
3254         * input.c (reset_ic): Check if ic_info->state is NULL.
3255         (filter): If ic_info->state is NULL, return 0.
3256         (load_input_method): Don't unref `maps' it it's not created.
3257
3258 2004-11-15  Kenichi Handa  <handa@m17n.org>
3259
3260         * input.c (find_candidates_group): If INDEX is -1, find the last
3261         candidate group.
3262         (take_action_list): If the previous of the first candidate is
3263         requested, select the last candidate.
3264
3265 2004-11-08  Kenichi Handa  <handa@m17n.org>
3266
3267         * m17n-X.c (device_open): Try at most 32 fonts to find a
3268         non-autoscaled font.
3269
3270         * font.c (xlfd_parse_name): Fix previous change.
3271
3272 2004-11-05  Kenichi Handa  <handa@m17n.org>
3273
3274         * font.c: (commont_style): Include dummy elements "slanted" and
3275         "rslanted" to prefer "o" to "r" if "i" is requested.
3276
3277         * font-ft.c (ft_to_prop): Fix "oblique" entry.
3278
3279 2004-10-29  Kenichi Handa  <handa@m17n.org>
3280
3281         * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
3282
3283         * m17n-X.c (MXFont): Change type of the member `sizes' to int.
3284         New members smallest and larger.
3285         (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
3286         (xfont_registry_list): Likewise.
3287         (xfont_select): Likewise.
3288         
3289
3290 2004-10-28  Kenichi Handa  <handa@m17n.org>
3291
3292         * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
3293         font name comparison.
3294         (xfont_select): Fix logic for selecting a larger size font.
3295
3296 2004-10-25  Kenichi Handa  <handa@m17n.org>
3297
3298         * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
3299         ">" actions.
3300
3301 2004-10-22  Kenichi Handa  <handa@m17n.org>
3302
3303         * input.c (update_candidate): Renamed from udpate_candidate.
3304         (take_action_list): Show more debugging info on arithmetic commands.
3305
3306         * m17n-X.c (device_open): Fix previous change.
3307
3308         * draw.c (compose_glyph_string): Don't get face property at the
3309         end of M-text.
3310
3311 2004-10-21  Kenichi Handa  <handa@m17n.org>
3312
3313         * draw.c (compose_glyph_string): Fix for the case of category
3314         being Mnil.
3315
3316 2004-10-19  Kenichi Handa  <handa@m17n.org>
3317
3318         * input.c (mdebug_mask): New variable.
3319         (shift_state): Print debug information.
3320         (take_action_list): Likewise.
3321         (handle_key): Likewise.
3322
3323 2004-10-14  Kenichi Handa  <handa@m17n.org>
3324
3325         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
3326
3327 2004-10-13  Kenichi Handa  <handa@m17n.org>
3328
3329         * m17n-X.c (device_open): Be sure to register at least one font
3330         driver.
3331
3332         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
3333         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
3334
3335 2004-10-12  Kenichi Handa  <handa@m17n.org>
3336
3337         * draw.c (alloc_gstring): Fix previous change.
3338
3339         * font-ft.c (ft_list_generic): Fix for the case of not
3340         HAVE_FONTCONFIG.
3341
3342         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
3343
3344         * font.c (mfont_list): If no font is found, return NULL.
3345         (load_font_encoding_table): Put entries of nil registry first.
3346         (find_encoding): Adjust for the above change.
3347
3348 2004-10-11  Kenichi Handa  <handa@m17n.org>
3349
3350         * m17n-gui.h (mfont_list): Adjust prototype.
3351
3352         * m17n-X.c (xfont_list): New arg maxnum.
3353
3354         * font.h (struct MFontDriver): Change prototype of <list>.
3355
3356         * font-ft.c (fc_generic_family_list): Delete it.
3357         (Mserif, Msans_serif, Mmonospace): Delete them.
3358         (M_generic_family_info): New variable.
3359         (enum GenericFamilyType): New enum.
3360         (struct GenericFamilyInfo): New struct.
3361         (generic_family_table): New variable.
3362         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
3363         iso8859-1.
3364         (add_font_info): Get style here.
3365         (ft_list_family): Don't initialize fc_config here.  Don't list
3366         generic families.
3367         (ft_list_generic): New function.
3368         (ft_select): Pay attention to generic familes here.
3369         (ft_open): Fix calculation of ascent and descent.
3370         (ft_list): Pay attention to generic families.
3371         (mfont__ft_init): Initialize M_generic_family_info,
3372         generic_family_table, and fc_config..
3373         (mfont__ft_fini): Finalize generic_family_table.
3374
3375         * draw.c (compose_glyph_string): Use more constant font for
3376         glyphs.  Adjust for the member change in MGlyph.
3377         (layout_glyph_string): Adjust for the member change in MGlyph.
3378         (alloc_gstring): Intilize scracth_glyph to avoid
3379         compose_glyph_string on it.
3380         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
3381         (mdraw_coordinates_position): Fix previous change.
3382
3383         * internal-gui.h (glyph_category): New enum.
3384         (MGlyph): Change type of <category> to enum glyph_category.
3385
3386         * face.c (mface__realize): Delete args langauge and charset.
3387         (mface__for_chars): Fix for the case that glyphs have different
3388         rfaces.
3389         (mface__update_frame_face): Adjust for mface__realize change.
3390
3391         * face.h (mface__realize): Adjust prototype.
3392
3393 2004-10-05  Kenichi Handa  <handa@m17n.org>
3394
3395         * language.c (mlang__init): Add Akan.
3396
3397 2004-10-04  Kenichi Handa  <handa@m17n.org>
3398
3399         * font-ft.c (add_font_info): Add instead of push the element.
3400         (ft_list_family): For generic fonts, try all
3401         substituted. families.
3402
3403         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
3404         (run_rule): Don't update cluster range here.
3405         (run_command): Update cluster range on appending a glyph.
3406         (run_otf): Update cluster range for glyphs generated by OTF.
3407
3408 2004-10-02  Kenichi Handa  <handa@m17n.org>
3409
3410         * m17n-X.c (device_open): Handle Mfont key in PLIST.
3411
3412 2004-09-30  Kenichi Handa  <handa@m17n.org>
3413
3414         * font-ft.c (ft_select): Ignore family on calling mfont__score.
3415
3416 2004-09-30  Kenichi Handa  <handa@m17n.org>
3417
3418         * font.h: Include <fontconfig/fontconfig.h>.
3419         (MFTInfo): New member langset.
3420         (mfont__encoding_list): Extern it.
3421
3422         * font.c (mfont__encoding_list): New function.
3423         (mdebug_dump_font_list): New function.
3424
3425         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
3426         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
3427         variables.
3428         (ft_family_list): New variable.
3429         (set_font_info): New arg basep.  Callers changed.
3430         (fc_list): Check the return value of FcPatternGetString.
3431         (add_font_info): New arg plist.  Callers changed. Update
3432         ft_family_list.
3433         (ft_list_family): New function (merged fc_list and ft_list_all).
3434         (ft_select): Use ft_list_family.
3435         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
3436         typo (== -> !=).
3437         (mfont__ft_init): Initialize above new variables.
3438         (mfont__ft_fini): Free ft_family_list.
3439         (STRDUP_LOWER): New macro.
3440         (set_font_info): Use STRDUP_LOWER.
3441         (ft_list_family): Avoid duplicate addition of font path.  Use
3442         STRDUP_LOWER.
3443         (fc_decode_prop): Fix typo.
3444
3445         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
3446         (xfont_registry_list): Change argument disp_info to frame.
3447         Callers changed.
3448         (xfont_list_all): New function.
3449         (xfont_list): If FONT is not NULL, check all fonts.
3450
3451 2004-09-28  Kenichi Handa  <handa@m17n.org>
3452
3453         * m17n-X.c (MXFont, MXFontList): New types.
3454         (MDisplayInfo): Delete members font_registry_list,
3455         iso8859_1_family_list, iso10646_1_family_list, new members
3456         font_list, base_font_list.
3457         (free_display_info): Adusted for the change of MDisplayInfo.
3458         (xfont_driver): Initialize with xfont_list.
3459         (font_compare): New function.
3460         (build_font_list): Deleted.
3461         (xfont_registry_list): New function.
3462         (xfont_select): Use xfont_registry_list.
3463         (xfont_list): New function.
3464         (device_open): Adusted for the change of MDisplayInfo.
3465
3466         * font-ft.c (add_font_info): New arg languages.  Callers changed.
3467         (fc_list): Get languages from fonts..
3468         (ft_list_all): Renamed from ft_list.  Callers changed.
3469         (ft_list): New function.
3470         (mfont__ft_driver): Initalize with ft_list.
3471
3472         * font.c (mfont_list): New function.
3473
3474         * font.h (struct MFontDriver): New member `list'.
3475         (MFTInfo): New member languages.
3476
3477         * m17n-gui.h (mfont_list): Extern it.
3478
3479 2004-09-27  Kenichi Handa  <handa@m17n.org>
3480
3481         * internal-gui.h (struct MGlyphString): Delete members mt,
3482         sub_width, sub_lbrearing, sub_rbearing, and region.
3483
3484         * draw.c (MSubTextExtents): New type.
3485         (layout_glyphs): New arg extents.  Set its members.
3486         (layout_glyph_string): Adjusted for the above change.
3487         (alloc_gstring): Don't set gstring->mt.
3488         (truncate_gstring): Call line_break function with mt instead of
3489         gstring->mt.
3490
3491 2004-09-22  Kenichi Handa  <handa@m17n.org>
3492
3493         * mtext.c (count_utf_16_chars): Count each code of invalid
3494         surrogates as one.
3495
3496 2004-09-19  Kenichi Handa  <handa@m17n.org>
3497
3498         * mtext.c (default_utf_16, default_utf_32): Rename them to
3499         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
3500         changed.
3501
3502         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
3503         them.
3504
3505 2004-09-13  Kenichi Handa  <handa@m17n.org>
3506
3507         * draw.c (Mlatin): Don't declare it here.
3508         (visual_order): Fix reordering of combining characters.
3509         (compose_glyph_string): Fix detection of script.
3510         (layout_glyphs): Don't fix reordering of combining characters
3511         here.
3512         (layout_glyph_string): Pay attention to
3513         control->disable_overlapping_adjustment.
3514         (truncate_gstring): Include at least on character in a line.
3515         (get_gstring): Always scan one full line.
3516         (mdraw__init): Don't initialize Mlatin here.
3517         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
3518         have a font, use ascent/descent of an ASCII font.  Allow
3519         ink_array_return and logical_array_return to be NULL.
3520         (mdraw_coordinates_position): Fix iteration.
3521
3522         * font-ft.c (MFTtoProp): Member completely changed.
3523         (ft_to_prop): Adjusted for the above change.
3524         (ft_to_prop_size): Likewise.
3525         (set_font_info): Adjusted for the change of MFTtoProp.
3526         (fc_generic_family_list): New variable.
3527         (fc_list): Add special handling of generic font names.
3528         (mfont__ft_init): Adjusted for the change of MFTtoProp.
3529         Initialize fc_generic_family_list.
3530         (mfont__ft_fini): Don't free ft_to_prop.  Free
3531         fc_generic_family_list.
3532         (FC_vs_M17N_font_prop): New type.
3533         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
3534         (fc_decode_prop, fc_encode_prop): New functions.
3535         (mfont__ft_parse_name): Use fc_decode_prop.
3536         (mfont__ft_unparse_name): Use fc_encode_prop.
3537
3538         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
3539         (MWDevice): Add member realized_font_list.
3540         (free_display_info): Don't free disp_info->realized_font_list.
3541         (free_device): Free device->realized_fontset_list.
3542         (xft_find_metric): Use gstring->frame instead of rfont->frame.
3543         (device_open): Don't initialize disp_info->realized_font_list.
3544         (device_open): Initialize device->realized_font_list and set it to
3545         frame->realized_font_list.
3546
3547         * fontset.c (try_font_group): New function.
3548         (mfont__lookup_fontset): Use try_font_group.
3549
3550         * font.c (common_weight): Change the order of "regular".
3551
3552         * face.c (Mlatin): Don't make it static.
3553         (mface__realize): Be sure to set work_gstring.frame.
3554         (mface__for_chars): Likewise.
3555
3556         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
3557         MTEXT_FORMAT_UTF_8.
3558
3559         * internal-gui.h (Mlatin): Extern it.
3560
3561         * m17n-gui.h (MDrawControl): New member
3562         disable_overlapping_adjustment.
3563
3564 2004-09-06  Kenichi Handa  <handa@m17n.org>
3565
3566         * font-flt.c (run_otf): Fix typo ('}'->']').
3567
3568         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
3569         (COMBINING_PRECOMPUTED_P): New macros.
3570
3571         * draw.c (layout_glyphs): Handle precomputed combining code.
3572
3573         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
3574         precomupted combining code.
3575
3576 2004-09-03  Kenichi Handa  <handa@m17n.org>
3577
3578         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
3579         otf_gstring.glyphs.
3580
3581 2004-08-27  Kenichi Handa  <handa@m17n.org>
3582
3583         * face.c (mface_put_prop): If the new value is the same as the
3584         current one, don't increment frame->tick.
3585
3586 2004-08-25  Kenichi Handa  <handa@m17n.org>
3587
3588         * fontset.c (mfontset): Initialize font_spec_list member.
3589         (mfontset_copy): Load fontset if necessary.
3590
3591         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
3592         'metrics' to for C++.
3593
3594         * draw.c (mdraw_glyph_info): Adjusted for the member name change
3595         (this -> metics).
3596
3597 2004-08-16  Kenichi Handa  <handa@m17n.org>
3598
3599         * Version 1.1.0 released.
3600
3601 2004-08-13  Kenichi Handa  <handa@m17n.org>
3602
3603         * language.c (mlang__init): Add Dhivehi.
3604
3605         * m17n-gui.c (Mx, Mfreetype): Delete it.
3606         (m17n_init_win): Don't initialize Mx and Mfreetype here.
3607
3608         * m17n-gui.h (Mfreetype, Mxft): Extern them.
3609         (mfont_resize_ratio): Extern it.
3610         (MDrawGlyphInfo): New member logical_width;
3611         (MDrawGlyph): New type.
3612         (mdraw_glyph_list): Prototype adjusted.
3613
3614         * m17n-X.c (xfont_open): Set type and fontp members.
3615         (xft_open): Likewise.
3616
3617         * internal-gui.h (Mx, Mfreetype): Delete extern.
3618
3619         * font.h (struct MRealizedFont): New member type and fontp.
3620
3621         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
3622         (Mx, Mfreetype): Declare here.
3623         (Mxft): New variable.
3624         (mfont_resize_ratio): New function.
3625
3626         * font-ft.c (ft_open): Set type and fontp members.
3627
3628         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
3629         glyph_code member.
3630
3631 2004-08-11  Kenichi Handa  <handa@m17n.org>
3632
3633         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
3634         FT_LOAD_DEFAULT.
3635
3636 2004-08-06  Kenichi Handa  <handa@m17n.org>
3637
3638         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
3639         feature to apply.
3640
3641         * font-flt.c (run_otf): Print debugging information if necessary.
3642
3643 2004-08-05  Kenichi Handa  <handa@m17n.org>
3644
3645         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
3646         positioning_type 5 and 6.  Switch simplified.
3647
3648 2004-08-04  Kenichi Handa  <handa@m17n.org>
3649
3650         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
3651
3652 2004-08-02  Kenichi Handa  <handa@m17n.org>
3653
3654         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
3655         set val to 1 even if it is greater than 1.
3656
3657         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
3658
3659 2004-07-29  Kenichi Handa  <handa@m17n.org>
3660
3661         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
3662         debugging information.
3663
3664         * internal.h (MDEBUG_PRINT5): New macro.
3665
3666         * draw.c (layout_glyphs): Don't combine a zero width glyph with
3667         the previous one if the zero width glyph has left or right
3668         padding.
3669
3670 2004-07-26  Kenichi Handa  <handa@m17n.org>
3671
3672         * m17n-X.c (xft_render): Pay attention to members left_padding and
3673         right_padding of MGlyph.
3674
3675         * draw.c (visual_order): Allocate one more elements for arrays as
3676         a workaround of fribidi bug.
3677         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
3678         instead of MGlyph->bidi_sensitive.
3679         (layout_glyph_string): Pay attentinon to
3680         control->orientation_reversed when padding at the head or tail.
3681         Fix adjustment of space glyph width.
3682         (get_gstring): If cursor_width or cursor_bidi is changed, don't
3683         use a cache.
3684
3685         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
3686         instead of MGlyph->bidi_sensitive.
3687
3688         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
3689
3690 2004-07-26  Kenichi Handa  <handa@m17n.org>
3691
3692         * draw.c (visual_order): Don't treat combined glyphs specially.
3693         (layout_glyphs): Don't get metrics glyphs that are already ready.
3694         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
3695         width with the previous one. 
3696         (draw_background): Fix bar cursor position on a r2l glyph.
3697
3698         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
3699         (run_rule): Fix place of updating cluster_begin_pos and
3700         cluster_end_pos here.
3701         (run_otf): Don't set left_padding.
3702
3703         * font-ft.c (adjust_anchor): Type of argument `code' changed.
3704         Caller changed.
3705         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
3706         Fix handling of GPOS.
3707         (mfont__ft_drive_gpos): Delete this function.
3708
3709         * font.h (mfont__ft_drive_otf): Renamed back from
3710         mfont__ft_drive_gsub.
3711         (mfont__ft_drive_gpos): Delete extern.
3712
3713         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
3714         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
3715
3716 2004-07-23  Kenichi Handa  <handa@m17n.org>
3717
3718         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
3719         the same bidi level.
3720
3721         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
3722
3723 2004-07-22  Kenichi Handa  <handa@m17n.org>
3724
3725         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
3726
3727 2004-07-20  Kenichi Handa  <handa@m17n.org>
3728
3729         * draw.c (render_glyphs): Fix checking of g->code validity.
3730
3731         * face.c (mface__realize): Set g.type.
3732
3733 2004-07-18  Kenichi Handa  <handa@m17n.org>
3734
3735         * Makefile.am: Prepend ${top_srcdir} to all *.la in
3736         *_LIBADD/*_LDADD.
3737
3738         * m17n-gui.c (mframe): Print error message give by dlopen to
3739         stderr.
3740
3741 2004-07-16  Kenichi Handa  <handa@m17n.org>
3742
3743         * draw.c (compose_glyph_string): Improve the way of deciding a
3744         script.  For a character that doesn't have script property, use
3745         the last non-latin script.
3746
3747         * font-ft.c (fc_list): Cancel previous change.
3748         (mfont__ft_init): Add more entries in ft_to_prop_name.
3749
3750 2004-07-15  Kenichi Handa  <handa@m17n.org>
3751
3752         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
3753         previous or next character glyphs.
3754
3755 2004-07-14  Kenichi Handa  <handa@m17n.org>
3756
3757         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
3758         of type GLYPH_SPACE.
3759
3760         * fontset.c (mfont__lookup_fontset): If glyph type is
3761         GLYPH_SPACE, get codes for SPACE.
3762
3763         * internal-gui.h (Mfont): Delete extern.
3764
3765         * m17n-gui.h (Mfont): Delete duplicated extern.
3766
3767 2004-07-13  Kenichi Handa  <handa@m17n.org>
3768
3769         * font-ft.c (DEVICE_DELTA): New macro.
3770         (adjust_anchor): New function.
3771         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
3772         only GSUB.
3773         (mfont__ft_drive_gpos): New function.
3774
3775         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
3776         (FontLayoutContext): Delete member `rfont'.
3777         (run_otf): Set g->otf_cmd.  Call 
3778         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
3779         only whne HAVE_OTF is defined.
3780
3781         * fontset.c: Include "config.h".
3782
3783         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
3784         (MGlyph): New member otf_cmd.
3785
3786         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
3787         (mfont__ft_drive_gpos): Extern it.
3788
3789         * face.c: Include "config.h".
3790
3791         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
3792
3793         * input-gui.c: Include "config.h".
3794
3795         * plist.c: Include "config.h".
3796
3797 2004-07-06  Kenichi Handa  <handa@m17n.org>
3798
3799         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
3800         internal-gui.h: Cancel previous changes.
3801
3802         * m17n-gd.h: Delete it.
3803
3804         * Makefile.am (libm17n_core_la_LIBADD): New variable.
3805         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
3806         @XML2_LD_FLAGS@ to above.
3807         (libm17n_la_LIBADD): Add -ldl.
3808         (libm17n_la_LDFLAGS): Add -export-dynamic.
3809         (X_LD_FLAGS): Fix the order of linking.
3810         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
3811         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
3812         (libm17n_X_la_LDFLAGS): Add -module.
3813         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
3814         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
3815         (libm17n_gd_la_LDFLAGS): Add -module.
3816         (include_HEADERS): Delete m17n-gd.h.
3817
3818 2004-06-30  Kenichi Handa  <handa@m17n.org>
3819
3820         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
3821         (MDeviceLibraryInterface): Delete it.
3822         (register_device_library): Delete it.
3823         (m17n__device_library_list): Renamed from device_library_list.
3824
3825         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
3826         (m17n_init_win): Adjust prototype.
3827
3828         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
3829         (m17n_init_gd): New function. 
3830
3831         * m17n-gd.h: New file.
3832
3833         * m17n-X.h: Include <m17n-gui.h>.
3834         (m17n_init_X): Extern it.
3835         (M17N_INIT): Redefine it.
3836
3837         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
3838         (m17n_init_X): New function.
3839
3840         * internal-gui.h (m17n__device_library_list): Extern it.
3841         (struct MDeviceDriver): New members initialized, init, and fini.
3842
3843         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
3844         @XFT2_LD_FLAGS@.
3845         (libm17n_X_la_LIBADD): Delete aboves.
3846         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
3847         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
3848         (libm17n_gd_la_LDFLAGS): Delete it.
3849         (include_HEADERS): Add m17n-gd.h.
3850
3851 2004-06-25  Kenichi Handa  <handa@m17n.org>
3852
3853         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
3854         (libm17n_gd_la_LDFLAGS): Cancel previous change.
3855
3856         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
3857
3858         * font-ft.c (fc_list): If FcFontList finds no font, try
3859         FcFontMatch.
3860
3861         * draw.c (compose_glyph_string): Terminate the last loop after
3862         doing default combining if necessary.
3863
3864 2004-06-24  Kenichi Handa  <handa@m17n.org>
3865
3866         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
3867
3868         * character.c (mchar_define_property): Add const to an arg.
3869
3870         * charset.c (mchar_define_charset): Add const to an arg.
3871
3872         * coding.c (MCodingSystem): Add const to an arg or decoder.
3873         (finish_decoding): Add const to an arg.
3874         (decode_coding_charset, decode_coding_utf_8)
3875         (decode_coding_utf_16, decode_coding_utf_32)
3876         (decode_coding_iso_2022, decode_coding_sjis)
3877         (mconv_define_coding): Likewise.
3878
3879         * m17n-X.c (xft_find_metric): Delete unused variable.
3880
3881         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
3882         prototypes.
3883
3884         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
3885         prototypes.
3886
3887         * mtext.c (count_utf_8_chars, count_utf_16_chars)
3888         (mtext__from_data, mtext_from_data): Add `const' to an arg.
3889
3890         * mtext.h (mtext__from_data): Ajust prototype.
3891
3892 2004-06-23  Kenichi Handa  <handa@m17n.org>
3893
3894         * draw.c (compose_glyph_string): Always get glyph codes by
3895         mface__for_char.
3896         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
3897         (mdraw_glyph_list): New function.
3898
3899         * font-flt.c (mfont__flt_run): Be sure to call
3900         rfont->driver->encode_char.
3901
3902         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
3903         (ft_encode_char): Delete arg C.
3904         (ft_render): Don't call FT_Get_Char_Index.
3905
3906         * font.c (mfont__encodable_p): Delete it.
3907         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
3908
3909         * font.h (struct MFontDriver): Delete arg C of encode_char.
3910         (mfont__encodable_p): Delete extern.
3911
3912         * m17n-X.c (xfont_encode_char): Delete arg C.
3913         (xft_find_metric): Don't cal FT_Get_Char_Index.
3914         (xft_render): Likewise.
3915
3916         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
3917         logical_width.
3918         (mdraw_glyph_list): Extern it.
3919
3920         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
3921
3922 2004-06-22  Kenichi Handa  <handa@m17n.org>
3923
3924         * m17n-gui.h (mfontset_lookup): Extern it.
3925
3926         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
3927
3928         * fontset.c (realize_fontset_elements)
3929         (free_realized_fontset_elements, update_fontset_elements): New
3930         functions.
3931         (mfont__realize_fontset): Call realize_fontset_elements.
3932         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
3933         (mfont__lookup_fontset): If a fontset was modified, update
3934         the realized fontset.
3935         (mfontset_modify_entry): Increment fontset->tick.
3936         (mfontset_lookup): New function.
3937
3938 2004-06-21  Kenichi Handa  <handa@m17n.org>
3939
3940         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
3941
3942         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
3943         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
3944         length of source text 0.
3945
3946 2004-06-21  Kenichi Handa  <handa@m17n.org>
3947
3948         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
3949         (compare): Pay attention to format other than utf-8.
3950         (copy): Delete this function.
3951         (count_by_utf_8, count_by_utf_16, insert): New functions.
3952         (count_utf_16_chars): Fix handling of a surrogate pair.
3953         (find_char_forward, find_char_backward): Likewise.
3954         (mtext__from_data): Delete unnecessary check.  Fix number of
3955         allocated bytes.
3956         (mtext_from_data): Don't count items.
3957         (mtext_ref_char): Optimize the code.
3958         (mtext_set_char): Pay attention to format other than utf-8.
3959         (mtext_cat_char): Likewise.
3960         (mtext_dup): Don't call copy, instead do allocation here.
3961         (mtext_cat): Call insert instead of copy.
3962         (mtext_ncat): Likewise.
3963         (mtext_cpy): Delete character at first and call insert instead of
3964         copy.
3965         (mtext_ncpy): Likewise.
3966         (mtext_copy): Likewise.
3967         (mtext_duplicate): Call insert instead of copy.
3968         (mtext_del): Pay attention to format other than utf-8.
3969         (mtext_ins): Simply call insert.
3970         (mtext_ins_char): Pay attention to format other than utf-8.
3971         (mtext_tok): Call insert instead of copy.
3972         (mtext_text): Call UNIT_BYTES.
3973
3974         * textprop.c (mtext__adjust_plist_for_change): New function.
3975
3976         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
3977         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
3978         (CHAR_UNITS_AT): Fix typo.
3979         (CHAR_UNITS_BY_HEAD): Fix typo.
3980         (STRING_CHAR_AND_UNITS): Fix typo.
3981
3982         * internal.h (MTEXT_READ_ONLY_P): New macro. 
3983
3984         * mtext.h (mtext__replace): Delete the extern.
3985         (mtext__adjust_foramt): Adjust prototype.
3986
3987         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
3988         if possible.  Otherwise make a copy of mmt.
3989
3990         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
3991         utf-8.
3992
3993 2004-06-18  Kenichi Handa  <handa@m17n.org>
3994
3995         * character.h (CHAR_STRING_UTF16): Fix syntax.
3996
3997 2004-06-16  Kenichi Handa  <handa@m17n.org>
3998
3999         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
4000         (libm17n_X_la_LIBADD): Delete it.
4001         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
4002
4003         * m17n-X.c (device_open): Add parens in `if' condition.
4004
4005         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
4006         (DEC_POSITION): Likewise.
4007         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
4008
4009 2004-06-15  Kenichi Handa  <handa@m17n.org>
4010
4011         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
4012         by language.
4013
4014         * draw.c (compose_glyph_string): If langauge is specified, call
4015         mface__for_chars even if a text is all latin.  Fix condition for
4016         setting non_ascii_found.
4017
4018         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
4019
4020         * m17n.h (minput_char_to_key): Delete extern.
4021
4022         * m17n-gui.h (minput_event_to_key): Cancel previous change.
4023
4024         * m17n-gui.c (null_device_open): Set several members of frame.
4025
4026 2004-06-14  Kenichi Handa  <handa@m17n.org>
4027
4028         * m17n-gui.h (minput_event_to_key): Delete extern.
4029
4030         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
4031
4032         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
4033
4034         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
4035
4036 2004-06-08  Kenichi Handa  <handa@m17n.org>
4037
4038         * character.c (mchar_put_prop): Don't increment the ref-count of
4039         record->table.
4040
4041 2004-06-04  Kenichi Handa  <handa@m17n.org>
4042
4043         * m17n-core.c (mdebug__register_object): New function.
4044         (mdebug__unregister_object): Likewise.
4045
4046         * internal.h (mdebug__register_object, mdebug__unregister_object):
4047         Extern them.
4048         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
4049         respectively.
4050
4051         * charset.c (mcharset__load_from_database): Don't call
4052         mconv__register_charset_coding here.
4053
4054         * coding.c (find_coding): Get a real name from an element of
4055         coding_definition_list.
4056         (mconv__register_charset_coding): Set the real name at the top of
4057         param.
4058         (mcoding__load_from_database): Likewise.
4059         (mconv_list_codings): Adjusted for the above change.
4060
4061 2004-06-03  Kenichi Handa  <handa@m17n.org>
4062
4063         * coding.c (find_coding): Find by canonicalized name.  Don't have
4064         to modify the element of coding_definition_list by
4065         mplist__from_plist.
4066         (mconv__define_coding_from_charset): Delete it.
4067         (mconv__register_charset_coding): Canonicalize sym.
4068         (mcoding__load_from_database): Register plist modified by
4069         mplist__from_plist.
4070
4071         * coding.h (mconv__define_coding_from_charset): Don't extern it.
4072
4073         * font-ft.c (ft_open): Fix setting of rfont->descent.
4074
4075 2004-06-02  Kenichi Handa  <handa@m17n.org>
4076
4077         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
4078         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
4079         (xlfd_unparse_name): Renamed from xfont_build_name.
4080         (mfont__init): Initialized Mfontconfig.
4081         (mfont__free_realized): Unconditionally unref rfont->info.
4082         (mfont__select): Free `this' if it's not best.
4083         (mfont__open): Don't check frame->realized_font_list.
4084         (mfont__parse_name_into_font): New function.
4085         (Mfontconfig): New variable.
4086         (mfont_from_name): Call mfont_parse_name.
4087         (mfont_name): Call mfont_unparse_name.
4088         (mdebug_dump_font): Likewise.
4089
4090         * font.h (struct MFontDriver): Delete members parse_name and
4091         build_name.
4092         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
4093         (mfont__parse_name_into_font): Extern it.
4094
4095         * font-ft.c: Include "symbol.h".
4096         (close_ft): Unconditionally free filename and charmap_list of
4097         ft_into.
4098         (ft_open): Duplicate base->filename.  Increment ref-count of
4099         ft_info->charmap_list.  Free ft_info->charmap_list and
4100         ft_info->filename on error.
4101         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
4102
4103         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
4104         xfont_build_name.
4105         (enum xlfd_field_idx): Moved to font.c.
4106         (split_font_name, build_font_name): Likewise.
4107         (build_font_list): Call mfont__parse_name_info_font.
4108         (xfont_open): Call mfont__unparse_name.  Free name.
4109         (xfont_parse_name, xfont_build_name): Moved to font.c
4110         (xft_select): Prototype deleted.
4111         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
4112         Call mfont_pase_name.
4113
4114         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
4115         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
4116         (mframe): Likewise.
4117
4118         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
4119         Extern them.
4120
4121         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
4122
4123 2004-06-01  Kenichi Handa  <handa@m17n.org>
4124
4125         * fontset.c (mfontset_modify_entry): Pay attention to the case
4126         that fontset->font_spec_list is NULL.
4127
4128 2004-05-31  Kenichi Handa  <handa@m17n.org>
4129
4130         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
4131
4132         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
4133
4134         * font.c (mfont__select): Print score the a font for debugging.
4135
4136         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
4137
4138         * coding.c (reset_coding_sjis): Check kanji and kana instead of
4139         kanji_sym and kana_sym.
4140
4141 2004-05-28  Kenichi Handa  <handa@m17n.org>
4142
4143         * Makefile.am (VINFO): New variable.
4144         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
4145         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
4146
4147 2004-05-27  Kenichi Handa  <handa@m17n.org>
4148
4149         The following chanages are to make device dependent functions
4150         accessible only from MDeviceDriver structure, and to add GD and
4151         null device drivers.  Font drivers get also device dependent.
4152
4153         * m17n.c (m17n_init): Increament shell_initialized.
4154         (m17n_fini): Decremented shell_initialized.
4155
4156         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
4157
4158         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
4159         (Mwidget, Mcolormap, Mx): Extern them.
4160
4161         * m17n-gui.c: Include <dlfcn.h> and "config.h".
4162         (free_frame): Call frame->driver->close instead of
4163         mwin__close_device.
4164         (DLOPEN_SHLIB_EXT): New macro.
4165         (MDeviceLibraryInterface): New type.
4166         (device_library_list): New variable.
4167         (register_device_library): New function.
4168         (null_device): New variable.
4169         (null_device_close, null_device_get_prop)
4170         (null_device_realize_face, null_device_free_realized_face): New
4171         function.
4172         (null_driver): New variable.
4173         (null_device_init, null_device_fini, null_device_open): New
4174         functions.
4175         (null_interface): New variable.
4176         (Mfreetype, Mdevice): Declare them.
4177         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
4178         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
4179         Mwin__Close_Device.  Register drivers for Mx and Mgd.
4180         (m17n_fini_win): Decremented win_initialized.  Call "fini"
4181         function of all opened devices.  Don't call mwin__fini.
4182         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
4183         Declare them here.
4184         (mframe): Handle Mdevice key of PLIST.
4185         (mframe_get_prop): Call frame->device->get_prop instead of
4186         mwin__device_get_prop.
4187
4188         * m17n-gd.c: New file.
4189
4190         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
4191         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
4192
4193         * m17n-core.c (m17n_init_core): Increate core_initialized.
4194         (m17n_fini_core): Decremented core_initialized.
4195
4196         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
4197         (Mcolormap): Don't extern them here.
4198
4199         * m17n-X.c (FRAME_DEVICE): New macro.
4200         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
4201         (free_display_info): Use MPLIST_DO.
4202         (free_device): Free rface->info.
4203         (xft_close): Delete it.
4204         (device_init): Renamed from mwin__init.
4205         (device_fini): Renamed from mwin__fini.
4206         (device_open): Renamed from mwin__open_device.
4207         (x_driver): New variable.
4208         (MXFontInfo): Delete member frame, add member display.
4209         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
4210         Don't declare them here.
4211
4212         * internal-gui.h (MDeviceType): New enum.
4213         (MWDefice): Delete it.
4214         (struct MFrame): Change type of device to void *.  New members
4215         device_type, driver, font_driver_list.
4216         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
4217         (MDeviceDriver): New type.
4218         (Mx, Mgd, Mfreetype): Extern them.
4219         (mwin__XXX): Delete all of them.
4220
4221         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
4222         mwin__XXX.
4223         (win_destroy_ic): Likewise.
4224         (adjust_window_and_draw): Likewise.
4225         (win_callback): Likewise.
4226         (Mxim): Declare it here.
4227         (minput_event_to_key): Call M_CHECK_READABLE.
4228
4229         * fontset.c (mfont__lookup_fontset): Delete local variable
4230         font_group.
4231
4232         * font.h (struct MFontDriver): Delete member close, add members
4233         parse_name and build_name.
4234         (mfont__driver_list): Delete extern.
4235         (mfont__close): Delete extern.
4236
4237         * font.c (mfont__init): Don't set mfont__driver_list.
4238         (mfont__fini): Don't unref mfont__driver_list.
4239         (mfont__select): Try font drivers in frame->font_driver_list.  Set
4240         driver member of a realized font.
4241         (mfont__close): Delete it.
4242         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
4243         functions of the default frame.
4244
4245         * font-ft.c (close_ft): Check ft_info->ft_face and work
4246         differently.
4247         (add_font_info): Allocate ft_info by M17N_OBJECT.
4248         (ft_close): Delete it.
4249         (mfont__ft_driver): Don't set ft_close.
4250         (ft_select): Increment ref-count of best_font.
4251         (ft_open): Decremented ref-count of base.  On error, call
4252         FT_Done_Face and free ft_info.
4253         (ft_find_metric): Always use XXX_MONO in load_flags.
4254         (ft_render): Fix setting of width.  Call
4255         frame->driver->draw_points instead of mwin__draw_points.
4256         (ft_to_prop): Don't set mfont__driver_list.
4257         (mfont__ft_fini): Just unref ft_info.
4258
4259         * face.c (mface__init): Exchange foreground and background of
4260         mface__default.  Call mface_put_prop to set hline of
4261         mface_underline,
4262         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
4263         (mface__free_realized): Don't call mwin__free_realized_face.
4264
4265         * draw.c (Mdepth): Don't declare it here.
4266         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
4267         (render_glyphs, render_glyph_string): Likewise.
4268         (mdraw__init): Don't set Mdepth.
4269         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
4270         M_CHECK_WRITABLE.
4271         (mdraw_text_per_char_extents): Return 0 on success and -1 on
4272         error.
4273         (mdraw_text_items): Check FRAME is writable.
4274         (mdraw_per_char_extents): Implement body.
4275
4276         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
4277         libm17n-gd.la.
4278         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
4279         (GUI_SOURCES): Delete it.
4280         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
4281         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
4282         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
4283         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
4284         (linkgui_LDADD): Set to libm17n-gui.la
4285         (linkgui_LDFLAGS): New target.
4286         (SRC): Include ${libm17n_gui_la_SOURCES} and
4287         ${libm17n_gd_la_SOURCES}.
4288
4289 2004-05-24  Kenichi Handa  <handa@m17n.org>
4290
4291         * draw.c (draw_background): Don't draw background even if
4292         rface->face.property[MFACE_BACKGROUND] is not Mnil.
4293
4294 2004-05-22  Kenichi Handa  <handa@m17n.org>
4295
4296         * m17n-X.c (xft_open_font): Fix anti_alias setting.
4297
4298 2004-05-20  Kenichi Handa  <handa@m17n.org>
4299
4300         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
4301
4302         * m17n-gui.c: Include "plist.h".
4303         (mframe): If PLIST is NULL, initialize it to emply plist.
4304
4305         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
4306         (xft_driver): New variable.
4307         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
4308         (xft_find_metric, xft_render): New function.
4309         (mwin__init): Adjusted for the new mfont__driver_list.
4310         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
4311         generated face to PARAM.
4312         (mwin__realize_face): Fix setting of box colors.  Don't call hook
4313         function here.
4314         (mwin__draw_hline): New function.
4315         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
4316         (mwin__xft_render): Delete these function.
4317
4318         * internal-gui.h (struct MFrame): New member tick.
4319         (struct MGlyphString): New member tick.
4320         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
4321         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
4322         (mwin__xft_render): Delete extern.
4323
4324         * fontset.c (mfont__lookup_fontset): Make the code simpler.
4325         (mfontset): Always increment the reference count of returned
4326         object.
4327
4328         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
4329         (MFTInfo): Moved to font.h.
4330         (ft_iso8859_1_font_list): Delete this variable.
4331         (set_font_info): Don't set font->property[MFONT_TYPE].
4332         (set_font_info): Don't udpate ft_iso8859_1_font_list.
4333         (add_font_info): Change type to void.
4334         (fc_list): Change anme from xft_list.  Caller changed.  Include
4335         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
4336         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
4337         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
4338         (close_ft): Don't call mwin__xft_close.  Unref
4339         ft_info->extra_info.
4340         (ft_open): Don't setup ft_info->fontname.  Don't call
4341         mwin__xft_open.
4342         (ft_find_metric): Don't call mwin__xft_get_metric.
4343         (ft_encode_char): Call rfont->driver->open instead of ft_open.
4344         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
4345         (mfont__ft_init): Adjusted for new mfont__driver_list.
4346         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
4347
4348         * font.c (mfont__driver_list): Make it MPlist.
4349         (mfont__init): Adjust initialization of mfont__driver_list.
4350         (mfont__fini): Free mfont__driver_list.
4351         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
4352         (mfont__select): Adjusted for the new mfont__driver_list.
4353
4354         * font.h (enum MFontProperty): Delete MFONT_TYPE.
4355         (mfont__drirver_list): Adjust prototype.
4356         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
4357
4358         * face.h (struct MFace): Delete member realized_face_list, add
4359         member frame_list.
4360         (struct MRealizedFace): Delete member need_update
4361         andnofont_rface, add member non_ascii_list.
4362         (mface__update_frame_face): Extern it.
4363
4364         * face.c (hline_prop_list, box_prop_list, noop_hook): New
4365         variables.
4366         (get_hline_create, get_box_create): New functions.
4367         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
4368         Use memcmp.
4369         (free_face): Cancep previous change.  Free face->frame_list.
4370         (serialize_hline): Do nothing if hline->width is zero.
4371         (serialize_box): Do nothing if box->width is zero.
4372         (mface__init): Setup all properties of mface__default.
4373         (mface__fini): Free hline_prop_list and box_prop_list.
4374         (mface__realize): Cancel previous change.  Update
4375         face->frame_list.  Setup rface->non_ascii_list.
4376         (mface__for_chars): Update rface->non_ascii_list.
4377         (mface__free_realized): Free rface->non_ascii_list.
4378         (mface__update_frame_face): New function.
4379         (mface): Initialize face->frame_list.
4380         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
4381         properties.
4382         (mface_merge): Likewise.
4383         (mface_put_prop): If key is Mhline or Mbox, get value by
4384         get_hline_create or get_box_create respectively.
4385         (mface_put_prop): Update frame->tick and call
4386         mface__update_frame_face if necessary.
4387         (mface_update): Do nothing if func is noop_hook.
4388
4389         * draw.c (render_glyphs): If a font is not found, use
4390         mwin__draw_empty_boxes.
4391         (alloc_gstring): Initialize gstring->tick.
4392         (get_gstring): Check gstring->tick.
4393
4394 2004-05-17  Kenichi Handa  <handa@m17n.org>
4395
4396         * face.c (find_realized_face): Return value changed.  If RFONT is
4397         NULL, avoid unnecessary checking.
4398         (free_face): Free face->realized_face_list.
4399         (mface__realize): Adjusted for the change of find_realized_face.
4400         If it returns a realized face that needs update, free it and
4401         realize a new one.  Push a new realized face to
4402         frame->realized_face_list instead of appending.
4403         (mface__for_chars): Adjusted for the change of find_realized_face.
4404         Short cut if the required font is in rface->ascii_rface.
4405         (mface_put_prop): Free old value if necessary.  Set need_update
4406         member of realized faces to 1.
4407
4408         * face.h (struct MFace): Delete member tick, add member
4409         realized_face_list.
4410         (struct MRealizedFace): Delete member tick, add member
4411         need_update.
4412
4413 2004-05-13  Kenichi Handa  <handa@m17n.org>
4414
4415         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
4416
4417 2004-05-12  Kenichi Handa  <handa@m17n.org>
4418
4419         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
4420
4421         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
4422         parse it XftNameParse.
4423
4424         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
4425         (all_fonts_scaned): New variable.
4426         (set_font_info): FAMILY may be Mnil.
4427         (add_font_info): Argument changed.
4428         (xft_list): Call add_font_info in it.
4429         (ft_list): Likewise.
4430         (ft_select): Make it work in the case family is Mnil.
4431         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
4432         (mfont__ft_fini): Set all_fonts_scaned to 0.
4433
4434         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
4435         that is failed to open.
4436
4437 2004-05-10  Kenichi Handa  <handa@m17n.org>
4438
4439         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
4440         device's depth is 1 (i.e. monochrome).
4441
4442         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
4443         to work around the problem of libtool.
4444
4445         * font-ft.c: Include <freetype/ftbdf.h>.
4446         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
4447         variables.
4448         (mfont__ft_init): Initialize them.
4449         (ft_iso8859_1_font_list): New variable.
4450         (set_font_info): Detect a font containing iso8859-1 glyphs and
4451         register it in ft_iso8859_1_font_list.  If the font is not
4452         scalable, assume it as BDF or PCF font and setup SIZE and RESY
4453         properties of the font from its properties.
4454         (add_font_list): If the font is not scalable, check if it is BDF
4455         or PCF font.  If not, ignore it.
4456         (ft_select): If FAMILY is Mnil, return NULL only if the requested
4457         registry is not iso8859-1.
4458         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
4459         ft_iso8859_1_font_list.
4460         (ft_find_metric): If the font is not scalable, assume it as BDF
4461         or PCF, and get a metric from its properties.
4462         (mfont__ft_fini): Free ft_iso8859_1_font_list.
4463
4464 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
4465
4466         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
4467         (libm17n_la_LDFLAGS): Delete it.
4468         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
4469         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
4470
4471 2004-05-06  Kenichi Handa  <handa@m17n.org>
4472
4473         * draw.c (compose_glyph_string): Fix previous change.
4474
4475 2004-04-30  Kenichi Handa  <handa@m17n.org>
4476
4477         * font-ft.c (ft_list): Delete unused variable `result'.
4478         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
4479
4480 2004-04-27  Kenichi Handa  <handa@m17n.org>
4481
4482         * m17n-X.c: Include config.h
4483         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
4484         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
4485         (MWDevice) [HAVE_XFT2]: New member xft_draw.
4486         (FRAME_CMAP, FRAME_VISUAL): New macros.
4487         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
4488         (xfont_driver): Make it static.
4489         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
4490         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
4491         info->xft_color_back.
4492         (MXftFontInfo) [HAVE_XFT2]: New type.
4493         (mwin__xft_close) [HAVE_XFT2]: New function.
4494         (mwin__xft_open) [HAVE_XFT2]: New function.
4495         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
4496         (mwin__xft_render) [HAVE_XFT2]: New function.
4497
4498         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
4499         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
4500         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
4501         externs.
4502
4503         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
4504
4505         * font-ft.c: Don't include FT_FREETYPE_H here.
4506         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
4507         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
4508         (MFTInfo): New member charmap_index.
4509         (MFTInfo) [HAVE_XFT2]: New member xft_info.
4510         (check_otf_filename): Renamed from check_filename.  Return value
4511         changed.
4512         (ft_set_property): This function deleted.
4513         (set_font_info): New function.
4514         (add_font_list): Argument changed.  Add multiple fonts.
4515         (xft_list) [HAVE_XFT2]: New function.
4516         (ft_list) [not HAVE_XFT2]: New function.
4517         (ft_select): Add code for Xft.
4518         (close_ft): Likewise.
4519         (ft_open): Likewise.
4520         (ft_find_metric): Likewise.
4521         (ft_encode_char): Likewise.
4522         (ft_render): Likewise.
4523
4524         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
4525
4526 2004-04-26  Kenichi Handa  <handa@m17n.org>
4527
4528         * textprop.c (mtext_attach_property): Declare the return type as
4529         `int'.
4530
4531 2004-04-21  Kenichi Handa  <handa@m17n.org>
4532
4533         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
4534
4535 2004-04-09  Kenichi Handa  <handa@m17n.org>
4536
4537         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
4538         seq_to.
4539         (load_command): Setup above members.
4540
4541 2004-04-05  Kenichi Handa  <handa@m17n.org>
4542
4543         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
4544
4545 2004-03-30  Kenichi Handa  <handa@m17n.org>
4546
4547         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
4548         >= 0x10000.
4549
4550         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
4551         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
4552
4553 2004-03-29  Kenichi Handa  <handa@m17n.org>
4554
4555         * Version 1.0 Patch Level 2 released.
4556
4557 2004-03-29  Kenichi Handa  <handa@m17n.org>
4558
4559         * charset.c (make_charset): Set charset->fully_loaded and
4560         charset->simple correctly.  Don't try to get charset->min_char and
4561         charset->max_char for a charset of method subset and superset.
4562         Don't load a mapping file here.
4563         (mcharset__init): Set unified_max.
4564         (mcharset__load_from_database): Free a working plist.
4565
4566         * coding.c (mcoding__fini): Free all malloced data.
4567
4568         * input-gui.c (win_create_ic): Set control.as_image for preediting
4569         to 0.
4570
4571         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
4572         `count') to initialize the array.
4573
4574         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
4575         M17N_OBJECT_UNREF.
4576
4577         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
4578         rectangle.
4579         (mwin__create_window): Fix bug of setting a background pixel of a
4580         new window.
4581         (mwin__adjust_window): Clear the window before drawing.
4582
4583         * m17n-core.c (mdebug__report_object): Free array->objectes if
4584         necessary.
4585         (m17n_init_core): Don't set report_header_printed to 0 here.
4586         Fix debugging information.
4587         (m17n_fini_core): Set report_header_printed to 0 here.
4588
4589         * m17n-core.h (mplist_deserialize): Extern it.
4590
4591         * m17n-gui.c (m17n_fini_win): Fix debugging information.
4592
4593         * m17n.c (m17n_fini): Fix debugging information.
4594
4595         * mtext.c (mtext__adjust_foramt): New function.
4596
4597         * mtext.h (mtext__adjust_foramt): Extern it.
4598
4599         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
4600
4601         * plist.h (mplist__deserialize): Don't extern it.
4602
4603         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
4604         elements of symbol_table to NULL.  Report about created and freed
4605         symbols if MDEBUG_FINI is set.
4606
4607 2004-03-22  Kenichi Handa  <handa@m17n.org>
4608
4609         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
4610
4611         * m17n.c (m17n_init): Fix the way of checking merror_code.
4612
4613         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
4614
4615 2004-03-22  Kenichi Handa  <handa@m17n.org>
4616
4617         * fontset.c (realize_font_group): Adjust the font size by
4618         mfont__resize before selecting a font.
4619
4620         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
4621
4622 2004-03-19  Kenichi Handa  <handa@m17n.org>
4623
4624         * Version 1.0 Patch Level 1 released.
4625
4626 2004-03-19  Kenichi Handa  <handa@m17n.org>
4627
4628         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
4629
4630         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
4631
4632 2004-03-19  Kenichi Handa  <handa@m17n.org>
4633
4634         Re-apply the changes forgotten in the released version.
4635
4636         * charset.c (mcharset__load_from_database): Call
4637         mchar_define_charset.
4638
4639         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
4640         (mconv_encode_range): Put Mcoding text property.
4641
4642 2004-03-18  Kenichi Handa  <handa@m17n.org>
4643
4644         * draw.c (Mdepth): New variable.
4645         (visual_order): Delete unused local var `pos'.
4646         (compose_glyph_string): Fix for the case that gstring->glyphs is
4647         realloced.  Stop generating glyphs at TO.  Fix handling of
4648         control charaters.
4649         (layout_glyphs): Get metrics of all glyphs in advance.  Set
4650         lbearing and rbearing of base of composition glyph correctly.
4651         Handle left-overhang glyphs correctly.
4652         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
4653         changed.
4654         (dump_combining_code): Change the defualt off_x character to ".".
4655         (mdraw__init): Initialize Mdepth.
4656
4657         * face.c (work_gstring): New variable
4658         (mface__init): Initialize work_gstring.
4659         (mface__fini): Free work_gstring.glyphs.
4660         (mface__realize): Don't handle videomode property here.  Adjusted
4661         for the change of mfont__get_metric.
4662         (mface__for_chars): Adjusted for the change of mfont__get_metric.
4663
4664         * face.h (enum face_gc): Moved to m17n-X.c.
4665
4666         * font.h (struct MFontDriver): Arguments of find_metric changed.
4667         (mfont__select): Prototype adjusted.
4668         (mfont__get_metric): Likewise.
4669         (mfont__ft_drive_otf): Likewise.
4670         (mfont__flt_run): Likewise.
4671         
4672         * font.c (mfont__select): New argument layouter.  If layouter is
4673         different in the registered font, make a new copy of realized
4674         font.
4675         (mfont__get_metric): Argument changed.  Get metrics of multiple
4676         glyphs.
4677         (mfont_find): Call mfont__select with layouter as Mnil.
4678
4679         * font-flt.c (FontLayoutContext): New member rfont.
4680         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
4681         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
4682
4683         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
4684         multiple glyphs.
4685         (NUM_POINTS): New macro.
4686         (MPointTable): New type.
4687         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
4688         (mfont__ft_drive_otf): New argument rfont.
4689
4690         * fontset.c (realize_font_group): Adjusted for the changed of
4691         mfont__select.
4692         (check_fontset_element): This function deleted.
4693
4694         * input-gui.c (adjust_window_and_draw): Locate a preedit window
4695         off the parent window if the preedit text is zero length.
4696
4697         * internal-gui.h (struct MFrame): New members foreground,
4698         background, videomode, font.
4699         (struct MGlyphString): New member anti_alias.
4700         (MDrawPoint): New type.
4701         (mwin__draw_bitmap): Prototype deleted.
4702         (mwin__draw_points): Prototype added.
4703
4704         * m17n-gui.h (MDrawControl): New member anti_alias.
4705
4706         * m17n-gui.c (free_frame): Free frame->font.
4707         (mframe): Set the fontset of frame->face to the default fontset.
4708
4709         * m17n-X.c (RGB_GC): New type.
4710         (enum gc_index): Renamed from enum face_gc.  Member names changed.
4711         (GCInfo): New typel
4712         (struct MWDevice): Members foreground and background deleted.  New
4713         member scratch_gc, gc_list.
4714         (DEFAULT_FONT, FALLBACK_FONT): New macros.
4715         (free_device): Free GCs in device->gc_list.
4716         (get_rgb_gc): New function.
4717         (get_gc): Renamed and argument changed from get_color.
4718         (get_gc_for_anti_alias): New function.
4719         (xfont_find_metric): Arguments changed.  Get metrics of multiple
4720         glyphs.
4721         (set_region): Argument changed.  Caller changed.
4722         (xfont_render): Allways set a font in gc.
4723         (x_error_handler, x_io_error_handler): Define only if
4724         X_SET_ERROR_HANDLER is defined.
4725         (mwin__open_device): Create device->scratch_gc.  Set members
4726         foreground, background, and videomode of frame.  Call
4727         XSetErrorHandler and XSetIOErrorHandler only if
4728         X_SET_ERROR_HANDLER is defined.
4729         (struct gc_list): Deleted.
4730         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
4731         (mwin__realize_face): Adjusted for the change of the format of
4732         rface->info and the charge of set_region.
4733         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
4734         (mwin__draw_box): Likewise.
4735         (mwin__draw_bitmap): This function deleted.
4736         (mwin__draw_points): New function.
4737         (mwin__verify_region): Adjusted for the change of the format of
4738         rface->info and the charge of set_region.
4739         (mwin__create_window): Inherit backgound pixel from parent.
4740         (mwin__dump_gc): Adjusted for the change of the format of
4741         rface->info.
4742
4743 2004-03-16  Kenichi Handa  <handa@m17n.org>
4744
4745         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
4746
4747         * input.c (M_key_alias): New variable.
4748         (handle_key): Try M_key_alias property of a key too.
4749         (minput__init): Initialize M_key_alias.  Give that property to
4750         symbols in one_char_symbol.  Fix bug of initializing
4751         one_char_symbol.
4752
4753         * draw.c (compose_glyph_string): Don't handle
4754         ignore_formatting_char here.  Include formatting characters in the
4755         range processed by a FTL.
4756         (layout_glyph_string): Handle ignore_formatting_char here.
4757
4758 2004-03-12  Kenichi Handa  <handa@m17n.org>
4759
4760         * input-gui.c (win_create_ic): Enable bidi in status control.
4761
4762         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
4763
4764 2004-03-09  Kenichi Handa  <handa@m17n.org>
4765
4766         * input.c (load_input_method): If title is not specified, use the
4767         input method name as title.
4768
4769         * m17n-X.c (get_color): Make it static.
4770         (xim_create_ic, xim_destroy_ic, x_error_handler)
4771         (x_io_error_handler): Likewise.
4772
4773 2004-03-01  Kenichi Handa  <handa@m17n.org>
4774
4775         * Version 1.0 released.
4776
4777 \f
4778 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
4779   National Institute of Advanced Industrial Science and Technology (AIST)
4780   Registration Number H15PRO112
4781
4782 This file is part of the m17n library.
4783
4784 The m17n library is free software; you can redistribute it and/or
4785 modify it under the terms of the GNU Lesser General Public License
4786 as published by the Free Software Foundation; either version 2.1 of
4787 the License, or (at your option) any later version.
4788
4789 The m17n library is distributed in the hope that it will be useful,
4790 but WITHOUT ANY WARRANTY; without even the implied warranty of
4791 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4792 Lesser General Public License for more details.
4793
4794 You should have received a copy of the GNU Lesser General Public
4795 License along with the m17n library; if not, write to the Free
4796 Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
4797 Boston, MA 02110-1301, USA.