1 2006-01-12 Kenichi Handa <handa@m17n.org>
3 * input.c (get_surrounding_text): Always pop ic->plist.
4 (reset_ic): Don't reset ic->plist.
6 2006-01-10 Kenichi Handa <handa@m17n.org>
8 * input.c (preedit_commit): For debugging, print only commiting
9 charactes. Don't set ic->candidate_show to 0.
10 (handle_key): Don't run branch-actions just by shifting to the
12 (reset_ic): Reset state_key_head and key_head of ic_info to 0.
15 2006-01-07 Kenichi Handa <handa@m17n.org>
17 * input.c (load_branch): Confirm that maps is not NULL.
19 2006-01-05 Kenichi Handa <handa@m17n.org>
21 * input-gui.c (win_filter): Try to convert arg to key only when
24 * plist.c (read_integer_element): If '#' and '-' are followed by
25 non-integer-constituent, read them as a part of a symbol.
26 (read_symbol_element): New arg C.
27 (read_element): Adjust args to read_symbol_element.
29 * input.c (load_macros): On overwriting a macro, free the old
31 (minput__init): Store Mmap in load_im_info_keys.
32 (minput_get_title_icon): If the input method has no title, be sure
34 (minput_get_description): If the input method has no description,
35 be sure to return NULL.
36 (minput_get_variables): Fix documentation.
37 (handle_key): Pay attention to the case that key is Mnil.
38 (filter): Likewise. Fix handling of such symbol as S-A.
40 2005-12-22 Kenichi Handa <handa@m17n.org>
42 * Version 1.3.0 released.
44 2005-12-22 Kenichi Handa <handa@m17n.org>
46 * font-ft.c (ft_list): If the specified font has no property,
49 2005-12-20 Kenichi Handa <handa@m17n.org>
51 * character.c (mchar_get_prop): Check char_prop_list.
52 (mchar_put_prop, mchar_get_prop_table): Likewise.
54 2005-12-18 Kenichi Handa <handa@m17n.org>
56 * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
57 file name sans language.
59 2005-12-16 TAKAHASHI Naoto <ntakahas@m17n.org>
61 * input.c: Fix typo in comments.
63 2005-12-14 Kenichi Handa <handa@m17n.org>
65 * input.c (minput_get_title_icon): Check the default icon for the
68 2005-12-13 Kenichi Handa <handa@m17n.org>
70 * input.c (Mless_equal, Mgreater_equal): New variables.
71 (parse_expression, resolve_expression, parse_action_list)
72 (take_action_list): Handle the aboves.
73 (filter): Treat key S-X as X.
74 (minput__init): Initialize Mless_equal and Mgreater_equal.
75 (minput_get_title_icon): New function.
77 * m17n.h (minput_get_title_icon): Extern it.
79 * database.c (get_database_filename): Return a filename instead of
81 (load_database): Adjusted for the above change.
82 (mdatabase__load_for_keys): Likewise.
83 (mdatabase__find_file): New function.
85 * database.h (mdatabase__find_file): Extern it.
87 * font.h (mfont__resize): Delete extern.
89 * font.c (mfont__list): Check resize ratio.
90 (mfont__resize): Delete it.
91 (mfont_resize_ratio): Include the code of mfont__resize.
93 * font-ft.c (ft_open): Check resize ratio.
95 * m17n-X.c (xfont_open): Check resize ratio.
98 2005-12-07 Kenichi Handa <handa@m17n.org>
100 * input.c (take_action_list): If take_action_list return -1,
102 (handle_key): Likewise.
104 * face.c (mface__for_chars): When font is specified and layouter
105 is found for it, if the layouter doesn't support one of a
106 character, use a face sans layouter for it.
108 2005-12-06 Kenichi Handa <handa@m17n.org>
110 * fontset.c (mfont__lookup_fontset): If only a fallback font is
111 found, don't use it for more than one character.
113 2005-12-05 Kenichi Handa <handa@m17n.org>
115 * face.c (mface__realize): Set rfont->layouter to Mnil.
116 (mface__for_chars): Fix handling of layouter.
118 * character.h (mchar__define_prop): Extern it.
120 * database.c (update_database_list): Call mchar__define_prop if
123 * character.c (mchar__init): Don't call mchar_define_property.
124 Instead just initialize property keys.
125 (mchar__fini): Free char_prop_list only if it's not NULL.
126 (mchar__define_prop): New function.
127 (mchar_define_property): Call mchar__define_prop.
129 * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
132 2005-12-02 Kenichi Handa <handa@m17n.org>
134 * language.c (mlang__init): Handle extra chars.
136 * m17n-gui.h (mfont_check): Adjust prototype.
138 * m17n-X.c (xfont_driver): Specify xfont_check_capability.
139 (xfont_check_capability): New function.
140 (xft_driver): Specify xft_check_capability.
141 (xft_check_capability): New function.
143 * font-ft.c (M0_3): Delete it.
145 (ft_get_charmaps): Refer to M0.
146 (fc_parse_pattern): Fix previous change.
147 (ft_list_language): Check also extra chars.
148 (ft_check_otf): Define it even if HAVE_OTF is undef.
149 (ft_check_lang): Check the result of FcLangSetHasLang against
150 FcLangDifferentLang. Check also extra chars.
151 (ft_list_capability): Delete ifdef HAVE_OTF.
152 (ft_select): Likewise.
153 (ft_open): Improve debug information.
154 (ft_check_capability): New function.
155 (mfont__ft_driver): Specify ft_check_capability.
156 (mfont__ft_init): Initialize M0.
158 * fontset.c (get_font_from_group): New function.
159 (mfontset__get_font): New function.
161 * fontset.h (mfontset__get_font): Extern it.
163 * font.c (OTF_tag): Define it if HAVE_OTF is undef.
164 (mfont__fini): Delete ifdef HAVE_OTF.
165 (free_font_capability): Likewise.
166 (mfont__get_capability): Likewise.
167 (mfont__check_capability): New function.
168 (mfont_check): Change the order of arguments. Use
171 * font.h (struct MFontDriver): New member check_capability.
172 (MFontCapability): Delete ifdef HAVE_OTF.
173 (mfont__check_capability): Extern it.
175 * face.c (mface__realize): Fix handling of FONT arg.
176 (mface__for_chars): Fix handling of explicitly specified font.
178 2005-11-25 Kenichi Handa <handa@m17n.org>
180 * font-flt.c (run_command): Print debug info for
183 * draw.c (layout_glyphs): Fix handling of left/right_padding.
185 * face.c (mface__for_chars): Check rfont before accessing the
188 2005-11-21 Kenichi Handa <handa@m17n.org>
190 * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
193 * fontset.c (fontset_table): New variable.
194 (free_fontset): Call M17N_OBJECT_UNREGISTER.
195 (mfont__fontset_init): Add fontset_table as an object array.
196 (mfont__realize_fontset): Ref FONTSET.
197 (mfont__free_realized_fontset): Unref REALIZED->fontset.
198 (mfontset): Call M17N_OBJECT_REGISTER.
199 (mfontset_copy): Likewise.
201 * input.c (handle_key): For debugging, print information about
203 (filter): Add an alias for Meta and Alt modifiers.
204 (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
206 (minput__init): Initialize them.
207 (parse_expression): New function.
208 (resolve_expression): New function.
209 (parse_action_list): Handle expressions by parse_expression.
210 (take_action_list): Handle expressions by resolve_expression.
211 (parse_nested_list_value): Fix previous change.
212 (resolve_command): Fix handling of the return value of
215 2005-11-18 Kenichi Handa <handa@m17n.org>
217 * font-ft.c (ft_check_otf, otf_script_list): Define only when
219 (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
221 (ft_select): Likewise.
223 * font.c (mfont_list): Fix for the case that FONT is NULL.
224 (OTF_tag): Delete it.
225 (load_otf_script_list): Define only when HAVE_OTF is defined.
226 (mfont__fini): Unref otf_script_list only when HAVE_OTF is
229 * draw.c (truncate_gstring): Be sure to truncate at
230 glapheme-cluster boundary.
232 2005-11-11 Kenichi Handa <handa@m17n.org>
234 * input.c (delete_surrounding_text): Clear cache if necessary.
236 2005-11-09 Kenichi Handa <handa@m17n.org>
238 * draw.c (compose_glyph_string): Update prev->rface->rfont if the
239 glyph prev is also supported by the current flt.
241 2005-11-08 Kenichi Handa <handa@m17n.org>
243 * m17n-X.c (xft_render): Cancel previous change.
245 2005-11-07 Kenichi Handa <handa@m17n.org>
247 * input.c: Include <stdlib.h>.
248 (get_surrounding_text, delete_surrounding_text)
249 (get_preceding_char, get_following_char): New functions.
250 (integer_value): New arg surrounding. If it is nonzero, try to
251 get a surrounding character. Callers changed.
252 (take_action_list): Check `value' before setting an element.
253 (destroy_ic): Unref ic_info->preceding_text and
254 ic_info->following_text.
255 (minput__init): Initialize Minput_get_surrounding_text and
256 Minput_delete_surrounding_text.
257 (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
259 (filter): Unref ic_info->preceding_text and
260 ic_info->following_text.
262 * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
265 * input.h (MInputContextInfo): New members preceding_text and
268 2005-11-04 Kenichi Handa <handa@m17n.org>
270 * input.c (parse_nested_list_value): Fix handling of the global
272 (get_nested_list): Get global definitions by load_partial_im_info.
273 (preedit_commit): Set ic->candidates_changed to bitwise or of enum
274 MInputCandidatesChanged.
275 (take_action_list): Likewise.
276 (reset_ic): Likewise.
277 (create_ic): Don't pay special attention to
278 Mcandidates_group_size.
279 (load_partial_im_info): Call mdatabase_find with correct 4th arg.
280 (minput_set_variable): Get a definition of varible by
281 mplist_find_by_value, not mplist_get.
283 * m17n.h (enum MInputCandidatesChanged): New enum.
285 2005-11-01 Kenichi Handa <handa@m17n.org>
287 * m17n-X.c (xft_render): Check xft_draw's drawable before changing
289 (mwin__destroy_window): If xft_draw's drawable is win, change it
290 to device->drawable before destroying win.
292 2005-10-31 Kenichi Handa <handa@m17n.org>
294 * input.c (load_im_info): Fix adding of state.
296 * m17n-core.c (m17n_fini_core): Fix reporting of module
299 * m17n.c (m17n_fini): Fix reporting of module finalization.
301 * m17n-gui.c (m17n_init_win): Fix reporting of module
304 2005-10-29 Kenichi Handa <handa@m17n.org>
306 * input.c (get_candidate_list): Fix the timing of referring plist.
308 2005-10-28 Kenichi Handa <handa@m17n.org>
310 * input.c (load_branch): Ignore an undefined map name.
311 (load_im_info): Set im_info->title from `name' only if it's not
313 (shift_state): Always update ic->status.
314 (adjust_candidates): Renamed from adjust_candidate_command.
315 Argument changed. Caller changed.
316 (get_candidate_list, regularize_action): New functions.
317 (take_action_list): Use them. On handling Munhandle, don't set
319 (handle_key): If KEY is not handled by MAP, and MAP has
320 branch_actions, perform them.
322 * database.c (mdatabase__fini): Free dir_info->filename;
324 2005-10-20 Kenichi Handa <handa@m17n.org>
326 * input.c (marker_code): Accept '@@'.
327 (integer_value): Handle '@@'.
328 (parse_action_list): Accept a symbol argument.
329 (take_action_list): Resolve the symbol argument. Handle the
332 2005-10-18 Kenichi Handa <handa@m17n.org>
334 * input.c: Include "charset.h".
335 (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
337 (MIMState): New member (M17NObject control).
338 (lookup_nested_list, set_nested_list, parse_nested_list_value)
339 (get_nested_list, resolve_variable): New functions.
340 (integer_value): New arg (MPlist **value). Set it to the plist
341 element containing the value.
342 (resolve_command): New function.
343 (load_translation): New arg (MPlist *map_actions).
344 (load_branch): New args language and name. If `keylist' is a
345 symbol, resolved that as a command name.
346 (free_map): New arg top. Free map->map_actions only if top is
348 (free_state): New function.
349 (load_state): New arg name.
350 (im_info_list): New variable.
351 (free_im_info, get_im_info_by_tags): New functions.
352 (load_im_info): Arg key changed to plist. Handle `include'.
353 Return (MInputMethodInfo *).
354 (preedit_commit): Ref ic->candidate_list.
355 (get_select_charset, adjust_candidate_command): New functions.
356 (take_action_list): Handle `include'. Adjust candidate action
357 properly. Handle control variables `candidates-charset' and
358 `candidates-group-size'.
359 (open_im): Use get_im_info.
360 (create_ic): Get global variables.
361 (load_partial_im_info): New function.
362 (get_im_info): New function.
363 (check_command_keyseq, check_command_list, check_variable_list):
365 (minput__init): Don't handle M_database_hook and Mdetail_text.
366 Initialize M_candidates, Mcandidates_group_size,
368 (parse_variable_list, get_variable_list, parse_command_list)
369 (get_command_list): Delete them.
370 (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
371 (minput__fini): Simply unref command_list and variable_list.
372 (minput_get_description): Adjusted for the new form of description.
373 (minput_get_commands): Use get_nested_list.
374 (minput_assign_command_keys): Likewise.
375 (minput_get_variables, minput_set_variable): Likewise.
377 * input.h (MInputMethodInfo): New members im and maps.
379 * database.h (M_database_hook): Delete extern.
380 (MDatabaseHookFunc): Delete extern.
381 (mdatabase__check): Extern it.
383 * database.c: Include <glob.h>.
384 (MAX_TIME): New macro.
385 (Masterisk): New variable.
386 (get_database_stream): Argument changed to (MDatabaseInfo *).
388 (get_dir_info): Renamed from duplicate_dirname. Callers changed.
389 (find_database): New function.
390 (update_database_list): New function.
391 (mdatabase__init): Initialize Masterisk. Setup mdb_list by
392 calling update_database_list.
393 (mdatabase__check): New function.
394 (mdatabase_find): Use update_database and find_database. Don't
395 handle MDatabaseHookFunc.
396 (mdatabase_list): Call update_database at first.
397 (mdatabase_define): Adjusted for the change of mdb->extra_info.
398 (MDatabaseList): New type.
400 * plist.h (mplist_conv, mplist__pop_unref): Extern them.
402 * m17n.h (Mdetail_text): Delete extern.
404 * m17n-core.h (mplist_conc): Delete extern.
406 * plist.c (mplist__conc): Renamed from mplist_conc. Don't ref
408 (mplist_conc): Renamed to mplist__conc.
409 (mplist__pop_unref): New function.
411 2005-10-14 Kenichi Handa <handa@m17n.org>
413 * plist.c (read_mtext_element): Ignore the sequence of '\\' and
415 (read_element): If keys is an empty plist, return any element
417 (dump_plist_element): Check if plist is nested.
418 (mplist_conc): Always ref tail.
419 (mplist_set): If key is a managing key, ref val in advance.
421 * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
422 (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
423 (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
426 * fontset.c (free_fontset): Unref fontset_list if necessary.
427 (mfont__fontset_fini): Don't free fontset_list. Unref
429 (mfont__realize_fontset): Initialize request.
430 (mfontset): Ref default_fontset or fontset only if necessary.
431 (mfontset_copy): Don't ref copy.
433 * draw.c (render_glyphs): Check gend->type before checking
436 * font-ft.c (mfont__ft_fini): Unref ft_default_list. Set all
437 unrefed plists to NULL.
439 2005-10-04 Kenichi Handa <handa@m17n.org>
441 * textprop.c (mtext_serialize): Be sure to make mt
442 MTEXT_FORMAT_UTF_8 and NULL terminated.
444 * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
446 * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
448 2005-10-03 Kenichi Handa <handa@m17n.org>
450 * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
451 is not at the beginning of line.
453 2005-09-22 Kenichi Handa <handa@m17n.org>
455 * input.c: Include <sys/stat.h> and <unistd.h>.
456 (Minclude, Mcommit, Munhandle): New variables.
457 (minput__init): Initialize them. Push only Mstate to
458 load_im_info_keys. Add aliases C-lowercase for C-uppercase.
459 (parse_action_list): Allow integer arg for undo. Handle Mcommit
461 (load_input_method): Handle "include" directive. If no states are
463 (shift_state): If state_name is Mt, shift back to the previous
464 state. Call preedit_commit to commit preedit text.
465 (preedit_commit): New function.
466 (take_action_list): Improve debug printing. Handle commit and
468 (handle_key): Check the return value of take_action_list. Don't
469 take branch_actions just after changing to the root map.
470 (reset_ic): Reset all ic_info members.
471 (filter): When a key is not handled, just move ic_info->keys
472 instead fo calling reset_ic.
473 (load_im_info): If key is not Mstate, push Mmap to
475 (MDatabaseStatList): New type.
476 (imdir_stat_list): New variable.
477 (input_method_hook): Don't cancel the hook. Check the
478 modification time of directories.
479 (minput__fini): Free imdir_stat_list;
481 * input.h (MInputContextInfo): New member prev_state.
483 * m17n-core.h (mplist_conc): Extern it.
485 * plist.c (mplist_conc): New function.
487 * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
489 * font.h (MRealizedFont): New member average_width.
491 * font-ft.c (ft_open): Set rface->average_width.
493 * font.c (xlfd_unparse_name): Print '*' before registry name.
495 * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
496 (xfont_open): Set rfont->average_width.
497 (xft_open): Likewise.
498 (device_open): Initialize disp_info->AVERAGE_WIDTH.
500 * internal-gui.h (struct MFrame): New member average_width.
502 * m17n-gui.c (mframe): Fix setting of frame->rfont.
503 (mframe_get_prop): Return the average_width of a font.
505 * face.c (mface__realize): Set rface->average_width.
506 (mface__update_frame_face): Set frame->average_width.
508 * face.h (MRealizedFace): New member average_width.
510 2005-09-19 Kenichi Handa <handa@m17n.org>
512 * font.c (xlfd_unparse_name): New arg full_xlfd.
513 (mfont__encode_char): Use shortcut only for X core fonts.
514 (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
515 (mfont_put_prop): Handle `language' property.
516 (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
517 Print file can capability info too.
519 * m17n-core.c (mdebug__output): New variable.
520 (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
521 (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
522 (m17n_fini_core): Close mdebug__output if it's not stderr.
524 * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
525 (xfont_open): Handle baseline_offset.
526 (xfont_find_metric): Likewise.
527 (xfont_render): Likewise.
528 (xft_open): Likewise.
529 (xft_render): Likewise.
531 * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
532 (mdebug__output): Extern it.
533 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
534 (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
535 (MDEBUG_DUMP): New macro.
536 (MDEBUG_PRINT_TIME): Print to medebug__output.
538 * font.h (MRealizedFont): New member baseline_offset.
540 * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
542 (fc_weight_table): Add FC_WEIGHT_REGULAR.
543 (ft_list_family): Check alias.
544 (ft_list_language): If language is "en", don't try to the second
546 (ft_default_list): New variable.
547 (ft_list_default): New function.
548 (ft_select): If family is not specified, try only the default
549 fonts. Treat the weights normal and medium same.
550 (ft_open): Fix debug message. If registry is not specified, try
551 unicode-bmp. Handle _MULE_BASELINE_OFFSET property of BDF fonts.
552 (ft_find_metric): Likewise.
553 (ft_render): Likewise.
554 (ft_list): Fix debug message. Accept the registring iso8859-1.
555 If family is not specified, try only the default fonts.
557 * face.c (mface__realize): Fix logic of opening a font.
559 2005-09-16 Kenichi Handa <handa@m17n.org>
561 * face.c (mface__realize):
563 * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
566 * input.c (shift_state): Fix the condition of taking init actions.
567 (take_action_list): Fix handling of pushback action.
568 (handle_key): Don't change key while checking its alias.
569 (minput__init): Initialize new variables.
570 (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
573 2005-09-12 Kenichi Handa <handa@m17n.org>
575 * mtext.c (mtext__uppercase): Add proper open/close parens.
576 (mtext_titlecase): Add proper casting.
578 * input.c (parse_action_list): Handle the case that the arg is a
579 key sequence (MText or MPlist).
580 (take_action_list): Likewise.
581 (shift_state): Shorter debug message.
582 (handle_key): Terminate a debug message by "\n".
583 (reset_ic): Don't take initial actions here.
584 (minput_open_im): Print a debug message.
585 (minput_close_im): Likewise.
586 (minput_create_ic): Likewise.
587 (minput_destroy_ic): Likewise.
589 2005-09-09 TAKAHASHI Naoto <ntakahas@m17n.org>
591 * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
594 2005-09-07 TAKAHASHI Naoto <ntakahas@m17n.org>
595 * character.c: Add "cased", "soft-dotted", and "case-mapping" in
598 * character.c: Add Japanese documentation for
599 mchar_get_prop_table ().
601 2005-09-06 TAKAHASHI Naoto <ntakahas@m17n.org>
603 * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
604 (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
605 (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
607 (init_case_conversion): New function.
608 (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
609 (uppercase_precheck, lowercase_precheck, final_sigma)
610 (after_soft_dotted, more_above, before_dot, after_i)
611 (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
613 2005-09-05 TAKAHASHI Naoto <ntakahas@m17n.org>
615 * plist.c (read_mtext_element): Fix previous change.
617 2005-09-05 Kenichi Handa <handa@m17n.org>
619 * plist.c (read_mtext_element): Handle \uXXXX notation.
621 * internal.h (MTABLE_MALLOC): Don't use a local variable.
622 (MTABLE_ALLOCA): Change the name of local variable.
624 * m17n-gd.c (device_open): Define it even if HAVE_GD nor
625 HAVE_FREETYPE are defined.
627 * m17n-X.c: Check HAVE_X11.
629 * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
630 directory listing libraries.
631 (noinst_PROGRAMS): Define it only in maintainer mode.
633 2005-09-02 Kenichi Handa <handa@m17n.org>
635 * m17n-gui.h (mdraw_line_break_option): Extern it.
637 * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
638 end of the first glyph.
639 (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
641 (mdraw_line_break_option): New variable.
642 (mdraw_default_line_break): Use mtext_line_break.
644 * mtext.h (wordseg_func_table): Don't extern it.
645 (mtext__wseg_fini): Extern it.
647 * mtext.c: Don't include word-thai.h.
648 (wordseg_func_table): Delete this variable.
649 (mtext__init): Don't initialize above. Don't call
650 mtext__word_thai_init.
651 (mtext__fini): Don't free wordseg_func_table. Call
652 mtext__wseg_fini instead fo mtext__word_thai_fini.
653 (MTextWordsegFunc): Don't typedef it.
654 (mtext__word_segment): Moved to mtext-wseg.c.
656 * m17n-core.h (enum MTextLineBreakOption): New enum.
657 (mtext_line_break): Extern it.
659 * mtext-wseg.c: New file.
661 * mtext-lbrk.c: New file.
663 * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
664 add mtext-lbrk.c and mtext-wseg.c.
666 * textprop.c (mtext__adjust_plist_for_change): Pay attention for
667 the case that head is NULL.
669 2005-09-01 Kenichi Handa <handa@m17n.org>
671 * word-thai.c (wordseg_propertize): If the property value is nil,
672 don't make the property no-merge.
673 (thai_wordseg): Don't require *from and *to are set a priori. Pay
674 attention to the case that they are NULL.
675 (mtext__word_thai_init): Make the name of Mthai_wordseg starts
678 * character.c (mchar_get_prop_table): New function.
680 * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
682 * m17n-core.h (mtext_insert, mtext_replace): Extern them.
683 (mchar_get_prop_table): Extern it.
685 * textprop.c (prepare_to_modify): New arg deleting. Callers changed.
686 (mtext__adjust_plist_for_change): Argument changed. Callers changed.
688 * internal.h (enum MTextCoverage): New enum.
689 (MText): New member coverage.
691 * mtext.c (FORMAT_COVERAGE): New macro.
692 (insert): Copy mt2->coverage.
693 (mtext__from_data): Initialize mt->coverage.
694 (mtext__adjust_format): Update mt->coverage.
695 (mtext): Initialize mt->coverage.
696 (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
697 Update mt->coverage if necessary.
698 (mtext_duplicate): Copy mt->coverage.
699 (mtext_insert, mtext_replace): New functions.
700 (mtext_dup): Use mtext_duplicate.
701 (mtext__word_segment): Don't set *from and *to if a word
702 segmentation funcion is not found.
703 (mtext_ins_char): Fix typo.
705 2005-08-25 Kenichi Handa <handa@m17n.org>
707 * font.h (MFont): New member for_full_width.
709 * font.c (compare_font_score): Prefer a font of not
712 * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
713 registry charset of a font is one of CJK charsets.
715 * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
716 supports some of CJK.
718 2005-08-24 Kenichi Handa <handa@m17n.org>
720 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
722 * m17n-gui.c (null_device_open): Check Mresolution param and set
725 * m17n-gd.c (device_open): Check Mresolution param and set
728 * m17n-X.c (MWDevice): New member resy.
729 (xfont_open): Set ascent, descent, and max_advance members of
731 (xft_open): Likewise.
732 (device_open): Compare also screen_num to find a device. Set
733 device->resy and frame->dpi.
735 * internal-gui.h (MFrame): New member dpi.
737 * font.h (MRealizedFont): New member max_advance.
739 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
740 (mfont__init): Don't initialize Mascent, Mdescent.
741 (Mascent, Mdescent): Delete these variables.
742 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
743 Mfont_descent instead of Mascent and Mdescent.
744 (mfont_put_prop): Allow negative size.
745 (mfont_find): Handle the case of spec->size < 0. Fix previous
747 (mfont_list): Handle the case of spec->size < 0.
748 (mfont_check): Likewise.
750 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
751 (fc_get_pattern): Handle the case of font->size < 0.
752 (ft_open): Set ascent, descent, and max_advance members of rfont.
753 (ft_find_metric): Improve rounding.
754 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
757 * face.c (mface__realize): Handle the case of font->size < 0.
759 2005-08-22 Kenichi Handa <handa@m17n.org>
761 * coding.c (MConverterStatus): Change the member buf to union.
762 (mconv_buffer_converter): Add const to the arg buf.
763 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
764 (mconv_decode): Adjusted for the change of MConverterStatus.
765 (mconv_encode_range): Likewise.
767 * m17n.h (mconv_buffer_converter): Prototype adjusted.
768 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
770 2005-08-20 Kenichi Handa <handa@m17n.org>
772 * m17n-gui.h (mfont_from_name): Prototype adjusted.
773 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
775 * m17n-X.c (xfont_open): Set members ascent, descent, and
776 max_advance of rfont.
777 (xft_open): Likewise.
779 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
781 (mfont__ft_parse_name): Add const to the arg name.
783 * font.c (xlfd_parse_name): Add const to the arg name. Call
784 mfont__set_property instead of mfont_set_spec. Set font->spacing.
785 (xlfd_unparse_name): Handle spacing.
786 (mfont__init): Initialize new variables.
787 (mfont__id): Handle spacing.
788 (mfont__merge): Likewise.
789 (mfont__set_spec): This function deleted.
790 (mfont__parse_name_into_font): Add const to the arg name. Fix the
791 condition of calling mfont__ft_parse_name.
792 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
793 (mfont_get_prop): Handle properties spacing, ascent, descent,
795 (mfont_find): Return a realized font.
796 (mfont_from_name): Add const to the arg name.
798 * font.h (enum MFontProperty): New member MFONT_SPACING.
799 (enum MFontSpacing): New enum.
800 (MFont): New members spacing and max_advance.
801 (mfont__ft_parse_name): Prototype adjusted.
802 (mfont__set_spec): Extern deleted.
803 (mfont__parse_name_into_font): Prototype adjusted.
805 2005-08-19 Kenichi Handa <handa@m17n.org>
807 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
809 * font.c (mfont_list): If FONT is null, use a temporary font.
810 (mfont_parse_name): Add const to the arg name.
812 2005-08-18 Kenichi Handa <handa@m17n.org>
814 * word-thai.c: Surround code by #ifdef and #endif to escape from
817 * font-ft.c: Mostly re-written.
819 * font-flt.c (FontLayoutCmdOTF): This type deleted.
820 (FontLayoutCmd): Type of the member otf changed..
821 (load_otf_command): Adjusted for the format change of otf command.
822 (load_command): Likewise.
823 (free_flt_command): Unref cmd->body.otf.
824 (run_otf): Ajusted for the type change of otf_cmd.
825 (run_command): Ajusted for the type change of otf_cmd. On
826 debugging, print ctx->combining_code.
827 (mfont__flt_run): Initialize ctx's members code_offset,
828 combining_code, and left_padding to 0.
830 * face.h (struct MRealizedFace): New member font.
831 (mface__realize): Prototype adjusted.
833 * face.c (find_realized_face): New arg font.
834 (find_realized_face): Adjusted for the change of MFont.
835 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
836 (mface__fini): Don't call mdebug__report_object.
837 (mface__realize): New arg font.
838 (mface__for_chars): Adjusted for the change of mfont__encode_char.
839 Optimize the latin case.
840 (mface__free_realized): Free rface->font.
841 (mface__update_frame_face): Adjusted for the change of mface__realize.
842 (mface_equal): New function.
844 * draw.c (Mcommon): New variable.
845 (visual_order): Args to mfont__encode_char changed.
846 (compose_glyph_string): Handle Mfont text property.
847 (layout_glyphs): Adjusted for the change of MFont.
848 (mdraw__init): Initialize Mcommon.
849 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
851 * font.h (enum MFontType): Members completely changed.
852 (enum MFontProperty): Move MFONT_SIZE to the tail.
853 (enum MFontSource): New enum.
854 (struct MFont): New members type, source, sizes, file, capability,
856 (struct MRealizedFont): Type of member font changed. Members
857 score, status, and encoding deleted.
858 (MFontScore): New type.
859 (MFontList): Member changed.
860 (struct MFontDriver): New member has_char. Types of members
862 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
863 (Mapple_roman): Extern them.
864 (OTF_Tag): Typedefed if not HAVE_OTF.
865 (enum MFontOpenTypeTable): New enum.
866 (MFontCapability): New type.
867 (mfont__ft_drive_otf): Prototype adjusted.
868 (mfont__score): Extern deleted.
869 (mfont__merge): Extern it.
870 (mfont__has_char): Extern it.
871 (mfont__encode_char): Prototype adjusted.
872 (mfont__open): Extern it.
873 (mfont__set_spec): Prototype adjusted.
874 (mfont__get_capability): Extern it.
876 * font.c: Include "fontset.h".
877 (M_font_capability, M_font_list, M_font_list_len): New variables.
878 (font_score_priority): Change order of initial elements.
879 (font_score_shift_bits): Fix array size.
880 (common_weight): Add "thin", "semibold", and "heavy".
881 (common_stretch): Add "ultracondensed", "extracondensed",
882 "extraexpanded", and "utltraexpand".
883 (font_weight_regular, font_weight_normal, font_weight_medium): New
885 (gen_font_name): This function deleted.
886 (find_encoding): Set font->encoding.
887 (OTF_tag): New function.
888 (otf_script_list): New variable.
889 (load_otf_script_list): New function.
890 (find_script_from_otf_tag): New function.
891 (xlfd_parse_name): Set font->type and font->source.
892 (mfont__free_realized): Free chains rfonts.
893 (font_score): Renamed from mfont__score.
894 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
895 (Mapple_roman): New variables.
896 (mfont__init): Initilize new variables. Initalize
897 default_encoding.encoding_name and
898 default_encoding.encoding_charset to Municode_full and
899 mcharset__unicode. Use SAFE* macros for allocating filepath
901 (mfont__fini): Free otf_script_list.
902 (mfont__id): New function.
903 (mfont__match_p): Check also capability member of MFont.
904 (mfont__merge): New funciton.
905 (mfont__set_spec_from_face): Set type and source members.
906 (mfont__set_spec_from_plist): Set capability and type members.
907 (mfont__select): Argument changed.
908 (mfont__available): New function.
909 (compare_font_score): New function.
910 (mfont__list): New function.
911 (mfont__open): Return a realized font.
912 (mfont__resize): Adjusted for the change of MFont.
913 (mfont__has_char): New function.
914 (mfont__encode_char): Argument changed.
915 (mfont__set_spec): Argument changed.
916 (free_font_capability): New function.
917 (mfont__get_capability): New function.
918 (MFontfile): New variable.
919 (mfont_get_prop): Adjusted for the change of MFont.
920 (mfont_put_prop): Likewise.
921 (mfont_set_selection_priority): Fix the way of setting
922 font_score_priority[].
923 (mfont_find): Use mfont__list instead of mfont__select.
924 (mfont_resize_ratio): Adjusted for the change of MFont.
925 (mfont_list): Use mfont__list.
926 (mfont_check): New function.
927 (font_score): Make it static.
929 * fontset.h (mfont__realize_fontset): Prototype adjusted.
930 (mfont__lookup_fontset): Likewise.
932 * fontset.c (struct MFontset): Delete member font_spec_list.
933 (struct MRealizedFontset): Type of member spec changed. New
935 (load_font_group): Arg spec_list deleted.
936 (load_fontset_contents): Adjusted for the change of fontset_def.
937 (free_fontset): Fix the way of freeing fontset elements.
938 (realize_fontset_elements): Argument changed.
939 (get_per_script): New function.
940 (free_realized_fontset_elements): Fix the way of feeing rfontset
942 (update_fontset_elements): Fix args to realize_fontset_elements.
943 (mfont__realize_fontset): New arg spec.
944 (try_font_list): New function.
945 (try_font_group): New arg request. Use try_font_list.
946 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
948 (mfontset): Adjusted for the change of MFontset.
949 (mfontset_copy): Likewise. Don't share plists.
950 (mfontset_modify_entry): Adjusted for the change of MFontset.
951 (mfontset_lookup): Call get_per_script.
952 (mdebug_dump_fontset): Print also the address of fonts.
954 * input.c (shift_state): Don't reset ic_info->vars.
955 (take_action_list): Call MDEBUG_PRINT fore calling
958 * internal-gui.h (MFontDriver): Don't typedef it here.
960 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
961 (MXFont): This type deleted.
963 (struct _MFontX): New struct.
964 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
965 (MDisplayInfo): Member base_font_list deleted.
966 (DEFAULT_FONT): Definition changed.
967 (FALLBACK_FONT): This maclr deleted.
968 (free_display_info): Adjusted for the change of MDisplayInfo.
969 (free_device): Argument to mfont__free_realized changed.
970 (xfont_driver): Adjusted for the change of MFontDriver.
971 (xfont_registry_list): Use MFontX instead of MXFont.
972 (MRealizedFontX): Renamed from MXFontInfo.
973 (xfont_select): Return the font found first.
974 (close_xfont): Change MXFontInfo to MRealizedFontX.
975 (xfont_open): Return the realized font.
976 (xfont_find_metric): Get xfont from rfont->fontp.
977 (xfont_has_char): New function.
978 (xfont_encode_char): Adjusted for the argument change.
979 (xfont_render): Get xfont from rfont->fontp.
980 (xfont_list): Adjusted for the argument change.
981 (MRealizedFontXft): Renamed from MXftFontInfo.
982 (xft_driver): Ajusted for the change of MFontDriver.
983 (close_xft): Change MXtfFontInfo to MRealizedFontXft
984 (xft_open_font): Argument changed.
985 (xft_open): Argument changed. Return the realized font.
986 (xft_find_metric): Get xft_font from rfont->fontp.
987 (xft_has_char, xft_encode_char): New functions.
988 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
989 font if not yet opened.
990 (device_open): Don't set frame->font.
992 * m17n-gd.c (gd_font_driver): Adjusted for the change of
994 (gd_font_open): New function.
995 (gd_render): Don't use the local variable ft_info.
996 (device_init): Adjusted for the change of gd_font_driver.
998 * textprop.c (mtext__prop_init): Initialize text_property_table.
999 Call M17N_OBJECT_ADD_ARRAY.
1000 (mtext__prop_fini): Don't call mdebug__report_object.
1002 * plist.c (mplist__init): Initialize plist_table.
1003 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
1004 (mplist__fini): Don't call mdebug__report_object.
1006 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
1007 (mtext__fini): Don't call mdebug__report_object.
1008 (MTEXT_FORMAT_UTF_16): Correct type.
1009 (mtext_data): New function.
1010 (mtext_text): Fix calculation of limit and args to
1013 * language.c: Include "plist.h".
1014 (M_script_lang_list): New variable.
1015 (mlang__init): Read languages and their information from m17n
1017 (mlanguage__list): New function.
1018 (Miso639_1, Miso639_2): New variables.
1020 * language.h (mlanguage__list): Extern it.
1022 * database.c (get_database_stream): Use SAFE_* macros for
1023 allocating and freeing path.
1024 (mdatabase__init): Likewise.
1026 * symbol.c (msymbol__fini): Don't free symbols here.
1027 (msymbol__free_table): New function.
1028 (msymbol_is_managing_key): New function.
1030 * symbol.h (msymbol__free_table): Extern it.
1031 (msymbol__list): Extern it.
1033 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
1035 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
1036 (struct _M17NObjectArray): New member name and next.
1037 (mdebug__add_object_array): Extern it.
1038 (M17N_OBJECT_ADD_ARRAY): New macro.
1039 (mdebug__report_object): Don't extern it.
1041 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
1043 * m17n-gui.c (free_frame): Don't free frame->font.
1044 (null_device_fini): Fix code for freeing
1045 null_device.realized_font_list.
1046 (m17n_fini_win): Free interface.
1047 (mframe): Cast the return value of dlsym. Set frame->font here.
1048 (mframe_get_prop): Check frame->rface->rfont before accessing the
1051 * m17n-gui.h (Mfontfile): Extern it.
1052 (mfont_check): Extern it.
1053 (mface_equal): Extern it.
1055 * m17n-core.c: Include "symbol.h".
1056 (report_header_printed): This variable deleted.
1057 (object_array_root): New variable.
1058 (report_object_array): New function.
1059 (mdebug__report_object): This function deleted.
1060 (mdebug__add_object_array): New function.
1061 (m17n_init_core): Call mchartable_init () before mtext_init ().
1062 (m17n_fini_core): Call report_object_array (if necessary) and
1063 msymbol__free_atable at the end.
1065 * m17n-core.h (msymbol_is_managing_key): Extern it.
1066 (mtext_data): Extern it.
1067 (MTEXT_FORMAT_UTF_16): Correct type.
1068 (M17NLIB_MINOR_VERSION): Changed to 3.
1069 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1071 * chartab.c (mchartable__init): Initalize chartable_table.count.
1072 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1073 mdebug__report_object.
1075 2005-05-26 Kenichi Handa <handa@m17n.org>
1077 * m17n.h (Miso639_1, Miso639_2): Extern them.
1079 * symbol.h (msymbol__list): Extern it.
1081 * symbol.c (msymbol__list): New function.
1083 2005-05-19 Kenichi Handa <handa@m17n.org>
1085 * input-gui.c (minput__win_init): Don't change the value of
1088 2005-05-16 Kenichi Handa <handa@m17n.org>
1090 * m17n-core.c (m17n_object): Be sure to initialize all members.
1092 * font-ft.c (fc_decode_prop): Fix args to msymbol.
1094 2005-05-09 Kenichi Handa <handa@m17n.org>
1096 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1098 2005-04-27 Kenichi Handa <handa@m17n.org>
1100 * language.c (mlang__init): Add "an" (Aragonese).
1102 * word-thai.c: Add support for libthai.
1103 (mtext__word_thai_init): Initialize wordseg library conditionaly.
1104 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1106 * mtext.c: Include "word-thai.h" conditionaly.
1107 (mtext__init): Call mtext__word_thai_init conditionaly.
1108 (mtext__fini): Call mtext__word_thai_fini conditionaly.
1110 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1111 not WORDCUT_LD_FLAGS.
1113 2005-04-19 Kenichi Handa <handa@m17n.org>
1115 * word-thai.c (wordseg_propertize): Always unref the attached
1117 (thai_wordseg): Don't unref the property.
1119 2005-04-18 Kenichi Handa <handa@m17n.org>
1121 * word-thai.c: Include stdlib.h.
1122 (wordseg_propertize): Add dummy function for the case that wordcut
1123 library doesn't exist.
1124 (wordseg_propertize): Fix for old wordcut library.
1126 2005-04-16 Kenichi Handa <handa@m17n.org>
1128 * word-thai.c: Include <stdio.h>.
1130 2005-04-15 Kenichi Handa <handa@m17n.org>
1132 * draw.c: Include mtext.h.
1133 (linebreak_table, M_break_at_space, M_break_at_word)
1134 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1135 (compose_glyph_string): Check POS before getting Mface text
1137 (truncate_gstring): Give correct TO arg to line_break function.
1138 (GET_LB_TYPE): New macro.
1139 (find_break_backward, find_break_forward): New functions.
1140 (mdraw__init): Initialize the above new variables.
1141 (mdraw__fini): Free linebreak_table.
1142 (mdraw_default_line_break): Use find_break_backward and
1145 * word-thai.c: New file.
1147 * word-thai.h: New file.
1149 * mtext.c: Include word-thai.h.
1150 (wordseg_func_table): New variable.
1151 (mtext__init): Initialize wordseg_func_table and call
1152 mtext__word_thai_init.
1153 (mtext__fini): Call mtext__word_thai_fini, free
1155 (MTextWordsegFunc): New type.
1156 (mtext__word_segment): New function.
1158 * mtext.h (wordseg_func_table): Extern it.
1159 (mtext__word_segment): Extern it.
1161 * m17n.c (m17n_init): Fix typo (== -> =).
1163 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1164 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1166 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1167 (MTEXTPROP_VAL): New macros.
1169 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1171 2005-04-07 Kenichi Handa <handa@m17n.org>
1173 * database.c (load_chartable): Fix pursing of symbol name.
1175 2005-03-24 Kenichi Handa <handa@m17n.org>
1177 * m17n.c (m17n_init): Fix typo (== -> =).
1179 2005-03-11 Kenichi Handa <handa@m17n.org>
1181 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1183 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1185 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1188 2005-03-09 handa <handa@m17n.org>
1190 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1191 calling m17n_init ().
1193 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1194 calling m17n_init_core ().
1196 2005-02-28 Kenichi Handa <handa@m17n.org>
1198 * font-flt.c (mfont__flt_run): Add resulting code sequence in
1201 2005-02-17 Kenichi Handa <handa@m17n.org>
1203 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1204 (M_description, M_command, M_variable): New variables.
1205 (load_im_info_keys): New variables.
1206 (load_im_info, check_command_keyseq, get_description_advance)
1207 (parse_command_list, get_command_list, parse_variable_list)
1208 (get_variable_list, input_method_hook): New functions.
1209 (command_list, variable_list): New variables.
1210 (minput__init): Put input_method_hook to Minput_method.
1211 Initialize M_description, M_command, M_variable, Mdetail_text,
1212 load_im_info_keys, command_list, variable_list.
1213 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1214 (Mdetail_text): New variable.
1215 (minput_get_description, minput_get_commands)
1216 (minput_assign_command_keys, minput_get_variables)
1217 (minput_set_variable): New functions.
1219 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1220 (minput_assign_command_keys, minput_get_variables)
1221 (minput_set_variable): Extern them.
1223 * plist.c (UNGETC): Just decrement st->p.
1224 (read_mtext_element): New arg skip.
1225 (read_integer_element): Likewise.
1226 (read_symbol_element): Likewise.
1227 (read_element): New arg KEYS.
1228 (mplist__from_plist): Don't increment ref-count of NULL object.
1229 (mplist__from_file): New arg KEYS.
1230 (mplist_put): Don't increment ref-count of NULL object.
1231 (mplist_add): Likewise.
1232 (mplist_push): Likewise.
1233 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
1235 * plist.h (mplist__from_file): Prototype adjusted.
1237 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1238 (get_database_stream): New function.
1239 (load_database): Use get_database_stream.
1240 (M_database_hook): New variable
1241 (mdatabase__init): Initialize M_database_hook.
1242 (mdatabase__load_for_keys): New function.
1243 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1245 (mdatabase_define): Free mdb->extra_info if necessary.
1247 * database.h (mdatabase__dir_list, M_database_hook)
1248 (mdatabase__load_for_keys): Extern them.
1249 (MDatabaseHookFunc): New type.
1251 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1253 2004-12-27 Kenichi Handa <handa@m17n.org>
1255 * Version 1.2.0 released.
1257 2004-12-27 Kenichi Handa <handa@m17n.org>
1259 * input.c (minput_filter): Don't reset ic->xxx_changed.
1261 * mtext.c (mtext_from_data): Fix documentation.
1263 2004-12-25 Kenichi Handa <handa@m17n.org>
1265 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1266 (M17NLIB_VERSION_NAME): Update to "1.2.".
1268 2004-12-24 Kenichi Handa <handa@m17n.org>
1270 * input.c (reset_ic): Set key_unhandled to 0.
1272 2004-12-21 Kenichi Handa <handa@m17n.org>
1274 * m17n-gui.h (mfont_from_spec): Delete extern.
1276 * input-gui.c (win_callback): Handle Minput_reset.
1277 (minput__win_init): Register reset_ic as a callback for
1280 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
1281 changed. At first, shift to the initial state.
1282 (minput__init): Initialize Minput_reset. Register reset_ic as a
1283 callback for Minput_reset.
1284 (Minput_reset): New variable.
1285 (minput_filter): Always set ic->xxx_changed to 0.
1286 (minput_reset_ic): New function.
1287 (integer_value): Fix typo ('>' -> '<') and calculation of length
1290 * m17n-core.c (merror_code): Change type to `int'.
1292 * m17n-misc.h (merror_code): Adjust type.
1294 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1296 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1297 (mtext_change_prop): Delete extern.
1299 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1300 to `int'. Move the documents to m17n-core.h.
1302 2004-12-13 Kenichi Handa <handa@m17n.org>
1304 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1305 (MTextProperty): Document it.
1307 2004-12-09 Kenichi Handa <handa@m17n.org>
1309 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1311 2004-12-03 Kenichi Handa <handa@m17n.org>
1313 * internal.h (m17n__core_initialized, m17n__shell_initialized,
1314 m17n__gui_initialized): New externs.
1316 * m17n-core.h (enum M17NStatus): New enum.
1317 (m17n_status): Extern it.
1319 * m17n-core.c (core_initialized): Delete this variable.
1320 (m17n__core_initialized, m17n__shell_initialized,
1321 m17n__gui_initialized): New variables.
1322 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1323 instead of core_initialized.
1324 (m17n_status): New function.
1326 * m17n.c (shell_initialized): Delete this variable.
1327 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1330 * m17n-gui.h (m17n_init_win): Adjust the prototype.
1332 * m17n-gui.c (win_initialized): Delete this variable.
1333 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1334 instead of gui_initialized.
1336 2004-11-19 Kenichi Handa <handa@m17n.org>
1338 * input.c (reset_ic): Check if ic_info->state is NULL.
1339 (filter): If ic_info->state is NULL, return 0.
1340 (load_input_method): Don't unref `maps' it it's not created.
1342 2004-11-15 Kenichi Handa <handa@m17n.org>
1344 * input.c (find_candidates_group): If INDEX is -1, find the last
1346 (take_action_list): If the previous of the first candidate is
1347 requested, select the last candidate.
1349 2004-11-08 Kenichi Handa <handa@m17n.org>
1351 * m17n-X.c (device_open): Try at most 32 fonts to find a
1352 non-autoscaled font.
1354 * font.c (xlfd_parse_name): Fix previous change.
1356 2004-11-05 Kenichi Handa <handa@m17n.org>
1358 * font.c: (commont_style): Include dummy elements "slanted" and
1359 "rslanted" to prefer "o" to "r" if "i" is requested.
1361 * font-ft.c (ft_to_prop): Fix "oblique" entry.
1363 2004-10-29 Kenichi Handa <handa@m17n.org>
1365 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1367 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1368 New members smallest and larger.
1369 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1370 (xfont_registry_list): Likewise.
1371 (xfont_select): Likewise.
1374 2004-10-28 Kenichi Handa <handa@m17n.org>
1376 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1377 font name comparison.
1378 (xfont_select): Fix logic for selecting a larger size font.
1380 2004-10-25 Kenichi Handa <handa@m17n.org>
1382 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1385 2004-10-22 Kenichi Handa <handa@m17n.org>
1387 * input.c (update_candidate): Renamed from udpate_candidate.
1388 (take_action_list): Show more debugging info on arithmetic commands.
1390 * m17n-X.c (device_open): Fix previous change.
1392 * draw.c (compose_glyph_string): Don't get face property at the
1395 2004-10-21 Kenichi Handa <handa@m17n.org>
1397 * draw.c (compose_glyph_string): Fix for the case of category
1400 2004-10-19 Kenichi Handa <handa@m17n.org>
1402 * input.c (mdebug_mask): New variable.
1403 (shift_state): Print debug information.
1404 (take_action_list): Likewise.
1405 (handle_key): Likewise.
1407 2004-10-14 Kenichi Handa <handa@m17n.org>
1409 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1411 2004-10-13 Kenichi Handa <handa@m17n.org>
1413 * m17n-X.c (device_open): Be sure to register at least one font
1416 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
1417 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1419 2004-10-12 Kenichi Handa <handa@m17n.org>
1421 * draw.c (alloc_gstring): Fix previous change.
1423 * font-ft.c (ft_list_generic): Fix for the case of not
1426 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1428 * font.c (mfont_list): If no font is found, return NULL.
1429 (load_font_encoding_table): Put entries of nil registry first.
1430 (find_encoding): Adjust for the above change.
1432 2004-10-11 Kenichi Handa <handa@m17n.org>
1434 * m17n-gui.h (mfont_list): Adjust prototype.
1436 * m17n-X.c (xfont_list): New arg maxnum.
1438 * font.h (struct MFontDriver): Change prototype of <list>.
1440 * font-ft.c (fc_generic_family_list): Delete it.
1441 (Mserif, Msans_serif, Mmonospace): Delete them.
1442 (M_generic_family_info): New variable.
1443 (enum GenericFamilyType): New enum.
1444 (struct GenericFamilyInfo): New struct.
1445 (generic_family_table): New variable.
1446 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1448 (add_font_info): Get style here.
1449 (ft_list_family): Don't initialize fc_config here. Don't list
1451 (ft_list_generic): New function.
1452 (ft_select): Pay attention to generic familes here.
1453 (ft_open): Fix calculation of ascent and descent.
1454 (ft_list): Pay attention to generic families.
1455 (mfont__ft_init): Initialize M_generic_family_info,
1456 generic_family_table, and fc_config..
1457 (mfont__ft_fini): Finalize generic_family_table.
1459 * draw.c (compose_glyph_string): Use more constant font for
1460 glyphs. Adjust for the member change in MGlyph.
1461 (layout_glyph_string): Adjust for the member change in MGlyph.
1462 (alloc_gstring): Intilize scracth_glyph to avoid
1463 compose_glyph_string on it.
1464 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1465 (mdraw_coordinates_position): Fix previous change.
1467 * internal-gui.h (glyph_category): New enum.
1468 (MGlyph): Change type of <category> to enum glyph_category.
1470 * face.c (mface__realize): Delete args langauge and charset.
1471 (mface__for_chars): Fix for the case that glyphs have different
1473 (mface__update_frame_face): Adjust for mface__realize change.
1475 * face.h (mface__realize): Adjust prototype.
1477 2004-10-05 Kenichi Handa <handa@m17n.org>
1479 * language.c (mlang__init): Add Akan.
1481 2004-10-04 Kenichi Handa <handa@m17n.org>
1483 * font-ft.c (add_font_info): Add instead of push the element.
1484 (ft_list_family): For generic fonts, try all
1485 substituted. families.
1487 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1488 (run_rule): Don't update cluster range here.
1489 (run_command): Update cluster range on appending a glyph.
1490 (run_otf): Update cluster range for glyphs generated by OTF.
1492 2004-10-02 Kenichi Handa <handa@m17n.org>
1494 * m17n-X.c (device_open): Handle Mfont key in PLIST.
1496 2004-09-30 Kenichi Handa <handa@m17n.org>
1498 * font-ft.c (ft_select): Ignore family on calling mfont__score.
1500 2004-09-30 Kenichi Handa <handa@m17n.org>
1502 * font.h: Include <fontconfig/fontconfig.h>.
1503 (MFTInfo): New member langset.
1504 (mfont__encoding_list): Extern it.
1506 * font.c (mfont__encoding_list): New function.
1507 (mdebug_dump_font_list): New function.
1509 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1510 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1512 (ft_family_list): New variable.
1513 (set_font_info): New arg basep. Callers changed.
1514 (fc_list): Check the return value of FcPatternGetString.
1515 (add_font_info): New arg plist. Callers changed. Update
1517 (ft_list_family): New function (merged fc_list and ft_list_all).
1518 (ft_select): Use ft_list_family.
1519 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
1521 (mfont__ft_init): Initialize above new variables.
1522 (mfont__ft_fini): Free ft_family_list.
1523 (STRDUP_LOWER): New macro.
1524 (set_font_info): Use STRDUP_LOWER.
1525 (ft_list_family): Avoid duplicate addition of font path. Use
1527 (fc_decode_prop): Fix typo.
1529 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1530 (xfont_registry_list): Change argument disp_info to frame.
1532 (xfont_list_all): New function.
1533 (xfont_list): If FONT is not NULL, check all fonts.
1535 2004-09-28 Kenichi Handa <handa@m17n.org>
1537 * m17n-X.c (MXFont, MXFontList): New types.
1538 (MDisplayInfo): Delete members font_registry_list,
1539 iso8859_1_family_list, iso10646_1_family_list, new members
1540 font_list, base_font_list.
1541 (free_display_info): Adusted for the change of MDisplayInfo.
1542 (xfont_driver): Initialize with xfont_list.
1543 (font_compare): New function.
1544 (build_font_list): Deleted.
1545 (xfont_registry_list): New function.
1546 (xfont_select): Use xfont_registry_list.
1547 (xfont_list): New function.
1548 (device_open): Adusted for the change of MDisplayInfo.
1550 * font-ft.c (add_font_info): New arg languages. Callers changed.
1551 (fc_list): Get languages from fonts..
1552 (ft_list_all): Renamed from ft_list. Callers changed.
1553 (ft_list): New function.
1554 (mfont__ft_driver): Initalize with ft_list.
1556 * font.c (mfont_list): New function.
1558 * font.h (struct MFontDriver): New member `list'.
1559 (MFTInfo): New member languages.
1561 * m17n-gui.h (mfont_list): Extern it.
1563 2004-09-27 Kenichi Handa <handa@m17n.org>
1565 * internal-gui.h (struct MGlyphString): Delete members mt,
1566 sub_width, sub_lbrearing, sub_rbearing, and region.
1568 * draw.c (MSubTextExtents): New type.
1569 (layout_glyphs): New arg extents. Set its members.
1570 (layout_glyph_string): Adjusted for the above change.
1571 (alloc_gstring): Don't set gstring->mt.
1572 (truncate_gstring): Call line_break function with mt instead of
1575 2004-09-22 Kenichi Handa <handa@m17n.org>
1577 * mtext.c (count_utf_16_chars): Count each code of invalid
1580 2004-09-19 Kenichi Handa <handa@m17n.org>
1582 * mtext.c (default_utf_16, default_utf_32): Rename them to
1583 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
1586 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1589 2004-09-13 Kenichi Handa <handa@m17n.org>
1591 * draw.c (Mlatin): Don't declare it here.
1592 (visual_order): Fix reordering of combining characters.
1593 (compose_glyph_string): Fix detection of script.
1594 (layout_glyphs): Don't fix reordering of combining characters
1596 (layout_glyph_string): Pay attention to
1597 control->disable_overlapping_adjustment.
1598 (truncate_gstring): Include at least on character in a line.
1599 (get_gstring): Always scan one full line.
1600 (mdraw__init): Don't initialize Mlatin here.
1601 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
1602 have a font, use ascent/descent of an ASCII font. Allow
1603 ink_array_return and logical_array_return to be NULL.
1604 (mdraw_coordinates_position): Fix iteration.
1606 * font-ft.c (MFTtoProp): Member completely changed.
1607 (ft_to_prop): Adjusted for the above change.
1608 (ft_to_prop_size): Likewise.
1609 (set_font_info): Adjusted for the change of MFTtoProp.
1610 (fc_generic_family_list): New variable.
1611 (fc_list): Add special handling of generic font names.
1612 (mfont__ft_init): Adjusted for the change of MFTtoProp.
1613 Initialize fc_generic_family_list.
1614 (mfont__ft_fini): Don't free ft_to_prop. Free
1615 fc_generic_family_list.
1616 (FC_vs_M17N_font_prop): New type.
1617 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1618 (fc_decode_prop, fc_encode_prop): New functions.
1619 (mfont__ft_parse_name): Use fc_decode_prop.
1620 (mfont__ft_unparse_name): Use fc_encode_prop.
1622 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1623 (MWDevice): Add member realized_font_list.
1624 (free_display_info): Don't free disp_info->realized_font_list.
1625 (free_device): Free device->realized_fontset_list.
1626 (xft_find_metric): Use gstring->frame instead of rfont->frame.
1627 (device_open): Don't initialize disp_info->realized_font_list.
1628 (device_open): Initialize device->realized_font_list and set it to
1629 frame->realized_font_list.
1631 * fontset.c (try_font_group): New function.
1632 (mfont__lookup_fontset): Use try_font_group.
1634 * font.c (common_weight): Change the order of "regular".
1636 * face.c (Mlatin): Don't make it static.
1637 (mface__realize): Be sure to set work_gstring.frame.
1638 (mface__for_chars): Likewise.
1640 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1643 * internal-gui.h (Mlatin): Extern it.
1645 * m17n-gui.h (MDrawControl): New member
1646 disable_overlapping_adjustment.
1648 2004-09-06 Kenichi Handa <handa@m17n.org>
1650 * font-flt.c (run_otf): Fix typo ('}'->']').
1652 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1653 (COMBINING_PRECOMPUTED_P): New macros.
1655 * draw.c (layout_glyphs): Handle precomputed combining code.
1657 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1658 precomupted combining code.
1660 2004-09-03 Kenichi Handa <handa@m17n.org>
1662 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1665 2004-08-27 Kenichi Handa <handa@m17n.org>
1667 * face.c (mface_put_prop): If the new value is the same as the
1668 current one, don't increment frame->tick.
1670 2004-08-25 Kenichi Handa <handa@m17n.org>
1672 * fontset.c (mfontset): Initialize font_spec_list member.
1673 (mfontset_copy): Load fontset if necessary.
1675 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1676 'metrics' to for C++.
1678 * draw.c (mdraw_glyph_info): Adjusted for the member name change
1681 2004-08-16 Kenichi Handa <handa@m17n.org>
1683 * Version 1.1.0 released.
1685 2004-08-13 Kenichi Handa <handa@m17n.org>
1687 * language.c (mlang__init): Add Dhivehi.
1689 * m17n-gui.c (Mx, Mfreetype): Delete it.
1690 (m17n_init_win): Don't initialize Mx and Mfreetype here.
1692 * m17n-gui.h (Mfreetype, Mxft): Extern them.
1693 (mfont_resize_ratio): Extern it.
1694 (MDrawGlyphInfo): New member logical_width;
1695 (MDrawGlyph): New type.
1696 (mdraw_glyph_list): Prototype adjusted.
1698 * m17n-X.c (xfont_open): Set type and fontp members.
1699 (xft_open): Likewise.
1701 * internal-gui.h (Mx, Mfreetype): Delete extern.
1703 * font.h (struct MRealizedFont): New member type and fontp.
1705 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1706 (Mx, Mfreetype): Declare here.
1707 (Mxft): New variable.
1708 (mfont_resize_ratio): New function.
1710 * font-ft.c (ft_open): Set type and fontp members.
1712 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
1715 2004-08-11 Kenichi Handa <handa@m17n.org>
1717 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1720 2004-08-06 Kenichi Handa <handa@m17n.org>
1722 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1725 * font-flt.c (run_otf): Print debugging information if necessary.
1727 2004-08-05 Kenichi Handa <handa@m17n.org>
1729 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
1730 positioning_type 5 and 6. Switch simplified.
1732 2004-08-04 Kenichi Handa <handa@m17n.org>
1734 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1736 2004-08-02 Kenichi Handa <handa@m17n.org>
1738 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1739 set val to 1 even if it is greater than 1.
1741 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1743 2004-07-29 Kenichi Handa <handa@m17n.org>
1745 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1746 debugging information.
1748 * internal.h (MDEBUG_PRINT5): New macro.
1750 * draw.c (layout_glyphs): Don't combine a zero width glyph with
1751 the previous one if the zero width glyph has left or right
1754 2004-07-26 Kenichi Handa <handa@m17n.org>
1756 * m17n-X.c (xft_render): Pay attention to members left_padding and
1757 right_padding of MGlyph.
1759 * draw.c (visual_order): Allocate one more elements for arrays as
1760 a workaround of fribidi bug.
1761 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1762 instead of MGlyph->bidi_sensitive.
1763 (layout_glyph_string): Pay attentinon to
1764 control->orientation_reversed when padding at the head or tail.
1765 Fix adjustment of space glyph width.
1766 (get_gstring): If cursor_width or cursor_bidi is changed, don't
1769 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1770 instead of MGlyph->bidi_sensitive.
1772 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1774 2004-07-26 Kenichi Handa <handa@m17n.org>
1776 * draw.c (visual_order): Don't treat combined glyphs specially.
1777 (layout_glyphs): Don't get metrics glyphs that are already ready.
1778 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
1779 width with the previous one.
1780 (draw_background): Fix bar cursor position on a r2l glyph.
1782 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1783 (run_rule): Fix place of updating cluster_begin_pos and
1784 cluster_end_pos here.
1785 (run_otf): Don't set left_padding.
1787 * font-ft.c (adjust_anchor): Type of argument `code' changed.
1789 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1790 Fix handling of GPOS.
1791 (mfont__ft_drive_gpos): Delete this function.
1793 * font.h (mfont__ft_drive_otf): Renamed back from
1794 mfont__ft_drive_gsub.
1795 (mfont__ft_drive_gpos): Delete extern.
1797 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1798 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1800 2004-07-23 Kenichi Handa <handa@m17n.org>
1802 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1803 the same bidi level.
1805 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1807 2004-07-22 Kenichi Handa <handa@m17n.org>
1809 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1811 2004-07-20 Kenichi Handa <handa@m17n.org>
1813 * draw.c (render_glyphs): Fix checking of g->code validity.
1815 * face.c (mface__realize): Set g.type.
1817 2004-07-18 Kenichi Handa <handa@m17n.org>
1819 * Makefile.am: Prepend ${top_srcdir} to all *.la in
1822 * m17n-gui.c (mframe): Print error message give by dlopen to
1825 2004-07-16 Kenichi Handa <handa@m17n.org>
1827 * draw.c (compose_glyph_string): Improve the way of deciding a
1828 script. For a character that doesn't have script property, use
1829 the last non-latin script.
1831 * font-ft.c (fc_list): Cancel previous change.
1832 (mfont__ft_init): Add more entries in ft_to_prop_name.
1834 2004-07-15 Kenichi Handa <handa@m17n.org>
1836 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1837 previous or next character glyphs.
1839 2004-07-14 Kenichi Handa <handa@m17n.org>
1841 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1842 of type GLYPH_SPACE.
1844 * fontset.c (mfont__lookup_fontset): If glyph type is
1845 GLYPH_SPACE, get codes for SPACE.
1847 * internal-gui.h (Mfont): Delete extern.
1849 * m17n-gui.h (Mfont): Delete duplicated extern.
1851 2004-07-13 Kenichi Handa <handa@m17n.org>
1853 * font-ft.c (DEVICE_DELTA): New macro.
1854 (adjust_anchor): New function.
1855 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
1857 (mfont__ft_drive_gpos): New function.
1859 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1860 (FontLayoutContext): Delete member `rfont'.
1861 (run_otf): Set g->otf_cmd. Call
1862 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
1863 only whne HAVE_OTF is defined.
1865 * fontset.c: Include "config.h".
1867 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1868 (MGlyph): New member otf_cmd.
1870 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1871 (mfont__ft_drive_gpos): Extern it.
1873 * face.c: Include "config.h".
1875 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1877 * input-gui.c: Include "config.h".
1879 * plist.c: Include "config.h".
1881 2004-07-06 Kenichi Handa <handa@m17n.org>
1883 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1884 internal-gui.h: Cancel previous changes.
1886 * m17n-gd.h: Delete it.
1888 * Makefile.am (libm17n_core_la_LIBADD): New variable.
1889 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1890 @XML2_LD_FLAGS@ to above.
1891 (libm17n_la_LIBADD): Add -ldl.
1892 (libm17n_la_LDFLAGS): Add -export-dynamic.
1893 (X_LD_FLAGS): Fix the order of linking.
1894 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1895 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1896 (libm17n_X_la_LDFLAGS): Add -module.
1897 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1898 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1899 (libm17n_gd_la_LDFLAGS): Add -module.
1900 (include_HEADERS): Delete m17n-gd.h.
1902 2004-06-30 Kenichi Handa <handa@m17n.org>
1904 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1905 (MDeviceLibraryInterface): Delete it.
1906 (register_device_library): Delete it.
1907 (m17n__device_library_list): Renamed from device_library_list.
1909 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1910 (m17n_init_win): Adjust prototype.
1912 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1913 (m17n_init_gd): New function.
1915 * m17n-gd.h: New file.
1917 * m17n-X.h: Include <m17n-gui.h>.
1918 (m17n_init_X): Extern it.
1919 (M17N_INIT): Redefine it.
1921 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1922 (m17n_init_X): New function.
1924 * internal-gui.h (m17n__device_library_list): Extern it.
1925 (struct MDeviceDriver): New members initialized, init, and fini.
1927 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1929 (libm17n_X_la_LIBADD): Delete aboves.
1930 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1931 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1932 (libm17n_gd_la_LDFLAGS): Delete it.
1933 (include_HEADERS): Add m17n-gd.h.
1935 2004-06-25 Kenichi Handa <handa@m17n.org>
1937 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1938 (libm17n_gd_la_LDFLAGS): Cancel previous change.
1940 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1942 * font-ft.c (fc_list): If FcFontList finds no font, try
1945 * draw.c (compose_glyph_string): Terminate the last loop after
1946 doing default combining if necessary.
1948 2004-06-24 Kenichi Handa <handa@m17n.org>
1950 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1952 * character.c (mchar_define_property): Add const to an arg.
1954 * charset.c (mchar_define_charset): Add const to an arg.
1956 * coding.c (MCodingSystem): Add const to an arg or decoder.
1957 (finish_decoding): Add const to an arg.
1958 (decode_coding_charset, decode_coding_utf_8)
1959 (decode_coding_utf_16, decode_coding_utf_32)
1960 (decode_coding_iso_2022, decode_coding_sjis)
1961 (mconv_define_coding): Likewise.
1963 * m17n-X.c (xft_find_metric): Delete unused variable.
1965 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1968 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1971 * mtext.c (count_utf_8_chars, count_utf_16_chars)
1972 (mtext__from_data, mtext_from_data): Add `const' to an arg.
1974 * mtext.h (mtext__from_data): Ajust prototype.
1976 2004-06-23 Kenichi Handa <handa@m17n.org>
1978 * draw.c (compose_glyph_string): Always get glyph codes by
1980 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1981 (mdraw_glyph_list): New function.
1983 * font-flt.c (mfont__flt_run): Be sure to call
1984 rfont->driver->encode_char.
1986 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1987 (ft_encode_char): Delete arg C.
1988 (ft_render): Don't call FT_Get_Char_Index.
1990 * font.c (mfont__encodable_p): Delete it.
1991 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1993 * font.h (struct MFontDriver): Delete arg C of encode_char.
1994 (mfont__encodable_p): Delete extern.
1996 * m17n-X.c (xfont_encode_char): Delete arg C.
1997 (xft_find_metric): Don't cal FT_Get_Char_Index.
1998 (xft_render): Likewise.
2000 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
2002 (mdraw_glyph_list): Extern it.
2004 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
2006 2004-06-22 Kenichi Handa <handa@m17n.org>
2008 * m17n-gui.h (mfontset_lookup): Extern it.
2010 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
2012 * fontset.c (realize_fontset_elements)
2013 (free_realized_fontset_elements, update_fontset_elements): New
2015 (mfont__realize_fontset): Call realize_fontset_elements.
2016 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
2017 (mfont__lookup_fontset): If a fontset was modified, update
2018 the realized fontset.
2019 (mfontset_modify_entry): Increment fontset->tick.
2020 (mfontset_lookup): New function.
2022 2004-06-21 Kenichi Handa <handa@m17n.org>
2024 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
2026 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
2027 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
2028 length of source text 0.
2030 2004-06-21 Kenichi Handa <handa@m17n.org>
2032 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
2033 (compare): Pay attention to format other than utf-8.
2034 (copy): Delete this function.
2035 (count_by_utf_8, count_by_utf_16, insert): New functions.
2036 (count_utf_16_chars): Fix handling of a surrogate pair.
2037 (find_char_forward, find_char_backward): Likewise.
2038 (mtext__from_data): Delete unnecessary check. Fix number of
2040 (mtext_from_data): Don't count items.
2041 (mtext_ref_char): Optimize the code.
2042 (mtext_set_char): Pay attention to format other than utf-8.
2043 (mtext_cat_char): Likewise.
2044 (mtext_dup): Don't call copy, instead do allocation here.
2045 (mtext_cat): Call insert instead of copy.
2046 (mtext_ncat): Likewise.
2047 (mtext_cpy): Delete character at first and call insert instead of
2049 (mtext_ncpy): Likewise.
2050 (mtext_copy): Likewise.
2051 (mtext_duplicate): Call insert instead of copy.
2052 (mtext_del): Pay attention to format other than utf-8.
2053 (mtext_ins): Simply call insert.
2054 (mtext_ins_char): Pay attention to format other than utf-8.
2055 (mtext_tok): Call insert instead of copy.
2056 (mtext_text): Call UNIT_BYTES.
2058 * textprop.c (mtext__adjust_plist_for_change): New function.
2060 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
2061 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
2062 (CHAR_UNITS_AT): Fix typo.
2063 (CHAR_UNITS_BY_HEAD): Fix typo.
2064 (STRING_CHAR_AND_UNITS): Fix typo.
2066 * internal.h (MTEXT_READ_ONLY_P): New macro.
2068 * mtext.h (mtext__replace): Delete the extern.
2069 (mtext__adjust_foramt): Adjust prototype.
2071 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2072 if possible. Otherwise make a copy of mmt.
2074 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2077 2004-06-18 Kenichi Handa <handa@m17n.org>
2079 * character.h (CHAR_STRING_UTF16): Fix syntax.
2081 2004-06-16 Kenichi Handa <handa@m17n.org>
2083 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2084 (libm17n_X_la_LIBADD): Delete it.
2085 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2087 * m17n-X.c (device_open): Add parens in `if' condition.
2089 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2090 (DEC_POSITION): Likewise.
2091 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2093 2004-06-15 Kenichi Handa <handa@m17n.org>
2095 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2098 * draw.c (compose_glyph_string): If langauge is specified, call
2099 mface__for_chars even if a text is all latin. Fix condition for
2100 setting non_ascii_found.
2102 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2104 * m17n.h (minput_char_to_key): Delete extern.
2106 * m17n-gui.h (minput_event_to_key): Cancel previous change.
2108 * m17n-gui.c (null_device_open): Set several members of frame.
2110 2004-06-14 Kenichi Handa <handa@m17n.org>
2112 * m17n-gui.h (minput_event_to_key): Delete extern.
2114 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2116 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2118 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2120 2004-06-08 Kenichi Handa <handa@m17n.org>
2122 * character.c (mchar_put_prop): Don't increment the ref-count of
2125 2004-06-04 Kenichi Handa <handa@m17n.org>
2127 * m17n-core.c (mdebug__register_object): New function.
2128 (mdebug__unregister_object): Likewise.
2130 * internal.h (mdebug__register_object, mdebug__unregister_object):
2132 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2135 * charset.c (mcharset__load_from_database): Don't call
2136 mconv__register_charset_coding here.
2138 * coding.c (find_coding): Get a real name from an element of
2139 coding_definition_list.
2140 (mconv__register_charset_coding): Set the real name at the top of
2142 (mcoding__load_from_database): Likewise.
2143 (mconv_list_codings): Adjusted for the above change.
2145 2004-06-03 Kenichi Handa <handa@m17n.org>
2147 * coding.c (find_coding): Find by canonicalized name. Don't have
2148 to modify the element of coding_definition_list by
2150 (mconv__define_coding_from_charset): Delete it.
2151 (mconv__register_charset_coding): Canonicalize sym.
2152 (mcoding__load_from_database): Register plist modified by
2155 * coding.h (mconv__define_coding_from_charset): Don't extern it.
2157 * font-ft.c (ft_open): Fix setting of rfont->descent.
2159 2004-06-02 Kenichi Handa <handa@m17n.org>
2161 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2162 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2163 (xlfd_unparse_name): Renamed from xfont_build_name.
2164 (mfont__init): Initialized Mfontconfig.
2165 (mfont__free_realized): Unconditionally unref rfont->info.
2166 (mfont__select): Free `this' if it's not best.
2167 (mfont__open): Don't check frame->realized_font_list.
2168 (mfont__parse_name_into_font): New function.
2169 (Mfontconfig): New variable.
2170 (mfont_from_name): Call mfont_parse_name.
2171 (mfont_name): Call mfont_unparse_name.
2172 (mdebug_dump_font): Likewise.
2174 * font.h (struct MFontDriver): Delete members parse_name and
2176 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2177 (mfont__parse_name_into_font): Extern it.
2179 * font-ft.c: Include "symbol.h".
2180 (close_ft): Unconditionally free filename and charmap_list of
2182 (ft_open): Duplicate base->filename. Increment ref-count of
2183 ft_info->charmap_list. Free ft_info->charmap_list and
2184 ft_info->filename on error.
2185 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2187 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2189 (enum xlfd_field_idx): Moved to font.c.
2190 (split_font_name, build_font_name): Likewise.
2191 (build_font_list): Call mfont__parse_name_info_font.
2192 (xfont_open): Call mfont__unparse_name. Free name.
2193 (xfont_parse_name, xfont_build_name): Moved to font.c
2194 (xft_select): Prototype deleted.
2195 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2196 Call mfont_pase_name.
2198 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2199 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2202 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2205 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2207 2004-06-01 Kenichi Handa <handa@m17n.org>
2209 * fontset.c (mfontset_modify_entry): Pay attention to the case
2210 that fontset->font_spec_list is NULL.
2212 2004-05-31 Kenichi Handa <handa@m17n.org>
2214 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2216 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2218 * font.c (mfont__select): Print score the a font for debugging.
2220 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2222 * coding.c (reset_coding_sjis): Check kanji and kana instead of
2223 kanji_sym and kana_sym.
2225 2004-05-28 Kenichi Handa <handa@m17n.org>
2227 * Makefile.am (VINFO): New variable.
2228 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2229 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2231 2004-05-27 Kenichi Handa <handa@m17n.org>
2233 The following chanages are to make device dependent functions
2234 accessible only from MDeviceDriver structure, and to add GD and
2235 null device drivers. Font drivers get also device dependent.
2237 * m17n.c (m17n_init): Increament shell_initialized.
2238 (m17n_fini): Decremented shell_initialized.
2240 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2242 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2243 (Mwidget, Mcolormap, Mx): Extern them.
2245 * m17n-gui.c: Include <dlfcn.h> and "config.h".
2246 (free_frame): Call frame->driver->close instead of
2248 (DLOPEN_SHLIB_EXT): New macro.
2249 (MDeviceLibraryInterface): New type.
2250 (device_library_list): New variable.
2251 (register_device_library): New function.
2252 (null_device): New variable.
2253 (null_device_close, null_device_get_prop)
2254 (null_device_realize_face, null_device_free_realized_face): New
2256 (null_driver): New variable.
2257 (null_device_init, null_device_fini, null_device_open): New
2259 (null_interface): New variable.
2260 (Mfreetype, Mdevice): Declare them.
2261 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
2262 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2263 Mwin__Close_Device. Register drivers for Mx and Mgd.
2264 (m17n_fini_win): Decremented win_initialized. Call "fini"
2265 function of all opened devices. Don't call mwin__fini.
2266 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2268 (mframe): Handle Mdevice key of PLIST.
2269 (mframe_get_prop): Call frame->device->get_prop instead of
2270 mwin__device_get_prop.
2272 * m17n-gd.c: New file.
2274 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2275 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2277 * m17n-core.c (m17n_init_core): Increate core_initialized.
2278 (m17n_fini_core): Decremented core_initialized.
2280 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2281 (Mcolormap): Don't extern them here.
2283 * m17n-X.c (FRAME_DEVICE): New macro.
2284 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2285 (free_display_info): Use MPLIST_DO.
2286 (free_device): Free rface->info.
2287 (xft_close): Delete it.
2288 (device_init): Renamed from mwin__init.
2289 (device_fini): Renamed from mwin__fini.
2290 (device_open): Renamed from mwin__open_device.
2291 (x_driver): New variable.
2292 (MXFontInfo): Delete member frame, add member display.
2293 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2294 Don't declare them here.
2296 * internal-gui.h (MDeviceType): New enum.
2297 (MWDefice): Delete it.
2298 (struct MFrame): Change type of device to void *. New members
2299 device_type, driver, font_driver_list.
2300 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2301 (MDeviceDriver): New type.
2302 (Mx, Mgd, Mfreetype): Extern them.
2303 (mwin__XXX): Delete all of them.
2305 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2307 (win_destroy_ic): Likewise.
2308 (adjust_window_and_draw): Likewise.
2309 (win_callback): Likewise.
2310 (Mxim): Declare it here.
2311 (minput_event_to_key): Call M_CHECK_READABLE.
2313 * fontset.c (mfont__lookup_fontset): Delete local variable
2316 * font.h (struct MFontDriver): Delete member close, add members
2317 parse_name and build_name.
2318 (mfont__driver_list): Delete extern.
2319 (mfont__close): Delete extern.
2321 * font.c (mfont__init): Don't set mfont__driver_list.
2322 (mfont__fini): Don't unref mfont__driver_list.
2323 (mfont__select): Try font drivers in frame->font_driver_list. Set
2324 driver member of a realized font.
2325 (mfont__close): Delete it.
2326 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2327 functions of the default frame.
2329 * font-ft.c (close_ft): Check ft_info->ft_face and work
2331 (add_font_info): Allocate ft_info by M17N_OBJECT.
2332 (ft_close): Delete it.
2333 (mfont__ft_driver): Don't set ft_close.
2334 (ft_select): Increment ref-count of best_font.
2335 (ft_open): Decremented ref-count of base. On error, call
2336 FT_Done_Face and free ft_info.
2337 (ft_find_metric): Always use XXX_MONO in load_flags.
2338 (ft_render): Fix setting of width. Call
2339 frame->driver->draw_points instead of mwin__draw_points.
2340 (ft_to_prop): Don't set mfont__driver_list.
2341 (mfont__ft_fini): Just unref ft_info.
2343 * face.c (mface__init): Exchange foreground and background of
2344 mface__default. Call mface_put_prop to set hline of
2346 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2347 (mface__free_realized): Don't call mwin__free_realized_face.
2349 * draw.c (Mdepth): Don't declare it here.
2350 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2351 (render_glyphs, render_glyph_string): Likewise.
2352 (mdraw__init): Don't set Mdepth.
2353 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2355 (mdraw_text_per_char_extents): Return 0 on success and -1 on
2357 (mdraw_text_items): Check FRAME is writable.
2358 (mdraw_per_char_extents): Implement body.
2360 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2362 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2363 (GUI_SOURCES): Delete it.
2364 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2365 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2366 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2367 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2368 (linkgui_LDADD): Set to libm17n-gui.la
2369 (linkgui_LDFLAGS): New target.
2370 (SRC): Include ${libm17n_gui_la_SOURCES} and
2371 ${libm17n_gd_la_SOURCES}.
2373 2004-05-24 Kenichi Handa <handa@m17n.org>
2375 * draw.c (draw_background): Don't draw background even if
2376 rface->face.property[MFACE_BACKGROUND] is not Mnil.
2378 2004-05-22 Kenichi Handa <handa@m17n.org>
2380 * m17n-X.c (xft_open_font): Fix anti_alias setting.
2382 2004-05-20 Kenichi Handa <handa@m17n.org>
2384 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2386 * m17n-gui.c: Include "plist.h".
2387 (mframe): If PLIST is NULL, initialize it to emply plist.
2389 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2390 (xft_driver): New variable.
2391 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2392 (xft_find_metric, xft_render): New function.
2393 (mwin__init): Adjusted for the new mfont__driver_list.
2394 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
2395 generated face to PARAM.
2396 (mwin__realize_face): Fix setting of box colors. Don't call hook
2398 (mwin__draw_hline): New function.
2399 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2400 (mwin__xft_render): Delete these function.
2402 * internal-gui.h (struct MFrame): New member tick.
2403 (struct MGlyphString): New member tick.
2404 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2405 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2406 (mwin__xft_render): Delete extern.
2408 * fontset.c (mfont__lookup_fontset): Make the code simpler.
2409 (mfontset): Always increment the reference count of returned
2412 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2413 (MFTInfo): Moved to font.h.
2414 (ft_iso8859_1_font_list): Delete this variable.
2415 (set_font_info): Don't set font->property[MFONT_TYPE].
2416 (set_font_info): Don't udpate ft_iso8859_1_font_list.
2417 (add_font_info): Change type to void.
2418 (fc_list): Change anme from xft_list. Caller changed. Include
2419 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2420 (mfont__ft_driver): Change name from ft_driver. Caller changed.
2421 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2422 (close_ft): Don't call mwin__xft_close. Unref
2423 ft_info->extra_info.
2424 (ft_open): Don't setup ft_info->fontname. Don't call
2426 (ft_find_metric): Don't call mwin__xft_get_metric.
2427 (ft_encode_char): Call rfont->driver->open instead of ft_open.
2428 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
2429 (mfont__ft_init): Adjusted for new mfont__driver_list.
2430 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2432 * font.c (mfont__driver_list): Make it MPlist.
2433 (mfont__init): Adjust initialization of mfont__driver_list.
2434 (mfont__fini): Free mfont__driver_list.
2435 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2436 (mfont__select): Adjusted for the new mfont__driver_list.
2438 * font.h (enum MFontProperty): Delete MFONT_TYPE.
2439 (mfont__drirver_list): Adjust prototype.
2440 (MFTInfo): Move to here from fron.c. Deleve member fontname.
2442 * face.h (struct MFace): Delete member realized_face_list, add
2444 (struct MRealizedFace): Delete member need_update
2445 andnofont_rface, add member non_ascii_list.
2446 (mface__update_frame_face): Extern it.
2448 * face.c (hline_prop_list, box_prop_list, noop_hook): New
2450 (get_hline_create, get_box_create): New functions.
2451 (find_realized_face): Cancel previous change. Arg RFONT deleted.
2453 (free_face): Cancep previous change. Free face->frame_list.
2454 (serialize_hline): Do nothing if hline->width is zero.
2455 (serialize_box): Do nothing if box->width is zero.
2456 (mface__init): Setup all properties of mface__default.
2457 (mface__fini): Free hline_prop_list and box_prop_list.
2458 (mface__realize): Cancel previous change. Update
2459 face->frame_list. Setup rface->non_ascii_list.
2460 (mface__for_chars): Update rface->non_ascii_list.
2461 (mface__free_realized): Free rface->non_ascii_list.
2462 (mface__update_frame_face): New function.
2463 (mface): Initialize face->frame_list.
2464 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
2466 (mface_merge): Likewise.
2467 (mface_put_prop): If key is Mhline or Mbox, get value by
2468 get_hline_create or get_box_create respectively.
2469 (mface_put_prop): Update frame->tick and call
2470 mface__update_frame_face if necessary.
2471 (mface_update): Do nothing if func is noop_hook.
2473 * draw.c (render_glyphs): If a font is not found, use
2474 mwin__draw_empty_boxes.
2475 (alloc_gstring): Initialize gstring->tick.
2476 (get_gstring): Check gstring->tick.
2478 2004-05-17 Kenichi Handa <handa@m17n.org>
2480 * face.c (find_realized_face): Return value changed. If RFONT is
2481 NULL, avoid unnecessary checking.
2482 (free_face): Free face->realized_face_list.
2483 (mface__realize): Adjusted for the change of find_realized_face.
2484 If it returns a realized face that needs update, free it and
2485 realize a new one. Push a new realized face to
2486 frame->realized_face_list instead of appending.
2487 (mface__for_chars): Adjusted for the change of find_realized_face.
2488 Short cut if the required font is in rface->ascii_rface.
2489 (mface_put_prop): Free old value if necessary. Set need_update
2490 member of realized faces to 1.
2492 * face.h (struct MFace): Delete member tick, add member
2494 (struct MRealizedFace): Delete member tick, add member
2497 2004-05-13 Kenichi Handa <handa@m17n.org>
2499 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2501 2004-05-12 Kenichi Handa <handa@m17n.org>
2503 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2505 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2506 parse it XftNameParse.
2508 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2509 (all_fonts_scaned): New variable.
2510 (set_font_info): FAMILY may be Mnil.
2511 (add_font_info): Argument changed.
2512 (xft_list): Call add_font_info in it.
2513 (ft_list): Likewise.
2514 (ft_select): Make it work in the case family is Mnil.
2515 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2516 (mfont__ft_fini): Set all_fonts_scaned to 0.
2518 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2519 that is failed to open.
2521 2004-05-10 Kenichi Handa <handa@m17n.org>
2523 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2524 device's depth is 1 (i.e. monochrome).
2526 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2527 to work around the problem of libtool.
2529 * font-ft.c: Include <freetype/ftbdf.h>.
2530 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2532 (mfont__ft_init): Initialize them.
2533 (ft_iso8859_1_font_list): New variable.
2534 (set_font_info): Detect a font containing iso8859-1 glyphs and
2535 register it in ft_iso8859_1_font_list. If the font is not
2536 scalable, assume it as BDF or PCF font and setup SIZE and RESY
2537 properties of the font from its properties.
2538 (add_font_list): If the font is not scalable, check if it is BDF
2539 or PCF font. If not, ignore it.
2540 (ft_select): If FAMILY is Mnil, return NULL only if the requested
2541 registry is not iso8859-1.
2542 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2543 ft_iso8859_1_font_list.
2544 (ft_find_metric): If the font is not scalable, assume it as BDF
2545 or PCF, and get a metric from its properties.
2546 (mfont__ft_fini): Free ft_iso8859_1_font_list.
2548 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
2550 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2551 (libm17n_la_LDFLAGS): Delete it.
2552 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2553 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2555 2004-05-06 Kenichi Handa <handa@m17n.org>
2557 * draw.c (compose_glyph_string): Fix previous change.
2559 2004-04-30 Kenichi Handa <handa@m17n.org>
2561 * font-ft.c (ft_list): Delete unused variable `result'.
2562 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2564 2004-04-27 Kenichi Handa <handa@m17n.org>
2566 * m17n-X.c: Include config.h
2567 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2568 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2569 (MWDevice) [HAVE_XFT2]: New member xft_draw.
2570 (FRAME_CMAP, FRAME_VISUAL): New macros.
2571 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2572 (xfont_driver): Make it static.
2573 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2574 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2575 info->xft_color_back.
2576 (MXftFontInfo) [HAVE_XFT2]: New type.
2577 (mwin__xft_close) [HAVE_XFT2]: New function.
2578 (mwin__xft_open) [HAVE_XFT2]: New function.
2579 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2580 (mwin__xft_render) [HAVE_XFT2]: New function.
2582 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2583 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2584 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2587 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2589 * font-ft.c: Don't include FT_FREETYPE_H here.
2590 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2591 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2592 (MFTInfo): New member charmap_index.
2593 (MFTInfo) [HAVE_XFT2]: New member xft_info.
2594 (check_otf_filename): Renamed from check_filename. Return value
2596 (ft_set_property): This function deleted.
2597 (set_font_info): New function.
2598 (add_font_list): Argument changed. Add multiple fonts.
2599 (xft_list) [HAVE_XFT2]: New function.
2600 (ft_list) [not HAVE_XFT2]: New function.
2601 (ft_select): Add code for Xft.
2602 (close_ft): Likewise.
2603 (ft_open): Likewise.
2604 (ft_find_metric): Likewise.
2605 (ft_encode_char): Likewise.
2606 (ft_render): Likewise.
2608 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2610 2004-04-26 Kenichi Handa <handa@m17n.org>
2612 * textprop.c (mtext_attach_property): Declare the return type as
2615 2004-04-21 Kenichi Handa <handa@m17n.org>
2617 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2619 2004-04-09 Kenichi Handa <handa@m17n.org>
2621 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2623 (load_command): Setup above members.
2625 2004-04-05 Kenichi Handa <handa@m17n.org>
2627 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2629 2004-03-30 Kenichi Handa <handa@m17n.org>
2631 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2634 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2635 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2637 2004-03-29 Kenichi Handa <handa@m17n.org>
2639 * Version 1.0 Patch Level 2 released.
2641 2004-03-29 Kenichi Handa <handa@m17n.org>
2643 * charset.c (make_charset): Set charset->fully_loaded and
2644 charset->simple correctly. Don't try to get charset->min_char and
2645 charset->max_char for a charset of method subset and superset.
2646 Don't load a mapping file here.
2647 (mcharset__init): Set unified_max.
2648 (mcharset__load_from_database): Free a working plist.
2650 * coding.c (mcoding__fini): Free all malloced data.
2652 * input-gui.c (win_create_ic): Set control.as_image for preediting
2655 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2656 `count') to initialize the array.
2658 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2661 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2663 (mwin__create_window): Fix bug of setting a background pixel of a
2665 (mwin__adjust_window): Clear the window before drawing.
2667 * m17n-core.c (mdebug__report_object): Free array->objectes if
2669 (m17n_init_core): Don't set report_header_printed to 0 here.
2670 Fix debugging information.
2671 (m17n_fini_core): Set report_header_printed to 0 here.
2673 * m17n-core.h (mplist_deserialize): Extern it.
2675 * m17n-gui.c (m17n_fini_win): Fix debugging information.
2677 * m17n.c (m17n_fini): Fix debugging information.
2679 * mtext.c (mtext__adjust_foramt): New function.
2681 * mtext.h (mtext__adjust_foramt): Extern it.
2683 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2685 * plist.h (mplist__deserialize): Don't extern it.
2687 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
2688 elements of symbol_table to NULL. Report about created and freed
2689 symbols if MDEBUG_FINI is set.
2691 2004-03-22 Kenichi Handa <handa@m17n.org>
2693 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2695 * m17n.c (m17n_init): Fix the way of checking merror_code.
2697 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2699 2004-03-22 Kenichi Handa <handa@m17n.org>
2701 * fontset.c (realize_font_group): Adjust the font size by
2702 mfont__resize before selecting a font.
2704 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2706 2004-03-19 Kenichi Handa <handa@m17n.org>
2708 * Version 1.0 Patch Level 1 released.
2710 2004-03-19 Kenichi Handa <handa@m17n.org>
2712 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2714 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2716 2004-03-19 Kenichi Handa <handa@m17n.org>
2718 Re-apply the changes forgotten in the released version.
2720 * charset.c (mcharset__load_from_database): Call
2721 mchar_define_charset.
2723 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2724 (mconv_encode_range): Put Mcoding text property.
2726 2004-03-18 Kenichi Handa <handa@m17n.org>
2728 * draw.c (Mdepth): New variable.
2729 (visual_order): Delete unused local var `pos'.
2730 (compose_glyph_string): Fix for the case that gstring->glyphs is
2731 realloced. Stop generating glyphs at TO. Fix handling of
2733 (layout_glyphs): Get metrics of all glyphs in advance. Set
2734 lbearing and rbearing of base of composition glyph correctly.
2735 Handle left-overhang glyphs correctly.
2736 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
2738 (dump_combining_code): Change the defualt off_x character to ".".
2739 (mdraw__init): Initialize Mdepth.
2741 * face.c (work_gstring): New variable
2742 (mface__init): Initialize work_gstring.
2743 (mface__fini): Free work_gstring.glyphs.
2744 (mface__realize): Don't handle videomode property here. Adjusted
2745 for the change of mfont__get_metric.
2746 (mface__for_chars): Adjusted for the change of mfont__get_metric.
2748 * face.h (enum face_gc): Moved to m17n-X.c.
2750 * font.h (struct MFontDriver): Arguments of find_metric changed.
2751 (mfont__select): Prototype adjusted.
2752 (mfont__get_metric): Likewise.
2753 (mfont__ft_drive_otf): Likewise.
2754 (mfont__flt_run): Likewise.
2756 * font.c (mfont__select): New argument layouter. If layouter is
2757 different in the registered font, make a new copy of realized
2759 (mfont__get_metric): Argument changed. Get metrics of multiple
2761 (mfont_find): Call mfont__select with layouter as Mnil.
2763 * font-flt.c (FontLayoutContext): New member rfont.
2764 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2765 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
2767 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
2769 (NUM_POINTS): New macro.
2770 (MPointTable): New type.
2771 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2772 (mfont__ft_drive_otf): New argument rfont.
2774 * fontset.c (realize_font_group): Adjusted for the changed of
2776 (check_fontset_element): This function deleted.
2778 * input-gui.c (adjust_window_and_draw): Locate a preedit window
2779 off the parent window if the preedit text is zero length.
2781 * internal-gui.h (struct MFrame): New members foreground,
2782 background, videomode, font.
2783 (struct MGlyphString): New member anti_alias.
2784 (MDrawPoint): New type.
2785 (mwin__draw_bitmap): Prototype deleted.
2786 (mwin__draw_points): Prototype added.
2788 * m17n-gui.h (MDrawControl): New member anti_alias.
2790 * m17n-gui.c (free_frame): Free frame->font.
2791 (mframe): Set the fontset of frame->face to the default fontset.
2793 * m17n-X.c (RGB_GC): New type.
2794 (enum gc_index): Renamed from enum face_gc. Member names changed.
2796 (struct MWDevice): Members foreground and background deleted. New
2797 member scratch_gc, gc_list.
2798 (DEFAULT_FONT, FALLBACK_FONT): New macros.
2799 (free_device): Free GCs in device->gc_list.
2800 (get_rgb_gc): New function.
2801 (get_gc): Renamed and argument changed from get_color.
2802 (get_gc_for_anti_alias): New function.
2803 (xfont_find_metric): Arguments changed. Get metrics of multiple
2805 (set_region): Argument changed. Caller changed.
2806 (xfont_render): Allways set a font in gc.
2807 (x_error_handler, x_io_error_handler): Define only if
2808 X_SET_ERROR_HANDLER is defined.
2809 (mwin__open_device): Create device->scratch_gc. Set members
2810 foreground, background, and videomode of frame. Call
2811 XSetErrorHandler and XSetIOErrorHandler only if
2812 X_SET_ERROR_HANDLER is defined.
2813 (struct gc_list): Deleted.
2814 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2815 (mwin__realize_face): Adjusted for the change of the format of
2816 rface->info and the charge of set_region.
2817 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2818 (mwin__draw_box): Likewise.
2819 (mwin__draw_bitmap): This function deleted.
2820 (mwin__draw_points): New function.
2821 (mwin__verify_region): Adjusted for the change of the format of
2822 rface->info and the charge of set_region.
2823 (mwin__create_window): Inherit backgound pixel from parent.
2824 (mwin__dump_gc): Adjusted for the change of the format of
2827 2004-03-16 Kenichi Handa <handa@m17n.org>
2829 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2831 * input.c (M_key_alias): New variable.
2832 (handle_key): Try M_key_alias property of a key too.
2833 (minput__init): Initialize M_key_alias. Give that property to
2834 symbols in one_char_symbol. Fix bug of initializing
2837 * draw.c (compose_glyph_string): Don't handle
2838 ignore_formatting_char here. Include formatting characters in the
2839 range processed by a FTL.
2840 (layout_glyph_string): Handle ignore_formatting_char here.
2842 2004-03-12 Kenichi Handa <handa@m17n.org>
2844 * input-gui.c (win_create_ic): Enable bidi in status control.
2846 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2848 2004-03-09 Kenichi Handa <handa@m17n.org>
2850 * input.c (load_input_method): If title is not specified, use the
2851 input method name as title.
2853 * m17n-X.c (get_color): Make it static.
2854 (xim_create_ic, xim_destroy_ic, x_error_handler)
2855 (x_io_error_handler): Likewise.
2857 2004-03-01 Kenichi Handa <handa@m17n.org>
2859 * Version 1.0 released.
2862 Copyright (C) 2003, 2004
2863 National Institute of Advanced Industrial Science and Technology (AIST)
2864 Registration Number H15PRO112
2866 This file is part of the m17n library.
2868 The m17n library is free software; you can redistribute it and/or
2869 modify it under the terms of the GNU Lesser General Public License
2870 as published by the Free Software Foundation; either version 2.1 of
2871 the License, or (at your option) any later version.
2873 The m17n library is distributed in the hope that it will be useful,
2874 but WITHOUT ANY WARRANTY; without even the implied warranty of
2875 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2876 Lesser General Public License for more details.
2878 You should have received a copy of the GNU Lesser General Public
2879 License along with the m17n library; if not, write to the Free
2880 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA