1 2006-01-05 Kenichi Handa <handa@m17n.org>
3 * plist.c (read_integer_element): If '#' and '-' are followed by
4 non-integer-constituent, read them as a part of a symbol.
5 (read_symbol_element): New arg C.
6 (read_element): Adjust args to read_symbol_element.
8 * input.c (load_macros): On overwriting a macro, free the old
10 (minput__init): Store Mmap in load_im_info_keys.
11 (minput_get_title_icon): If the input method has no title, be sure
13 (minput_get_description): If the input method has no description,
14 be sure to return NULL.
15 (minput_get_variables): Fix documentation.
17 2005-12-22 Kenichi Handa <handa@m17n.org>
19 * Version 1.3.0 released.
21 2005-12-22 Kenichi Handa <handa@m17n.org>
23 * font-ft.c (ft_list): If the specified font has no property,
26 2005-12-20 Kenichi Handa <handa@m17n.org>
28 * character.c (mchar_get_prop): Check char_prop_list.
29 (mchar_put_prop, mchar_get_prop_table): Likewise.
31 2005-12-18 Kenichi Handa <handa@m17n.org>
33 * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
34 file name sans language.
36 2005-12-16 TAKAHASHI Naoto <ntakahas@m17n.org>
38 * input.c: Fix typo in comments.
40 2005-12-14 Kenichi Handa <handa@m17n.org>
42 * input.c (minput_get_title_icon): Check the default icon for the
45 2005-12-13 Kenichi Handa <handa@m17n.org>
47 * input.c (Mless_equal, Mgreater_equal): New variables.
48 (parse_expression, resolve_expression, parse_action_list)
49 (take_action_list): Handle the aboves.
50 (filter): Treat key S-X as X.
51 (minput__init): Initialize Mless_equal and Mgreater_equal.
52 (minput_get_title_icon): New function.
54 * m17n.h (minput_get_title_icon): Extern it.
56 * database.c (get_database_filename): Return a filename instead of
58 (load_database): Adjusted for the above change.
59 (mdatabase__load_for_keys): Likewise.
60 (mdatabase__find_file): New function.
62 * database.h (mdatabase__find_file): Extern it.
64 * font.h (mfont__resize): Delete extern.
66 * font.c (mfont__list): Check resize ratio.
67 (mfont__resize): Delete it.
68 (mfont_resize_ratio): Include the code of mfont__resize.
70 * font-ft.c (ft_open): Check resize ratio.
72 * m17n-X.c (xfont_open): Check resize ratio.
75 2005-12-07 Kenichi Handa <handa@m17n.org>
77 * input.c (take_action_list): If take_action_list return -1,
79 (handle_key): Likewise.
81 * face.c (mface__for_chars): When font is specified and layouter
82 is found for it, if the layouter doesn't support one of a
83 character, use a face sans layouter for it.
85 2005-12-06 Kenichi Handa <handa@m17n.org>
87 * fontset.c (mfont__lookup_fontset): If only a fallback font is
88 found, don't use it for more than one character.
90 2005-12-05 Kenichi Handa <handa@m17n.org>
92 * face.c (mface__realize): Set rfont->layouter to Mnil.
93 (mface__for_chars): Fix handling of layouter.
95 * character.h (mchar__define_prop): Extern it.
97 * database.c (update_database_list): Call mchar__define_prop if
100 * character.c (mchar__init): Don't call mchar_define_property.
101 Instead just initialize property keys.
102 (mchar__fini): Free char_prop_list only if it's not NULL.
103 (mchar__define_prop): New function.
104 (mchar_define_property): Call mchar__define_prop.
106 * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
109 2005-12-02 Kenichi Handa <handa@m17n.org>
111 * language.c (mlang__init): Handle extra chars.
113 * m17n-gui.h (mfont_check): Adjust prototype.
115 * m17n-X.c (xfont_driver): Specify xfont_check_capability.
116 (xfont_check_capability): New function.
117 (xft_driver): Specify xft_check_capability.
118 (xft_check_capability): New function.
120 * font-ft.c (M0_3): Delete it.
122 (ft_get_charmaps): Refer to M0.
123 (fc_parse_pattern): Fix previous change.
124 (ft_list_language): Check also extra chars.
125 (ft_check_otf): Define it even if HAVE_OTF is undef.
126 (ft_check_lang): Check the result of FcLangSetHasLang against
127 FcLangDifferentLang. Check also extra chars.
128 (ft_list_capability): Delete ifdef HAVE_OTF.
129 (ft_select): Likewise.
130 (ft_open): Improve debug information.
131 (ft_check_capability): New function.
132 (mfont__ft_driver): Specify ft_check_capability.
133 (mfont__ft_init): Initialize M0.
135 * fontset.c (get_font_from_group): New function.
136 (mfontset__get_font): New function.
138 * fontset.h (mfontset__get_font): Extern it.
140 * font.c (OTF_tag): Define it if HAVE_OTF is undef.
141 (mfont__fini): Delete ifdef HAVE_OTF.
142 (free_font_capability): Likewise.
143 (mfont__get_capability): Likewise.
144 (mfont__check_capability): New function.
145 (mfont_check): Change the order of arguments. Use
148 * font.h (struct MFontDriver): New member check_capability.
149 (MFontCapability): Delete ifdef HAVE_OTF.
150 (mfont__check_capability): Extern it.
152 * face.c (mface__realize): Fix handling of FONT arg.
153 (mface__for_chars): Fix handling of explicitly specified font.
155 2005-11-25 Kenichi Handa <handa@m17n.org>
157 * font-flt.c (run_command): Print debug info for
160 * draw.c (layout_glyphs): Fix handling of left/right_padding.
162 * face.c (mface__for_chars): Check rfont before accessing the
165 2005-11-21 Kenichi Handa <handa@m17n.org>
167 * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
170 * fontset.c (fontset_table): New variable.
171 (free_fontset): Call M17N_OBJECT_UNREGISTER.
172 (mfont__fontset_init): Add fontset_table as an object array.
173 (mfont__realize_fontset): Ref FONTSET.
174 (mfont__free_realized_fontset): Unref REALIZED->fontset.
175 (mfontset): Call M17N_OBJECT_REGISTER.
176 (mfontset_copy): Likewise.
178 * input.c (handle_key): For debugging, print information about
180 (filter): Add an alias for Meta and Alt modifiers.
181 (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
183 (minput__init): Initialize them.
184 (parse_expression): New function.
185 (resolve_expression): New function.
186 (parse_action_list): Handle expressions by parse_expression.
187 (take_action_list): Handle expressions by resolve_expression.
188 (parse_nested_list_value): Fix previous change.
189 (resolve_command): Fix handling of the return value of
192 2005-11-18 Kenichi Handa <handa@m17n.org>
194 * font-ft.c (ft_check_otf, otf_script_list): Define only when
196 (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
198 (ft_select): Likewise.
200 * font.c (mfont_list): Fix for the case that FONT is NULL.
201 (OTF_tag): Delete it.
202 (load_otf_script_list): Define only when HAVE_OTF is defined.
203 (mfont__fini): Unref otf_script_list only when HAVE_OTF is
206 * draw.c (truncate_gstring): Be sure to truncate at
207 glapheme-cluster boundary.
209 2005-11-11 Kenichi Handa <handa@m17n.org>
211 * input.c (delete_surrounding_text): Clear cache if necessary.
213 2005-11-09 Kenichi Handa <handa@m17n.org>
215 * draw.c (compose_glyph_string): Update prev->rface->rfont if the
216 glyph prev is also supported by the current flt.
218 2005-11-08 Kenichi Handa <handa@m17n.org>
220 * m17n-X.c (xft_render): Cancel previous change.
222 2005-11-07 Kenichi Handa <handa@m17n.org>
224 * input.c: Include <stdlib.h>.
225 (get_surrounding_text, delete_surrounding_text)
226 (get_preceding_char, get_following_char): New functions.
227 (integer_value): New arg surrounding. If it is nonzero, try to
228 get a surrounding character. Callers changed.
229 (take_action_list): Check `value' before setting an element.
230 (destroy_ic): Unref ic_info->preceding_text and
231 ic_info->following_text.
232 (minput__init): Initialize Minput_get_surrounding_text and
233 Minput_delete_surrounding_text.
234 (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
236 (filter): Unref ic_info->preceding_text and
237 ic_info->following_text.
239 * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
242 * input.h (MInputContextInfo): New members preceding_text and
245 2005-11-04 Kenichi Handa <handa@m17n.org>
247 * input.c (parse_nested_list_value): Fix handling of the global
249 (get_nested_list): Get global definitions by load_partial_im_info.
250 (preedit_commit): Set ic->candidates_changed to bitwise or of enum
251 MInputCandidatesChanged.
252 (take_action_list): Likewise.
253 (reset_ic): Likewise.
254 (create_ic): Don't pay special attention to
255 Mcandidates_group_size.
256 (load_partial_im_info): Call mdatabase_find with correct 4th arg.
257 (minput_set_variable): Get a definition of varible by
258 mplist_find_by_value, not mplist_get.
260 * m17n.h (enum MInputCandidatesChanged): New enum.
262 2005-11-01 Kenichi Handa <handa@m17n.org>
264 * m17n-X.c (xft_render): Check xft_draw's drawable before changing
266 (mwin__destroy_window): If xft_draw's drawable is win, change it
267 to device->drawable before destroying win.
269 2005-10-31 Kenichi Handa <handa@m17n.org>
271 * input.c (load_im_info): Fix adding of state.
273 * m17n-core.c (m17n_fini_core): Fix reporting of module
276 * m17n.c (m17n_fini): Fix reporting of module finalization.
278 * m17n-gui.c (m17n_init_win): Fix reporting of module
281 2005-10-29 Kenichi Handa <handa@m17n.org>
283 * input.c (get_candidate_list): Fix the timing of referring plist.
285 2005-10-28 Kenichi Handa <handa@m17n.org>
287 * input.c (load_branch): Ignore an undefined map name.
288 (load_im_info): Set im_info->title from `name' only if it's not
290 (shift_state): Always update ic->status.
291 (adjust_candidates): Renamed from adjust_candidate_command.
292 Argument changed. Caller changed.
293 (get_candidate_list, regularize_action): New functions.
294 (take_action_list): Use them. On handling Munhandle, don't set
296 (handle_key): If KEY is not handled by MAP, and MAP has
297 branch_actions, perform them.
299 * database.c (mdatabase__fini): Free dir_info->filename;
301 2005-10-20 Kenichi Handa <handa@m17n.org>
303 * input.c (marker_code): Accept '@@'.
304 (integer_value): Handle '@@'.
305 (parse_action_list): Accept a symbol argument.
306 (take_action_list): Resolve the symbol argument. Handle the
309 2005-10-18 Kenichi Handa <handa@m17n.org>
311 * input.c: Include "charset.h".
312 (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
314 (MIMState): New member (M17NObject control).
315 (lookup_nested_list, set_nested_list, parse_nested_list_value)
316 (get_nested_list, resolve_variable): New functions.
317 (integer_value): New arg (MPlist **value). Set it to the plist
318 element containing the value.
319 (resolve_command): New function.
320 (load_translation): New arg (MPlist *map_actions).
321 (load_branch): New args language and name. If `keylist' is a
322 symbol, resolved that as a command name.
323 (free_map): New arg top. Free map->map_actions only if top is
325 (free_state): New function.
326 (load_state): New arg name.
327 (im_info_list): New variable.
328 (free_im_info, get_im_info_by_tags): New functions.
329 (load_im_info): Arg key changed to plist. Handle `include'.
330 Return (MInputMethodInfo *).
331 (preedit_commit): Ref ic->candidate_list.
332 (get_select_charset, adjust_candidate_command): New functions.
333 (take_action_list): Handle `include'. Adjust candidate action
334 properly. Handle control variables `candidates-charset' and
335 `candidates-group-size'.
336 (open_im): Use get_im_info.
337 (create_ic): Get global variables.
338 (load_partial_im_info): New function.
339 (get_im_info): New function.
340 (check_command_keyseq, check_command_list, check_variable_list):
342 (minput__init): Don't handle M_database_hook and Mdetail_text.
343 Initialize M_candidates, Mcandidates_group_size,
345 (parse_variable_list, get_variable_list, parse_command_list)
346 (get_command_list): Delete them.
347 (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
348 (minput__fini): Simply unref command_list and variable_list.
349 (minput_get_description): Adjusted for the new form of description.
350 (minput_get_commands): Use get_nested_list.
351 (minput_assign_command_keys): Likewise.
352 (minput_get_variables, minput_set_variable): Likewise.
354 * input.h (MInputMethodInfo): New members im and maps.
356 * database.h (M_database_hook): Delete extern.
357 (MDatabaseHookFunc): Delete extern.
358 (mdatabase__check): Extern it.
360 * database.c: Include <glob.h>.
361 (MAX_TIME): New macro.
362 (Masterisk): New variable.
363 (get_database_stream): Argument changed to (MDatabaseInfo *).
365 (get_dir_info): Renamed from duplicate_dirname. Callers changed.
366 (find_database): New function.
367 (update_database_list): New function.
368 (mdatabase__init): Initialize Masterisk. Setup mdb_list by
369 calling update_database_list.
370 (mdatabase__check): New function.
371 (mdatabase_find): Use update_database and find_database. Don't
372 handle MDatabaseHookFunc.
373 (mdatabase_list): Call update_database at first.
374 (mdatabase_define): Adjusted for the change of mdb->extra_info.
375 (MDatabaseList): New type.
377 * plist.h (mplist_conv, mplist__pop_unref): Extern them.
379 * m17n.h (Mdetail_text): Delete extern.
381 * m17n-core.h (mplist_conc): Delete extern.
383 * plist.c (mplist__conc): Renamed from mplist_conc. Don't ref
385 (mplist_conc): Renamed to mplist__conc.
386 (mplist__pop_unref): New function.
388 2005-10-14 Kenichi Handa <handa@m17n.org>
390 * plist.c (read_mtext_element): Ignore the sequence of '\\' and
392 (read_element): If keys is an empty plist, return any element
394 (dump_plist_element): Check if plist is nested.
395 (mplist_conc): Always ref tail.
396 (mplist_set): If key is a managing key, ref val in advance.
398 * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
399 (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
400 (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
403 * fontset.c (free_fontset): Unref fontset_list if necessary.
404 (mfont__fontset_fini): Don't free fontset_list. Unref
406 (mfont__realize_fontset): Initialize request.
407 (mfontset): Ref default_fontset or fontset only if necessary.
408 (mfontset_copy): Don't ref copy.
410 * draw.c (render_glyphs): Check gend->type before checking
413 * font-ft.c (mfont__ft_fini): Unref ft_default_list. Set all
414 unrefed plists to NULL.
416 2005-10-04 Kenichi Handa <handa@m17n.org>
418 * textprop.c (mtext_serialize): Be sure to make mt
419 MTEXT_FORMAT_UTF_8 and NULL terminated.
421 * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
423 * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
425 2005-10-03 Kenichi Handa <handa@m17n.org>
427 * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
428 is not at the beginning of line.
430 2005-09-22 Kenichi Handa <handa@m17n.org>
432 * input.c: Include <sys/stat.h> and <unistd.h>.
433 (Minclude, Mcommit, Munhandle): New variables.
434 (minput__init): Initialize them. Push only Mstate to
435 load_im_info_keys. Add aliases C-lowercase for C-uppercase.
436 (parse_action_list): Allow integer arg for undo. Handle Mcommit
438 (load_input_method): Handle "include" directive. If no states are
440 (shift_state): If state_name is Mt, shift back to the previous
441 state. Call preedit_commit to commit preedit text.
442 (preedit_commit): New function.
443 (take_action_list): Improve debug printing. Handle commit and
445 (handle_key): Check the return value of take_action_list. Don't
446 take branch_actions just after changing to the root map.
447 (reset_ic): Reset all ic_info members.
448 (filter): When a key is not handled, just move ic_info->keys
449 instead fo calling reset_ic.
450 (load_im_info): If key is not Mstate, push Mmap to
452 (MDatabaseStatList): New type.
453 (imdir_stat_list): New variable.
454 (input_method_hook): Don't cancel the hook. Check the
455 modification time of directories.
456 (minput__fini): Free imdir_stat_list;
458 * input.h (MInputContextInfo): New member prev_state.
460 * m17n-core.h (mplist_conc): Extern it.
462 * plist.c (mplist_conc): New function.
464 * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
466 * font.h (MRealizedFont): New member average_width.
468 * font-ft.c (ft_open): Set rface->average_width.
470 * font.c (xlfd_unparse_name): Print '*' before registry name.
472 * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
473 (xfont_open): Set rfont->average_width.
474 (xft_open): Likewise.
475 (device_open): Initialize disp_info->AVERAGE_WIDTH.
477 * internal-gui.h (struct MFrame): New member average_width.
479 * m17n-gui.c (mframe): Fix setting of frame->rfont.
480 (mframe_get_prop): Return the average_width of a font.
482 * face.c (mface__realize): Set rface->average_width.
483 (mface__update_frame_face): Set frame->average_width.
485 * face.h (MRealizedFace): New member average_width.
487 2005-09-19 Kenichi Handa <handa@m17n.org>
489 * font.c (xlfd_unparse_name): New arg full_xlfd.
490 (mfont__encode_char): Use shortcut only for X core fonts.
491 (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
492 (mfont_put_prop): Handle `language' property.
493 (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
494 Print file can capability info too.
496 * m17n-core.c (mdebug__output): New variable.
497 (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
498 (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
499 (m17n_fini_core): Close mdebug__output if it's not stderr.
501 * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
502 (xfont_open): Handle baseline_offset.
503 (xfont_find_metric): Likewise.
504 (xfont_render): Likewise.
505 (xft_open): Likewise.
506 (xft_render): Likewise.
508 * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
509 (mdebug__output): Extern it.
510 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
511 (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
512 (MDEBUG_DUMP): New macro.
513 (MDEBUG_PRINT_TIME): Print to medebug__output.
515 * font.h (MRealizedFont): New member baseline_offset.
517 * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
519 (fc_weight_table): Add FC_WEIGHT_REGULAR.
520 (ft_list_family): Check alias.
521 (ft_list_language): If language is "en", don't try to the second
523 (ft_default_list): New variable.
524 (ft_list_default): New function.
525 (ft_select): If family is not specified, try only the default
526 fonts. Treat the weights normal and medium same.
527 (ft_open): Fix debug message. If registry is not specified, try
528 unicode-bmp. Handle _MULE_BASELINE_OFFSET property of BDF fonts.
529 (ft_find_metric): Likewise.
530 (ft_render): Likewise.
531 (ft_list): Fix debug message. Accept the registring iso8859-1.
532 If family is not specified, try only the default fonts.
534 * face.c (mface__realize): Fix logic of opening a font.
536 2005-09-16 Kenichi Handa <handa@m17n.org>
538 * face.c (mface__realize):
540 * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
543 * input.c (shift_state): Fix the condition of taking init actions.
544 (take_action_list): Fix handling of pushback action.
545 (handle_key): Don't change key while checking its alias.
546 (minput__init): Initialize new variables.
547 (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
550 2005-09-12 Kenichi Handa <handa@m17n.org>
552 * mtext.c (mtext__uppercase): Add proper open/close parens.
553 (mtext_titlecase): Add proper casting.
555 * input.c (parse_action_list): Handle the case that the arg is a
556 key sequence (MText or MPlist).
557 (take_action_list): Likewise.
558 (shift_state): Shorter debug message.
559 (handle_key): Terminate a debug message by "\n".
560 (reset_ic): Don't take initial actions here.
561 (minput_open_im): Print a debug message.
562 (minput_close_im): Likewise.
563 (minput_create_ic): Likewise.
564 (minput_destroy_ic): Likewise.
566 2005-09-09 TAKAHASHI Naoto <ntakahas@m17n.org>
568 * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
571 2005-09-07 TAKAHASHI Naoto <ntakahas@m17n.org>
572 * character.c: Add "cased", "soft-dotted", and "case-mapping" in
575 * character.c: Add Japanese documentation for
576 mchar_get_prop_table ().
578 2005-09-06 TAKAHASHI Naoto <ntakahas@m17n.org>
580 * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
581 (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
582 (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
584 (init_case_conversion): New function.
585 (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
586 (uppercase_precheck, lowercase_precheck, final_sigma)
587 (after_soft_dotted, more_above, before_dot, after_i)
588 (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
590 2005-09-05 TAKAHASHI Naoto <ntakahas@m17n.org>
592 * plist.c (read_mtext_element): Fix previous change.
594 2005-09-05 Kenichi Handa <handa@m17n.org>
596 * plist.c (read_mtext_element): Handle \uXXXX notation.
598 * internal.h (MTABLE_MALLOC): Don't use a local variable.
599 (MTABLE_ALLOCA): Change the name of local variable.
601 * m17n-gd.c (device_open): Define it even if HAVE_GD nor
602 HAVE_FREETYPE are defined.
604 * m17n-X.c: Check HAVE_X11.
606 * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
607 directory listing libraries.
608 (noinst_PROGRAMS): Define it only in maintainer mode.
610 2005-09-02 Kenichi Handa <handa@m17n.org>
612 * m17n-gui.h (mdraw_line_break_option): Extern it.
614 * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
615 end of the first glyph.
616 (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
618 (mdraw_line_break_option): New variable.
619 (mdraw_default_line_break): Use mtext_line_break.
621 * mtext.h (wordseg_func_table): Don't extern it.
622 (mtext__wseg_fini): Extern it.
624 * mtext.c: Don't include word-thai.h.
625 (wordseg_func_table): Delete this variable.
626 (mtext__init): Don't initialize above. Don't call
627 mtext__word_thai_init.
628 (mtext__fini): Don't free wordseg_func_table. Call
629 mtext__wseg_fini instead fo mtext__word_thai_fini.
630 (MTextWordsegFunc): Don't typedef it.
631 (mtext__word_segment): Moved to mtext-wseg.c.
633 * m17n-core.h (enum MTextLineBreakOption): New enum.
634 (mtext_line_break): Extern it.
636 * mtext-wseg.c: New file.
638 * mtext-lbrk.c: New file.
640 * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
641 add mtext-lbrk.c and mtext-wseg.c.
643 * textprop.c (mtext__adjust_plist_for_change): Pay attention for
644 the case that head is NULL.
646 2005-09-01 Kenichi Handa <handa@m17n.org>
648 * word-thai.c (wordseg_propertize): If the property value is nil,
649 don't make the property no-merge.
650 (thai_wordseg): Don't require *from and *to are set a priori. Pay
651 attention to the case that they are NULL.
652 (mtext__word_thai_init): Make the name of Mthai_wordseg starts
655 * character.c (mchar_get_prop_table): New function.
657 * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
659 * m17n-core.h (mtext_insert, mtext_replace): Extern them.
660 (mchar_get_prop_table): Extern it.
662 * textprop.c (prepare_to_modify): New arg deleting. Callers changed.
663 (mtext__adjust_plist_for_change): Argument changed. Callers changed.
665 * internal.h (enum MTextCoverage): New enum.
666 (MText): New member coverage.
668 * mtext.c (FORMAT_COVERAGE): New macro.
669 (insert): Copy mt2->coverage.
670 (mtext__from_data): Initialize mt->coverage.
671 (mtext__adjust_format): Update mt->coverage.
672 (mtext): Initialize mt->coverage.
673 (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
674 Update mt->coverage if necessary.
675 (mtext_duplicate): Copy mt->coverage.
676 (mtext_insert, mtext_replace): New functions.
677 (mtext_dup): Use mtext_duplicate.
678 (mtext__word_segment): Don't set *from and *to if a word
679 segmentation funcion is not found.
680 (mtext_ins_char): Fix typo.
682 2005-08-25 Kenichi Handa <handa@m17n.org>
684 * font.h (MFont): New member for_full_width.
686 * font.c (compare_font_score): Prefer a font of not
689 * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
690 registry charset of a font is one of CJK charsets.
692 * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
693 supports some of CJK.
695 2005-08-24 Kenichi Handa <handa@m17n.org>
697 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
699 * m17n-gui.c (null_device_open): Check Mresolution param and set
702 * m17n-gd.c (device_open): Check Mresolution param and set
705 * m17n-X.c (MWDevice): New member resy.
706 (xfont_open): Set ascent, descent, and max_advance members of
708 (xft_open): Likewise.
709 (device_open): Compare also screen_num to find a device. Set
710 device->resy and frame->dpi.
712 * internal-gui.h (MFrame): New member dpi.
714 * font.h (MRealizedFont): New member max_advance.
716 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
717 (mfont__init): Don't initialize Mascent, Mdescent.
718 (Mascent, Mdescent): Delete these variables.
719 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
720 Mfont_descent instead of Mascent and Mdescent.
721 (mfont_put_prop): Allow negative size.
722 (mfont_find): Handle the case of spec->size < 0. Fix previous
724 (mfont_list): Handle the case of spec->size < 0.
725 (mfont_check): Likewise.
727 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
728 (fc_get_pattern): Handle the case of font->size < 0.
729 (ft_open): Set ascent, descent, and max_advance members of rfont.
730 (ft_find_metric): Improve rounding.
731 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
734 * face.c (mface__realize): Handle the case of font->size < 0.
736 2005-08-22 Kenichi Handa <handa@m17n.org>
738 * coding.c (MConverterStatus): Change the member buf to union.
739 (mconv_buffer_converter): Add const to the arg buf.
740 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
741 (mconv_decode): Adjusted for the change of MConverterStatus.
742 (mconv_encode_range): Likewise.
744 * m17n.h (mconv_buffer_converter): Prototype adjusted.
745 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
747 2005-08-20 Kenichi Handa <handa@m17n.org>
749 * m17n-gui.h (mfont_from_name): Prototype adjusted.
750 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
752 * m17n-X.c (xfont_open): Set members ascent, descent, and
753 max_advance of rfont.
754 (xft_open): Likewise.
756 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
758 (mfont__ft_parse_name): Add const to the arg name.
760 * font.c (xlfd_parse_name): Add const to the arg name. Call
761 mfont__set_property instead of mfont_set_spec. Set font->spacing.
762 (xlfd_unparse_name): Handle spacing.
763 (mfont__init): Initialize new variables.
764 (mfont__id): Handle spacing.
765 (mfont__merge): Likewise.
766 (mfont__set_spec): This function deleted.
767 (mfont__parse_name_into_font): Add const to the arg name. Fix the
768 condition of calling mfont__ft_parse_name.
769 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
770 (mfont_get_prop): Handle properties spacing, ascent, descent,
772 (mfont_find): Return a realized font.
773 (mfont_from_name): Add const to the arg name.
775 * font.h (enum MFontProperty): New member MFONT_SPACING.
776 (enum MFontSpacing): New enum.
777 (MFont): New members spacing and max_advance.
778 (mfont__ft_parse_name): Prototype adjusted.
779 (mfont__set_spec): Extern deleted.
780 (mfont__parse_name_into_font): Prototype adjusted.
782 2005-08-19 Kenichi Handa <handa@m17n.org>
784 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
786 * font.c (mfont_list): If FONT is null, use a temporary font.
787 (mfont_parse_name): Add const to the arg name.
789 2005-08-18 Kenichi Handa <handa@m17n.org>
791 * word-thai.c: Surround code by #ifdef and #endif to escape from
794 * font-ft.c: Mostly re-written.
796 * font-flt.c (FontLayoutCmdOTF): This type deleted.
797 (FontLayoutCmd): Type of the member otf changed..
798 (load_otf_command): Adjusted for the format change of otf command.
799 (load_command): Likewise.
800 (free_flt_command): Unref cmd->body.otf.
801 (run_otf): Ajusted for the type change of otf_cmd.
802 (run_command): Ajusted for the type change of otf_cmd. On
803 debugging, print ctx->combining_code.
804 (mfont__flt_run): Initialize ctx's members code_offset,
805 combining_code, and left_padding to 0.
807 * face.h (struct MRealizedFace): New member font.
808 (mface__realize): Prototype adjusted.
810 * face.c (find_realized_face): New arg font.
811 (find_realized_face): Adjusted for the change of MFont.
812 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
813 (mface__fini): Don't call mdebug__report_object.
814 (mface__realize): New arg font.
815 (mface__for_chars): Adjusted for the change of mfont__encode_char.
816 Optimize the latin case.
817 (mface__free_realized): Free rface->font.
818 (mface__update_frame_face): Adjusted for the change of mface__realize.
819 (mface_equal): New function.
821 * draw.c (Mcommon): New variable.
822 (visual_order): Args to mfont__encode_char changed.
823 (compose_glyph_string): Handle Mfont text property.
824 (layout_glyphs): Adjusted for the change of MFont.
825 (mdraw__init): Initialize Mcommon.
826 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
828 * font.h (enum MFontType): Members completely changed.
829 (enum MFontProperty): Move MFONT_SIZE to the tail.
830 (enum MFontSource): New enum.
831 (struct MFont): New members type, source, sizes, file, capability,
833 (struct MRealizedFont): Type of member font changed. Members
834 score, status, and encoding deleted.
835 (MFontScore): New type.
836 (MFontList): Member changed.
837 (struct MFontDriver): New member has_char. Types of members
839 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
840 (Mapple_roman): Extern them.
841 (OTF_Tag): Typedefed if not HAVE_OTF.
842 (enum MFontOpenTypeTable): New enum.
843 (MFontCapability): New type.
844 (mfont__ft_drive_otf): Prototype adjusted.
845 (mfont__score): Extern deleted.
846 (mfont__merge): Extern it.
847 (mfont__has_char): Extern it.
848 (mfont__encode_char): Prototype adjusted.
849 (mfont__open): Extern it.
850 (mfont__set_spec): Prototype adjusted.
851 (mfont__get_capability): Extern it.
853 * font.c: Include "fontset.h".
854 (M_font_capability, M_font_list, M_font_list_len): New variables.
855 (font_score_priority): Change order of initial elements.
856 (font_score_shift_bits): Fix array size.
857 (common_weight): Add "thin", "semibold", and "heavy".
858 (common_stretch): Add "ultracondensed", "extracondensed",
859 "extraexpanded", and "utltraexpand".
860 (font_weight_regular, font_weight_normal, font_weight_medium): New
862 (gen_font_name): This function deleted.
863 (find_encoding): Set font->encoding.
864 (OTF_tag): New function.
865 (otf_script_list): New variable.
866 (load_otf_script_list): New function.
867 (find_script_from_otf_tag): New function.
868 (xlfd_parse_name): Set font->type and font->source.
869 (mfont__free_realized): Free chains rfonts.
870 (font_score): Renamed from mfont__score.
871 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
872 (Mapple_roman): New variables.
873 (mfont__init): Initilize new variables. Initalize
874 default_encoding.encoding_name and
875 default_encoding.encoding_charset to Municode_full and
876 mcharset__unicode. Use SAFE* macros for allocating filepath
878 (mfont__fini): Free otf_script_list.
879 (mfont__id): New function.
880 (mfont__match_p): Check also capability member of MFont.
881 (mfont__merge): New funciton.
882 (mfont__set_spec_from_face): Set type and source members.
883 (mfont__set_spec_from_plist): Set capability and type members.
884 (mfont__select): Argument changed.
885 (mfont__available): New function.
886 (compare_font_score): New function.
887 (mfont__list): New function.
888 (mfont__open): Return a realized font.
889 (mfont__resize): Adjusted for the change of MFont.
890 (mfont__has_char): New function.
891 (mfont__encode_char): Argument changed.
892 (mfont__set_spec): Argument changed.
893 (free_font_capability): New function.
894 (mfont__get_capability): New function.
895 (MFontfile): New variable.
896 (mfont_get_prop): Adjusted for the change of MFont.
897 (mfont_put_prop): Likewise.
898 (mfont_set_selection_priority): Fix the way of setting
899 font_score_priority[].
900 (mfont_find): Use mfont__list instead of mfont__select.
901 (mfont_resize_ratio): Adjusted for the change of MFont.
902 (mfont_list): Use mfont__list.
903 (mfont_check): New function.
904 (font_score): Make it static.
906 * fontset.h (mfont__realize_fontset): Prototype adjusted.
907 (mfont__lookup_fontset): Likewise.
909 * fontset.c (struct MFontset): Delete member font_spec_list.
910 (struct MRealizedFontset): Type of member spec changed. New
912 (load_font_group): Arg spec_list deleted.
913 (load_fontset_contents): Adjusted for the change of fontset_def.
914 (free_fontset): Fix the way of freeing fontset elements.
915 (realize_fontset_elements): Argument changed.
916 (get_per_script): New function.
917 (free_realized_fontset_elements): Fix the way of feeing rfontset
919 (update_fontset_elements): Fix args to realize_fontset_elements.
920 (mfont__realize_fontset): New arg spec.
921 (try_font_list): New function.
922 (try_font_group): New arg request. Use try_font_list.
923 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
925 (mfontset): Adjusted for the change of MFontset.
926 (mfontset_copy): Likewise. Don't share plists.
927 (mfontset_modify_entry): Adjusted for the change of MFontset.
928 (mfontset_lookup): Call get_per_script.
929 (mdebug_dump_fontset): Print also the address of fonts.
931 * input.c (shift_state): Don't reset ic_info->vars.
932 (take_action_list): Call MDEBUG_PRINT fore calling
935 * internal-gui.h (MFontDriver): Don't typedef it here.
937 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
938 (MXFont): This type deleted.
940 (struct _MFontX): New struct.
941 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
942 (MDisplayInfo): Member base_font_list deleted.
943 (DEFAULT_FONT): Definition changed.
944 (FALLBACK_FONT): This maclr deleted.
945 (free_display_info): Adjusted for the change of MDisplayInfo.
946 (free_device): Argument to mfont__free_realized changed.
947 (xfont_driver): Adjusted for the change of MFontDriver.
948 (xfont_registry_list): Use MFontX instead of MXFont.
949 (MRealizedFontX): Renamed from MXFontInfo.
950 (xfont_select): Return the font found first.
951 (close_xfont): Change MXFontInfo to MRealizedFontX.
952 (xfont_open): Return the realized font.
953 (xfont_find_metric): Get xfont from rfont->fontp.
954 (xfont_has_char): New function.
955 (xfont_encode_char): Adjusted for the argument change.
956 (xfont_render): Get xfont from rfont->fontp.
957 (xfont_list): Adjusted for the argument change.
958 (MRealizedFontXft): Renamed from MXftFontInfo.
959 (xft_driver): Ajusted for the change of MFontDriver.
960 (close_xft): Change MXtfFontInfo to MRealizedFontXft
961 (xft_open_font): Argument changed.
962 (xft_open): Argument changed. Return the realized font.
963 (xft_find_metric): Get xft_font from rfont->fontp.
964 (xft_has_char, xft_encode_char): New functions.
965 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
966 font if not yet opened.
967 (device_open): Don't set frame->font.
969 * m17n-gd.c (gd_font_driver): Adjusted for the change of
971 (gd_font_open): New function.
972 (gd_render): Don't use the local variable ft_info.
973 (device_init): Adjusted for the change of gd_font_driver.
975 * textprop.c (mtext__prop_init): Initialize text_property_table.
976 Call M17N_OBJECT_ADD_ARRAY.
977 (mtext__prop_fini): Don't call mdebug__report_object.
979 * plist.c (mplist__init): Initialize plist_table.
980 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
981 (mplist__fini): Don't call mdebug__report_object.
983 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
984 (mtext__fini): Don't call mdebug__report_object.
985 (MTEXT_FORMAT_UTF_16): Correct type.
986 (mtext_data): New function.
987 (mtext_text): Fix calculation of limit and args to
990 * language.c: Include "plist.h".
991 (M_script_lang_list): New variable.
992 (mlang__init): Read languages and their information from m17n
994 (mlanguage__list): New function.
995 (Miso639_1, Miso639_2): New variables.
997 * language.h (mlanguage__list): Extern it.
999 * database.c (get_database_stream): Use SAFE_* macros for
1000 allocating and freeing path.
1001 (mdatabase__init): Likewise.
1003 * symbol.c (msymbol__fini): Don't free symbols here.
1004 (msymbol__free_table): New function.
1005 (msymbol_is_managing_key): New function.
1007 * symbol.h (msymbol__free_table): Extern it.
1008 (msymbol__list): Extern it.
1010 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
1012 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
1013 (struct _M17NObjectArray): New member name and next.
1014 (mdebug__add_object_array): Extern it.
1015 (M17N_OBJECT_ADD_ARRAY): New macro.
1016 (mdebug__report_object): Don't extern it.
1018 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
1020 * m17n-gui.c (free_frame): Don't free frame->font.
1021 (null_device_fini): Fix code for freeing
1022 null_device.realized_font_list.
1023 (m17n_fini_win): Free interface.
1024 (mframe): Cast the return value of dlsym. Set frame->font here.
1025 (mframe_get_prop): Check frame->rface->rfont before accessing the
1028 * m17n-gui.h (Mfontfile): Extern it.
1029 (mfont_check): Extern it.
1030 (mface_equal): Extern it.
1032 * m17n-core.c: Include "symbol.h".
1033 (report_header_printed): This variable deleted.
1034 (object_array_root): New variable.
1035 (report_object_array): New function.
1036 (mdebug__report_object): This function deleted.
1037 (mdebug__add_object_array): New function.
1038 (m17n_init_core): Call mchartable_init () before mtext_init ().
1039 (m17n_fini_core): Call report_object_array (if necessary) and
1040 msymbol__free_atable at the end.
1042 * m17n-core.h (msymbol_is_managing_key): Extern it.
1043 (mtext_data): Extern it.
1044 (MTEXT_FORMAT_UTF_16): Correct type.
1045 (M17NLIB_MINOR_VERSION): Changed to 3.
1046 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1048 * chartab.c (mchartable__init): Initalize chartable_table.count.
1049 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1050 mdebug__report_object.
1052 2005-05-26 Kenichi Handa <handa@m17n.org>
1054 * m17n.h (Miso639_1, Miso639_2): Extern them.
1056 * symbol.h (msymbol__list): Extern it.
1058 * symbol.c (msymbol__list): New function.
1060 2005-05-19 Kenichi Handa <handa@m17n.org>
1062 * input-gui.c (minput__win_init): Don't change the value of
1065 2005-05-16 Kenichi Handa <handa@m17n.org>
1067 * m17n-core.c (m17n_object): Be sure to initialize all members.
1069 * font-ft.c (fc_decode_prop): Fix args to msymbol.
1071 2005-05-09 Kenichi Handa <handa@m17n.org>
1073 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1075 2005-04-27 Kenichi Handa <handa@m17n.org>
1077 * language.c (mlang__init): Add "an" (Aragonese).
1079 * word-thai.c: Add support for libthai.
1080 (mtext__word_thai_init): Initialize wordseg library conditionaly.
1081 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1083 * mtext.c: Include "word-thai.h" conditionaly.
1084 (mtext__init): Call mtext__word_thai_init conditionaly.
1085 (mtext__fini): Call mtext__word_thai_fini conditionaly.
1087 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1088 not WORDCUT_LD_FLAGS.
1090 2005-04-19 Kenichi Handa <handa@m17n.org>
1092 * word-thai.c (wordseg_propertize): Always unref the attached
1094 (thai_wordseg): Don't unref the property.
1096 2005-04-18 Kenichi Handa <handa@m17n.org>
1098 * word-thai.c: Include stdlib.h.
1099 (wordseg_propertize): Add dummy function for the case that wordcut
1100 library doesn't exist.
1101 (wordseg_propertize): Fix for old wordcut library.
1103 2005-04-16 Kenichi Handa <handa@m17n.org>
1105 * word-thai.c: Include <stdio.h>.
1107 2005-04-15 Kenichi Handa <handa@m17n.org>
1109 * draw.c: Include mtext.h.
1110 (linebreak_table, M_break_at_space, M_break_at_word)
1111 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1112 (compose_glyph_string): Check POS before getting Mface text
1114 (truncate_gstring): Give correct TO arg to line_break function.
1115 (GET_LB_TYPE): New macro.
1116 (find_break_backward, find_break_forward): New functions.
1117 (mdraw__init): Initialize the above new variables.
1118 (mdraw__fini): Free linebreak_table.
1119 (mdraw_default_line_break): Use find_break_backward and
1122 * word-thai.c: New file.
1124 * word-thai.h: New file.
1126 * mtext.c: Include word-thai.h.
1127 (wordseg_func_table): New variable.
1128 (mtext__init): Initialize wordseg_func_table and call
1129 mtext__word_thai_init.
1130 (mtext__fini): Call mtext__word_thai_fini, free
1132 (MTextWordsegFunc): New type.
1133 (mtext__word_segment): New function.
1135 * mtext.h (wordseg_func_table): Extern it.
1136 (mtext__word_segment): Extern it.
1138 * m17n.c (m17n_init): Fix typo (== -> =).
1140 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1141 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1143 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1144 (MTEXTPROP_VAL): New macros.
1146 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1148 2005-04-07 Kenichi Handa <handa@m17n.org>
1150 * database.c (load_chartable): Fix pursing of symbol name.
1152 2005-03-24 Kenichi Handa <handa@m17n.org>
1154 * m17n.c (m17n_init): Fix typo (== -> =).
1156 2005-03-11 Kenichi Handa <handa@m17n.org>
1158 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1160 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1162 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1165 2005-03-09 handa <handa@m17n.org>
1167 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1168 calling m17n_init ().
1170 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1171 calling m17n_init_core ().
1173 2005-02-28 Kenichi Handa <handa@m17n.org>
1175 * font-flt.c (mfont__flt_run): Add resulting code sequence in
1178 2005-02-17 Kenichi Handa <handa@m17n.org>
1180 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1181 (M_description, M_command, M_variable): New variables.
1182 (load_im_info_keys): New variables.
1183 (load_im_info, check_command_keyseq, get_description_advance)
1184 (parse_command_list, get_command_list, parse_variable_list)
1185 (get_variable_list, input_method_hook): New functions.
1186 (command_list, variable_list): New variables.
1187 (minput__init): Put input_method_hook to Minput_method.
1188 Initialize M_description, M_command, M_variable, Mdetail_text,
1189 load_im_info_keys, command_list, variable_list.
1190 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1191 (Mdetail_text): New variable.
1192 (minput_get_description, minput_get_commands)
1193 (minput_assign_command_keys, minput_get_variables)
1194 (minput_set_variable): New functions.
1196 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1197 (minput_assign_command_keys, minput_get_variables)
1198 (minput_set_variable): Extern them.
1200 * plist.c (UNGETC): Just decrement st->p.
1201 (read_mtext_element): New arg skip.
1202 (read_integer_element): Likewise.
1203 (read_symbol_element): Likewise.
1204 (read_element): New arg KEYS.
1205 (mplist__from_plist): Don't increment ref-count of NULL object.
1206 (mplist__from_file): New arg KEYS.
1207 (mplist_put): Don't increment ref-count of NULL object.
1208 (mplist_add): Likewise.
1209 (mplist_push): Likewise.
1210 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
1212 * plist.h (mplist__from_file): Prototype adjusted.
1214 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1215 (get_database_stream): New function.
1216 (load_database): Use get_database_stream.
1217 (M_database_hook): New variable
1218 (mdatabase__init): Initialize M_database_hook.
1219 (mdatabase__load_for_keys): New function.
1220 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1222 (mdatabase_define): Free mdb->extra_info if necessary.
1224 * database.h (mdatabase__dir_list, M_database_hook)
1225 (mdatabase__load_for_keys): Extern them.
1226 (MDatabaseHookFunc): New type.
1228 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1230 2004-12-27 Kenichi Handa <handa@m17n.org>
1232 * Version 1.2.0 released.
1234 2004-12-27 Kenichi Handa <handa@m17n.org>
1236 * input.c (minput_filter): Don't reset ic->xxx_changed.
1238 * mtext.c (mtext_from_data): Fix documentation.
1240 2004-12-25 Kenichi Handa <handa@m17n.org>
1242 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1243 (M17NLIB_VERSION_NAME): Update to "1.2.".
1245 2004-12-24 Kenichi Handa <handa@m17n.org>
1247 * input.c (reset_ic): Set key_unhandled to 0.
1249 2004-12-21 Kenichi Handa <handa@m17n.org>
1251 * m17n-gui.h (mfont_from_spec): Delete extern.
1253 * input-gui.c (win_callback): Handle Minput_reset.
1254 (minput__win_init): Register reset_ic as a callback for
1257 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
1258 changed. At first, shift to the initial state.
1259 (minput__init): Initialize Minput_reset. Register reset_ic as a
1260 callback for Minput_reset.
1261 (Minput_reset): New variable.
1262 (minput_filter): Always set ic->xxx_changed to 0.
1263 (minput_reset_ic): New function.
1264 (integer_value): Fix typo ('>' -> '<') and calculation of length
1267 * m17n-core.c (merror_code): Change type to `int'.
1269 * m17n-misc.h (merror_code): Adjust type.
1271 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1273 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1274 (mtext_change_prop): Delete extern.
1276 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1277 to `int'. Move the documents to m17n-core.h.
1279 2004-12-13 Kenichi Handa <handa@m17n.org>
1281 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1282 (MTextProperty): Document it.
1284 2004-12-09 Kenichi Handa <handa@m17n.org>
1286 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1288 2004-12-03 Kenichi Handa <handa@m17n.org>
1290 * internal.h (m17n__core_initialized, m17n__shell_initialized,
1291 m17n__gui_initialized): New externs.
1293 * m17n-core.h (enum M17NStatus): New enum.
1294 (m17n_status): Extern it.
1296 * m17n-core.c (core_initialized): Delete this variable.
1297 (m17n__core_initialized, m17n__shell_initialized,
1298 m17n__gui_initialized): New variables.
1299 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1300 instead of core_initialized.
1301 (m17n_status): New function.
1303 * m17n.c (shell_initialized): Delete this variable.
1304 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1307 * m17n-gui.h (m17n_init_win): Adjust the prototype.
1309 * m17n-gui.c (win_initialized): Delete this variable.
1310 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1311 instead of gui_initialized.
1313 2004-11-19 Kenichi Handa <handa@m17n.org>
1315 * input.c (reset_ic): Check if ic_info->state is NULL.
1316 (filter): If ic_info->state is NULL, return 0.
1317 (load_input_method): Don't unref `maps' it it's not created.
1319 2004-11-15 Kenichi Handa <handa@m17n.org>
1321 * input.c (find_candidates_group): If INDEX is -1, find the last
1323 (take_action_list): If the previous of the first candidate is
1324 requested, select the last candidate.
1326 2004-11-08 Kenichi Handa <handa@m17n.org>
1328 * m17n-X.c (device_open): Try at most 32 fonts to find a
1329 non-autoscaled font.
1331 * font.c (xlfd_parse_name): Fix previous change.
1333 2004-11-05 Kenichi Handa <handa@m17n.org>
1335 * font.c: (commont_style): Include dummy elements "slanted" and
1336 "rslanted" to prefer "o" to "r" if "i" is requested.
1338 * font-ft.c (ft_to_prop): Fix "oblique" entry.
1340 2004-10-29 Kenichi Handa <handa@m17n.org>
1342 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1344 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1345 New members smallest and larger.
1346 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1347 (xfont_registry_list): Likewise.
1348 (xfont_select): Likewise.
1351 2004-10-28 Kenichi Handa <handa@m17n.org>
1353 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1354 font name comparison.
1355 (xfont_select): Fix logic for selecting a larger size font.
1357 2004-10-25 Kenichi Handa <handa@m17n.org>
1359 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1362 2004-10-22 Kenichi Handa <handa@m17n.org>
1364 * input.c (update_candidate): Renamed from udpate_candidate.
1365 (take_action_list): Show more debugging info on arithmetic commands.
1367 * m17n-X.c (device_open): Fix previous change.
1369 * draw.c (compose_glyph_string): Don't get face property at the
1372 2004-10-21 Kenichi Handa <handa@m17n.org>
1374 * draw.c (compose_glyph_string): Fix for the case of category
1377 2004-10-19 Kenichi Handa <handa@m17n.org>
1379 * input.c (mdebug_mask): New variable.
1380 (shift_state): Print debug information.
1381 (take_action_list): Likewise.
1382 (handle_key): Likewise.
1384 2004-10-14 Kenichi Handa <handa@m17n.org>
1386 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1388 2004-10-13 Kenichi Handa <handa@m17n.org>
1390 * m17n-X.c (device_open): Be sure to register at least one font
1393 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
1394 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1396 2004-10-12 Kenichi Handa <handa@m17n.org>
1398 * draw.c (alloc_gstring): Fix previous change.
1400 * font-ft.c (ft_list_generic): Fix for the case of not
1403 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1405 * font.c (mfont_list): If no font is found, return NULL.
1406 (load_font_encoding_table): Put entries of nil registry first.
1407 (find_encoding): Adjust for the above change.
1409 2004-10-11 Kenichi Handa <handa@m17n.org>
1411 * m17n-gui.h (mfont_list): Adjust prototype.
1413 * m17n-X.c (xfont_list): New arg maxnum.
1415 * font.h (struct MFontDriver): Change prototype of <list>.
1417 * font-ft.c (fc_generic_family_list): Delete it.
1418 (Mserif, Msans_serif, Mmonospace): Delete them.
1419 (M_generic_family_info): New variable.
1420 (enum GenericFamilyType): New enum.
1421 (struct GenericFamilyInfo): New struct.
1422 (generic_family_table): New variable.
1423 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1425 (add_font_info): Get style here.
1426 (ft_list_family): Don't initialize fc_config here. Don't list
1428 (ft_list_generic): New function.
1429 (ft_select): Pay attention to generic familes here.
1430 (ft_open): Fix calculation of ascent and descent.
1431 (ft_list): Pay attention to generic families.
1432 (mfont__ft_init): Initialize M_generic_family_info,
1433 generic_family_table, and fc_config..
1434 (mfont__ft_fini): Finalize generic_family_table.
1436 * draw.c (compose_glyph_string): Use more constant font for
1437 glyphs. Adjust for the member change in MGlyph.
1438 (layout_glyph_string): Adjust for the member change in MGlyph.
1439 (alloc_gstring): Intilize scracth_glyph to avoid
1440 compose_glyph_string on it.
1441 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1442 (mdraw_coordinates_position): Fix previous change.
1444 * internal-gui.h (glyph_category): New enum.
1445 (MGlyph): Change type of <category> to enum glyph_category.
1447 * face.c (mface__realize): Delete args langauge and charset.
1448 (mface__for_chars): Fix for the case that glyphs have different
1450 (mface__update_frame_face): Adjust for mface__realize change.
1452 * face.h (mface__realize): Adjust prototype.
1454 2004-10-05 Kenichi Handa <handa@m17n.org>
1456 * language.c (mlang__init): Add Akan.
1458 2004-10-04 Kenichi Handa <handa@m17n.org>
1460 * font-ft.c (add_font_info): Add instead of push the element.
1461 (ft_list_family): For generic fonts, try all
1462 substituted. families.
1464 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1465 (run_rule): Don't update cluster range here.
1466 (run_command): Update cluster range on appending a glyph.
1467 (run_otf): Update cluster range for glyphs generated by OTF.
1469 2004-10-02 Kenichi Handa <handa@m17n.org>
1471 * m17n-X.c (device_open): Handle Mfont key in PLIST.
1473 2004-09-30 Kenichi Handa <handa@m17n.org>
1475 * font-ft.c (ft_select): Ignore family on calling mfont__score.
1477 2004-09-30 Kenichi Handa <handa@m17n.org>
1479 * font.h: Include <fontconfig/fontconfig.h>.
1480 (MFTInfo): New member langset.
1481 (mfont__encoding_list): Extern it.
1483 * font.c (mfont__encoding_list): New function.
1484 (mdebug_dump_font_list): New function.
1486 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1487 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1489 (ft_family_list): New variable.
1490 (set_font_info): New arg basep. Callers changed.
1491 (fc_list): Check the return value of FcPatternGetString.
1492 (add_font_info): New arg plist. Callers changed. Update
1494 (ft_list_family): New function (merged fc_list and ft_list_all).
1495 (ft_select): Use ft_list_family.
1496 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
1498 (mfont__ft_init): Initialize above new variables.
1499 (mfont__ft_fini): Free ft_family_list.
1500 (STRDUP_LOWER): New macro.
1501 (set_font_info): Use STRDUP_LOWER.
1502 (ft_list_family): Avoid duplicate addition of font path. Use
1504 (fc_decode_prop): Fix typo.
1506 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1507 (xfont_registry_list): Change argument disp_info to frame.
1509 (xfont_list_all): New function.
1510 (xfont_list): If FONT is not NULL, check all fonts.
1512 2004-09-28 Kenichi Handa <handa@m17n.org>
1514 * m17n-X.c (MXFont, MXFontList): New types.
1515 (MDisplayInfo): Delete members font_registry_list,
1516 iso8859_1_family_list, iso10646_1_family_list, new members
1517 font_list, base_font_list.
1518 (free_display_info): Adusted for the change of MDisplayInfo.
1519 (xfont_driver): Initialize with xfont_list.
1520 (font_compare): New function.
1521 (build_font_list): Deleted.
1522 (xfont_registry_list): New function.
1523 (xfont_select): Use xfont_registry_list.
1524 (xfont_list): New function.
1525 (device_open): Adusted for the change of MDisplayInfo.
1527 * font-ft.c (add_font_info): New arg languages. Callers changed.
1528 (fc_list): Get languages from fonts..
1529 (ft_list_all): Renamed from ft_list. Callers changed.
1530 (ft_list): New function.
1531 (mfont__ft_driver): Initalize with ft_list.
1533 * font.c (mfont_list): New function.
1535 * font.h (struct MFontDriver): New member `list'.
1536 (MFTInfo): New member languages.
1538 * m17n-gui.h (mfont_list): Extern it.
1540 2004-09-27 Kenichi Handa <handa@m17n.org>
1542 * internal-gui.h (struct MGlyphString): Delete members mt,
1543 sub_width, sub_lbrearing, sub_rbearing, and region.
1545 * draw.c (MSubTextExtents): New type.
1546 (layout_glyphs): New arg extents. Set its members.
1547 (layout_glyph_string): Adjusted for the above change.
1548 (alloc_gstring): Don't set gstring->mt.
1549 (truncate_gstring): Call line_break function with mt instead of
1552 2004-09-22 Kenichi Handa <handa@m17n.org>
1554 * mtext.c (count_utf_16_chars): Count each code of invalid
1557 2004-09-19 Kenichi Handa <handa@m17n.org>
1559 * mtext.c (default_utf_16, default_utf_32): Rename them to
1560 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
1563 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1566 2004-09-13 Kenichi Handa <handa@m17n.org>
1568 * draw.c (Mlatin): Don't declare it here.
1569 (visual_order): Fix reordering of combining characters.
1570 (compose_glyph_string): Fix detection of script.
1571 (layout_glyphs): Don't fix reordering of combining characters
1573 (layout_glyph_string): Pay attention to
1574 control->disable_overlapping_adjustment.
1575 (truncate_gstring): Include at least on character in a line.
1576 (get_gstring): Always scan one full line.
1577 (mdraw__init): Don't initialize Mlatin here.
1578 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
1579 have a font, use ascent/descent of an ASCII font. Allow
1580 ink_array_return and logical_array_return to be NULL.
1581 (mdraw_coordinates_position): Fix iteration.
1583 * font-ft.c (MFTtoProp): Member completely changed.
1584 (ft_to_prop): Adjusted for the above change.
1585 (ft_to_prop_size): Likewise.
1586 (set_font_info): Adjusted for the change of MFTtoProp.
1587 (fc_generic_family_list): New variable.
1588 (fc_list): Add special handling of generic font names.
1589 (mfont__ft_init): Adjusted for the change of MFTtoProp.
1590 Initialize fc_generic_family_list.
1591 (mfont__ft_fini): Don't free ft_to_prop. Free
1592 fc_generic_family_list.
1593 (FC_vs_M17N_font_prop): New type.
1594 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1595 (fc_decode_prop, fc_encode_prop): New functions.
1596 (mfont__ft_parse_name): Use fc_decode_prop.
1597 (mfont__ft_unparse_name): Use fc_encode_prop.
1599 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1600 (MWDevice): Add member realized_font_list.
1601 (free_display_info): Don't free disp_info->realized_font_list.
1602 (free_device): Free device->realized_fontset_list.
1603 (xft_find_metric): Use gstring->frame instead of rfont->frame.
1604 (device_open): Don't initialize disp_info->realized_font_list.
1605 (device_open): Initialize device->realized_font_list and set it to
1606 frame->realized_font_list.
1608 * fontset.c (try_font_group): New function.
1609 (mfont__lookup_fontset): Use try_font_group.
1611 * font.c (common_weight): Change the order of "regular".
1613 * face.c (Mlatin): Don't make it static.
1614 (mface__realize): Be sure to set work_gstring.frame.
1615 (mface__for_chars): Likewise.
1617 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1620 * internal-gui.h (Mlatin): Extern it.
1622 * m17n-gui.h (MDrawControl): New member
1623 disable_overlapping_adjustment.
1625 2004-09-06 Kenichi Handa <handa@m17n.org>
1627 * font-flt.c (run_otf): Fix typo ('}'->']').
1629 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1630 (COMBINING_PRECOMPUTED_P): New macros.
1632 * draw.c (layout_glyphs): Handle precomputed combining code.
1634 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1635 precomupted combining code.
1637 2004-09-03 Kenichi Handa <handa@m17n.org>
1639 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1642 2004-08-27 Kenichi Handa <handa@m17n.org>
1644 * face.c (mface_put_prop): If the new value is the same as the
1645 current one, don't increment frame->tick.
1647 2004-08-25 Kenichi Handa <handa@m17n.org>
1649 * fontset.c (mfontset): Initialize font_spec_list member.
1650 (mfontset_copy): Load fontset if necessary.
1652 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1653 'metrics' to for C++.
1655 * draw.c (mdraw_glyph_info): Adjusted for the member name change
1658 2004-08-16 Kenichi Handa <handa@m17n.org>
1660 * Version 1.1.0 released.
1662 2004-08-13 Kenichi Handa <handa@m17n.org>
1664 * language.c (mlang__init): Add Dhivehi.
1666 * m17n-gui.c (Mx, Mfreetype): Delete it.
1667 (m17n_init_win): Don't initialize Mx and Mfreetype here.
1669 * m17n-gui.h (Mfreetype, Mxft): Extern them.
1670 (mfont_resize_ratio): Extern it.
1671 (MDrawGlyphInfo): New member logical_width;
1672 (MDrawGlyph): New type.
1673 (mdraw_glyph_list): Prototype adjusted.
1675 * m17n-X.c (xfont_open): Set type and fontp members.
1676 (xft_open): Likewise.
1678 * internal-gui.h (Mx, Mfreetype): Delete extern.
1680 * font.h (struct MRealizedFont): New member type and fontp.
1682 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1683 (Mx, Mfreetype): Declare here.
1684 (Mxft): New variable.
1685 (mfont_resize_ratio): New function.
1687 * font-ft.c (ft_open): Set type and fontp members.
1689 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
1692 2004-08-11 Kenichi Handa <handa@m17n.org>
1694 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1697 2004-08-06 Kenichi Handa <handa@m17n.org>
1699 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1702 * font-flt.c (run_otf): Print debugging information if necessary.
1704 2004-08-05 Kenichi Handa <handa@m17n.org>
1706 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
1707 positioning_type 5 and 6. Switch simplified.
1709 2004-08-04 Kenichi Handa <handa@m17n.org>
1711 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1713 2004-08-02 Kenichi Handa <handa@m17n.org>
1715 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1716 set val to 1 even if it is greater than 1.
1718 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1720 2004-07-29 Kenichi Handa <handa@m17n.org>
1722 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1723 debugging information.
1725 * internal.h (MDEBUG_PRINT5): New macro.
1727 * draw.c (layout_glyphs): Don't combine a zero width glyph with
1728 the previous one if the zero width glyph has left or right
1731 2004-07-26 Kenichi Handa <handa@m17n.org>
1733 * m17n-X.c (xft_render): Pay attention to members left_padding and
1734 right_padding of MGlyph.
1736 * draw.c (visual_order): Allocate one more elements for arrays as
1737 a workaround of fribidi bug.
1738 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1739 instead of MGlyph->bidi_sensitive.
1740 (layout_glyph_string): Pay attentinon to
1741 control->orientation_reversed when padding at the head or tail.
1742 Fix adjustment of space glyph width.
1743 (get_gstring): If cursor_width or cursor_bidi is changed, don't
1746 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1747 instead of MGlyph->bidi_sensitive.
1749 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1751 2004-07-26 Kenichi Handa <handa@m17n.org>
1753 * draw.c (visual_order): Don't treat combined glyphs specially.
1754 (layout_glyphs): Don't get metrics glyphs that are already ready.
1755 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
1756 width with the previous one.
1757 (draw_background): Fix bar cursor position on a r2l glyph.
1759 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1760 (run_rule): Fix place of updating cluster_begin_pos and
1761 cluster_end_pos here.
1762 (run_otf): Don't set left_padding.
1764 * font-ft.c (adjust_anchor): Type of argument `code' changed.
1766 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1767 Fix handling of GPOS.
1768 (mfont__ft_drive_gpos): Delete this function.
1770 * font.h (mfont__ft_drive_otf): Renamed back from
1771 mfont__ft_drive_gsub.
1772 (mfont__ft_drive_gpos): Delete extern.
1774 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1775 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1777 2004-07-23 Kenichi Handa <handa@m17n.org>
1779 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1780 the same bidi level.
1782 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1784 2004-07-22 Kenichi Handa <handa@m17n.org>
1786 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1788 2004-07-20 Kenichi Handa <handa@m17n.org>
1790 * draw.c (render_glyphs): Fix checking of g->code validity.
1792 * face.c (mface__realize): Set g.type.
1794 2004-07-18 Kenichi Handa <handa@m17n.org>
1796 * Makefile.am: Prepend ${top_srcdir} to all *.la in
1799 * m17n-gui.c (mframe): Print error message give by dlopen to
1802 2004-07-16 Kenichi Handa <handa@m17n.org>
1804 * draw.c (compose_glyph_string): Improve the way of deciding a
1805 script. For a character that doesn't have script property, use
1806 the last non-latin script.
1808 * font-ft.c (fc_list): Cancel previous change.
1809 (mfont__ft_init): Add more entries in ft_to_prop_name.
1811 2004-07-15 Kenichi Handa <handa@m17n.org>
1813 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1814 previous or next character glyphs.
1816 2004-07-14 Kenichi Handa <handa@m17n.org>
1818 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1819 of type GLYPH_SPACE.
1821 * fontset.c (mfont__lookup_fontset): If glyph type is
1822 GLYPH_SPACE, get codes for SPACE.
1824 * internal-gui.h (Mfont): Delete extern.
1826 * m17n-gui.h (Mfont): Delete duplicated extern.
1828 2004-07-13 Kenichi Handa <handa@m17n.org>
1830 * font-ft.c (DEVICE_DELTA): New macro.
1831 (adjust_anchor): New function.
1832 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
1834 (mfont__ft_drive_gpos): New function.
1836 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1837 (FontLayoutContext): Delete member `rfont'.
1838 (run_otf): Set g->otf_cmd. Call
1839 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
1840 only whne HAVE_OTF is defined.
1842 * fontset.c: Include "config.h".
1844 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1845 (MGlyph): New member otf_cmd.
1847 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1848 (mfont__ft_drive_gpos): Extern it.
1850 * face.c: Include "config.h".
1852 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1854 * input-gui.c: Include "config.h".
1856 * plist.c: Include "config.h".
1858 2004-07-06 Kenichi Handa <handa@m17n.org>
1860 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1861 internal-gui.h: Cancel previous changes.
1863 * m17n-gd.h: Delete it.
1865 * Makefile.am (libm17n_core_la_LIBADD): New variable.
1866 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1867 @XML2_LD_FLAGS@ to above.
1868 (libm17n_la_LIBADD): Add -ldl.
1869 (libm17n_la_LDFLAGS): Add -export-dynamic.
1870 (X_LD_FLAGS): Fix the order of linking.
1871 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1872 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1873 (libm17n_X_la_LDFLAGS): Add -module.
1874 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1875 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1876 (libm17n_gd_la_LDFLAGS): Add -module.
1877 (include_HEADERS): Delete m17n-gd.h.
1879 2004-06-30 Kenichi Handa <handa@m17n.org>
1881 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1882 (MDeviceLibraryInterface): Delete it.
1883 (register_device_library): Delete it.
1884 (m17n__device_library_list): Renamed from device_library_list.
1886 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1887 (m17n_init_win): Adjust prototype.
1889 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1890 (m17n_init_gd): New function.
1892 * m17n-gd.h: New file.
1894 * m17n-X.h: Include <m17n-gui.h>.
1895 (m17n_init_X): Extern it.
1896 (M17N_INIT): Redefine it.
1898 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1899 (m17n_init_X): New function.
1901 * internal-gui.h (m17n__device_library_list): Extern it.
1902 (struct MDeviceDriver): New members initialized, init, and fini.
1904 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1906 (libm17n_X_la_LIBADD): Delete aboves.
1907 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1908 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1909 (libm17n_gd_la_LDFLAGS): Delete it.
1910 (include_HEADERS): Add m17n-gd.h.
1912 2004-06-25 Kenichi Handa <handa@m17n.org>
1914 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1915 (libm17n_gd_la_LDFLAGS): Cancel previous change.
1917 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1919 * font-ft.c (fc_list): If FcFontList finds no font, try
1922 * draw.c (compose_glyph_string): Terminate the last loop after
1923 doing default combining if necessary.
1925 2004-06-24 Kenichi Handa <handa@m17n.org>
1927 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1929 * character.c (mchar_define_property): Add const to an arg.
1931 * charset.c (mchar_define_charset): Add const to an arg.
1933 * coding.c (MCodingSystem): Add const to an arg or decoder.
1934 (finish_decoding): Add const to an arg.
1935 (decode_coding_charset, decode_coding_utf_8)
1936 (decode_coding_utf_16, decode_coding_utf_32)
1937 (decode_coding_iso_2022, decode_coding_sjis)
1938 (mconv_define_coding): Likewise.
1940 * m17n-X.c (xft_find_metric): Delete unused variable.
1942 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1945 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1948 * mtext.c (count_utf_8_chars, count_utf_16_chars)
1949 (mtext__from_data, mtext_from_data): Add `const' to an arg.
1951 * mtext.h (mtext__from_data): Ajust prototype.
1953 2004-06-23 Kenichi Handa <handa@m17n.org>
1955 * draw.c (compose_glyph_string): Always get glyph codes by
1957 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1958 (mdraw_glyph_list): New function.
1960 * font-flt.c (mfont__flt_run): Be sure to call
1961 rfont->driver->encode_char.
1963 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1964 (ft_encode_char): Delete arg C.
1965 (ft_render): Don't call FT_Get_Char_Index.
1967 * font.c (mfont__encodable_p): Delete it.
1968 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1970 * font.h (struct MFontDriver): Delete arg C of encode_char.
1971 (mfont__encodable_p): Delete extern.
1973 * m17n-X.c (xfont_encode_char): Delete arg C.
1974 (xft_find_metric): Don't cal FT_Get_Char_Index.
1975 (xft_render): Likewise.
1977 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
1979 (mdraw_glyph_list): Extern it.
1981 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
1983 2004-06-22 Kenichi Handa <handa@m17n.org>
1985 * m17n-gui.h (mfontset_lookup): Extern it.
1987 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
1989 * fontset.c (realize_fontset_elements)
1990 (free_realized_fontset_elements, update_fontset_elements): New
1992 (mfont__realize_fontset): Call realize_fontset_elements.
1993 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
1994 (mfont__lookup_fontset): If a fontset was modified, update
1995 the realized fontset.
1996 (mfontset_modify_entry): Increment fontset->tick.
1997 (mfontset_lookup): New function.
1999 2004-06-21 Kenichi Handa <handa@m17n.org>
2001 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
2003 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
2004 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
2005 length of source text 0.
2007 2004-06-21 Kenichi Handa <handa@m17n.org>
2009 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
2010 (compare): Pay attention to format other than utf-8.
2011 (copy): Delete this function.
2012 (count_by_utf_8, count_by_utf_16, insert): New functions.
2013 (count_utf_16_chars): Fix handling of a surrogate pair.
2014 (find_char_forward, find_char_backward): Likewise.
2015 (mtext__from_data): Delete unnecessary check. Fix number of
2017 (mtext_from_data): Don't count items.
2018 (mtext_ref_char): Optimize the code.
2019 (mtext_set_char): Pay attention to format other than utf-8.
2020 (mtext_cat_char): Likewise.
2021 (mtext_dup): Don't call copy, instead do allocation here.
2022 (mtext_cat): Call insert instead of copy.
2023 (mtext_ncat): Likewise.
2024 (mtext_cpy): Delete character at first and call insert instead of
2026 (mtext_ncpy): Likewise.
2027 (mtext_copy): Likewise.
2028 (mtext_duplicate): Call insert instead of copy.
2029 (mtext_del): Pay attention to format other than utf-8.
2030 (mtext_ins): Simply call insert.
2031 (mtext_ins_char): Pay attention to format other than utf-8.
2032 (mtext_tok): Call insert instead of copy.
2033 (mtext_text): Call UNIT_BYTES.
2035 * textprop.c (mtext__adjust_plist_for_change): New function.
2037 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
2038 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
2039 (CHAR_UNITS_AT): Fix typo.
2040 (CHAR_UNITS_BY_HEAD): Fix typo.
2041 (STRING_CHAR_AND_UNITS): Fix typo.
2043 * internal.h (MTEXT_READ_ONLY_P): New macro.
2045 * mtext.h (mtext__replace): Delete the extern.
2046 (mtext__adjust_foramt): Adjust prototype.
2048 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2049 if possible. Otherwise make a copy of mmt.
2051 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2054 2004-06-18 Kenichi Handa <handa@m17n.org>
2056 * character.h (CHAR_STRING_UTF16): Fix syntax.
2058 2004-06-16 Kenichi Handa <handa@m17n.org>
2060 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2061 (libm17n_X_la_LIBADD): Delete it.
2062 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2064 * m17n-X.c (device_open): Add parens in `if' condition.
2066 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2067 (DEC_POSITION): Likewise.
2068 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2070 2004-06-15 Kenichi Handa <handa@m17n.org>
2072 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2075 * draw.c (compose_glyph_string): If langauge is specified, call
2076 mface__for_chars even if a text is all latin. Fix condition for
2077 setting non_ascii_found.
2079 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2081 * m17n.h (minput_char_to_key): Delete extern.
2083 * m17n-gui.h (minput_event_to_key): Cancel previous change.
2085 * m17n-gui.c (null_device_open): Set several members of frame.
2087 2004-06-14 Kenichi Handa <handa@m17n.org>
2089 * m17n-gui.h (minput_event_to_key): Delete extern.
2091 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2093 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2095 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2097 2004-06-08 Kenichi Handa <handa@m17n.org>
2099 * character.c (mchar_put_prop): Don't increment the ref-count of
2102 2004-06-04 Kenichi Handa <handa@m17n.org>
2104 * m17n-core.c (mdebug__register_object): New function.
2105 (mdebug__unregister_object): Likewise.
2107 * internal.h (mdebug__register_object, mdebug__unregister_object):
2109 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2112 * charset.c (mcharset__load_from_database): Don't call
2113 mconv__register_charset_coding here.
2115 * coding.c (find_coding): Get a real name from an element of
2116 coding_definition_list.
2117 (mconv__register_charset_coding): Set the real name at the top of
2119 (mcoding__load_from_database): Likewise.
2120 (mconv_list_codings): Adjusted for the above change.
2122 2004-06-03 Kenichi Handa <handa@m17n.org>
2124 * coding.c (find_coding): Find by canonicalized name. Don't have
2125 to modify the element of coding_definition_list by
2127 (mconv__define_coding_from_charset): Delete it.
2128 (mconv__register_charset_coding): Canonicalize sym.
2129 (mcoding__load_from_database): Register plist modified by
2132 * coding.h (mconv__define_coding_from_charset): Don't extern it.
2134 * font-ft.c (ft_open): Fix setting of rfont->descent.
2136 2004-06-02 Kenichi Handa <handa@m17n.org>
2138 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2139 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2140 (xlfd_unparse_name): Renamed from xfont_build_name.
2141 (mfont__init): Initialized Mfontconfig.
2142 (mfont__free_realized): Unconditionally unref rfont->info.
2143 (mfont__select): Free `this' if it's not best.
2144 (mfont__open): Don't check frame->realized_font_list.
2145 (mfont__parse_name_into_font): New function.
2146 (Mfontconfig): New variable.
2147 (mfont_from_name): Call mfont_parse_name.
2148 (mfont_name): Call mfont_unparse_name.
2149 (mdebug_dump_font): Likewise.
2151 * font.h (struct MFontDriver): Delete members parse_name and
2153 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2154 (mfont__parse_name_into_font): Extern it.
2156 * font-ft.c: Include "symbol.h".
2157 (close_ft): Unconditionally free filename and charmap_list of
2159 (ft_open): Duplicate base->filename. Increment ref-count of
2160 ft_info->charmap_list. Free ft_info->charmap_list and
2161 ft_info->filename on error.
2162 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2164 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2166 (enum xlfd_field_idx): Moved to font.c.
2167 (split_font_name, build_font_name): Likewise.
2168 (build_font_list): Call mfont__parse_name_info_font.
2169 (xfont_open): Call mfont__unparse_name. Free name.
2170 (xfont_parse_name, xfont_build_name): Moved to font.c
2171 (xft_select): Prototype deleted.
2172 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2173 Call mfont_pase_name.
2175 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2176 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2179 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2182 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2184 2004-06-01 Kenichi Handa <handa@m17n.org>
2186 * fontset.c (mfontset_modify_entry): Pay attention to the case
2187 that fontset->font_spec_list is NULL.
2189 2004-05-31 Kenichi Handa <handa@m17n.org>
2191 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2193 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2195 * font.c (mfont__select): Print score the a font for debugging.
2197 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2199 * coding.c (reset_coding_sjis): Check kanji and kana instead of
2200 kanji_sym and kana_sym.
2202 2004-05-28 Kenichi Handa <handa@m17n.org>
2204 * Makefile.am (VINFO): New variable.
2205 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2206 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2208 2004-05-27 Kenichi Handa <handa@m17n.org>
2210 The following chanages are to make device dependent functions
2211 accessible only from MDeviceDriver structure, and to add GD and
2212 null device drivers. Font drivers get also device dependent.
2214 * m17n.c (m17n_init): Increament shell_initialized.
2215 (m17n_fini): Decremented shell_initialized.
2217 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2219 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2220 (Mwidget, Mcolormap, Mx): Extern them.
2222 * m17n-gui.c: Include <dlfcn.h> and "config.h".
2223 (free_frame): Call frame->driver->close instead of
2225 (DLOPEN_SHLIB_EXT): New macro.
2226 (MDeviceLibraryInterface): New type.
2227 (device_library_list): New variable.
2228 (register_device_library): New function.
2229 (null_device): New variable.
2230 (null_device_close, null_device_get_prop)
2231 (null_device_realize_face, null_device_free_realized_face): New
2233 (null_driver): New variable.
2234 (null_device_init, null_device_fini, null_device_open): New
2236 (null_interface): New variable.
2237 (Mfreetype, Mdevice): Declare them.
2238 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
2239 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2240 Mwin__Close_Device. Register drivers for Mx and Mgd.
2241 (m17n_fini_win): Decremented win_initialized. Call "fini"
2242 function of all opened devices. Don't call mwin__fini.
2243 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2245 (mframe): Handle Mdevice key of PLIST.
2246 (mframe_get_prop): Call frame->device->get_prop instead of
2247 mwin__device_get_prop.
2249 * m17n-gd.c: New file.
2251 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2252 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2254 * m17n-core.c (m17n_init_core): Increate core_initialized.
2255 (m17n_fini_core): Decremented core_initialized.
2257 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2258 (Mcolormap): Don't extern them here.
2260 * m17n-X.c (FRAME_DEVICE): New macro.
2261 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2262 (free_display_info): Use MPLIST_DO.
2263 (free_device): Free rface->info.
2264 (xft_close): Delete it.
2265 (device_init): Renamed from mwin__init.
2266 (device_fini): Renamed from mwin__fini.
2267 (device_open): Renamed from mwin__open_device.
2268 (x_driver): New variable.
2269 (MXFontInfo): Delete member frame, add member display.
2270 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2271 Don't declare them here.
2273 * internal-gui.h (MDeviceType): New enum.
2274 (MWDefice): Delete it.
2275 (struct MFrame): Change type of device to void *. New members
2276 device_type, driver, font_driver_list.
2277 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2278 (MDeviceDriver): New type.
2279 (Mx, Mgd, Mfreetype): Extern them.
2280 (mwin__XXX): Delete all of them.
2282 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2284 (win_destroy_ic): Likewise.
2285 (adjust_window_and_draw): Likewise.
2286 (win_callback): Likewise.
2287 (Mxim): Declare it here.
2288 (minput_event_to_key): Call M_CHECK_READABLE.
2290 * fontset.c (mfont__lookup_fontset): Delete local variable
2293 * font.h (struct MFontDriver): Delete member close, add members
2294 parse_name and build_name.
2295 (mfont__driver_list): Delete extern.
2296 (mfont__close): Delete extern.
2298 * font.c (mfont__init): Don't set mfont__driver_list.
2299 (mfont__fini): Don't unref mfont__driver_list.
2300 (mfont__select): Try font drivers in frame->font_driver_list. Set
2301 driver member of a realized font.
2302 (mfont__close): Delete it.
2303 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2304 functions of the default frame.
2306 * font-ft.c (close_ft): Check ft_info->ft_face and work
2308 (add_font_info): Allocate ft_info by M17N_OBJECT.
2309 (ft_close): Delete it.
2310 (mfont__ft_driver): Don't set ft_close.
2311 (ft_select): Increment ref-count of best_font.
2312 (ft_open): Decremented ref-count of base. On error, call
2313 FT_Done_Face and free ft_info.
2314 (ft_find_metric): Always use XXX_MONO in load_flags.
2315 (ft_render): Fix setting of width. Call
2316 frame->driver->draw_points instead of mwin__draw_points.
2317 (ft_to_prop): Don't set mfont__driver_list.
2318 (mfont__ft_fini): Just unref ft_info.
2320 * face.c (mface__init): Exchange foreground and background of
2321 mface__default. Call mface_put_prop to set hline of
2323 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2324 (mface__free_realized): Don't call mwin__free_realized_face.
2326 * draw.c (Mdepth): Don't declare it here.
2327 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2328 (render_glyphs, render_glyph_string): Likewise.
2329 (mdraw__init): Don't set Mdepth.
2330 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2332 (mdraw_text_per_char_extents): Return 0 on success and -1 on
2334 (mdraw_text_items): Check FRAME is writable.
2335 (mdraw_per_char_extents): Implement body.
2337 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2339 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2340 (GUI_SOURCES): Delete it.
2341 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2342 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2343 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2344 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2345 (linkgui_LDADD): Set to libm17n-gui.la
2346 (linkgui_LDFLAGS): New target.
2347 (SRC): Include ${libm17n_gui_la_SOURCES} and
2348 ${libm17n_gd_la_SOURCES}.
2350 2004-05-24 Kenichi Handa <handa@m17n.org>
2352 * draw.c (draw_background): Don't draw background even if
2353 rface->face.property[MFACE_BACKGROUND] is not Mnil.
2355 2004-05-22 Kenichi Handa <handa@m17n.org>
2357 * m17n-X.c (xft_open_font): Fix anti_alias setting.
2359 2004-05-20 Kenichi Handa <handa@m17n.org>
2361 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2363 * m17n-gui.c: Include "plist.h".
2364 (mframe): If PLIST is NULL, initialize it to emply plist.
2366 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2367 (xft_driver): New variable.
2368 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2369 (xft_find_metric, xft_render): New function.
2370 (mwin__init): Adjusted for the new mfont__driver_list.
2371 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
2372 generated face to PARAM.
2373 (mwin__realize_face): Fix setting of box colors. Don't call hook
2375 (mwin__draw_hline): New function.
2376 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2377 (mwin__xft_render): Delete these function.
2379 * internal-gui.h (struct MFrame): New member tick.
2380 (struct MGlyphString): New member tick.
2381 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2382 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2383 (mwin__xft_render): Delete extern.
2385 * fontset.c (mfont__lookup_fontset): Make the code simpler.
2386 (mfontset): Always increment the reference count of returned
2389 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2390 (MFTInfo): Moved to font.h.
2391 (ft_iso8859_1_font_list): Delete this variable.
2392 (set_font_info): Don't set font->property[MFONT_TYPE].
2393 (set_font_info): Don't udpate ft_iso8859_1_font_list.
2394 (add_font_info): Change type to void.
2395 (fc_list): Change anme from xft_list. Caller changed. Include
2396 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2397 (mfont__ft_driver): Change name from ft_driver. Caller changed.
2398 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2399 (close_ft): Don't call mwin__xft_close. Unref
2400 ft_info->extra_info.
2401 (ft_open): Don't setup ft_info->fontname. Don't call
2403 (ft_find_metric): Don't call mwin__xft_get_metric.
2404 (ft_encode_char): Call rfont->driver->open instead of ft_open.
2405 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
2406 (mfont__ft_init): Adjusted for new mfont__driver_list.
2407 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2409 * font.c (mfont__driver_list): Make it MPlist.
2410 (mfont__init): Adjust initialization of mfont__driver_list.
2411 (mfont__fini): Free mfont__driver_list.
2412 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2413 (mfont__select): Adjusted for the new mfont__driver_list.
2415 * font.h (enum MFontProperty): Delete MFONT_TYPE.
2416 (mfont__drirver_list): Adjust prototype.
2417 (MFTInfo): Move to here from fron.c. Deleve member fontname.
2419 * face.h (struct MFace): Delete member realized_face_list, add
2421 (struct MRealizedFace): Delete member need_update
2422 andnofont_rface, add member non_ascii_list.
2423 (mface__update_frame_face): Extern it.
2425 * face.c (hline_prop_list, box_prop_list, noop_hook): New
2427 (get_hline_create, get_box_create): New functions.
2428 (find_realized_face): Cancel previous change. Arg RFONT deleted.
2430 (free_face): Cancep previous change. Free face->frame_list.
2431 (serialize_hline): Do nothing if hline->width is zero.
2432 (serialize_box): Do nothing if box->width is zero.
2433 (mface__init): Setup all properties of mface__default.
2434 (mface__fini): Free hline_prop_list and box_prop_list.
2435 (mface__realize): Cancel previous change. Update
2436 face->frame_list. Setup rface->non_ascii_list.
2437 (mface__for_chars): Update rface->non_ascii_list.
2438 (mface__free_realized): Free rface->non_ascii_list.
2439 (mface__update_frame_face): New function.
2440 (mface): Initialize face->frame_list.
2441 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
2443 (mface_merge): Likewise.
2444 (mface_put_prop): If key is Mhline or Mbox, get value by
2445 get_hline_create or get_box_create respectively.
2446 (mface_put_prop): Update frame->tick and call
2447 mface__update_frame_face if necessary.
2448 (mface_update): Do nothing if func is noop_hook.
2450 * draw.c (render_glyphs): If a font is not found, use
2451 mwin__draw_empty_boxes.
2452 (alloc_gstring): Initialize gstring->tick.
2453 (get_gstring): Check gstring->tick.
2455 2004-05-17 Kenichi Handa <handa@m17n.org>
2457 * face.c (find_realized_face): Return value changed. If RFONT is
2458 NULL, avoid unnecessary checking.
2459 (free_face): Free face->realized_face_list.
2460 (mface__realize): Adjusted for the change of find_realized_face.
2461 If it returns a realized face that needs update, free it and
2462 realize a new one. Push a new realized face to
2463 frame->realized_face_list instead of appending.
2464 (mface__for_chars): Adjusted for the change of find_realized_face.
2465 Short cut if the required font is in rface->ascii_rface.
2466 (mface_put_prop): Free old value if necessary. Set need_update
2467 member of realized faces to 1.
2469 * face.h (struct MFace): Delete member tick, add member
2471 (struct MRealizedFace): Delete member tick, add member
2474 2004-05-13 Kenichi Handa <handa@m17n.org>
2476 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2478 2004-05-12 Kenichi Handa <handa@m17n.org>
2480 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2482 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2483 parse it XftNameParse.
2485 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2486 (all_fonts_scaned): New variable.
2487 (set_font_info): FAMILY may be Mnil.
2488 (add_font_info): Argument changed.
2489 (xft_list): Call add_font_info in it.
2490 (ft_list): Likewise.
2491 (ft_select): Make it work in the case family is Mnil.
2492 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2493 (mfont__ft_fini): Set all_fonts_scaned to 0.
2495 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2496 that is failed to open.
2498 2004-05-10 Kenichi Handa <handa@m17n.org>
2500 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2501 device's depth is 1 (i.e. monochrome).
2503 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2504 to work around the problem of libtool.
2506 * font-ft.c: Include <freetype/ftbdf.h>.
2507 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2509 (mfont__ft_init): Initialize them.
2510 (ft_iso8859_1_font_list): New variable.
2511 (set_font_info): Detect a font containing iso8859-1 glyphs and
2512 register it in ft_iso8859_1_font_list. If the font is not
2513 scalable, assume it as BDF or PCF font and setup SIZE and RESY
2514 properties of the font from its properties.
2515 (add_font_list): If the font is not scalable, check if it is BDF
2516 or PCF font. If not, ignore it.
2517 (ft_select): If FAMILY is Mnil, return NULL only if the requested
2518 registry is not iso8859-1.
2519 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2520 ft_iso8859_1_font_list.
2521 (ft_find_metric): If the font is not scalable, assume it as BDF
2522 or PCF, and get a metric from its properties.
2523 (mfont__ft_fini): Free ft_iso8859_1_font_list.
2525 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
2527 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2528 (libm17n_la_LDFLAGS): Delete it.
2529 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2530 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2532 2004-05-06 Kenichi Handa <handa@m17n.org>
2534 * draw.c (compose_glyph_string): Fix previous change.
2536 2004-04-30 Kenichi Handa <handa@m17n.org>
2538 * font-ft.c (ft_list): Delete unused variable `result'.
2539 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2541 2004-04-27 Kenichi Handa <handa@m17n.org>
2543 * m17n-X.c: Include config.h
2544 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2545 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2546 (MWDevice) [HAVE_XFT2]: New member xft_draw.
2547 (FRAME_CMAP, FRAME_VISUAL): New macros.
2548 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2549 (xfont_driver): Make it static.
2550 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2551 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2552 info->xft_color_back.
2553 (MXftFontInfo) [HAVE_XFT2]: New type.
2554 (mwin__xft_close) [HAVE_XFT2]: New function.
2555 (mwin__xft_open) [HAVE_XFT2]: New function.
2556 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2557 (mwin__xft_render) [HAVE_XFT2]: New function.
2559 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2560 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2561 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2564 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2566 * font-ft.c: Don't include FT_FREETYPE_H here.
2567 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2568 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2569 (MFTInfo): New member charmap_index.
2570 (MFTInfo) [HAVE_XFT2]: New member xft_info.
2571 (check_otf_filename): Renamed from check_filename. Return value
2573 (ft_set_property): This function deleted.
2574 (set_font_info): New function.
2575 (add_font_list): Argument changed. Add multiple fonts.
2576 (xft_list) [HAVE_XFT2]: New function.
2577 (ft_list) [not HAVE_XFT2]: New function.
2578 (ft_select): Add code for Xft.
2579 (close_ft): Likewise.
2580 (ft_open): Likewise.
2581 (ft_find_metric): Likewise.
2582 (ft_encode_char): Likewise.
2583 (ft_render): Likewise.
2585 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2587 2004-04-26 Kenichi Handa <handa@m17n.org>
2589 * textprop.c (mtext_attach_property): Declare the return type as
2592 2004-04-21 Kenichi Handa <handa@m17n.org>
2594 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2596 2004-04-09 Kenichi Handa <handa@m17n.org>
2598 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2600 (load_command): Setup above members.
2602 2004-04-05 Kenichi Handa <handa@m17n.org>
2604 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2606 2004-03-30 Kenichi Handa <handa@m17n.org>
2608 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2611 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2612 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2614 2004-03-29 Kenichi Handa <handa@m17n.org>
2616 * Version 1.0 Patch Level 2 released.
2618 2004-03-29 Kenichi Handa <handa@m17n.org>
2620 * charset.c (make_charset): Set charset->fully_loaded and
2621 charset->simple correctly. Don't try to get charset->min_char and
2622 charset->max_char for a charset of method subset and superset.
2623 Don't load a mapping file here.
2624 (mcharset__init): Set unified_max.
2625 (mcharset__load_from_database): Free a working plist.
2627 * coding.c (mcoding__fini): Free all malloced data.
2629 * input-gui.c (win_create_ic): Set control.as_image for preediting
2632 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2633 `count') to initialize the array.
2635 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2638 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2640 (mwin__create_window): Fix bug of setting a background pixel of a
2642 (mwin__adjust_window): Clear the window before drawing.
2644 * m17n-core.c (mdebug__report_object): Free array->objectes if
2646 (m17n_init_core): Don't set report_header_printed to 0 here.
2647 Fix debugging information.
2648 (m17n_fini_core): Set report_header_printed to 0 here.
2650 * m17n-core.h (mplist_deserialize): Extern it.
2652 * m17n-gui.c (m17n_fini_win): Fix debugging information.
2654 * m17n.c (m17n_fini): Fix debugging information.
2656 * mtext.c (mtext__adjust_foramt): New function.
2658 * mtext.h (mtext__adjust_foramt): Extern it.
2660 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2662 * plist.h (mplist__deserialize): Don't extern it.
2664 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
2665 elements of symbol_table to NULL. Report about created and freed
2666 symbols if MDEBUG_FINI is set.
2668 2004-03-22 Kenichi Handa <handa@m17n.org>
2670 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2672 * m17n.c (m17n_init): Fix the way of checking merror_code.
2674 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2676 2004-03-22 Kenichi Handa <handa@m17n.org>
2678 * fontset.c (realize_font_group): Adjust the font size by
2679 mfont__resize before selecting a font.
2681 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2683 2004-03-19 Kenichi Handa <handa@m17n.org>
2685 * Version 1.0 Patch Level 1 released.
2687 2004-03-19 Kenichi Handa <handa@m17n.org>
2689 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2691 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2693 2004-03-19 Kenichi Handa <handa@m17n.org>
2695 Re-apply the changes forgotten in the released version.
2697 * charset.c (mcharset__load_from_database): Call
2698 mchar_define_charset.
2700 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2701 (mconv_encode_range): Put Mcoding text property.
2703 2004-03-18 Kenichi Handa <handa@m17n.org>
2705 * draw.c (Mdepth): New variable.
2706 (visual_order): Delete unused local var `pos'.
2707 (compose_glyph_string): Fix for the case that gstring->glyphs is
2708 realloced. Stop generating glyphs at TO. Fix handling of
2710 (layout_glyphs): Get metrics of all glyphs in advance. Set
2711 lbearing and rbearing of base of composition glyph correctly.
2712 Handle left-overhang glyphs correctly.
2713 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
2715 (dump_combining_code): Change the defualt off_x character to ".".
2716 (mdraw__init): Initialize Mdepth.
2718 * face.c (work_gstring): New variable
2719 (mface__init): Initialize work_gstring.
2720 (mface__fini): Free work_gstring.glyphs.
2721 (mface__realize): Don't handle videomode property here. Adjusted
2722 for the change of mfont__get_metric.
2723 (mface__for_chars): Adjusted for the change of mfont__get_metric.
2725 * face.h (enum face_gc): Moved to m17n-X.c.
2727 * font.h (struct MFontDriver): Arguments of find_metric changed.
2728 (mfont__select): Prototype adjusted.
2729 (mfont__get_metric): Likewise.
2730 (mfont__ft_drive_otf): Likewise.
2731 (mfont__flt_run): Likewise.
2733 * font.c (mfont__select): New argument layouter. If layouter is
2734 different in the registered font, make a new copy of realized
2736 (mfont__get_metric): Argument changed. Get metrics of multiple
2738 (mfont_find): Call mfont__select with layouter as Mnil.
2740 * font-flt.c (FontLayoutContext): New member rfont.
2741 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2742 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
2744 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
2746 (NUM_POINTS): New macro.
2747 (MPointTable): New type.
2748 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2749 (mfont__ft_drive_otf): New argument rfont.
2751 * fontset.c (realize_font_group): Adjusted for the changed of
2753 (check_fontset_element): This function deleted.
2755 * input-gui.c (adjust_window_and_draw): Locate a preedit window
2756 off the parent window if the preedit text is zero length.
2758 * internal-gui.h (struct MFrame): New members foreground,
2759 background, videomode, font.
2760 (struct MGlyphString): New member anti_alias.
2761 (MDrawPoint): New type.
2762 (mwin__draw_bitmap): Prototype deleted.
2763 (mwin__draw_points): Prototype added.
2765 * m17n-gui.h (MDrawControl): New member anti_alias.
2767 * m17n-gui.c (free_frame): Free frame->font.
2768 (mframe): Set the fontset of frame->face to the default fontset.
2770 * m17n-X.c (RGB_GC): New type.
2771 (enum gc_index): Renamed from enum face_gc. Member names changed.
2773 (struct MWDevice): Members foreground and background deleted. New
2774 member scratch_gc, gc_list.
2775 (DEFAULT_FONT, FALLBACK_FONT): New macros.
2776 (free_device): Free GCs in device->gc_list.
2777 (get_rgb_gc): New function.
2778 (get_gc): Renamed and argument changed from get_color.
2779 (get_gc_for_anti_alias): New function.
2780 (xfont_find_metric): Arguments changed. Get metrics of multiple
2782 (set_region): Argument changed. Caller changed.
2783 (xfont_render): Allways set a font in gc.
2784 (x_error_handler, x_io_error_handler): Define only if
2785 X_SET_ERROR_HANDLER is defined.
2786 (mwin__open_device): Create device->scratch_gc. Set members
2787 foreground, background, and videomode of frame. Call
2788 XSetErrorHandler and XSetIOErrorHandler only if
2789 X_SET_ERROR_HANDLER is defined.
2790 (struct gc_list): Deleted.
2791 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2792 (mwin__realize_face): Adjusted for the change of the format of
2793 rface->info and the charge of set_region.
2794 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2795 (mwin__draw_box): Likewise.
2796 (mwin__draw_bitmap): This function deleted.
2797 (mwin__draw_points): New function.
2798 (mwin__verify_region): Adjusted for the change of the format of
2799 rface->info and the charge of set_region.
2800 (mwin__create_window): Inherit backgound pixel from parent.
2801 (mwin__dump_gc): Adjusted for the change of the format of
2804 2004-03-16 Kenichi Handa <handa@m17n.org>
2806 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2808 * input.c (M_key_alias): New variable.
2809 (handle_key): Try M_key_alias property of a key too.
2810 (minput__init): Initialize M_key_alias. Give that property to
2811 symbols in one_char_symbol. Fix bug of initializing
2814 * draw.c (compose_glyph_string): Don't handle
2815 ignore_formatting_char here. Include formatting characters in the
2816 range processed by a FTL.
2817 (layout_glyph_string): Handle ignore_formatting_char here.
2819 2004-03-12 Kenichi Handa <handa@m17n.org>
2821 * input-gui.c (win_create_ic): Enable bidi in status control.
2823 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2825 2004-03-09 Kenichi Handa <handa@m17n.org>
2827 * input.c (load_input_method): If title is not specified, use the
2828 input method name as title.
2830 * m17n-X.c (get_color): Make it static.
2831 (xim_create_ic, xim_destroy_ic, x_error_handler)
2832 (x_io_error_handler): Likewise.
2834 2004-03-01 Kenichi Handa <handa@m17n.org>
2836 * Version 1.0 released.
2839 Copyright (C) 2003, 2004
2840 National Institute of Advanced Industrial Science and Technology (AIST)
2841 Registration Number H15PRO112
2843 This file is part of the m17n library.
2845 The m17n library is free software; you can redistribute it and/or
2846 modify it under the terms of the GNU Lesser General Public License
2847 as published by the Free Software Foundation; either version 2.1 of
2848 the License, or (at your option) any later version.
2850 The m17n library is distributed in the hope that it will be useful,
2851 but WITHOUT ANY WARRANTY; without even the implied warranty of
2852 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2853 Lesser General Public License for more details.
2855 You should have received a copy of the GNU Lesser General Public
2856 License along with the m17n library; if not, write to the Free
2857 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA