1 2006-10-18 Kenichi Handa <handa@m17n.org>
3 * input.c (delete_surrounding_text): Be sure to set members
4 preceding_text and following_text to NULL.
5 (shift_state): Save variable values in ic_info->vars_saved.
6 (preedit_commit): Don't print debug information here. Don't
7 change ic_info->keys here.
8 (get_candidate_list): Don't ref plist.
9 (take_action_list): Don't unref return value of
10 get_candidate_list. For undo, reset ic->produced and recover
11 ic_info->vars. Be sure to set ic->candidate_list to NULL after
13 (init_ic_info): Set ic_info->vars_saved.
14 (fini_ic_info): Unref ic_info->vars_saved.
15 (re_init_ic): Be sure to set ic->candidate_list to NULL after
17 (filter): Be sure to set members preceding_text and following_text
18 to NULL. Print debug information about produced text. Delete
19 processed keys from ic_info->keys.
21 * input.h (MInputContextInfo): New member vars_saved.
23 2006-10-16 Kenichi Handa <handa@m17n.org>
25 * database.c (mdatabase__update): Fix the way to get db_info.
27 2006-10-02 Kenichi Handa <handa@m17n.org>
29 * font.h (struct MFont): New member `multiple_sizes'. Bit-size of
32 * font.c (xlfd_unparse_name): Adjusted for the change of
34 (font_score): Likewise.
35 (mfont__set_spec_from_face): Set spec->multiple_sizes to 0.
37 * m17n-X.c (MFontX, _MFontX): Deleted.
38 (SET_SIZE, HAVE_SIZE): Deleted.
39 (free_display_info): Adjusted for the change of
40 disp_info->font_list format.
41 (xfont_registry_list): Likewise.
42 (xfont_open): Likewise.
43 (xfont_list): Likewise.
44 (xfont_encode_char): Ignore size to find a realized font.
45 (MRealizedFontXft): Change the order of members to make it
46 compatible with MRealizedFontFT.
48 2006-09-27 Kenichi Handa <handa@m17n.org>
50 * font.c (mfont_match_p, mfont_open, mfont_encapsulate)
51 (mfont_close): Add comments.
53 * mtext-lbrk.c (mtext_line_break): Add comment.
55 2006-09-26 Kenichi Handa <handa@m17n.org>
57 * input.c (minput_get_description): Handle description about
58 inclusion-only input methods.
60 2006-09-21 Kenichi Handa <handa@m17n.org>
62 * input.c (M_gettext): New variable.
63 (fully_initialize): Initialize M_gettext.
64 (check_description): New function.
65 (load_commands): Call check_description.
66 (config_all_commands): Be sure to unref pl.
67 (load_variables): Call check_description.
68 (config_all_variables): Be sure to unref pl.
69 (load_im_info): Call check_description.
71 * internal.h [ENABLE_NLS]: Include <libintl.h> and define _.
73 * m17n-core.c (m17n_init_core) [ENABLE_NLS]: Call bindtextdoman
74 and bind_textdomain_codeset.
76 * Makefile.am (AM_CPPFLAGS): Add -DGETTEXTDIR=...
78 2006-09-15 Kenichi Handa <handa@m17n.org>
80 * input.c (reload_im_info): Update custom and global info.
81 (init_ic_info): Fix previous change.
83 2006-09-14 Kenichi Handa <handa@m17n.org>
85 * database.c: Include <libgen.h>.
86 (mdatabase__lock): Make a directory if necessary.
88 * input.c (resolve_command): Adjusted for the format change of
89 configured_cmds member.
90 (load_commands, load_variables): Fix for errornous data handling.
91 (config_command, config_variable): New function.
92 (config_all_commands, config_all_variables): Renamed from
93 config_commands and config_variables. Utilize the above function.
94 (check_variable_value): Argument changed. Callers changed.
95 (load_im_info): Call config_all_commands and config_all_variables.
96 (init_ic_info): Adjusted for the format change of configured_vars
98 (minput__init): Initialize Mcustomized, Mconfigured, and
100 (Mcustomized, Mconfigured, Minherited): New variables.
101 (minput_get_command): Be sure to return NULL if an input method
102 use no local command.
103 (minput_get_variable): Be sure to return NULL if an input method
104 use no local variable.
105 (minput_config_command, minput_config_variable)
106 (minput_save_config): Adjusted for the format change of
107 configured_cmds and configured_vars members.
109 * plist.c (write_element): Delete superfluous ':'.
111 2006-09-13 Kenichi Handa <handa@m17n.org>
113 * m17n.h (Minherited, Mcustomized, Mconfigured): Extern them.
114 (minput_config_file): Extern it.
116 * draw.c (Minherited): Declaration moved to input.c.
117 (mdraw__init): Don't initialize Minherited here.
119 * database.c (mdatabase__unlock): Be sure to unlink uniq file.
121 2006-09-07 Kenichi Handa <handa@m17n.org>
123 * textprop.c (mtext_serialize): Call mplist__serialize with the
126 * plist.h (mplist__serialize): Prototype adjusted.
127 (mplist__assq): Extern it.
129 * plist.c: Include <ctype.h>
130 (PUTC, PUTS): New macros.
131 (write_symbol): New function.
132 (write_element): New arg indent.
133 (dump_string, dump_plist_element): Delete them.
134 (mplist__from_string): New arg pretty.
135 (mplist__assq): New function.
136 (mdebug_dump_plist): Use write_element.
138 * mtext.c (mtext_cat_char): Allocate more memory.
139 (mdebug_dump_mtext): Don't escal a newline character.
141 * m17n.h (minput_get_command, minput_get_variable)
142 (minput_config_command, minput_config_variable)
143 (minput_save_config): Extern them.
145 * m17n-core.c: Include <string.h>.
146 (m17n_init_core): If the env. var. MDEBUG_OUTPUT_FILE is "stdout",
147 use the stream stdout instead of a file of that name.
149 * m17n-X.c (mwin__parse_event): Fix handling of Shift and Control
152 * internal.h (MFAILP, MDEBUG_PRINT0): New macros.
153 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
154 (MDEBUG_PRINT4, MDEBUG_PRINT5): Use MDEBUG_PRINT0.
155 (MDEBUG_DUMP): Flush the stream.
157 * input.h (struct _MInputMethodInfo): Delete member im. New
158 members mdb, language, name, extra, cmds, configured_cmds,
159 bc_cmds, vars, configured_vars, bc_vars, description, and tick.
160 (MInputContextInfo): New member tick.
162 * input.c: Big change to improve user-side input method
163 customization. Here, list just public API changes.
164 (minput_get_commands, minput_get_variables)
165 (minput_assign_command_keys, minput_set_variable): Label them
167 (minput_get_command, minput_get_variable)
168 (minput_config_command, minput_config_variable)
169 (minput_save_config): New functions.
171 * database.h (PATH_MAX): Define it if not yet defined.
172 (PATH_SEPARATOR): Likewise.
173 (enum MDatabaseStatus): New enum.
174 (struct MDatabaseInfo): Moved from database.c. New members status,
175 time, lock_file, and uniq_file.
176 (mdatabase__update, mdatabase__file, mdatabase__lock, mdatabase__save)
177 (mdatabase__unlock): Extern them.
179 * database.c: Include <time.h>.
180 (MDB_DIR_LEN): Don't include the terminating '\0' in the length.
181 (GEN_PATH): Args changed. Callers changed.
182 (struct MDatabaseInfo): Moved to database.h.
183 (struct MDatabase, mdb_list): Deleted.
184 (mdatabase__list): New var.
185 (get_database_filename): Deleted. Callers changed to use
187 (find_file, get_database_file): New files.
188 (get_dir_info): Initialize new members of MDatabaseInfo.
189 (find_database): Arg chagnded. Callers changed.
190 (free_db_info, register_database, register_databases_in_files):
192 (update_database_list): Deleted.
193 (mdatabase__init): Initialize mdatabase__list instead of mdb_list.
194 (mdatabase__fini): Finalize mdatabase__list instead of mdb_list.
195 (mdatabase__update): New function.
196 (mdatabase__check): Return value changed.
197 (mdatabase__file, mdatabase__lock, mdatabase__save)
198 (mdatabase__unlock): New functions.
200 2006-08-30 TAKAHASHI Naoto <ntakahas@m17n.org>
202 * input.c (get_surrounding_text): Return -2 when surrounding text
204 (get_following_char): Likewise.
205 (get_preceding_char): Likewise.
206 (minput__callback): Return 0 if there is a callback function,
209 2006-08-17 Kenichi Handa <handa@m17n.org>
211 * input.c (reset_ic): Use shift_state to setup the current state.
213 2006-08-02 Theppitak Karoonboonyanan <thep@linux.thai.net> (tiny change)
215 * Makefile.am (libm17n_la_LIBADD, libm17n_gui_la_LIBADD)
216 (libm17n_X_la_LIBADD, libm17n_gd_la_LIBADD, linkcore_LDADD)
217 (linkshell_LDADD, linkgui_LDADD): Use ${top_builddir}.
219 2006-08-02 Kenichi Handa <handa@m17n.org>
221 * plist.c (mdebug_dump_plist): Fix the 2nd arg to dump_plist_element.
223 * mtext.c (mdebug_dump_mtext): If not fullp, dump just text.
225 * font-ft.c (ft_encapsulate): Add code for debugging.
226 (mfont__ft_drive_otf): Be sure to encode character before getting
229 2006-07-21 Kenichi Handa <handa@m17n.org>
231 * draw.c (mdraw_text_extents): Fix previous typo.
233 2006-07-19 Kenichi Handa <handa@m17n.org>
235 * draw.c (gstring_width): New arg lbearing.
236 (render_glyph_string): Adjusted for the change of gstring_width.
237 (mdraw_text_extents): Fix lbearing of ink and line metrics.
239 * m17n-core.h (Mlanguage): Extern it.
241 * m17n.h (Mlanguage): Extern deleted.
243 * mtext.c (mtext__init): Initialize Mlanguage.
244 (Mlanguage): Declaration moved from locale.c
246 * locale.c (mlocale__init): Don't initialize Mlanguage here.
247 (Mlanguage): Declaration moved to mtext.c.
249 * language.c (mlang__init): Don't initialize Mlanguage here.
251 * font.c (OTF_tag_name) [! HAVE_OTF]: New function.
253 2006-07-14 Kenichi Handa <handa@m17n.org>
255 * font-ft.c: Use FT_BDF_H macro. Include fontconfig/fcfreetype.h.
256 (MRealizedFontFT): New member face_encapsulated.
257 (free_ft_rfont): Pay attention to ft_rfont->face_encapsulated.
258 (ft_gen_font): New function.
259 (ft_add_font): Use ft_gen_font.
260 (ft_list_script): Store lists in ft_script_list.
261 (ft_check_otf): New arg ft_face. Caller changed.
262 (ft_check_language): Likewise.
263 (ft_check_script): Likewise.
264 (ft_encapsulate, ft_close): New functions.
265 (mfont__ft_driver): Initialize members encapsulate and close.
266 (mfont__ft_drive_otf): Use OTF_open_ft_face if it is available.
268 * font.h (struct MRealizedFont): New member encapsulating.
269 (struct MFontDriver): New members encapsulate and close.
271 * font.c (mfont__match_p): If FONT is realized, check capability
272 by font drivers's check_capability method.
273 (mfont_match_p, mfont_open, mfont_encapsulate, mfont_close): New
276 * m17n-X.c (xfont_list_family_names): Delete unused var. Fix
277 declarations of foundry and fam local vars.
278 (xft_driver): Make it static.
280 * m17n-gui.h (mfont_match_p, mfont_open, mfont_encapsulate)
281 (mfont_close): Extern them.
283 * m17n-gd.c (device_open): Don't specify foundry and family of the
286 2006-07-11 Kenichi Handa <handa@m17n.org>
288 * m17n-gui.c (m17n_fini_win): Set null_interface.handle to NULL;
290 2006-07-13 Kenichi Handa <handa@m17n.org>
292 * font-ft.c (fc_build_charset): Return NULL if FcCharSet can't be
294 (ft_check_script): Delete unused var.
295 (ft_list_capability): Likewise.
297 * font.c (mfont__get_capability): Setup cap->otf.
298 (Motf): Make it global.
299 (mfont_get_prop): Accept Mlanguage, Mscript, and Motf as key arg.
301 * font.h (MFontCapability): New member otf.
303 * language.c (mlang__fini): Delete unused vars.
305 * m17n-gui.h (Motf): Extern it.
307 * database.c (update_database_list): Delete unused vars.
309 2006-07-07 Kenichi Handa <handa@m17n.org>
311 * font-ft.c (DEVICE_DELTA): Fix typo.
313 2006-07-06 Kenichi Handa <handa@m17n.org>
315 * fontset.c (mfont__lookup_fontset): Don't ignore family and
318 2006-07-05 TAKAHASHI Naoto <ntakahas@m17n.org>
320 * database.c: Update comments.
322 2006-07-05 Kenichi Handa <handa@m17n.org>
324 * database.c (PATH_MAX): Define it if not yet defined.
325 (PATH_SEPARATOR, USE_GEN_PATH, GEN_PATH, GEN_PATH_FROM_MT): New
327 (get_database_filename): Use GEN_PATH.
328 (get_dir_info): Don't include the last '/' in directory name.
329 (register_database): New function.
330 (update_database_list): Use register_database. Search all
331 directories in mdatabase__dir_list for wildcard databases.
332 (mdatabase__init): Check "~/.m17n.d".
334 2006-07-03 Kenichi Handa <handa@m17n.org>
336 * input-gui.c (win_callback): If is ic->candidate_show zero, don't
337 push reverse property.
339 * plist.c (dump_plist_element): Fix previous change.
341 2006-06-28 Kenichi Handa <handa@m17n.org>
343 * font.c (xlfd_unparse_name): Suppress the heading '-' if not
346 * draw.c (MbidiNSM): New variable.
347 (visual_order) [! HAVE_FRIBIDI]: Clear levels at first. Pay
348 attention to bidi type NSM.
349 (mdraw__init): Initialize MbibiNSM.
351 * language.c (mscript__char_list): Fix finding a char-list element.
353 * plist.c (dump_string): Return number of printed characters.
354 (dump_plist_element): Print elements more compactly.
356 2006-06-23 Kenichi Handa <handa@m17n.org>
358 * Makefile.am (BUILD_LIBS): Don't increment it conditionally.
359 (include_HEADERS): Likewise.
361 2006-06-23 TAKAHASHI Naoto <ntakahas@m17n.org>
363 * language.c: Update documentation.
365 2006-06-23 Kenichi Handa <handa@m17n.org>
367 * font-ft.c (struct MFontFT): Delete member lang.
368 (free_ft_info): Don't unref member lang. Destroy members langset
370 (fc_parse_pattern): Last argument changed to MFontFT *. Callers
371 changed. Set members langset and charset.
372 (fc_init_font_list, fc_list_pattern, fc_build_charset): New
374 (ft_init_font_list, ft_has_char_list_p, ft_list_char_list): New
376 (ft_list_family) [HAVE_FONTCONFIG]: Include FC_CHARSET on objset.
377 (ft_list_family) [! HAVE_FONTCONFIG]: Call ft_init_font_list.
378 (ft_list_language) [HAVE_FONTCONFIG]: Check representative
379 characters at first. If it fails, try listing by language names.
380 (ft_list_language) [! HAVE_FONTCONFIG]: Call ft_list_char_list.
381 (ft_check_language): Renamed from ft_check_lang. Adjusted for the
382 change of MFontCapability.
383 (ft_list_capability): Likewise. Try listing by languages, then by
384 scripts. Check OTF at last.
385 (ft_check_script): New function.
386 (ft_select): Adjusted for the check of MFontCapability.
387 (ft_list_family_names): New function.
388 (ft_check_capability): If cap->script is not Mnil, call
390 (mfont__ft_driver): Initialize with ft_list_family_names.
392 * font.h (struct MFontDriver): New member list_fmaily_names.
393 (struct): Change member "MSymbol *lang" to "MSymbol language".
395 * font.c: Include "language.h".
396 (Motf): New variable.
397 (otf_script_list, load_otf_script_list): Delete it.
398 (find_script_from_otf_tag): Delete it.
399 (merge_capability): New function.
400 (mfont__init): Init Motf.
401 (mfont__fini): Don't unref otf_script_list.
402 (free_font_capability): Check cap->script_tag to determine if
403 OTF-related capability is set.
404 (mfont__get_capability): Call mscript__from_otf_tag. Adjusted for
405 the change of type MFontCapability.
406 (mfont_put_prop): Call merge_capability for Mlanguage, Mscript,
408 (mfont_list): Call merge_capability for LANGUAGE arg.
409 (mfont_list_family_names): New function.
411 * input-gui.c: Typo in comments fixed.
413 * input.c: Typo in comments fixed.
415 * language.h (mlanguage__list): Delete it.
416 (mscript__char_list, mscript__otf_tag, mscript__from_otf_tag): New
419 * language.c: Include "mtext.h".
420 (M_script_lang_list): Delete it.
421 (language_list, script_list): New variables.
422 (load_lang_script_list, init_language_list, init_script_list): New
424 (mlang__init): Don't load language database here.
425 (mlang__fini): Unref language_list and script_list if not NULL.
426 (mlanguage__list): Delete it.
427 (mlanguage__info, mscript__info, mscript__char_list)
428 (mscript__otf_tag, mscript__from_otf_tag): New functions.
429 (mlanguage_list, mlanguage_code, mlanguage_name, mlanguage_text)
430 (mscript_list, mscript_language_list): New functions.
432 * m17n-gui.h (mfont_list_family_names): Extern it.
434 * m17n.h (mlanguage_list, mlanguage_code, mlanguage_name)
435 (mlanguage_text, mscript_list, mscript_language_list): Extern
438 2006-06-21 Kenichi Handa <handa@m17n.org>
440 * m17n-X.c (xfont_driver): Initialize with
441 xfont_list_family_names.
442 (xfont_list_family_names): New function.
443 (xft_driver): Initialize with NULL for list_family_names member.
444 (device_init): Set list_family_names member of xft_driver to that
447 2006-06-06 Kenichi Handa <handa@m17n.org>
449 * fontset.c (mfont__lookup_fontset): Don't set *num to 1 if it is 0.
451 2006-03-24 Kenichi Handa <handa@m17n.org>
453 * font-ft.c (ft_open): Improve debug message.
455 * fontset.c (mfontset__get_font): Fix for the case that no font in
456 per_script list is available.
458 2006-02-06 Kenichi Handa <handa@m17n.org>
460 * Version 1.3.3 released.
462 2006-02-22 Kenichi Handa <handa@m17n.org>
464 * textprop.c: Fix some typos in documentation.
466 * plist.c: Fix some typos in documentation.
468 * m17n-core.h: Fix some typos in documentation.
469 (M17NLIB_PATCH_LEVEL): Updated to 3.
470 (M17NLIB_VERSION_NAME): Updated to "1.3.3".
472 * symbol.c: Fix some typos in documentation.
474 * mtext.c: Fix some typos in documentation.
476 * input.c: Fix several typos in documentation.
478 2006-02-06 Kenichi Handa <handa@m17n.org>
480 * Version 1.3.2 released.
482 2006-02-03 Kenichi Handa <handa@m17n.org>
484 * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 2.
485 (M17NLIB_VERSION_NAME): Updated to "1.3.2".
487 * font.c (xlfd_parse_name): Fix handling of the name "nil".
489 * draw.c (layout_glyphs): Fix handling left_padding of
492 * m17n-gd.c (read_rgb_txt): Support HTML 4.0 color names.
494 2006-02-02 Kenichi Handa <handa@m17n.org>
496 * Makefile.am (include_HEADERS): Add m17n-gui.h and m17n-X.h only
499 2006-01-25 Kenichi Handa <handa@m17n.org>
501 * input.c (resolve_expression): If the value of PLIST is a plist,
502 but the first element is not symbol, return 0.
504 2006-01-17 Kenichi Handa <handa@m17n.org>
506 * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha only if
507 HAVE_GD is 2 or the greater.
509 2006-01-16 Kenichi Handa <handa@m17n.org>
511 * Version 1.3.1 released.
513 2006-01-16 Kenichi Handa <handa@m17n.org>
515 * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha instead of
516 simulating anti-aliasing.
518 * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 1.
519 (M17NLIB_VERSION_NAME): Updated to "1.3.1".
521 2006-01-12 Kenichi Handa <handa@m17n.org>
523 * input.c (get_surrounding_text): Always pop ic->plist.
524 (reset_ic): Don't reset ic->plist.
526 2006-01-10 Kenichi Handa <handa@m17n.org>
528 * input.c (preedit_commit): For debugging, print only commiting
529 charactes. Don't set ic->candidate_show to 0.
530 (handle_key): Don't run branch-actions just by shifting to the
532 (reset_ic): Reset state_key_head and key_head of ic_info to 0.
533 Reset vars and plist.
535 2006-01-07 Kenichi Handa <handa@m17n.org>
537 * input.c (load_branch): Confirm that maps is not NULL.
539 2006-01-05 Kenichi Handa <handa@m17n.org>
541 * input-gui.c (win_filter): Try to convert arg to key only when
544 * plist.c (read_integer_element): If '#' and '-' are followed by
545 non-integer-constituent, read them as a part of a symbol.
546 (read_symbol_element): New arg C.
547 (read_element): Adjust args to read_symbol_element.
549 * input.c (load_macros): On overwriting a macro, free the old
551 (minput__init): Store Mmap in load_im_info_keys.
552 (minput_get_title_icon): If the input method has no title, be sure
554 (minput_get_description): If the input method has no description,
555 be sure to return NULL.
556 (minput_get_variables): Fix documentation.
557 (handle_key): Pay attention to the case that key is Mnil.
558 (filter): Likewise. Fix handling of such symbol as S-A.
560 2005-12-22 Kenichi Handa <handa@m17n.org>
562 * Version 1.3.0 released.
564 2005-12-22 Kenichi Handa <handa@m17n.org>
566 * font-ft.c (ft_list): If the specified font has no property,
569 2005-12-20 Kenichi Handa <handa@m17n.org>
571 * character.c (mchar_get_prop): Check char_prop_list.
572 (mchar_put_prop, mchar_get_prop_table): Likewise.
574 2005-12-18 Kenichi Handa <handa@m17n.org>
576 * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
577 file name sans language.
579 2005-12-16 TAKAHASHI Naoto <ntakahas@m17n.org>
581 * input.c: Fix typo in comments.
583 2005-12-14 Kenichi Handa <handa@m17n.org>
585 * input.c (minput_get_title_icon): Check the default icon for the
588 2005-12-13 Kenichi Handa <handa@m17n.org>
590 * input.c (Mless_equal, Mgreater_equal): New variables.
591 (parse_expression, resolve_expression, parse_action_list)
592 (take_action_list): Handle the aboves.
593 (filter): Treat key S-X as X.
594 (minput__init): Initialize Mless_equal and Mgreater_equal.
595 (minput_get_title_icon): New function.
597 * m17n.h (minput_get_title_icon): Extern it.
599 * database.c (get_database_filename): Return a filename instead of
601 (load_database): Adjusted for the above change.
602 (mdatabase__load_for_keys): Likewise.
603 (mdatabase__find_file): New function.
605 * database.h (mdatabase__find_file): Extern it.
607 * font.h (mfont__resize): Delete extern.
609 * font.c (mfont__list): Check resize ratio.
610 (mfont__resize): Delete it.
611 (mfont_resize_ratio): Include the code of mfont__resize.
613 * font-ft.c (ft_open): Check resize ratio.
615 * m17n-X.c (xfont_open): Check resize ratio.
616 (xft_open): Likewise.
618 2005-12-07 Kenichi Handa <handa@m17n.org>
620 * input.c (take_action_list): If take_action_list return -1,
622 (handle_key): Likewise.
624 * face.c (mface__for_chars): When font is specified and layouter
625 is found for it, if the layouter doesn't support one of a
626 character, use a face sans layouter for it.
628 2005-12-06 Kenichi Handa <handa@m17n.org>
630 * fontset.c (mfont__lookup_fontset): If only a fallback font is
631 found, don't use it for more than one character.
633 2005-12-05 Kenichi Handa <handa@m17n.org>
635 * face.c (mface__realize): Set rfont->layouter to Mnil.
636 (mface__for_chars): Fix handling of layouter.
638 * character.h (mchar__define_prop): Extern it.
640 * database.c (update_database_list): Call mchar__define_prop if
643 * character.c (mchar__init): Don't call mchar_define_property.
644 Instead just initialize property keys.
645 (mchar__fini): Free char_prop_list only if it's not NULL.
646 (mchar__define_prop): New function.
647 (mchar_define_property): Call mchar__define_prop.
649 * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
652 2005-12-02 Kenichi Handa <handa@m17n.org>
654 * language.c (mlang__init): Handle extra chars.
656 * m17n-gui.h (mfont_check): Adjust prototype.
658 * m17n-X.c (xfont_driver): Specify xfont_check_capability.
659 (xfont_check_capability): New function.
660 (xft_driver): Specify xft_check_capability.
661 (xft_check_capability): New function.
663 * font-ft.c (M0_3): Delete it.
665 (ft_get_charmaps): Refer to M0.
666 (fc_parse_pattern): Fix previous change.
667 (ft_list_language): Check also extra chars.
668 (ft_check_otf): Define it even if HAVE_OTF is undef.
669 (ft_check_lang): Check the result of FcLangSetHasLang against
670 FcLangDifferentLang. Check also extra chars.
671 (ft_list_capability): Delete ifdef HAVE_OTF.
672 (ft_select): Likewise.
673 (ft_open): Improve debug information.
674 (ft_check_capability): New function.
675 (mfont__ft_driver): Specify ft_check_capability.
676 (mfont__ft_init): Initialize M0.
678 * fontset.c (get_font_from_group): New function.
679 (mfontset__get_font): New function.
681 * fontset.h (mfontset__get_font): Extern it.
683 * font.c (OTF_tag): Define it if HAVE_OTF is undef.
684 (mfont__fini): Delete ifdef HAVE_OTF.
685 (free_font_capability): Likewise.
686 (mfont__get_capability): Likewise.
687 (mfont__check_capability): New function.
688 (mfont_check): Change the order of arguments. Use
691 * font.h (struct MFontDriver): New member check_capability.
692 (MFontCapability): Delete ifdef HAVE_OTF.
693 (mfont__check_capability): Extern it.
695 * face.c (mface__realize): Fix handling of FONT arg.
696 (mface__for_chars): Fix handling of explicitly specified font.
698 2005-11-25 Kenichi Handa <handa@m17n.org>
700 * font-flt.c (run_command): Print debug info for
703 * draw.c (layout_glyphs): Fix handling of left/right_padding.
705 * face.c (mface__for_chars): Check rfont before accessing the
708 2005-11-21 Kenichi Handa <handa@m17n.org>
710 * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
713 * fontset.c (fontset_table): New variable.
714 (free_fontset): Call M17N_OBJECT_UNREGISTER.
715 (mfont__fontset_init): Add fontset_table as an object array.
716 (mfont__realize_fontset): Ref FONTSET.
717 (mfont__free_realized_fontset): Unref REALIZED->fontset.
718 (mfontset): Call M17N_OBJECT_REGISTER.
719 (mfontset_copy): Likewise.
721 * input.c (handle_key): For debugging, print information about
723 (filter): Add an alias for Meta and Alt modifiers.
724 (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
726 (minput__init): Initialize them.
727 (parse_expression): New function.
728 (resolve_expression): New function.
729 (parse_action_list): Handle expressions by parse_expression.
730 (take_action_list): Handle expressions by resolve_expression.
731 (parse_nested_list_value): Fix previous change.
732 (resolve_command): Fix handling of the return value of
735 2005-11-18 Kenichi Handa <handa@m17n.org>
737 * font-ft.c (ft_check_otf, otf_script_list): Define only when
739 (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
741 (ft_select): Likewise.
743 * font.c (mfont_list): Fix for the case that FONT is NULL.
744 (OTF_tag): Delete it.
745 (load_otf_script_list): Define only when HAVE_OTF is defined.
746 (mfont__fini): Unref otf_script_list only when HAVE_OTF is
749 * draw.c (truncate_gstring): Be sure to truncate at
750 glapheme-cluster boundary.
752 2005-11-11 Kenichi Handa <handa@m17n.org>
754 * input.c (delete_surrounding_text): Clear cache if necessary.
756 2005-11-09 Kenichi Handa <handa@m17n.org>
758 * draw.c (compose_glyph_string): Update prev->rface->rfont if the
759 glyph prev is also supported by the current flt.
761 2005-11-08 Kenichi Handa <handa@m17n.org>
763 * m17n-X.c (xft_render): Cancel previous change.
765 2005-11-07 Kenichi Handa <handa@m17n.org>
767 * input.c: Include <stdlib.h>.
768 (get_surrounding_text, delete_surrounding_text)
769 (get_preceding_char, get_following_char): New functions.
770 (integer_value): New arg surrounding. If it is nonzero, try to
771 get a surrounding character. Callers changed.
772 (take_action_list): Check `value' before setting an element.
773 (destroy_ic): Unref ic_info->preceding_text and
774 ic_info->following_text.
775 (minput__init): Initialize Minput_get_surrounding_text and
776 Minput_delete_surrounding_text.
777 (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
779 (filter): Unref ic_info->preceding_text and
780 ic_info->following_text.
782 * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
785 * input.h (MInputContextInfo): New members preceding_text and
788 2005-11-04 Kenichi Handa <handa@m17n.org>
790 * input.c (parse_nested_list_value): Fix handling of the global
792 (get_nested_list): Get global definitions by load_partial_im_info.
793 (preedit_commit): Set ic->candidates_changed to bitwise or of enum
794 MInputCandidatesChanged.
795 (take_action_list): Likewise.
796 (reset_ic): Likewise.
797 (create_ic): Don't pay special attention to
798 Mcandidates_group_size.
799 (load_partial_im_info): Call mdatabase_find with correct 4th arg.
800 (minput_set_variable): Get a definition of varible by
801 mplist_find_by_value, not mplist_get.
803 * m17n.h (enum MInputCandidatesChanged): New enum.
805 2005-11-01 Kenichi Handa <handa@m17n.org>
807 * m17n-X.c (xft_render): Check xft_draw's drawable before changing
809 (mwin__destroy_window): If xft_draw's drawable is win, change it
810 to device->drawable before destroying win.
812 2005-10-31 Kenichi Handa <handa@m17n.org>
814 * input.c (load_im_info): Fix adding of state.
816 * m17n-core.c (m17n_fini_core): Fix reporting of module
819 * m17n.c (m17n_fini): Fix reporting of module finalization.
821 * m17n-gui.c (m17n_init_win): Fix reporting of module
824 2005-10-29 Kenichi Handa <handa@m17n.org>
826 * input.c (get_candidate_list): Fix the timing of referring plist.
828 2005-10-28 Kenichi Handa <handa@m17n.org>
830 * input.c (load_branch): Ignore an undefined map name.
831 (load_im_info): Set im_info->title from `name' only if it's not
833 (shift_state): Always update ic->status.
834 (adjust_candidates): Renamed from adjust_candidate_command.
835 Argument changed. Caller changed.
836 (get_candidate_list, regularize_action): New functions.
837 (take_action_list): Use them. On handling Munhandle, don't set
839 (handle_key): If KEY is not handled by MAP, and MAP has
840 branch_actions, perform them.
842 * database.c (mdatabase__fini): Free dir_info->filename;
844 2005-10-20 Kenichi Handa <handa@m17n.org>
846 * input.c (marker_code): Accept '@@'.
847 (integer_value): Handle '@@'.
848 (parse_action_list): Accept a symbol argument.
849 (take_action_list): Resolve the symbol argument. Handle the
852 2005-10-18 Kenichi Handa <handa@m17n.org>
854 * input.c: Include "charset.h".
855 (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
857 (MIMState): New member (M17NObject control).
858 (lookup_nested_list, set_nested_list, parse_nested_list_value)
859 (get_nested_list, resolve_variable): New functions.
860 (integer_value): New arg (MPlist **value). Set it to the plist
861 element containing the value.
862 (resolve_command): New function.
863 (load_translation): New arg (MPlist *map_actions).
864 (load_branch): New args language and name. If `keylist' is a
865 symbol, resolved that as a command name.
866 (free_map): New arg top. Free map->map_actions only if top is
868 (free_state): New function.
869 (load_state): New arg name.
870 (im_info_list): New variable.
871 (free_im_info, get_im_info_by_tags): New functions.
872 (load_im_info): Arg key changed to plist. Handle `include'.
873 Return (MInputMethodInfo *).
874 (preedit_commit): Ref ic->candidate_list.
875 (get_select_charset, adjust_candidate_command): New functions.
876 (take_action_list): Handle `include'. Adjust candidate action
877 properly. Handle control variables `candidates-charset' and
878 `candidates-group-size'.
879 (open_im): Use get_im_info.
880 (create_ic): Get global variables.
881 (load_partial_im_info): New function.
882 (get_im_info): New function.
883 (check_command_keyseq, check_command_list, check_variable_list):
885 (minput__init): Don't handle M_database_hook and Mdetail_text.
886 Initialize M_candidates, Mcandidates_group_size,
888 (parse_variable_list, get_variable_list, parse_command_list)
889 (get_command_list): Delete them.
890 (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
891 (minput__fini): Simply unref command_list and variable_list.
892 (minput_get_description): Adjusted for the new form of description.
893 (minput_get_commands): Use get_nested_list.
894 (minput_assign_command_keys): Likewise.
895 (minput_get_variables, minput_set_variable): Likewise.
897 * input.h (MInputMethodInfo): New members im and maps.
899 * database.h (M_database_hook): Delete extern.
900 (MDatabaseHookFunc): Delete extern.
901 (mdatabase__check): Extern it.
903 * database.c: Include <glob.h>.
904 (MAX_TIME): New macro.
905 (Masterisk): New variable.
906 (get_database_stream): Argument changed to (MDatabaseInfo *).
908 (get_dir_info): Renamed from duplicate_dirname. Callers changed.
909 (find_database): New function.
910 (update_database_list): New function.
911 (mdatabase__init): Initialize Masterisk. Setup mdb_list by
912 calling update_database_list.
913 (mdatabase__check): New function.
914 (mdatabase_find): Use update_database and find_database. Don't
915 handle MDatabaseHookFunc.
916 (mdatabase_list): Call update_database at first.
917 (mdatabase_define): Adjusted for the change of mdb->extra_info.
918 (MDatabaseList): New type.
920 * plist.h (mplist_conv, mplist__pop_unref): Extern them.
922 * m17n.h (Mdetail_text): Delete extern.
924 * m17n-core.h (mplist_conc): Delete extern.
926 * plist.c (mplist__conc): Renamed from mplist_conc. Don't ref
928 (mplist_conc): Renamed to mplist__conc.
929 (mplist__pop_unref): New function.
931 2005-10-14 Kenichi Handa <handa@m17n.org>
933 * plist.c (read_mtext_element): Ignore the sequence of '\\' and
935 (read_element): If keys is an empty plist, return any element
937 (dump_plist_element): Check if plist is nested.
938 (mplist_conc): Always ref tail.
939 (mplist_set): If key is a managing key, ref val in advance.
941 * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
942 (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
943 (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
946 * fontset.c (free_fontset): Unref fontset_list if necessary.
947 (mfont__fontset_fini): Don't free fontset_list. Unref
949 (mfont__realize_fontset): Initialize request.
950 (mfontset): Ref default_fontset or fontset only if necessary.
951 (mfontset_copy): Don't ref copy.
953 * draw.c (render_glyphs): Check gend->type before checking
956 * font-ft.c (mfont__ft_fini): Unref ft_default_list. Set all
957 unrefed plists to NULL.
959 2005-10-04 Kenichi Handa <handa@m17n.org>
961 * textprop.c (mtext_serialize): Be sure to make mt
962 MTEXT_FORMAT_UTF_8 and NULL terminated.
964 * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
966 * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
968 2005-10-03 Kenichi Handa <handa@m17n.org>
970 * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
971 is not at the beginning of line.
973 2005-09-22 Kenichi Handa <handa@m17n.org>
975 * input.c: Include <sys/stat.h> and <unistd.h>.
976 (Minclude, Mcommit, Munhandle): New variables.
977 (minput__init): Initialize them. Push only Mstate to
978 load_im_info_keys. Add aliases C-lowercase for C-uppercase.
979 (parse_action_list): Allow integer arg for undo. Handle Mcommit
981 (load_input_method): Handle "include" directive. If no states are
983 (shift_state): If state_name is Mt, shift back to the previous
984 state. Call preedit_commit to commit preedit text.
985 (preedit_commit): New function.
986 (take_action_list): Improve debug printing. Handle commit and
988 (handle_key): Check the return value of take_action_list. Don't
989 take branch_actions just after changing to the root map.
990 (reset_ic): Reset all ic_info members.
991 (filter): When a key is not handled, just move ic_info->keys
992 instead fo calling reset_ic.
993 (load_im_info): If key is not Mstate, push Mmap to
995 (MDatabaseStatList): New type.
996 (imdir_stat_list): New variable.
997 (input_method_hook): Don't cancel the hook. Check the
998 modification time of directories.
999 (minput__fini): Free imdir_stat_list;
1001 * input.h (MInputContextInfo): New member prev_state.
1003 * m17n-core.h (mplist_conc): Extern it.
1005 * plist.c (mplist_conc): New function.
1007 * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
1009 * font.h (MRealizedFont): New member average_width.
1011 * font-ft.c (ft_open): Set rface->average_width.
1013 * font.c (xlfd_unparse_name): Print '*' before registry name.
1015 * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
1016 (xfont_open): Set rfont->average_width.
1017 (xft_open): Likewise.
1018 (device_open): Initialize disp_info->AVERAGE_WIDTH.
1020 * internal-gui.h (struct MFrame): New member average_width.
1022 * m17n-gui.c (mframe): Fix setting of frame->rfont.
1023 (mframe_get_prop): Return the average_width of a font.
1025 * face.c (mface__realize): Set rface->average_width.
1026 (mface__update_frame_face): Set frame->average_width.
1028 * face.h (MRealizedFace): New member average_width.
1030 2005-09-19 Kenichi Handa <handa@m17n.org>
1032 * font.c (xlfd_unparse_name): New arg full_xlfd.
1033 (mfont__encode_char): Use shortcut only for X core fonts.
1034 (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
1035 (mfont_put_prop): Handle `language' property.
1036 (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
1037 Print file can capability info too.
1039 * m17n-core.c (mdebug__output): New variable.
1040 (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
1041 (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
1042 (m17n_fini_core): Close mdebug__output if it's not stderr.
1044 * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
1045 (xfont_open): Handle baseline_offset.
1046 (xfont_find_metric): Likewise.
1047 (xfont_render): Likewise.
1048 (xft_open): Likewise.
1049 (xft_render): Likewise.
1051 * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
1052 (mdebug__output): Extern it.
1053 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
1054 (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
1055 (MDEBUG_DUMP): New macro.
1056 (MDEBUG_PRINT_TIME): Print to medebug__output.
1058 * font.h (MRealizedFont): New member baseline_offset.
1060 * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
1062 (fc_weight_table): Add FC_WEIGHT_REGULAR.
1063 (ft_list_family): Check alias.
1064 (ft_list_language): If language is "en", don't try to the second
1066 (ft_default_list): New variable.
1067 (ft_list_default): New function.
1068 (ft_select): If family is not specified, try only the default
1069 fonts. Treat the weights normal and medium same.
1070 (ft_open): Fix debug message. If registry is not specified, try
1071 unicode-bmp. Handle _MULE_BASELINE_OFFSET property of BDF fonts.
1072 (ft_find_metric): Likewise.
1073 (ft_render): Likewise.
1074 (ft_list): Fix debug message. Accept the registring iso8859-1.
1075 If family is not specified, try only the default fonts.
1077 * face.c (mface__realize): Fix logic of opening a font.
1079 2005-09-16 Kenichi Handa <handa@m17n.org>
1081 * face.c (mface__realize):
1083 * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
1086 * input.c (shift_state): Fix the condition of taking init actions.
1087 (take_action_list): Fix handling of pushback action.
1088 (handle_key): Don't change key while checking its alias.
1089 (minput__init): Initialize new variables.
1090 (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
1093 2005-09-12 Kenichi Handa <handa@m17n.org>
1095 * mtext.c (mtext__uppercase): Add proper open/close parens.
1096 (mtext_titlecase): Add proper casting.
1098 * input.c (parse_action_list): Handle the case that the arg is a
1099 key sequence (MText or MPlist).
1100 (take_action_list): Likewise.
1101 (shift_state): Shorter debug message.
1102 (handle_key): Terminate a debug message by "\n".
1103 (reset_ic): Don't take initial actions here.
1104 (minput_open_im): Print a debug message.
1105 (minput_close_im): Likewise.
1106 (minput_create_ic): Likewise.
1107 (minput_destroy_ic): Likewise.
1109 2005-09-09 TAKAHASHI Naoto <ntakahas@m17n.org>
1111 * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
1114 2005-09-07 TAKAHASHI Naoto <ntakahas@m17n.org>
1115 * character.c: Add "cased", "soft-dotted", and "case-mapping" in
1118 * character.c: Add Japanese documentation for
1119 mchar_get_prop_table ().
1121 2005-09-06 TAKAHASHI Naoto <ntakahas@m17n.org>
1123 * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
1124 (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
1125 (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
1127 (init_case_conversion): New function.
1128 (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
1129 (uppercase_precheck, lowercase_precheck, final_sigma)
1130 (after_soft_dotted, more_above, before_dot, after_i)
1131 (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
1133 2005-09-05 TAKAHASHI Naoto <ntakahas@m17n.org>
1135 * plist.c (read_mtext_element): Fix previous change.
1137 2005-09-05 Kenichi Handa <handa@m17n.org>
1139 * plist.c (read_mtext_element): Handle \uXXXX notation.
1141 * internal.h (MTABLE_MALLOC): Don't use a local variable.
1142 (MTABLE_ALLOCA): Change the name of local variable.
1144 * m17n-gd.c (device_open): Define it even if HAVE_GD nor
1145 HAVE_FREETYPE are defined.
1147 * m17n-X.c: Check HAVE_X11.
1149 * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
1150 directory listing libraries.
1151 (noinst_PROGRAMS): Define it only in maintainer mode.
1153 2005-09-02 Kenichi Handa <handa@m17n.org>
1155 * m17n-gui.h (mdraw_line_break_option): Extern it.
1157 * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
1158 end of the first glyph.
1159 (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
1161 (mdraw_line_break_option): New variable.
1162 (mdraw_default_line_break): Use mtext_line_break.
1164 * mtext.h (wordseg_func_table): Don't extern it.
1165 (mtext__wseg_fini): Extern it.
1167 * mtext.c: Don't include word-thai.h.
1168 (wordseg_func_table): Delete this variable.
1169 (mtext__init): Don't initialize above. Don't call
1170 mtext__word_thai_init.
1171 (mtext__fini): Don't free wordseg_func_table. Call
1172 mtext__wseg_fini instead fo mtext__word_thai_fini.
1173 (MTextWordsegFunc): Don't typedef it.
1174 (mtext__word_segment): Moved to mtext-wseg.c.
1176 * m17n-core.h (enum MTextLineBreakOption): New enum.
1177 (mtext_line_break): Extern it.
1179 * mtext-wseg.c: New file.
1181 * mtext-lbrk.c: New file.
1183 * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
1184 add mtext-lbrk.c and mtext-wseg.c.
1186 * textprop.c (mtext__adjust_plist_for_change): Pay attention for
1187 the case that head is NULL.
1189 2005-09-01 Kenichi Handa <handa@m17n.org>
1191 * word-thai.c (wordseg_propertize): If the property value is nil,
1192 don't make the property no-merge.
1193 (thai_wordseg): Don't require *from and *to are set a priori. Pay
1194 attention to the case that they are NULL.
1195 (mtext__word_thai_init): Make the name of Mthai_wordseg starts
1198 * character.c (mchar_get_prop_table): New function.
1200 * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
1202 * m17n-core.h (mtext_insert, mtext_replace): Extern them.
1203 (mchar_get_prop_table): Extern it.
1205 * textprop.c (prepare_to_modify): New arg deleting. Callers changed.
1206 (mtext__adjust_plist_for_change): Argument changed. Callers changed.
1208 * internal.h (enum MTextCoverage): New enum.
1209 (MText): New member coverage.
1211 * mtext.c (FORMAT_COVERAGE): New macro.
1212 (insert): Copy mt2->coverage.
1213 (mtext__from_data): Initialize mt->coverage.
1214 (mtext__adjust_format): Update mt->coverage.
1215 (mtext): Initialize mt->coverage.
1216 (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
1217 Update mt->coverage if necessary.
1218 (mtext_duplicate): Copy mt->coverage.
1219 (mtext_insert, mtext_replace): New functions.
1220 (mtext_dup): Use mtext_duplicate.
1221 (mtext__word_segment): Don't set *from and *to if a word
1222 segmentation funcion is not found.
1223 (mtext_ins_char): Fix typo.
1225 2005-08-25 Kenichi Handa <handa@m17n.org>
1227 * font.h (MFont): New member for_full_width.
1229 * font.c (compare_font_score): Prefer a font of not
1232 * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
1233 registry charset of a font is one of CJK charsets.
1235 * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
1236 supports some of CJK.
1238 2005-08-24 Kenichi Handa <handa@m17n.org>
1240 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
1242 * m17n-gui.c (null_device_open): Check Mresolution param and set
1245 * m17n-gd.c (device_open): Check Mresolution param and set
1248 * m17n-X.c (MWDevice): New member resy.
1249 (xfont_open): Set ascent, descent, and max_advance members of
1251 (xft_open): Likewise.
1252 (device_open): Compare also screen_num to find a device. Set
1253 device->resy and frame->dpi.
1255 * internal-gui.h (MFrame): New member dpi.
1257 * font.h (MRealizedFont): New member max_advance.
1259 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
1260 (mfont__init): Don't initialize Mascent, Mdescent.
1261 (Mascent, Mdescent): Delete these variables.
1262 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
1263 Mfont_descent instead of Mascent and Mdescent.
1264 (mfont_put_prop): Allow negative size.
1265 (mfont_find): Handle the case of spec->size < 0. Fix previous
1267 (mfont_list): Handle the case of spec->size < 0.
1268 (mfont_check): Likewise.
1270 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
1271 (fc_get_pattern): Handle the case of font->size < 0.
1272 (ft_open): Set ascent, descent, and max_advance members of rfont.
1273 (ft_find_metric): Improve rounding.
1274 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
1277 * face.c (mface__realize): Handle the case of font->size < 0.
1279 2005-08-22 Kenichi Handa <handa@m17n.org>
1281 * coding.c (MConverterStatus): Change the member buf to union.
1282 (mconv_buffer_converter): Add const to the arg buf.
1283 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
1284 (mconv_decode): Adjusted for the change of MConverterStatus.
1285 (mconv_encode_range): Likewise.
1287 * m17n.h (mconv_buffer_converter): Prototype adjusted.
1288 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
1290 2005-08-20 Kenichi Handa <handa@m17n.org>
1292 * m17n-gui.h (mfont_from_name): Prototype adjusted.
1293 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
1295 * m17n-X.c (xfont_open): Set members ascent, descent, and
1296 max_advance of rfont.
1297 (xft_open): Likewise.
1299 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
1301 (mfont__ft_parse_name): Add const to the arg name.
1303 * font.c (xlfd_parse_name): Add const to the arg name. Call
1304 mfont__set_property instead of mfont_set_spec. Set font->spacing.
1305 (xlfd_unparse_name): Handle spacing.
1306 (mfont__init): Initialize new variables.
1307 (mfont__id): Handle spacing.
1308 (mfont__merge): Likewise.
1309 (mfont__set_spec): This function deleted.
1310 (mfont__parse_name_into_font): Add const to the arg name. Fix the
1311 condition of calling mfont__ft_parse_name.
1312 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
1313 (mfont_get_prop): Handle properties spacing, ascent, descent,
1315 (mfont_find): Return a realized font.
1316 (mfont_from_name): Add const to the arg name.
1318 * font.h (enum MFontProperty): New member MFONT_SPACING.
1319 (enum MFontSpacing): New enum.
1320 (MFont): New members spacing and max_advance.
1321 (mfont__ft_parse_name): Prototype adjusted.
1322 (mfont__set_spec): Extern deleted.
1323 (mfont__parse_name_into_font): Prototype adjusted.
1325 2005-08-19 Kenichi Handa <handa@m17n.org>
1327 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
1329 * font.c (mfont_list): If FONT is null, use a temporary font.
1330 (mfont_parse_name): Add const to the arg name.
1332 2005-08-18 Kenichi Handa <handa@m17n.org>
1334 * word-thai.c: Surround code by #ifdef and #endif to escape from
1337 * font-ft.c: Mostly re-written.
1339 * font-flt.c (FontLayoutCmdOTF): This type deleted.
1340 (FontLayoutCmd): Type of the member otf changed..
1341 (load_otf_command): Adjusted for the format change of otf command.
1342 (load_command): Likewise.
1343 (free_flt_command): Unref cmd->body.otf.
1344 (run_otf): Ajusted for the type change of otf_cmd.
1345 (run_command): Ajusted for the type change of otf_cmd. On
1346 debugging, print ctx->combining_code.
1347 (mfont__flt_run): Initialize ctx's members code_offset,
1348 combining_code, and left_padding to 0.
1350 * face.h (struct MRealizedFace): New member font.
1351 (mface__realize): Prototype adjusted.
1353 * face.c (find_realized_face): New arg font.
1354 (find_realized_face): Adjusted for the change of MFont.
1355 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
1356 (mface__fini): Don't call mdebug__report_object.
1357 (mface__realize): New arg font.
1358 (mface__for_chars): Adjusted for the change of mfont__encode_char.
1359 Optimize the latin case.
1360 (mface__free_realized): Free rface->font.
1361 (mface__update_frame_face): Adjusted for the change of mface__realize.
1362 (mface_equal): New function.
1364 * draw.c (Mcommon): New variable.
1365 (visual_order): Args to mfont__encode_char changed.
1366 (compose_glyph_string): Handle Mfont text property.
1367 (layout_glyphs): Adjusted for the change of MFont.
1368 (mdraw__init): Initialize Mcommon.
1369 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
1371 * font.h (enum MFontType): Members completely changed.
1372 (enum MFontProperty): Move MFONT_SIZE to the tail.
1373 (enum MFontSource): New enum.
1374 (struct MFont): New members type, source, sizes, file, capability,
1376 (struct MRealizedFont): Type of member font changed. Members
1377 score, status, and encoding deleted.
1378 (MFontScore): New type.
1379 (MFontList): Member changed.
1380 (struct MFontDriver): New member has_char. Types of members
1382 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
1383 (Mapple_roman): Extern them.
1384 (OTF_Tag): Typedefed if not HAVE_OTF.
1385 (enum MFontOpenTypeTable): New enum.
1386 (MFontCapability): New type.
1387 (mfont__ft_drive_otf): Prototype adjusted.
1388 (mfont__score): Extern deleted.
1389 (mfont__merge): Extern it.
1390 (mfont__has_char): Extern it.
1391 (mfont__encode_char): Prototype adjusted.
1392 (mfont__open): Extern it.
1393 (mfont__set_spec): Prototype adjusted.
1394 (mfont__get_capability): Extern it.
1396 * font.c: Include "fontset.h".
1397 (M_font_capability, M_font_list, M_font_list_len): New variables.
1398 (font_score_priority): Change order of initial elements.
1399 (font_score_shift_bits): Fix array size.
1400 (common_weight): Add "thin", "semibold", and "heavy".
1401 (common_stretch): Add "ultracondensed", "extracondensed",
1402 "extraexpanded", and "utltraexpand".
1403 (font_weight_regular, font_weight_normal, font_weight_medium): New
1405 (gen_font_name): This function deleted.
1406 (find_encoding): Set font->encoding.
1407 (OTF_tag): New function.
1408 (otf_script_list): New variable.
1409 (load_otf_script_list): New function.
1410 (find_script_from_otf_tag): New function.
1411 (xlfd_parse_name): Set font->type and font->source.
1412 (mfont__free_realized): Free chains rfonts.
1413 (font_score): Renamed from mfont__score.
1414 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
1415 (Mapple_roman): New variables.
1416 (mfont__init): Initilize new variables. Initalize
1417 default_encoding.encoding_name and
1418 default_encoding.encoding_charset to Municode_full and
1419 mcharset__unicode. Use SAFE* macros for allocating filepath
1421 (mfont__fini): Free otf_script_list.
1422 (mfont__id): New function.
1423 (mfont__match_p): Check also capability member of MFont.
1424 (mfont__merge): New funciton.
1425 (mfont__set_spec_from_face): Set type and source members.
1426 (mfont__set_spec_from_plist): Set capability and type members.
1427 (mfont__select): Argument changed.
1428 (mfont__available): New function.
1429 (compare_font_score): New function.
1430 (mfont__list): New function.
1431 (mfont__open): Return a realized font.
1432 (mfont__resize): Adjusted for the change of MFont.
1433 (mfont__has_char): New function.
1434 (mfont__encode_char): Argument changed.
1435 (mfont__set_spec): Argument changed.
1436 (free_font_capability): New function.
1437 (mfont__get_capability): New function.
1438 (MFontfile): New variable.
1439 (mfont_get_prop): Adjusted for the change of MFont.
1440 (mfont_put_prop): Likewise.
1441 (mfont_set_selection_priority): Fix the way of setting
1442 font_score_priority[].
1443 (mfont_find): Use mfont__list instead of mfont__select.
1444 (mfont_resize_ratio): Adjusted for the change of MFont.
1445 (mfont_list): Use mfont__list.
1446 (mfont_check): New function.
1447 (font_score): Make it static.
1449 * fontset.h (mfont__realize_fontset): Prototype adjusted.
1450 (mfont__lookup_fontset): Likewise.
1452 * fontset.c (struct MFontset): Delete member font_spec_list.
1453 (struct MRealizedFontset): Type of member spec changed. New
1455 (load_font_group): Arg spec_list deleted.
1456 (load_fontset_contents): Adjusted for the change of fontset_def.
1457 (free_fontset): Fix the way of freeing fontset elements.
1458 (realize_fontset_elements): Argument changed.
1459 (get_per_script): New function.
1460 (free_realized_fontset_elements): Fix the way of feeing rfontset
1462 (update_fontset_elements): Fix args to realize_fontset_elements.
1463 (mfont__realize_fontset): New arg spec.
1464 (try_font_list): New function.
1465 (try_font_group): New arg request. Use try_font_list.
1466 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
1468 (mfontset): Adjusted for the change of MFontset.
1469 (mfontset_copy): Likewise. Don't share plists.
1470 (mfontset_modify_entry): Adjusted for the change of MFontset.
1471 (mfontset_lookup): Call get_per_script.
1472 (mdebug_dump_fontset): Print also the address of fonts.
1474 * input.c (shift_state): Don't reset ic_info->vars.
1475 (take_action_list): Call MDEBUG_PRINT fore calling
1478 * internal-gui.h (MFontDriver): Don't typedef it here.
1480 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
1481 (MXFont): This type deleted.
1483 (struct _MFontX): New struct.
1484 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
1485 (MDisplayInfo): Member base_font_list deleted.
1486 (DEFAULT_FONT): Definition changed.
1487 (FALLBACK_FONT): This maclr deleted.
1488 (free_display_info): Adjusted for the change of MDisplayInfo.
1489 (free_device): Argument to mfont__free_realized changed.
1490 (xfont_driver): Adjusted for the change of MFontDriver.
1491 (xfont_registry_list): Use MFontX instead of MXFont.
1492 (MRealizedFontX): Renamed from MXFontInfo.
1493 (xfont_select): Return the font found first.
1494 (close_xfont): Change MXFontInfo to MRealizedFontX.
1495 (xfont_open): Return the realized font.
1496 (xfont_find_metric): Get xfont from rfont->fontp.
1497 (xfont_has_char): New function.
1498 (xfont_encode_char): Adjusted for the argument change.
1499 (xfont_render): Get xfont from rfont->fontp.
1500 (xfont_list): Adjusted for the argument change.
1501 (MRealizedFontXft): Renamed from MXftFontInfo.
1502 (xft_driver): Ajusted for the change of MFontDriver.
1503 (close_xft): Change MXtfFontInfo to MRealizedFontXft
1504 (xft_open_font): Argument changed.
1505 (xft_open): Argument changed. Return the realized font.
1506 (xft_find_metric): Get xft_font from rfont->fontp.
1507 (xft_has_char, xft_encode_char): New functions.
1508 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
1509 font if not yet opened.
1510 (device_open): Don't set frame->font.
1512 * m17n-gd.c (gd_font_driver): Adjusted for the change of
1514 (gd_font_open): New function.
1515 (gd_render): Don't use the local variable ft_info.
1516 (device_init): Adjusted for the change of gd_font_driver.
1518 * textprop.c (mtext__prop_init): Initialize text_property_table.
1519 Call M17N_OBJECT_ADD_ARRAY.
1520 (mtext__prop_fini): Don't call mdebug__report_object.
1522 * plist.c (mplist__init): Initialize plist_table.
1523 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
1524 (mplist__fini): Don't call mdebug__report_object.
1526 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
1527 (mtext__fini): Don't call mdebug__report_object.
1528 (MTEXT_FORMAT_UTF_16): Correct type.
1529 (mtext_data): New function.
1530 (mtext_text): Fix calculation of limit and args to
1533 * language.c: Include "plist.h".
1534 (M_script_lang_list): New variable.
1535 (mlang__init): Read languages and their information from m17n
1537 (mlanguage__list): New function.
1538 (Miso639_1, Miso639_2): New variables.
1540 * language.h (mlanguage__list): Extern it.
1542 * database.c (get_database_stream): Use SAFE_* macros for
1543 allocating and freeing path.
1544 (mdatabase__init): Likewise.
1546 * symbol.c (msymbol__fini): Don't free symbols here.
1547 (msymbol__free_table): New function.
1548 (msymbol_is_managing_key): New function.
1550 * symbol.h (msymbol__free_table): Extern it.
1551 (msymbol__list): Extern it.
1553 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
1555 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
1556 (struct _M17NObjectArray): New member name and next.
1557 (mdebug__add_object_array): Extern it.
1558 (M17N_OBJECT_ADD_ARRAY): New macro.
1559 (mdebug__report_object): Don't extern it.
1561 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
1563 * m17n-gui.c (free_frame): Don't free frame->font.
1564 (null_device_fini): Fix code for freeing
1565 null_device.realized_font_list.
1566 (m17n_fini_win): Free interface.
1567 (mframe): Cast the return value of dlsym. Set frame->font here.
1568 (mframe_get_prop): Check frame->rface->rfont before accessing the
1571 * m17n-gui.h (Mfontfile): Extern it.
1572 (mfont_check): Extern it.
1573 (mface_equal): Extern it.
1575 * m17n-core.c: Include "symbol.h".
1576 (report_header_printed): This variable deleted.
1577 (object_array_root): New variable.
1578 (report_object_array): New function.
1579 (mdebug__report_object): This function deleted.
1580 (mdebug__add_object_array): New function.
1581 (m17n_init_core): Call mchartable_init () before mtext_init ().
1582 (m17n_fini_core): Call report_object_array (if necessary) and
1583 msymbol__free_atable at the end.
1585 * m17n-core.h (msymbol_is_managing_key): Extern it.
1586 (mtext_data): Extern it.
1587 (MTEXT_FORMAT_UTF_16): Correct type.
1588 (M17NLIB_MINOR_VERSION): Changed to 3.
1589 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1591 * chartab.c (mchartable__init): Initalize chartable_table.count.
1592 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1593 mdebug__report_object.
1595 2005-05-26 Kenichi Handa <handa@m17n.org>
1597 * m17n.h (Miso639_1, Miso639_2): Extern them.
1599 * symbol.h (msymbol__list): Extern it.
1601 * symbol.c (msymbol__list): New function.
1603 2005-05-19 Kenichi Handa <handa@m17n.org>
1605 * input-gui.c (minput__win_init): Don't change the value of
1608 2005-05-16 Kenichi Handa <handa@m17n.org>
1610 * m17n-core.c (m17n_object): Be sure to initialize all members.
1612 * font-ft.c (fc_decode_prop): Fix args to msymbol.
1614 2005-05-09 Kenichi Handa <handa@m17n.org>
1616 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1618 2005-04-27 Kenichi Handa <handa@m17n.org>
1620 * language.c (mlang__init): Add "an" (Aragonese).
1622 * word-thai.c: Add support for libthai.
1623 (mtext__word_thai_init): Initialize wordseg library conditionaly.
1624 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1626 * mtext.c: Include "word-thai.h" conditionaly.
1627 (mtext__init): Call mtext__word_thai_init conditionaly.
1628 (mtext__fini): Call mtext__word_thai_fini conditionaly.
1630 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1631 not WORDCUT_LD_FLAGS.
1633 2005-04-19 Kenichi Handa <handa@m17n.org>
1635 * word-thai.c (wordseg_propertize): Always unref the attached
1637 (thai_wordseg): Don't unref the property.
1639 2005-04-18 Kenichi Handa <handa@m17n.org>
1641 * word-thai.c: Include stdlib.h.
1642 (wordseg_propertize): Add dummy function for the case that wordcut
1643 library doesn't exist.
1644 (wordseg_propertize): Fix for old wordcut library.
1646 2005-04-16 Kenichi Handa <handa@m17n.org>
1648 * word-thai.c: Include <stdio.h>.
1650 2005-04-15 Kenichi Handa <handa@m17n.org>
1652 * draw.c: Include mtext.h.
1653 (linebreak_table, M_break_at_space, M_break_at_word)
1654 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1655 (compose_glyph_string): Check POS before getting Mface text
1657 (truncate_gstring): Give correct TO arg to line_break function.
1658 (GET_LB_TYPE): New macro.
1659 (find_break_backward, find_break_forward): New functions.
1660 (mdraw__init): Initialize the above new variables.
1661 (mdraw__fini): Free linebreak_table.
1662 (mdraw_default_line_break): Use find_break_backward and
1665 * word-thai.c: New file.
1667 * word-thai.h: New file.
1669 * mtext.c: Include word-thai.h.
1670 (wordseg_func_table): New variable.
1671 (mtext__init): Initialize wordseg_func_table and call
1672 mtext__word_thai_init.
1673 (mtext__fini): Call mtext__word_thai_fini, free
1675 (MTextWordsegFunc): New type.
1676 (mtext__word_segment): New function.
1678 * mtext.h (wordseg_func_table): Extern it.
1679 (mtext__word_segment): Extern it.
1681 * m17n.c (m17n_init): Fix typo (== -> =).
1683 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1684 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1686 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1687 (MTEXTPROP_VAL): New macros.
1689 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1691 2005-04-07 Kenichi Handa <handa@m17n.org>
1693 * database.c (load_chartable): Fix pursing of symbol name.
1695 2005-03-24 Kenichi Handa <handa@m17n.org>
1697 * m17n.c (m17n_init): Fix typo (== -> =).
1699 2005-03-11 Kenichi Handa <handa@m17n.org>
1701 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1703 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1705 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1708 2005-03-09 handa <handa@m17n.org>
1710 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1711 calling m17n_init ().
1713 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1714 calling m17n_init_core ().
1716 2005-02-28 Kenichi Handa <handa@m17n.org>
1718 * font-flt.c (mfont__flt_run): Add resulting code sequence in
1721 2005-02-17 Kenichi Handa <handa@m17n.org>
1723 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1724 (M_description, M_command, M_variable): New variables.
1725 (load_im_info_keys): New variables.
1726 (load_im_info, check_command_keyseq, get_description_advance)
1727 (parse_command_list, get_command_list, parse_variable_list)
1728 (get_variable_list, input_method_hook): New functions.
1729 (command_list, variable_list): New variables.
1730 (minput__init): Put input_method_hook to Minput_method.
1731 Initialize M_description, M_command, M_variable, Mdetail_text,
1732 load_im_info_keys, command_list, variable_list.
1733 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1734 (Mdetail_text): New variable.
1735 (minput_get_description, minput_get_commands)
1736 (minput_assign_command_keys, minput_get_variables)
1737 (minput_set_variable): New functions.
1739 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1740 (minput_assign_command_keys, minput_get_variables)
1741 (minput_set_variable): Extern them.
1743 * plist.c (UNGETC): Just decrement st->p.
1744 (read_mtext_element): New arg skip.
1745 (read_integer_element): Likewise.
1746 (read_symbol_element): Likewise.
1747 (read_element): New arg KEYS.
1748 (mplist__from_plist): Don't increment ref-count of NULL object.
1749 (mplist__from_file): New arg KEYS.
1750 (mplist_put): Don't increment ref-count of NULL object.
1751 (mplist_add): Likewise.
1752 (mplist_push): Likewise.
1753 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
1755 * plist.h (mplist__from_file): Prototype adjusted.
1757 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1758 (get_database_stream): New function.
1759 (load_database): Use get_database_stream.
1760 (M_database_hook): New variable
1761 (mdatabase__init): Initialize M_database_hook.
1762 (mdatabase__load_for_keys): New function.
1763 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1765 (mdatabase_define): Free mdb->extra_info if necessary.
1767 * database.h (mdatabase__dir_list, M_database_hook)
1768 (mdatabase__load_for_keys): Extern them.
1769 (MDatabaseHookFunc): New type.
1771 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1773 2004-12-27 Kenichi Handa <handa@m17n.org>
1775 * Version 1.2.0 released.
1777 2004-12-27 Kenichi Handa <handa@m17n.org>
1779 * input.c (minput_filter): Don't reset ic->xxx_changed.
1781 * mtext.c (mtext_from_data): Fix documentation.
1783 2004-12-25 Kenichi Handa <handa@m17n.org>
1785 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1786 (M17NLIB_VERSION_NAME): Update to "1.2.".
1788 2004-12-24 Kenichi Handa <handa@m17n.org>
1790 * input.c (reset_ic): Set key_unhandled to 0.
1792 2004-12-21 Kenichi Handa <handa@m17n.org>
1794 * m17n-gui.h (mfont_from_spec): Delete extern.
1796 * input-gui.c (win_callback): Handle Minput_reset.
1797 (minput__win_init): Register reset_ic as a callback for
1800 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
1801 changed. At first, shift to the initial state.
1802 (minput__init): Initialize Minput_reset. Register reset_ic as a
1803 callback for Minput_reset.
1804 (Minput_reset): New variable.
1805 (minput_filter): Always set ic->xxx_changed to 0.
1806 (minput_reset_ic): New function.
1807 (integer_value): Fix typo ('>' -> '<') and calculation of length
1810 * m17n-core.c (merror_code): Change type to `int'.
1812 * m17n-misc.h (merror_code): Adjust type.
1814 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1816 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1817 (mtext_change_prop): Delete extern.
1819 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1820 to `int'. Move the documents to m17n-core.h.
1822 2004-12-13 Kenichi Handa <handa@m17n.org>
1824 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1825 (MTextProperty): Document it.
1827 2004-12-09 Kenichi Handa <handa@m17n.org>
1829 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1831 2004-12-03 Kenichi Handa <handa@m17n.org>
1833 * internal.h (m17n__core_initialized, m17n__shell_initialized,
1834 m17n__gui_initialized): New externs.
1836 * m17n-core.h (enum M17NStatus): New enum.
1837 (m17n_status): Extern it.
1839 * m17n-core.c (core_initialized): Delete this variable.
1840 (m17n__core_initialized, m17n__shell_initialized,
1841 m17n__gui_initialized): New variables.
1842 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1843 instead of core_initialized.
1844 (m17n_status): New function.
1846 * m17n.c (shell_initialized): Delete this variable.
1847 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1850 * m17n-gui.h (m17n_init_win): Adjust the prototype.
1852 * m17n-gui.c (win_initialized): Delete this variable.
1853 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1854 instead of gui_initialized.
1856 2004-11-19 Kenichi Handa <handa@m17n.org>
1858 * input.c (reset_ic): Check if ic_info->state is NULL.
1859 (filter): If ic_info->state is NULL, return 0.
1860 (load_input_method): Don't unref `maps' it it's not created.
1862 2004-11-15 Kenichi Handa <handa@m17n.org>
1864 * input.c (find_candidates_group): If INDEX is -1, find the last
1866 (take_action_list): If the previous of the first candidate is
1867 requested, select the last candidate.
1869 2004-11-08 Kenichi Handa <handa@m17n.org>
1871 * m17n-X.c (device_open): Try at most 32 fonts to find a
1872 non-autoscaled font.
1874 * font.c (xlfd_parse_name): Fix previous change.
1876 2004-11-05 Kenichi Handa <handa@m17n.org>
1878 * font.c: (commont_style): Include dummy elements "slanted" and
1879 "rslanted" to prefer "o" to "r" if "i" is requested.
1881 * font-ft.c (ft_to_prop): Fix "oblique" entry.
1883 2004-10-29 Kenichi Handa <handa@m17n.org>
1885 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1887 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1888 New members smallest and larger.
1889 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1890 (xfont_registry_list): Likewise.
1891 (xfont_select): Likewise.
1894 2004-10-28 Kenichi Handa <handa@m17n.org>
1896 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1897 font name comparison.
1898 (xfont_select): Fix logic for selecting a larger size font.
1900 2004-10-25 Kenichi Handa <handa@m17n.org>
1902 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1905 2004-10-22 Kenichi Handa <handa@m17n.org>
1907 * input.c (update_candidate): Renamed from udpate_candidate.
1908 (take_action_list): Show more debugging info on arithmetic commands.
1910 * m17n-X.c (device_open): Fix previous change.
1912 * draw.c (compose_glyph_string): Don't get face property at the
1915 2004-10-21 Kenichi Handa <handa@m17n.org>
1917 * draw.c (compose_glyph_string): Fix for the case of category
1920 2004-10-19 Kenichi Handa <handa@m17n.org>
1922 * input.c (mdebug_mask): New variable.
1923 (shift_state): Print debug information.
1924 (take_action_list): Likewise.
1925 (handle_key): Likewise.
1927 2004-10-14 Kenichi Handa <handa@m17n.org>
1929 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1931 2004-10-13 Kenichi Handa <handa@m17n.org>
1933 * m17n-X.c (device_open): Be sure to register at least one font
1936 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
1937 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1939 2004-10-12 Kenichi Handa <handa@m17n.org>
1941 * draw.c (alloc_gstring): Fix previous change.
1943 * font-ft.c (ft_list_generic): Fix for the case of not
1946 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1948 * font.c (mfont_list): If no font is found, return NULL.
1949 (load_font_encoding_table): Put entries of nil registry first.
1950 (find_encoding): Adjust for the above change.
1952 2004-10-11 Kenichi Handa <handa@m17n.org>
1954 * m17n-gui.h (mfont_list): Adjust prototype.
1956 * m17n-X.c (xfont_list): New arg maxnum.
1958 * font.h (struct MFontDriver): Change prototype of <list>.
1960 * font-ft.c (fc_generic_family_list): Delete it.
1961 (Mserif, Msans_serif, Mmonospace): Delete them.
1962 (M_generic_family_info): New variable.
1963 (enum GenericFamilyType): New enum.
1964 (struct GenericFamilyInfo): New struct.
1965 (generic_family_table): New variable.
1966 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1968 (add_font_info): Get style here.
1969 (ft_list_family): Don't initialize fc_config here. Don't list
1971 (ft_list_generic): New function.
1972 (ft_select): Pay attention to generic familes here.
1973 (ft_open): Fix calculation of ascent and descent.
1974 (ft_list): Pay attention to generic families.
1975 (mfont__ft_init): Initialize M_generic_family_info,
1976 generic_family_table, and fc_config..
1977 (mfont__ft_fini): Finalize generic_family_table.
1979 * draw.c (compose_glyph_string): Use more constant font for
1980 glyphs. Adjust for the member change in MGlyph.
1981 (layout_glyph_string): Adjust for the member change in MGlyph.
1982 (alloc_gstring): Intilize scracth_glyph to avoid
1983 compose_glyph_string on it.
1984 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1985 (mdraw_coordinates_position): Fix previous change.
1987 * internal-gui.h (glyph_category): New enum.
1988 (MGlyph): Change type of <category> to enum glyph_category.
1990 * face.c (mface__realize): Delete args langauge and charset.
1991 (mface__for_chars): Fix for the case that glyphs have different
1993 (mface__update_frame_face): Adjust for mface__realize change.
1995 * face.h (mface__realize): Adjust prototype.
1997 2004-10-05 Kenichi Handa <handa@m17n.org>
1999 * language.c (mlang__init): Add Akan.
2001 2004-10-04 Kenichi Handa <handa@m17n.org>
2003 * font-ft.c (add_font_info): Add instead of push the element.
2004 (ft_list_family): For generic fonts, try all
2005 substituted. families.
2007 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
2008 (run_rule): Don't update cluster range here.
2009 (run_command): Update cluster range on appending a glyph.
2010 (run_otf): Update cluster range for glyphs generated by OTF.
2012 2004-10-02 Kenichi Handa <handa@m17n.org>
2014 * m17n-X.c (device_open): Handle Mfont key in PLIST.
2016 2004-09-30 Kenichi Handa <handa@m17n.org>
2018 * font-ft.c (ft_select): Ignore family on calling mfont__score.
2020 2004-09-30 Kenichi Handa <handa@m17n.org>
2022 * font.h: Include <fontconfig/fontconfig.h>.
2023 (MFTInfo): New member langset.
2024 (mfont__encoding_list): Extern it.
2026 * font.c (mfont__encoding_list): New function.
2027 (mdebug_dump_font_list): New function.
2029 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
2030 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
2032 (ft_family_list): New variable.
2033 (set_font_info): New arg basep. Callers changed.
2034 (fc_list): Check the return value of FcPatternGetString.
2035 (add_font_info): New arg plist. Callers changed. Update
2037 (ft_list_family): New function (merged fc_list and ft_list_all).
2038 (ft_select): Use ft_list_family.
2039 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
2041 (mfont__ft_init): Initialize above new variables.
2042 (mfont__ft_fini): Free ft_family_list.
2043 (STRDUP_LOWER): New macro.
2044 (set_font_info): Use STRDUP_LOWER.
2045 (ft_list_family): Avoid duplicate addition of font path. Use
2047 (fc_decode_prop): Fix typo.
2049 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
2050 (xfont_registry_list): Change argument disp_info to frame.
2052 (xfont_list_all): New function.
2053 (xfont_list): If FONT is not NULL, check all fonts.
2055 2004-09-28 Kenichi Handa <handa@m17n.org>
2057 * m17n-X.c (MXFont, MXFontList): New types.
2058 (MDisplayInfo): Delete members font_registry_list,
2059 iso8859_1_family_list, iso10646_1_family_list, new members
2060 font_list, base_font_list.
2061 (free_display_info): Adusted for the change of MDisplayInfo.
2062 (xfont_driver): Initialize with xfont_list.
2063 (font_compare): New function.
2064 (build_font_list): Deleted.
2065 (xfont_registry_list): New function.
2066 (xfont_select): Use xfont_registry_list.
2067 (xfont_list): New function.
2068 (device_open): Adusted for the change of MDisplayInfo.
2070 * font-ft.c (add_font_info): New arg languages. Callers changed.
2071 (fc_list): Get languages from fonts..
2072 (ft_list_all): Renamed from ft_list. Callers changed.
2073 (ft_list): New function.
2074 (mfont__ft_driver): Initalize with ft_list.
2076 * font.c (mfont_list): New function.
2078 * font.h (struct MFontDriver): New member `list'.
2079 (MFTInfo): New member languages.
2081 * m17n-gui.h (mfont_list): Extern it.
2083 2004-09-27 Kenichi Handa <handa@m17n.org>
2085 * internal-gui.h (struct MGlyphString): Delete members mt,
2086 sub_width, sub_lbrearing, sub_rbearing, and region.
2088 * draw.c (MSubTextExtents): New type.
2089 (layout_glyphs): New arg extents. Set its members.
2090 (layout_glyph_string): Adjusted for the above change.
2091 (alloc_gstring): Don't set gstring->mt.
2092 (truncate_gstring): Call line_break function with mt instead of
2095 2004-09-22 Kenichi Handa <handa@m17n.org>
2097 * mtext.c (count_utf_16_chars): Count each code of invalid
2100 2004-09-19 Kenichi Handa <handa@m17n.org>
2102 * mtext.c (default_utf_16, default_utf_32): Rename them to
2103 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
2106 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
2109 2004-09-13 Kenichi Handa <handa@m17n.org>
2111 * draw.c (Mlatin): Don't declare it here.
2112 (visual_order): Fix reordering of combining characters.
2113 (compose_glyph_string): Fix detection of script.
2114 (layout_glyphs): Don't fix reordering of combining characters
2116 (layout_glyph_string): Pay attention to
2117 control->disable_overlapping_adjustment.
2118 (truncate_gstring): Include at least on character in a line.
2119 (get_gstring): Always scan one full line.
2120 (mdraw__init): Don't initialize Mlatin here.
2121 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
2122 have a font, use ascent/descent of an ASCII font. Allow
2123 ink_array_return and logical_array_return to be NULL.
2124 (mdraw_coordinates_position): Fix iteration.
2126 * font-ft.c (MFTtoProp): Member completely changed.
2127 (ft_to_prop): Adjusted for the above change.
2128 (ft_to_prop_size): Likewise.
2129 (set_font_info): Adjusted for the change of MFTtoProp.
2130 (fc_generic_family_list): New variable.
2131 (fc_list): Add special handling of generic font names.
2132 (mfont__ft_init): Adjusted for the change of MFTtoProp.
2133 Initialize fc_generic_family_list.
2134 (mfont__ft_fini): Don't free ft_to_prop. Free
2135 fc_generic_family_list.
2136 (FC_vs_M17N_font_prop): New type.
2137 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
2138 (fc_decode_prop, fc_encode_prop): New functions.
2139 (mfont__ft_parse_name): Use fc_decode_prop.
2140 (mfont__ft_unparse_name): Use fc_encode_prop.
2142 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
2143 (MWDevice): Add member realized_font_list.
2144 (free_display_info): Don't free disp_info->realized_font_list.
2145 (free_device): Free device->realized_fontset_list.
2146 (xft_find_metric): Use gstring->frame instead of rfont->frame.
2147 (device_open): Don't initialize disp_info->realized_font_list.
2148 (device_open): Initialize device->realized_font_list and set it to
2149 frame->realized_font_list.
2151 * fontset.c (try_font_group): New function.
2152 (mfont__lookup_fontset): Use try_font_group.
2154 * font.c (common_weight): Change the order of "regular".
2156 * face.c (Mlatin): Don't make it static.
2157 (mface__realize): Be sure to set work_gstring.frame.
2158 (mface__for_chars): Likewise.
2160 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
2163 * internal-gui.h (Mlatin): Extern it.
2165 * m17n-gui.h (MDrawControl): New member
2166 disable_overlapping_adjustment.
2168 2004-09-06 Kenichi Handa <handa@m17n.org>
2170 * font-flt.c (run_otf): Fix typo ('}'->']').
2172 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
2173 (COMBINING_PRECOMPUTED_P): New macros.
2175 * draw.c (layout_glyphs): Handle precomputed combining code.
2177 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
2178 precomupted combining code.
2180 2004-09-03 Kenichi Handa <handa@m17n.org>
2182 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
2185 2004-08-27 Kenichi Handa <handa@m17n.org>
2187 * face.c (mface_put_prop): If the new value is the same as the
2188 current one, don't increment frame->tick.
2190 2004-08-25 Kenichi Handa <handa@m17n.org>
2192 * fontset.c (mfontset): Initialize font_spec_list member.
2193 (mfontset_copy): Load fontset if necessary.
2195 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
2196 'metrics' to for C++.
2198 * draw.c (mdraw_glyph_info): Adjusted for the member name change
2201 2004-08-16 Kenichi Handa <handa@m17n.org>
2203 * Version 1.1.0 released.
2205 2004-08-13 Kenichi Handa <handa@m17n.org>
2207 * language.c (mlang__init): Add Dhivehi.
2209 * m17n-gui.c (Mx, Mfreetype): Delete it.
2210 (m17n_init_win): Don't initialize Mx and Mfreetype here.
2212 * m17n-gui.h (Mfreetype, Mxft): Extern them.
2213 (mfont_resize_ratio): Extern it.
2214 (MDrawGlyphInfo): New member logical_width;
2215 (MDrawGlyph): New type.
2216 (mdraw_glyph_list): Prototype adjusted.
2218 * m17n-X.c (xfont_open): Set type and fontp members.
2219 (xft_open): Likewise.
2221 * internal-gui.h (Mx, Mfreetype): Delete extern.
2223 * font.h (struct MRealizedFont): New member type and fontp.
2225 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
2226 (Mx, Mfreetype): Declare here.
2227 (Mxft): New variable.
2228 (mfont_resize_ratio): New function.
2230 * font-ft.c (ft_open): Set type and fontp members.
2232 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
2235 2004-08-11 Kenichi Handa <handa@m17n.org>
2237 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
2240 2004-08-06 Kenichi Handa <handa@m17n.org>
2242 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
2245 * font-flt.c (run_otf): Print debugging information if necessary.
2247 2004-08-05 Kenichi Handa <handa@m17n.org>
2249 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
2250 positioning_type 5 and 6. Switch simplified.
2252 2004-08-04 Kenichi Handa <handa@m17n.org>
2254 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
2256 2004-08-02 Kenichi Handa <handa@m17n.org>
2258 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
2259 set val to 1 even if it is greater than 1.
2261 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
2263 2004-07-29 Kenichi Handa <handa@m17n.org>
2265 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
2266 debugging information.
2268 * internal.h (MDEBUG_PRINT5): New macro.
2270 * draw.c (layout_glyphs): Don't combine a zero width glyph with
2271 the previous one if the zero width glyph has left or right
2274 2004-07-26 Kenichi Handa <handa@m17n.org>
2276 * m17n-X.c (xft_render): Pay attention to members left_padding and
2277 right_padding of MGlyph.
2279 * draw.c (visual_order): Allocate one more elements for arrays as
2280 a workaround of fribidi bug.
2281 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
2282 instead of MGlyph->bidi_sensitive.
2283 (layout_glyph_string): Pay attentinon to
2284 control->orientation_reversed when padding at the head or tail.
2285 Fix adjustment of space glyph width.
2286 (get_gstring): If cursor_width or cursor_bidi is changed, don't
2289 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
2290 instead of MGlyph->bidi_sensitive.
2292 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
2294 2004-07-26 Kenichi Handa <handa@m17n.org>
2296 * draw.c (visual_order): Don't treat combined glyphs specially.
2297 (layout_glyphs): Don't get metrics glyphs that are already ready.
2298 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
2299 width with the previous one.
2300 (draw_background): Fix bar cursor position on a r2l glyph.
2302 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
2303 (run_rule): Fix place of updating cluster_begin_pos and
2304 cluster_end_pos here.
2305 (run_otf): Don't set left_padding.
2307 * font-ft.c (adjust_anchor): Type of argument `code' changed.
2309 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
2310 Fix handling of GPOS.
2311 (mfont__ft_drive_gpos): Delete this function.
2313 * font.h (mfont__ft_drive_otf): Renamed back from
2314 mfont__ft_drive_gsub.
2315 (mfont__ft_drive_gpos): Delete extern.
2317 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
2318 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
2320 2004-07-23 Kenichi Handa <handa@m17n.org>
2322 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
2323 the same bidi level.
2325 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
2327 2004-07-22 Kenichi Handa <handa@m17n.org>
2329 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
2331 2004-07-20 Kenichi Handa <handa@m17n.org>
2333 * draw.c (render_glyphs): Fix checking of g->code validity.
2335 * face.c (mface__realize): Set g.type.
2337 2004-07-18 Kenichi Handa <handa@m17n.org>
2339 * Makefile.am: Prepend ${top_srcdir} to all *.la in
2342 * m17n-gui.c (mframe): Print error message give by dlopen to
2345 2004-07-16 Kenichi Handa <handa@m17n.org>
2347 * draw.c (compose_glyph_string): Improve the way of deciding a
2348 script. For a character that doesn't have script property, use
2349 the last non-latin script.
2351 * font-ft.c (fc_list): Cancel previous change.
2352 (mfont__ft_init): Add more entries in ft_to_prop_name.
2354 2004-07-15 Kenichi Handa <handa@m17n.org>
2356 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
2357 previous or next character glyphs.
2359 2004-07-14 Kenichi Handa <handa@m17n.org>
2361 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
2362 of type GLYPH_SPACE.
2364 * fontset.c (mfont__lookup_fontset): If glyph type is
2365 GLYPH_SPACE, get codes for SPACE.
2367 * internal-gui.h (Mfont): Delete extern.
2369 * m17n-gui.h (Mfont): Delete duplicated extern.
2371 2004-07-13 Kenichi Handa <handa@m17n.org>
2373 * font-ft.c (DEVICE_DELTA): New macro.
2374 (adjust_anchor): New function.
2375 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
2377 (mfont__ft_drive_gpos): New function.
2379 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
2380 (FontLayoutContext): Delete member `rfont'.
2381 (run_otf): Set g->otf_cmd. Call
2382 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
2383 only whne HAVE_OTF is defined.
2385 * fontset.c: Include "config.h".
2387 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
2388 (MGlyph): New member otf_cmd.
2390 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
2391 (mfont__ft_drive_gpos): Extern it.
2393 * face.c: Include "config.h".
2395 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
2397 * input-gui.c: Include "config.h".
2399 * plist.c: Include "config.h".
2401 2004-07-06 Kenichi Handa <handa@m17n.org>
2403 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
2404 internal-gui.h: Cancel previous changes.
2406 * m17n-gd.h: Delete it.
2408 * Makefile.am (libm17n_core_la_LIBADD): New variable.
2409 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
2410 @XML2_LD_FLAGS@ to above.
2411 (libm17n_la_LIBADD): Add -ldl.
2412 (libm17n_la_LDFLAGS): Add -export-dynamic.
2413 (X_LD_FLAGS): Fix the order of linking.
2414 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
2415 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
2416 (libm17n_X_la_LDFLAGS): Add -module.
2417 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
2418 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
2419 (libm17n_gd_la_LDFLAGS): Add -module.
2420 (include_HEADERS): Delete m17n-gd.h.
2422 2004-06-30 Kenichi Handa <handa@m17n.org>
2424 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
2425 (MDeviceLibraryInterface): Delete it.
2426 (register_device_library): Delete it.
2427 (m17n__device_library_list): Renamed from device_library_list.
2429 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
2430 (m17n_init_win): Adjust prototype.
2432 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
2433 (m17n_init_gd): New function.
2435 * m17n-gd.h: New file.
2437 * m17n-X.h: Include <m17n-gui.h>.
2438 (m17n_init_X): Extern it.
2439 (M17N_INIT): Redefine it.
2441 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
2442 (m17n_init_X): New function.
2444 * internal-gui.h (m17n__device_library_list): Extern it.
2445 (struct MDeviceDriver): New members initialized, init, and fini.
2447 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
2449 (libm17n_X_la_LIBADD): Delete aboves.
2450 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
2451 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
2452 (libm17n_gd_la_LDFLAGS): Delete it.
2453 (include_HEADERS): Add m17n-gd.h.
2455 2004-06-25 Kenichi Handa <handa@m17n.org>
2457 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
2458 (libm17n_gd_la_LDFLAGS): Cancel previous change.
2460 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
2462 * font-ft.c (fc_list): If FcFontList finds no font, try
2465 * draw.c (compose_glyph_string): Terminate the last loop after
2466 doing default combining if necessary.
2468 2004-06-24 Kenichi Handa <handa@m17n.org>
2470 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
2472 * character.c (mchar_define_property): Add const to an arg.
2474 * charset.c (mchar_define_charset): Add const to an arg.
2476 * coding.c (MCodingSystem): Add const to an arg or decoder.
2477 (finish_decoding): Add const to an arg.
2478 (decode_coding_charset, decode_coding_utf_8)
2479 (decode_coding_utf_16, decode_coding_utf_32)
2480 (decode_coding_iso_2022, decode_coding_sjis)
2481 (mconv_define_coding): Likewise.
2483 * m17n-X.c (xft_find_metric): Delete unused variable.
2485 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
2488 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
2491 * mtext.c (count_utf_8_chars, count_utf_16_chars)
2492 (mtext__from_data, mtext_from_data): Add `const' to an arg.
2494 * mtext.h (mtext__from_data): Ajust prototype.
2496 2004-06-23 Kenichi Handa <handa@m17n.org>
2498 * draw.c (compose_glyph_string): Always get glyph codes by
2500 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
2501 (mdraw_glyph_list): New function.
2503 * font-flt.c (mfont__flt_run): Be sure to call
2504 rfont->driver->encode_char.
2506 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
2507 (ft_encode_char): Delete arg C.
2508 (ft_render): Don't call FT_Get_Char_Index.
2510 * font.c (mfont__encodable_p): Delete it.
2511 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
2513 * font.h (struct MFontDriver): Delete arg C of encode_char.
2514 (mfont__encodable_p): Delete extern.
2516 * m17n-X.c (xfont_encode_char): Delete arg C.
2517 (xft_find_metric): Don't cal FT_Get_Char_Index.
2518 (xft_render): Likewise.
2520 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
2522 (mdraw_glyph_list): Extern it.
2524 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
2526 2004-06-22 Kenichi Handa <handa@m17n.org>
2528 * m17n-gui.h (mfontset_lookup): Extern it.
2530 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
2532 * fontset.c (realize_fontset_elements)
2533 (free_realized_fontset_elements, update_fontset_elements): New
2535 (mfont__realize_fontset): Call realize_fontset_elements.
2536 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
2537 (mfont__lookup_fontset): If a fontset was modified, update
2538 the realized fontset.
2539 (mfontset_modify_entry): Increment fontset->tick.
2540 (mfontset_lookup): New function.
2542 2004-06-21 Kenichi Handa <handa@m17n.org>
2544 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
2546 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
2547 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
2548 length of source text 0.
2550 2004-06-21 Kenichi Handa <handa@m17n.org>
2552 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
2553 (compare): Pay attention to format other than utf-8.
2554 (copy): Delete this function.
2555 (count_by_utf_8, count_by_utf_16, insert): New functions.
2556 (count_utf_16_chars): Fix handling of a surrogate pair.
2557 (find_char_forward, find_char_backward): Likewise.
2558 (mtext__from_data): Delete unnecessary check. Fix number of
2560 (mtext_from_data): Don't count items.
2561 (mtext_ref_char): Optimize the code.
2562 (mtext_set_char): Pay attention to format other than utf-8.
2563 (mtext_cat_char): Likewise.
2564 (mtext_dup): Don't call copy, instead do allocation here.
2565 (mtext_cat): Call insert instead of copy.
2566 (mtext_ncat): Likewise.
2567 (mtext_cpy): Delete character at first and call insert instead of
2569 (mtext_ncpy): Likewise.
2570 (mtext_copy): Likewise.
2571 (mtext_duplicate): Call insert instead of copy.
2572 (mtext_del): Pay attention to format other than utf-8.
2573 (mtext_ins): Simply call insert.
2574 (mtext_ins_char): Pay attention to format other than utf-8.
2575 (mtext_tok): Call insert instead of copy.
2576 (mtext_text): Call UNIT_BYTES.
2578 * textprop.c (mtext__adjust_plist_for_change): New function.
2580 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
2581 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
2582 (CHAR_UNITS_AT): Fix typo.
2583 (CHAR_UNITS_BY_HEAD): Fix typo.
2584 (STRING_CHAR_AND_UNITS): Fix typo.
2586 * internal.h (MTEXT_READ_ONLY_P): New macro.
2588 * mtext.h (mtext__replace): Delete the extern.
2589 (mtext__adjust_foramt): Adjust prototype.
2591 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2592 if possible. Otherwise make a copy of mmt.
2594 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2597 2004-06-18 Kenichi Handa <handa@m17n.org>
2599 * character.h (CHAR_STRING_UTF16): Fix syntax.
2601 2004-06-16 Kenichi Handa <handa@m17n.org>
2603 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2604 (libm17n_X_la_LIBADD): Delete it.
2605 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2607 * m17n-X.c (device_open): Add parens in `if' condition.
2609 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2610 (DEC_POSITION): Likewise.
2611 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2613 2004-06-15 Kenichi Handa <handa@m17n.org>
2615 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2618 * draw.c (compose_glyph_string): If langauge is specified, call
2619 mface__for_chars even if a text is all latin. Fix condition for
2620 setting non_ascii_found.
2622 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2624 * m17n.h (minput_char_to_key): Delete extern.
2626 * m17n-gui.h (minput_event_to_key): Cancel previous change.
2628 * m17n-gui.c (null_device_open): Set several members of frame.
2630 2004-06-14 Kenichi Handa <handa@m17n.org>
2632 * m17n-gui.h (minput_event_to_key): Delete extern.
2634 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2636 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2638 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2640 2004-06-08 Kenichi Handa <handa@m17n.org>
2642 * character.c (mchar_put_prop): Don't increment the ref-count of
2645 2004-06-04 Kenichi Handa <handa@m17n.org>
2647 * m17n-core.c (mdebug__register_object): New function.
2648 (mdebug__unregister_object): Likewise.
2650 * internal.h (mdebug__register_object, mdebug__unregister_object):
2652 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2655 * charset.c (mcharset__load_from_database): Don't call
2656 mconv__register_charset_coding here.
2658 * coding.c (find_coding): Get a real name from an element of
2659 coding_definition_list.
2660 (mconv__register_charset_coding): Set the real name at the top of
2662 (mcoding__load_from_database): Likewise.
2663 (mconv_list_codings): Adjusted for the above change.
2665 2004-06-03 Kenichi Handa <handa@m17n.org>
2667 * coding.c (find_coding): Find by canonicalized name. Don't have
2668 to modify the element of coding_definition_list by
2670 (mconv__define_coding_from_charset): Delete it.
2671 (mconv__register_charset_coding): Canonicalize sym.
2672 (mcoding__load_from_database): Register plist modified by
2675 * coding.h (mconv__define_coding_from_charset): Don't extern it.
2677 * font-ft.c (ft_open): Fix setting of rfont->descent.
2679 2004-06-02 Kenichi Handa <handa@m17n.org>
2681 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2682 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2683 (xlfd_unparse_name): Renamed from xfont_build_name.
2684 (mfont__init): Initialized Mfontconfig.
2685 (mfont__free_realized): Unconditionally unref rfont->info.
2686 (mfont__select): Free `this' if it's not best.
2687 (mfont__open): Don't check frame->realized_font_list.
2688 (mfont__parse_name_into_font): New function.
2689 (Mfontconfig): New variable.
2690 (mfont_from_name): Call mfont_parse_name.
2691 (mfont_name): Call mfont_unparse_name.
2692 (mdebug_dump_font): Likewise.
2694 * font.h (struct MFontDriver): Delete members parse_name and
2696 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2697 (mfont__parse_name_into_font): Extern it.
2699 * font-ft.c: Include "symbol.h".
2700 (close_ft): Unconditionally free filename and charmap_list of
2702 (ft_open): Duplicate base->filename. Increment ref-count of
2703 ft_info->charmap_list. Free ft_info->charmap_list and
2704 ft_info->filename on error.
2705 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2707 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2709 (enum xlfd_field_idx): Moved to font.c.
2710 (split_font_name, build_font_name): Likewise.
2711 (build_font_list): Call mfont__parse_name_info_font.
2712 (xfont_open): Call mfont__unparse_name. Free name.
2713 (xfont_parse_name, xfont_build_name): Moved to font.c
2714 (xft_select): Prototype deleted.
2715 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2716 Call mfont_pase_name.
2718 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2719 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2722 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2725 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2727 2004-06-01 Kenichi Handa <handa@m17n.org>
2729 * fontset.c (mfontset_modify_entry): Pay attention to the case
2730 that fontset->font_spec_list is NULL.
2732 2004-05-31 Kenichi Handa <handa@m17n.org>
2734 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2736 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2738 * font.c (mfont__select): Print score the a font for debugging.
2740 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2742 * coding.c (reset_coding_sjis): Check kanji and kana instead of
2743 kanji_sym and kana_sym.
2745 2004-05-28 Kenichi Handa <handa@m17n.org>
2747 * Makefile.am (VINFO): New variable.
2748 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2749 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2751 2004-05-27 Kenichi Handa <handa@m17n.org>
2753 The following chanages are to make device dependent functions
2754 accessible only from MDeviceDriver structure, and to add GD and
2755 null device drivers. Font drivers get also device dependent.
2757 * m17n.c (m17n_init): Increament shell_initialized.
2758 (m17n_fini): Decremented shell_initialized.
2760 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2762 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2763 (Mwidget, Mcolormap, Mx): Extern them.
2765 * m17n-gui.c: Include <dlfcn.h> and "config.h".
2766 (free_frame): Call frame->driver->close instead of
2768 (DLOPEN_SHLIB_EXT): New macro.
2769 (MDeviceLibraryInterface): New type.
2770 (device_library_list): New variable.
2771 (register_device_library): New function.
2772 (null_device): New variable.
2773 (null_device_close, null_device_get_prop)
2774 (null_device_realize_face, null_device_free_realized_face): New
2776 (null_driver): New variable.
2777 (null_device_init, null_device_fini, null_device_open): New
2779 (null_interface): New variable.
2780 (Mfreetype, Mdevice): Declare them.
2781 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
2782 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2783 Mwin__Close_Device. Register drivers for Mx and Mgd.
2784 (m17n_fini_win): Decremented win_initialized. Call "fini"
2785 function of all opened devices. Don't call mwin__fini.
2786 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2788 (mframe): Handle Mdevice key of PLIST.
2789 (mframe_get_prop): Call frame->device->get_prop instead of
2790 mwin__device_get_prop.
2792 * m17n-gd.c: New file.
2794 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2795 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2797 * m17n-core.c (m17n_init_core): Increate core_initialized.
2798 (m17n_fini_core): Decremented core_initialized.
2800 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2801 (Mcolormap): Don't extern them here.
2803 * m17n-X.c (FRAME_DEVICE): New macro.
2804 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2805 (free_display_info): Use MPLIST_DO.
2806 (free_device): Free rface->info.
2807 (xft_close): Delete it.
2808 (device_init): Renamed from mwin__init.
2809 (device_fini): Renamed from mwin__fini.
2810 (device_open): Renamed from mwin__open_device.
2811 (x_driver): New variable.
2812 (MXFontInfo): Delete member frame, add member display.
2813 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2814 Don't declare them here.
2816 * internal-gui.h (MDeviceType): New enum.
2817 (MWDefice): Delete it.
2818 (struct MFrame): Change type of device to void *. New members
2819 device_type, driver, font_driver_list.
2820 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2821 (MDeviceDriver): New type.
2822 (Mx, Mgd, Mfreetype): Extern them.
2823 (mwin__XXX): Delete all of them.
2825 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2827 (win_destroy_ic): Likewise.
2828 (adjust_window_and_draw): Likewise.
2829 (win_callback): Likewise.
2830 (Mxim): Declare it here.
2831 (minput_event_to_key): Call M_CHECK_READABLE.
2833 * fontset.c (mfont__lookup_fontset): Delete local variable
2836 * font.h (struct MFontDriver): Delete member close, add members
2837 parse_name and build_name.
2838 (mfont__driver_list): Delete extern.
2839 (mfont__close): Delete extern.
2841 * font.c (mfont__init): Don't set mfont__driver_list.
2842 (mfont__fini): Don't unref mfont__driver_list.
2843 (mfont__select): Try font drivers in frame->font_driver_list. Set
2844 driver member of a realized font.
2845 (mfont__close): Delete it.
2846 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2847 functions of the default frame.
2849 * font-ft.c (close_ft): Check ft_info->ft_face and work
2851 (add_font_info): Allocate ft_info by M17N_OBJECT.
2852 (ft_close): Delete it.
2853 (mfont__ft_driver): Don't set ft_close.
2854 (ft_select): Increment ref-count of best_font.
2855 (ft_open): Decremented ref-count of base. On error, call
2856 FT_Done_Face and free ft_info.
2857 (ft_find_metric): Always use XXX_MONO in load_flags.
2858 (ft_render): Fix setting of width. Call
2859 frame->driver->draw_points instead of mwin__draw_points.
2860 (ft_to_prop): Don't set mfont__driver_list.
2861 (mfont__ft_fini): Just unref ft_info.
2863 * face.c (mface__init): Exchange foreground and background of
2864 mface__default. Call mface_put_prop to set hline of
2866 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2867 (mface__free_realized): Don't call mwin__free_realized_face.
2869 * draw.c (Mdepth): Don't declare it here.
2870 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2871 (render_glyphs, render_glyph_string): Likewise.
2872 (mdraw__init): Don't set Mdepth.
2873 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2875 (mdraw_text_per_char_extents): Return 0 on success and -1 on
2877 (mdraw_text_items): Check FRAME is writable.
2878 (mdraw_per_char_extents): Implement body.
2880 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2882 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2883 (GUI_SOURCES): Delete it.
2884 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2885 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2886 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2887 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2888 (linkgui_LDADD): Set to libm17n-gui.la
2889 (linkgui_LDFLAGS): New target.
2890 (SRC): Include ${libm17n_gui_la_SOURCES} and
2891 ${libm17n_gd_la_SOURCES}.
2893 2004-05-24 Kenichi Handa <handa@m17n.org>
2895 * draw.c (draw_background): Don't draw background even if
2896 rface->face.property[MFACE_BACKGROUND] is not Mnil.
2898 2004-05-22 Kenichi Handa <handa@m17n.org>
2900 * m17n-X.c (xft_open_font): Fix anti_alias setting.
2902 2004-05-20 Kenichi Handa <handa@m17n.org>
2904 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2906 * m17n-gui.c: Include "plist.h".
2907 (mframe): If PLIST is NULL, initialize it to emply plist.
2909 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2910 (xft_driver): New variable.
2911 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2912 (xft_find_metric, xft_render): New function.
2913 (mwin__init): Adjusted for the new mfont__driver_list.
2914 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
2915 generated face to PARAM.
2916 (mwin__realize_face): Fix setting of box colors. Don't call hook
2918 (mwin__draw_hline): New function.
2919 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2920 (mwin__xft_render): Delete these function.
2922 * internal-gui.h (struct MFrame): New member tick.
2923 (struct MGlyphString): New member tick.
2924 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2925 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2926 (mwin__xft_render): Delete extern.
2928 * fontset.c (mfont__lookup_fontset): Make the code simpler.
2929 (mfontset): Always increment the reference count of returned
2932 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2933 (MFTInfo): Moved to font.h.
2934 (ft_iso8859_1_font_list): Delete this variable.
2935 (set_font_info): Don't set font->property[MFONT_TYPE].
2936 (set_font_info): Don't udpate ft_iso8859_1_font_list.
2937 (add_font_info): Change type to void.
2938 (fc_list): Change anme from xft_list. Caller changed. Include
2939 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2940 (mfont__ft_driver): Change name from ft_driver. Caller changed.
2941 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2942 (close_ft): Don't call mwin__xft_close. Unref
2943 ft_info->extra_info.
2944 (ft_open): Don't setup ft_info->fontname. Don't call
2946 (ft_find_metric): Don't call mwin__xft_get_metric.
2947 (ft_encode_char): Call rfont->driver->open instead of ft_open.
2948 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
2949 (mfont__ft_init): Adjusted for new mfont__driver_list.
2950 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2952 * font.c (mfont__driver_list): Make it MPlist.
2953 (mfont__init): Adjust initialization of mfont__driver_list.
2954 (mfont__fini): Free mfont__driver_list.
2955 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2956 (mfont__select): Adjusted for the new mfont__driver_list.
2958 * font.h (enum MFontProperty): Delete MFONT_TYPE.
2959 (mfont__drirver_list): Adjust prototype.
2960 (MFTInfo): Move to here from fron.c. Deleve member fontname.
2962 * face.h (struct MFace): Delete member realized_face_list, add
2964 (struct MRealizedFace): Delete member need_update
2965 andnofont_rface, add member non_ascii_list.
2966 (mface__update_frame_face): Extern it.
2968 * face.c (hline_prop_list, box_prop_list, noop_hook): New
2970 (get_hline_create, get_box_create): New functions.
2971 (find_realized_face): Cancel previous change. Arg RFONT deleted.
2973 (free_face): Cancep previous change. Free face->frame_list.
2974 (serialize_hline): Do nothing if hline->width is zero.
2975 (serialize_box): Do nothing if box->width is zero.
2976 (mface__init): Setup all properties of mface__default.
2977 (mface__fini): Free hline_prop_list and box_prop_list.
2978 (mface__realize): Cancel previous change. Update
2979 face->frame_list. Setup rface->non_ascii_list.
2980 (mface__for_chars): Update rface->non_ascii_list.
2981 (mface__free_realized): Free rface->non_ascii_list.
2982 (mface__update_frame_face): New function.
2983 (mface): Initialize face->frame_list.
2984 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
2986 (mface_merge): Likewise.
2987 (mface_put_prop): If key is Mhline or Mbox, get value by
2988 get_hline_create or get_box_create respectively.
2989 (mface_put_prop): Update frame->tick and call
2990 mface__update_frame_face if necessary.
2991 (mface_update): Do nothing if func is noop_hook.
2993 * draw.c (render_glyphs): If a font is not found, use
2994 mwin__draw_empty_boxes.
2995 (alloc_gstring): Initialize gstring->tick.
2996 (get_gstring): Check gstring->tick.
2998 2004-05-17 Kenichi Handa <handa@m17n.org>
3000 * face.c (find_realized_face): Return value changed. If RFONT is
3001 NULL, avoid unnecessary checking.
3002 (free_face): Free face->realized_face_list.
3003 (mface__realize): Adjusted for the change of find_realized_face.
3004 If it returns a realized face that needs update, free it and
3005 realize a new one. Push a new realized face to
3006 frame->realized_face_list instead of appending.
3007 (mface__for_chars): Adjusted for the change of find_realized_face.
3008 Short cut if the required font is in rface->ascii_rface.
3009 (mface_put_prop): Free old value if necessary. Set need_update
3010 member of realized faces to 1.
3012 * face.h (struct MFace): Delete member tick, add member
3014 (struct MRealizedFace): Delete member tick, add member
3017 2004-05-13 Kenichi Handa <handa@m17n.org>
3019 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
3021 2004-05-12 Kenichi Handa <handa@m17n.org>
3023 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
3025 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
3026 parse it XftNameParse.
3028 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
3029 (all_fonts_scaned): New variable.
3030 (set_font_info): FAMILY may be Mnil.
3031 (add_font_info): Argument changed.
3032 (xft_list): Call add_font_info in it.
3033 (ft_list): Likewise.
3034 (ft_select): Make it work in the case family is Mnil.
3035 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
3036 (mfont__ft_fini): Set all_fonts_scaned to 0.
3038 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
3039 that is failed to open.
3041 2004-05-10 Kenichi Handa <handa@m17n.org>
3043 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
3044 device's depth is 1 (i.e. monochrome).
3046 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
3047 to work around the problem of libtool.
3049 * font-ft.c: Include <freetype/ftbdf.h>.
3050 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
3052 (mfont__ft_init): Initialize them.
3053 (ft_iso8859_1_font_list): New variable.
3054 (set_font_info): Detect a font containing iso8859-1 glyphs and
3055 register it in ft_iso8859_1_font_list. If the font is not
3056 scalable, assume it as BDF or PCF font and setup SIZE and RESY
3057 properties of the font from its properties.
3058 (add_font_list): If the font is not scalable, check if it is BDF
3059 or PCF font. If not, ignore it.
3060 (ft_select): If FAMILY is Mnil, return NULL only if the requested
3061 registry is not iso8859-1.
3062 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
3063 ft_iso8859_1_font_list.
3064 (ft_find_metric): If the font is not scalable, assume it as BDF
3065 or PCF, and get a metric from its properties.
3066 (mfont__ft_fini): Free ft_iso8859_1_font_list.
3068 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
3070 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
3071 (libm17n_la_LDFLAGS): Delete it.
3072 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
3073 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
3075 2004-05-06 Kenichi Handa <handa@m17n.org>
3077 * draw.c (compose_glyph_string): Fix previous change.
3079 2004-04-30 Kenichi Handa <handa@m17n.org>
3081 * font-ft.c (ft_list): Delete unused variable `result'.
3082 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
3084 2004-04-27 Kenichi Handa <handa@m17n.org>
3086 * m17n-X.c: Include config.h
3087 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
3088 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
3089 (MWDevice) [HAVE_XFT2]: New member xft_draw.
3090 (FRAME_CMAP, FRAME_VISUAL): New macros.
3091 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
3092 (xfont_driver): Make it static.
3093 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
3094 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
3095 info->xft_color_back.
3096 (MXftFontInfo) [HAVE_XFT2]: New type.
3097 (mwin__xft_close) [HAVE_XFT2]: New function.
3098 (mwin__xft_open) [HAVE_XFT2]: New function.
3099 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
3100 (mwin__xft_render) [HAVE_XFT2]: New function.
3102 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
3103 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
3104 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
3107 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
3109 * font-ft.c: Don't include FT_FREETYPE_H here.
3110 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
3111 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
3112 (MFTInfo): New member charmap_index.
3113 (MFTInfo) [HAVE_XFT2]: New member xft_info.
3114 (check_otf_filename): Renamed from check_filename. Return value
3116 (ft_set_property): This function deleted.
3117 (set_font_info): New function.
3118 (add_font_list): Argument changed. Add multiple fonts.
3119 (xft_list) [HAVE_XFT2]: New function.
3120 (ft_list) [not HAVE_XFT2]: New function.
3121 (ft_select): Add code for Xft.
3122 (close_ft): Likewise.
3123 (ft_open): Likewise.
3124 (ft_find_metric): Likewise.
3125 (ft_encode_char): Likewise.
3126 (ft_render): Likewise.
3128 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
3130 2004-04-26 Kenichi Handa <handa@m17n.org>
3132 * textprop.c (mtext_attach_property): Declare the return type as
3135 2004-04-21 Kenichi Handa <handa@m17n.org>
3137 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
3139 2004-04-09 Kenichi Handa <handa@m17n.org>
3141 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
3143 (load_command): Setup above members.
3145 2004-04-05 Kenichi Handa <handa@m17n.org>
3147 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
3149 2004-03-30 Kenichi Handa <handa@m17n.org>
3151 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
3154 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
3155 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
3157 2004-03-29 Kenichi Handa <handa@m17n.org>
3159 * Version 1.0 Patch Level 2 released.
3161 2004-03-29 Kenichi Handa <handa@m17n.org>
3163 * charset.c (make_charset): Set charset->fully_loaded and
3164 charset->simple correctly. Don't try to get charset->min_char and
3165 charset->max_char for a charset of method subset and superset.
3166 Don't load a mapping file here.
3167 (mcharset__init): Set unified_max.
3168 (mcharset__load_from_database): Free a working plist.
3170 * coding.c (mcoding__fini): Free all malloced data.
3172 * input-gui.c (win_create_ic): Set control.as_image for preediting
3175 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
3176 `count') to initialize the array.
3178 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
3181 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
3183 (mwin__create_window): Fix bug of setting a background pixel of a
3185 (mwin__adjust_window): Clear the window before drawing.
3187 * m17n-core.c (mdebug__report_object): Free array->objectes if
3189 (m17n_init_core): Don't set report_header_printed to 0 here.
3190 Fix debugging information.
3191 (m17n_fini_core): Set report_header_printed to 0 here.
3193 * m17n-core.h (mplist_deserialize): Extern it.
3195 * m17n-gui.c (m17n_fini_win): Fix debugging information.
3197 * m17n.c (m17n_fini): Fix debugging information.
3199 * mtext.c (mtext__adjust_foramt): New function.
3201 * mtext.h (mtext__adjust_foramt): Extern it.
3203 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
3205 * plist.h (mplist__deserialize): Don't extern it.
3207 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
3208 elements of symbol_table to NULL. Report about created and freed
3209 symbols if MDEBUG_FINI is set.
3211 2004-03-22 Kenichi Handa <handa@m17n.org>
3213 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
3215 * m17n.c (m17n_init): Fix the way of checking merror_code.
3217 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
3219 2004-03-22 Kenichi Handa <handa@m17n.org>
3221 * fontset.c (realize_font_group): Adjust the font size by
3222 mfont__resize before selecting a font.
3224 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
3226 2004-03-19 Kenichi Handa <handa@m17n.org>
3228 * Version 1.0 Patch Level 1 released.
3230 2004-03-19 Kenichi Handa <handa@m17n.org>
3232 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
3234 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
3236 2004-03-19 Kenichi Handa <handa@m17n.org>
3238 Re-apply the changes forgotten in the released version.
3240 * charset.c (mcharset__load_from_database): Call
3241 mchar_define_charset.
3243 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
3244 (mconv_encode_range): Put Mcoding text property.
3246 2004-03-18 Kenichi Handa <handa@m17n.org>
3248 * draw.c (Mdepth): New variable.
3249 (visual_order): Delete unused local var `pos'.
3250 (compose_glyph_string): Fix for the case that gstring->glyphs is
3251 realloced. Stop generating glyphs at TO. Fix handling of
3253 (layout_glyphs): Get metrics of all glyphs in advance. Set
3254 lbearing and rbearing of base of composition glyph correctly.
3255 Handle left-overhang glyphs correctly.
3256 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
3258 (dump_combining_code): Change the defualt off_x character to ".".
3259 (mdraw__init): Initialize Mdepth.
3261 * face.c (work_gstring): New variable
3262 (mface__init): Initialize work_gstring.
3263 (mface__fini): Free work_gstring.glyphs.
3264 (mface__realize): Don't handle videomode property here. Adjusted
3265 for the change of mfont__get_metric.
3266 (mface__for_chars): Adjusted for the change of mfont__get_metric.
3268 * face.h (enum face_gc): Moved to m17n-X.c.
3270 * font.h (struct MFontDriver): Arguments of find_metric changed.
3271 (mfont__select): Prototype adjusted.
3272 (mfont__get_metric): Likewise.
3273 (mfont__ft_drive_otf): Likewise.
3274 (mfont__flt_run): Likewise.
3276 * font.c (mfont__select): New argument layouter. If layouter is
3277 different in the registered font, make a new copy of realized
3279 (mfont__get_metric): Argument changed. Get metrics of multiple
3281 (mfont_find): Call mfont__select with layouter as Mnil.
3283 * font-flt.c (FontLayoutContext): New member rfont.
3284 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
3285 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
3287 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
3289 (NUM_POINTS): New macro.
3290 (MPointTable): New type.
3291 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
3292 (mfont__ft_drive_otf): New argument rfont.
3294 * fontset.c (realize_font_group): Adjusted for the changed of
3296 (check_fontset_element): This function deleted.
3298 * input-gui.c (adjust_window_and_draw): Locate a preedit window
3299 off the parent window if the preedit text is zero length.
3301 * internal-gui.h (struct MFrame): New members foreground,
3302 background, videomode, font.
3303 (struct MGlyphString): New member anti_alias.
3304 (MDrawPoint): New type.
3305 (mwin__draw_bitmap): Prototype deleted.
3306 (mwin__draw_points): Prototype added.
3308 * m17n-gui.h (MDrawControl): New member anti_alias.
3310 * m17n-gui.c (free_frame): Free frame->font.
3311 (mframe): Set the fontset of frame->face to the default fontset.
3313 * m17n-X.c (RGB_GC): New type.
3314 (enum gc_index): Renamed from enum face_gc. Member names changed.
3316 (struct MWDevice): Members foreground and background deleted. New
3317 member scratch_gc, gc_list.
3318 (DEFAULT_FONT, FALLBACK_FONT): New macros.
3319 (free_device): Free GCs in device->gc_list.
3320 (get_rgb_gc): New function.
3321 (get_gc): Renamed and argument changed from get_color.
3322 (get_gc_for_anti_alias): New function.
3323 (xfont_find_metric): Arguments changed. Get metrics of multiple
3325 (set_region): Argument changed. Caller changed.
3326 (xfont_render): Allways set a font in gc.
3327 (x_error_handler, x_io_error_handler): Define only if
3328 X_SET_ERROR_HANDLER is defined.
3329 (mwin__open_device): Create device->scratch_gc. Set members
3330 foreground, background, and videomode of frame. Call
3331 XSetErrorHandler and XSetIOErrorHandler only if
3332 X_SET_ERROR_HANDLER is defined.
3333 (struct gc_list): Deleted.
3334 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
3335 (mwin__realize_face): Adjusted for the change of the format of
3336 rface->info and the charge of set_region.
3337 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
3338 (mwin__draw_box): Likewise.
3339 (mwin__draw_bitmap): This function deleted.
3340 (mwin__draw_points): New function.
3341 (mwin__verify_region): Adjusted for the change of the format of
3342 rface->info and the charge of set_region.
3343 (mwin__create_window): Inherit backgound pixel from parent.
3344 (mwin__dump_gc): Adjusted for the change of the format of
3347 2004-03-16 Kenichi Handa <handa@m17n.org>
3349 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
3351 * input.c (M_key_alias): New variable.
3352 (handle_key): Try M_key_alias property of a key too.
3353 (minput__init): Initialize M_key_alias. Give that property to
3354 symbols in one_char_symbol. Fix bug of initializing
3357 * draw.c (compose_glyph_string): Don't handle
3358 ignore_formatting_char here. Include formatting characters in the
3359 range processed by a FTL.
3360 (layout_glyph_string): Handle ignore_formatting_char here.
3362 2004-03-12 Kenichi Handa <handa@m17n.org>
3364 * input-gui.c (win_create_ic): Enable bidi in status control.
3366 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
3368 2004-03-09 Kenichi Handa <handa@m17n.org>
3370 * input.c (load_input_method): If title is not specified, use the
3371 input method name as title.
3373 * m17n-X.c (get_color): Make it static.
3374 (xim_create_ic, xim_destroy_ic, x_error_handler)
3375 (x_io_error_handler): Likewise.
3377 2004-03-01 Kenichi Handa <handa@m17n.org>
3379 * Version 1.0 released.
3382 Copyright (C) 2003, 2004
3383 National Institute of Advanced Industrial Science and Technology (AIST)
3384 Registration Number H15PRO112
3386 This file is part of the m17n library.
3388 The m17n library is free software; you can redistribute it and/or
3389 modify it under the terms of the GNU Lesser General Public License
3390 as published by the Free Software Foundation; either version 2.1 of
3391 the License, or (at your option) any later version.
3393 The m17n library is distributed in the hope that it will be useful,
3394 but WITHOUT ANY WARRANTY; without even the implied warranty of
3395 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3396 Lesser General Public License for more details.
3398 You should have received a copy of the GNU Lesser General Public
3399 License along with the m17n library; if not, write to the Free
3400 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA