1 2005-12-13 Kenichi Handa <handa@m17n.org>
3 * input.c (Mless_equal, Mgreater_equal): New variables.
4 (parse_expression, resolve_expression, parse_action_list)
5 (take_action_list): Handle the aboves.
6 (filter): Treat key S-X as X.
7 (minput__init): Initialize Mless_equal and Mgreater_equal.
8 (minput_get_title_icon): New function.
10 * m17n.h (minput_get_title_icon): Extern it.
12 * database.c (get_database_filename): Return a filename instead of
14 (load_database): Adjusted for the above change.
15 (mdatabase__load_for_keys): Likewise.
16 (mdatabase__find_file): New function.
18 * database.h (mdatabase__find_file): Extern it.
20 * font.h (mfont__resize): Delete extern.
22 * font.c (mfont__list): Check resize ratio.
23 (mfont__resize): Delete it.
24 (mfont_resize_ratio): Include the code of mfont__resize.
26 * font-ft.c (ft_open): Check resize ratio.
28 * m17n-X.c (xfont_open): Check resize ratio.
31 2005-12-07 Kenichi Handa <handa@m17n.org>
33 * input.c (take_action_list): If take_action_list return -1,
35 (handle_key): Likewise.
37 * face.c (mface__for_chars): When font is specified and layouter
38 is found for it, if the layouter doesn't support one of a
39 character, use a face sans layouter for it.
41 2005-12-06 Kenichi Handa <handa@m17n.org>
43 * fontset.c (mfont__lookup_fontset): If only a fallback font is
44 found, don't use it for more than one character.
46 2005-12-05 Kenichi Handa <handa@m17n.org>
48 * face.c (mface__realize): Set rfont->layouter to Mnil.
49 (mface__for_chars): Fix handling of layouter.
51 * character.h (mchar__define_prop): Extern it.
53 * database.c (update_database_list): Call mchar__define_prop if
56 * character.c (mchar__init): Don't call mchar_define_property.
57 Instead just initialize property keys.
58 (mchar__fini): Free char_prop_list only if it's not NULL.
59 (mchar__define_prop): New function.
60 (mchar_define_property): Call mchar__define_prop.
62 * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
65 2005-12-02 Kenichi Handa <handa@m17n.org>
67 * language.c (mlang__init): Handle extra chars.
69 * m17n-gui.h (mfont_check): Adjust prototype.
71 * m17n-X.c (xfont_driver): Specify xfont_check_capability.
72 (xfont_check_capability): New function.
73 (xft_driver): Specify xft_check_capability.
74 (xft_check_capability): New function.
76 * font-ft.c (M0_3): Delete it.
78 (ft_get_charmaps): Refer to M0.
79 (fc_parse_pattern): Fix previous change.
80 (ft_list_language): Check also extra chars.
81 (ft_check_otf): Define it even if HAVE_OTF is undef.
82 (ft_check_lang): Check the result of FcLangSetHasLang against
83 FcLangDifferentLang. Check also extra chars.
84 (ft_list_capability): Delete ifdef HAVE_OTF.
85 (ft_select): Likewise.
86 (ft_open): Improve debug information.
87 (ft_check_capability): New function.
88 (mfont__ft_driver): Specify ft_check_capability.
89 (mfont__ft_init): Initialize M0.
91 * fontset.c (get_font_from_group): New function.
92 (mfontset__get_font): New function.
94 * fontset.h (mfontset__get_font): Extern it.
96 * font.c (OTF_tag): Define it if HAVE_OTF is undef.
97 (mfont__fini): Delete ifdef HAVE_OTF.
98 (free_font_capability): Likewise.
99 (mfont__get_capability): Likewise.
100 (mfont__check_capability): New function.
101 (mfont_check): Change the order of arguments. Use
104 * font.h (struct MFontDriver): New member check_capability.
105 (MFontCapability): Delete ifdef HAVE_OTF.
106 (mfont__check_capability): Extern it.
108 * face.c (mface__realize): Fix handling of FONT arg.
109 (mface__for_chars): Fix handling of explicitly specified font.
111 2005-11-25 Kenichi Handa <handa@m17n.org>
113 * font-flt.c (run_command): Print debug info for
116 * draw.c (layout_glyphs): Fix handling of left/right_padding.
118 * face.c (mface__for_chars): Check rfont before accessing the
121 2005-11-21 Kenichi Handa <handa@m17n.org>
123 * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
126 * fontset.c (fontset_table): New variable.
127 (free_fontset): Call M17N_OBJECT_UNREGISTER.
128 (mfont__fontset_init): Add fontset_table as an object array.
129 (mfont__realize_fontset): Ref FONTSET.
130 (mfont__free_realized_fontset): Unref REALIZED->fontset.
131 (mfontset): Call M17N_OBJECT_REGISTER.
132 (mfontset_copy): Likewise.
134 * input.c (handle_key): For debugging, print information about
136 (filter): Add an alias for Meta and Alt modifiers.
137 (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
139 (minput__init): Initialize them.
140 (parse_expression): New function.
141 (resolve_expression): New function.
142 (parse_action_list): Handle expressions by parse_expression.
143 (take_action_list): Handle expressions by resolve_expression.
144 (parse_nested_list_value): Fix previous change.
145 (resolve_command): Fix handling of the return value of
148 2005-11-18 Kenichi Handa <handa@m17n.org>
150 * font-ft.c (ft_check_otf, otf_script_list): Define only when
152 (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
154 (ft_select): Likewise.
156 * font.c (mfont_list): Fix for the case that FONT is NULL.
157 (OTF_tag): Delete it.
158 (load_otf_script_list): Define only when HAVE_OTF is defined.
159 (mfont__fini): Unref otf_script_list only when HAVE_OTF is
162 * draw.c (truncate_gstring): Be sure to truncate at
163 glapheme-cluster boundary.
165 2005-11-11 Kenichi Handa <handa@m17n.org>
167 * input.c (delete_surrounding_text): Clear cache if necessary.
169 2005-11-09 Kenichi Handa <handa@m17n.org>
171 * draw.c (compose_glyph_string): Update prev->rface->rfont if the
172 glyph prev is also supported by the current flt.
174 2005-11-08 Kenichi Handa <handa@m17n.org>
176 * m17n-X.c (xft_render): Cancel previous change.
178 2005-11-07 Kenichi Handa <handa@m17n.org>
180 * input.c: Include <stdlib.h>.
181 (get_surrounding_text, delete_surrounding_text)
182 (get_preceding_char, get_following_char): New functions.
183 (integer_value): New arg surrounding. If it is nonzero, try to
184 get a surrounding character. Callers changed.
185 (take_action_list): Check `value' before setting an element.
186 (destroy_ic): Unref ic_info->preceding_text and
187 ic_info->following_text.
188 (minput__init): Initialize Minput_get_surrounding_text and
189 Minput_delete_surrounding_text.
190 (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
192 (filter): Unref ic_info->preceding_text and
193 ic_info->following_text.
195 * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
198 * input.h (MInputContextInfo): New members preceding_text and
201 2005-11-04 Kenichi Handa <handa@m17n.org>
203 * input.c (parse_nested_list_value): Fix handling of the global
205 (get_nested_list): Get global definitions by load_partial_im_info.
206 (preedit_commit): Set ic->candidates_changed to bitwise or of enum
207 MInputCandidatesChanged.
208 (take_action_list): Likewise.
209 (reset_ic): Likewise.
210 (create_ic): Don't pay special attention to
211 Mcandidates_group_size.
212 (load_partial_im_info): Call mdatabase_find with correct 4th arg.
213 (minput_set_variable): Get a definition of varible by
214 mplist_find_by_value, not mplist_get.
216 * m17n.h (enum MInputCandidatesChanged): New enum.
218 2005-11-01 Kenichi Handa <handa@m17n.org>
220 * m17n-X.c (xft_render): Check xft_draw's drawable before changing
222 (mwin__destroy_window): If xft_draw's drawable is win, change it
223 to device->drawable before destroying win.
225 2005-10-31 Kenichi Handa <handa@m17n.org>
227 * input.c (load_im_info): Fix adding of state.
229 * m17n-core.c (m17n_fini_core): Fix reporting of module
232 * m17n.c (m17n_fini): Fix reporting of module finalization.
234 * m17n-gui.c (m17n_init_win): Fix reporting of module
237 2005-10-29 Kenichi Handa <handa@m17n.org>
239 * input.c (get_candidate_list): Fix the timing of referring plist.
241 2005-10-28 Kenichi Handa <handa@m17n.org>
243 * input.c (load_branch): Ignore an undefined map name.
244 (load_im_info): Set im_info->title from `name' only if it's not
246 (shift_state): Always update ic->status.
247 (adjust_candidates): Renamed from adjust_candidate_command.
248 Argument changed. Caller changed.
249 (get_candidate_list, regularize_action): New functions.
250 (take_action_list): Use them. On handling Munhandle, don't set
252 (handle_key): If KEY is not handled by MAP, and MAP has
253 branch_actions, perform them.
255 * database.c (mdatabase__fini): Free dir_info->filename;
257 2005-10-20 Kenichi Handa <handa@m17n.org>
259 * input.c (marker_code): Accept '@@'.
260 (integer_value): Handle '@@'.
261 (parse_action_list): Accept a symbol argument.
262 (take_action_list): Resolve the symbol argument. Handle the
265 2005-10-18 Kenichi Handa <handa@m17n.org>
267 * input.c: Include "charset.h".
268 (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
270 (MIMState): New member (M17NObject control).
271 (lookup_nested_list, set_nested_list, parse_nested_list_value)
272 (get_nested_list, resolve_variable): New functions.
273 (integer_value): New arg (MPlist **value). Set it to the plist
274 element containing the value.
275 (resolve_command): New function.
276 (load_translation): New arg (MPlist *map_actions).
277 (load_branch): New args language and name. If `keylist' is a
278 symbol, resolved that as a command name.
279 (free_map): New arg top. Free map->map_actions only if top is
281 (free_state): New function.
282 (load_state): New arg name.
283 (im_info_list): New variable.
284 (free_im_info, get_im_info_by_tags): New functions.
285 (load_im_info): Arg key changed to plist. Handle `include'.
286 Return (MInputMethodInfo *).
287 (preedit_commit): Ref ic->candidate_list.
288 (get_select_charset, adjust_candidate_command): New functions.
289 (take_action_list): Handle `include'. Adjust candidate action
290 properly. Handle control variables `candidates-charset' and
291 `candidates-group-size'.
292 (open_im): Use get_im_info.
293 (create_ic): Get global variables.
294 (load_partial_im_info): New function.
295 (get_im_info): New function.
296 (check_command_keyseq, check_command_list, check_variable_list):
298 (minput__init): Don't handle M_database_hook and Mdetail_text.
299 Initialize M_candidates, Mcandidates_group_size,
301 (parse_variable_list, get_variable_list, parse_command_list)
302 (get_command_list): Delete them.
303 (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
304 (minput__fini): Simply unref command_list and variable_list.
305 (minput_get_description): Adjusted for the new form of description.
306 (minput_get_commands): Use get_nested_list.
307 (minput_assign_command_keys): Likewise.
308 (minput_get_variables, minput_set_variable): Likewise.
310 * input.h (MInputMethodInfo): New members im and maps.
312 * database.h (M_database_hook): Delete extern.
313 (MDatabaseHookFunc): Delete extern.
314 (mdatabase__check): Extern it.
316 * database.c: Include <glob.h>.
317 (MAX_TIME): New macro.
318 (Masterisk): New variable.
319 (get_database_stream): Argument changed to (MDatabaseInfo *).
321 (get_dir_info): Renamed from duplicate_dirname. Callers changed.
322 (find_database): New function.
323 (update_database_list): New function.
324 (mdatabase__init): Initialize Masterisk. Setup mdb_list by
325 calling update_database_list.
326 (mdatabase__check): New function.
327 (mdatabase_find): Use update_database and find_database. Don't
328 handle MDatabaseHookFunc.
329 (mdatabase_list): Call update_database at first.
330 (mdatabase_define): Adjusted for the change of mdb->extra_info.
331 (MDatabaseList): New type.
333 * plist.h (mplist_conv, mplist__pop_unref): Extern them.
335 * m17n.h (Mdetail_text): Delete extern.
337 * m17n-core.h (mplist_conc): Delete extern.
339 * plist.c (mplist__conc): Renamed from mplist_conc. Don't ref
341 (mplist_conc): Renamed to mplist__conc.
342 (mplist__pop_unref): New function.
344 2005-10-14 Kenichi Handa <handa@m17n.org>
346 * plist.c (read_mtext_element): Ignore the sequence of '\\' and
348 (read_element): If keys is an empty plist, return any element
350 (dump_plist_element): Check if plist is nested.
351 (mplist_conc): Always ref tail.
352 (mplist_set): If key is a managing key, ref val in advance.
354 * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
355 (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
356 (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
359 * fontset.c (free_fontset): Unref fontset_list if necessary.
360 (mfont__fontset_fini): Don't free fontset_list. Unref
362 (mfont__realize_fontset): Initialize request.
363 (mfontset): Ref default_fontset or fontset only if necessary.
364 (mfontset_copy): Don't ref copy.
366 * draw.c (render_glyphs): Check gend->type before checking
369 * font-ft.c (mfont__ft_fini): Unref ft_default_list. Set all
370 unrefed plists to NULL.
372 2005-10-04 Kenichi Handa <handa@m17n.org>
374 * textprop.c (mtext_serialize): Be sure to make mt
375 MTEXT_FORMAT_UTF_8 and NULL terminated.
377 * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
379 * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
381 2005-10-03 Kenichi Handa <handa@m17n.org>
383 * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
384 is not at the beginning of line.
386 2005-09-22 Kenichi Handa <handa@m17n.org>
388 * input.c: Include <sys/stat.h> and <unistd.h>.
389 (Minclude, Mcommit, Munhandle): New variables.
390 (minput__init): Initialize them. Push only Mstate to
391 load_im_info_keys. Add aliases C-lowercase for C-uppercase.
392 (parse_action_list): Allow integer arg for undo. Handle Mcommit
394 (load_input_method): Handle "include" directive. If no states are
396 (shift_state): If state_name is Mt, shift back to the previous
397 state. Call preedit_commit to commit preedit text.
398 (preedit_commit): New function.
399 (take_action_list): Improve debug printing. Handle commit and
401 (handle_key): Check the return value of take_action_list. Don't
402 take branch_actions just after changing to the root map.
403 (reset_ic): Reset all ic_info members.
404 (filter): When a key is not handled, just move ic_info->keys
405 instead fo calling reset_ic.
406 (load_im_info): If key is not Mstate, push Mmap to
408 (MDatabaseStatList): New type.
409 (imdir_stat_list): New variable.
410 (input_method_hook): Don't cancel the hook. Check the
411 modification time of directories.
412 (minput__fini): Free imdir_stat_list;
414 * input.h (MInputContextInfo): New member prev_state.
416 * m17n-core.h (mplist_conc): Extern it.
418 * plist.c (mplist_conc): New function.
420 * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
422 * font.h (MRealizedFont): New member average_width.
424 * font-ft.c (ft_open): Set rface->average_width.
426 * font.c (xlfd_unparse_name): Print '*' before registry name.
428 * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
429 (xfont_open): Set rfont->average_width.
430 (xft_open): Likewise.
431 (device_open): Initialize disp_info->AVERAGE_WIDTH.
433 * internal-gui.h (struct MFrame): New member average_width.
435 * m17n-gui.c (mframe): Fix setting of frame->rfont.
436 (mframe_get_prop): Return the average_width of a font.
438 * face.c (mface__realize): Set rface->average_width.
439 (mface__update_frame_face): Set frame->average_width.
441 * face.h (MRealizedFace): New member average_width.
443 2005-09-19 Kenichi Handa <handa@m17n.org>
445 * font.c (xlfd_unparse_name): New arg full_xlfd.
446 (mfont__encode_char): Use shortcut only for X core fonts.
447 (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
448 (mfont_put_prop): Handle `language' property.
449 (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
450 Print file can capability info too.
452 * m17n-core.c (mdebug__output): New variable.
453 (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
454 (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
455 (m17n_fini_core): Close mdebug__output if it's not stderr.
457 * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
458 (xfont_open): Handle baseline_offset.
459 (xfont_find_metric): Likewise.
460 (xfont_render): Likewise.
461 (xft_open): Likewise.
462 (xft_render): Likewise.
464 * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
465 (mdebug__output): Extern it.
466 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
467 (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
468 (MDEBUG_DUMP): New macro.
469 (MDEBUG_PRINT_TIME): Print to medebug__output.
471 * font.h (MRealizedFont): New member baseline_offset.
473 * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
475 (fc_weight_table): Add FC_WEIGHT_REGULAR.
476 (ft_list_family): Check alias.
477 (ft_list_language): If language is "en", don't try to the second
479 (ft_default_list): New variable.
480 (ft_list_default): New function.
481 (ft_select): If family is not specified, try only the default
482 fonts. Treat the weights normal and medium same.
483 (ft_open): Fix debug message. If registry is not specified, try
484 unicode-bmp. Handle _MULE_BASELINE_OFFSET property of BDF fonts.
485 (ft_find_metric): Likewise.
486 (ft_render): Likewise.
487 (ft_list): Fix debug message. Accept the registring iso8859-1.
488 If family is not specified, try only the default fonts.
490 * face.c (mface__realize): Fix logic of opening a font.
492 2005-09-16 Kenichi Handa <handa@m17n.org>
494 * face.c (mface__realize):
496 * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
499 * input.c (shift_state): Fix the condition of taking init actions.
500 (take_action_list): Fix handling of pushback action.
501 (handle_key): Don't change key while checking its alias.
502 (minput__init): Initialize new variables.
503 (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
506 2005-09-12 Kenichi Handa <handa@m17n.org>
508 * mtext.c (mtext__uppercase): Add proper open/close parens.
509 (mtext_titlecase): Add proper casting.
511 * input.c (parse_action_list): Handle the case that the arg is a
512 key sequence (MText or MPlist).
513 (take_action_list): Likewise.
514 (shift_state): Shorter debug message.
515 (handle_key): Terminate a debug message by "\n".
516 (reset_ic): Don't take initial actions here.
517 (minput_open_im): Print a debug message.
518 (minput_close_im): Likewise.
519 (minput_create_ic): Likewise.
520 (minput_destroy_ic): Likewise.
522 2005-09-09 TAKAHASHI Naoto <ntakahas@m17n.org>
524 * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
527 2005-09-07 TAKAHASHI Naoto <ntakahas@m17n.org>
528 * character.c: Add "cased", "soft-dotted", and "case-mapping" in
531 * character.c: Add Japanese documentation for
532 mchar_get_prop_table ().
534 2005-09-06 TAKAHASHI Naoto <ntakahas@m17n.org>
536 * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
537 (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
538 (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
540 (init_case_conversion): New function.
541 (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
542 (uppercase_precheck, lowercase_precheck, final_sigma)
543 (after_soft_dotted, more_above, before_dot, after_i)
544 (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
546 2005-09-05 TAKAHASHI Naoto <ntakahas@m17n.org>
548 * plist.c (read_mtext_element): Fix previous change.
550 2005-09-05 Kenichi Handa <handa@m17n.org>
552 * plist.c (read_mtext_element): Handle \uXXXX notation.
554 * internal.h (MTABLE_MALLOC): Don't use a local variable.
555 (MTABLE_ALLOCA): Change the name of local variable.
557 * m17n-gd.c (device_open): Define it even if HAVE_GD nor
558 HAVE_FREETYPE are defined.
560 * m17n-X.c: Check HAVE_X11.
562 * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
563 directory listing libraries.
564 (noinst_PROGRAMS): Define it only in maintainer mode.
566 2005-09-02 Kenichi Handa <handa@m17n.org>
568 * m17n-gui.h (mdraw_line_break_option): Extern it.
570 * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
571 end of the first glyph.
572 (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
574 (mdraw_line_break_option): New variable.
575 (mdraw_default_line_break): Use mtext_line_break.
577 * mtext.h (wordseg_func_table): Don't extern it.
578 (mtext__wseg_fini): Extern it.
580 * mtext.c: Don't include word-thai.h.
581 (wordseg_func_table): Delete this variable.
582 (mtext__init): Don't initialize above. Don't call
583 mtext__word_thai_init.
584 (mtext__fini): Don't free wordseg_func_table. Call
585 mtext__wseg_fini instead fo mtext__word_thai_fini.
586 (MTextWordsegFunc): Don't typedef it.
587 (mtext__word_segment): Moved to mtext-wseg.c.
589 * m17n-core.h (enum MTextLineBreakOption): New enum.
590 (mtext_line_break): Extern it.
592 * mtext-wseg.c: New file.
594 * mtext-lbrk.c: New file.
596 * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
597 add mtext-lbrk.c and mtext-wseg.c.
599 * textprop.c (mtext__adjust_plist_for_change): Pay attention for
600 the case that head is NULL.
602 2005-09-01 Kenichi Handa <handa@m17n.org>
604 * word-thai.c (wordseg_propertize): If the property value is nil,
605 don't make the property no-merge.
606 (thai_wordseg): Don't require *from and *to are set a priori. Pay
607 attention to the case that they are NULL.
608 (mtext__word_thai_init): Make the name of Mthai_wordseg starts
611 * character.c (mchar_get_prop_table): New function.
613 * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
615 * m17n-core.h (mtext_insert, mtext_replace): Extern them.
616 (mchar_get_prop_table): Extern it.
618 * textprop.c (prepare_to_modify): New arg deleting. Callers changed.
619 (mtext__adjust_plist_for_change): Argument changed. Callers changed.
621 * internal.h (enum MTextCoverage): New enum.
622 (MText): New member coverage.
624 * mtext.c (FORMAT_COVERAGE): New macro.
625 (insert): Copy mt2->coverage.
626 (mtext__from_data): Initialize mt->coverage.
627 (mtext__adjust_format): Update mt->coverage.
628 (mtext): Initialize mt->coverage.
629 (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
630 Update mt->coverage if necessary.
631 (mtext_duplicate): Copy mt->coverage.
632 (mtext_insert, mtext_replace): New functions.
633 (mtext_dup): Use mtext_duplicate.
634 (mtext__word_segment): Don't set *from and *to if a word
635 segmentation funcion is not found.
636 (mtext_ins_char): Fix typo.
638 2005-08-25 Kenichi Handa <handa@m17n.org>
640 * font.h (MFont): New member for_full_width.
642 * font.c (compare_font_score): Prefer a font of not
645 * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
646 registry charset of a font is one of CJK charsets.
648 * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
649 supports some of CJK.
651 2005-08-24 Kenichi Handa <handa@m17n.org>
653 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
655 * m17n-gui.c (null_device_open): Check Mresolution param and set
658 * m17n-gd.c (device_open): Check Mresolution param and set
661 * m17n-X.c (MWDevice): New member resy.
662 (xfont_open): Set ascent, descent, and max_advance members of
664 (xft_open): Likewise.
665 (device_open): Compare also screen_num to find a device. Set
666 device->resy and frame->dpi.
668 * internal-gui.h (MFrame): New member dpi.
670 * font.h (MRealizedFont): New member max_advance.
672 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
673 (mfont__init): Don't initialize Mascent, Mdescent.
674 (Mascent, Mdescent): Delete these variables.
675 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
676 Mfont_descent instead of Mascent and Mdescent.
677 (mfont_put_prop): Allow negative size.
678 (mfont_find): Handle the case of spec->size < 0. Fix previous
680 (mfont_list): Handle the case of spec->size < 0.
681 (mfont_check): Likewise.
683 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
684 (fc_get_pattern): Handle the case of font->size < 0.
685 (ft_open): Set ascent, descent, and max_advance members of rfont.
686 (ft_find_metric): Improve rounding.
687 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
690 * face.c (mface__realize): Handle the case of font->size < 0.
692 2005-08-22 Kenichi Handa <handa@m17n.org>
694 * coding.c (MConverterStatus): Change the member buf to union.
695 (mconv_buffer_converter): Add const to the arg buf.
696 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
697 (mconv_decode): Adjusted for the change of MConverterStatus.
698 (mconv_encode_range): Likewise.
700 * m17n.h (mconv_buffer_converter): Prototype adjusted.
701 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
703 2005-08-20 Kenichi Handa <handa@m17n.org>
705 * m17n-gui.h (mfont_from_name): Prototype adjusted.
706 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
708 * m17n-X.c (xfont_open): Set members ascent, descent, and
709 max_advance of rfont.
710 (xft_open): Likewise.
712 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
714 (mfont__ft_parse_name): Add const to the arg name.
716 * font.c (xlfd_parse_name): Add const to the arg name. Call
717 mfont__set_property instead of mfont_set_spec. Set font->spacing.
718 (xlfd_unparse_name): Handle spacing.
719 (mfont__init): Initialize new variables.
720 (mfont__id): Handle spacing.
721 (mfont__merge): Likewise.
722 (mfont__set_spec): This function deleted.
723 (mfont__parse_name_into_font): Add const to the arg name. Fix the
724 condition of calling mfont__ft_parse_name.
725 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
726 (mfont_get_prop): Handle properties spacing, ascent, descent,
728 (mfont_find): Return a realized font.
729 (mfont_from_name): Add const to the arg name.
731 * font.h (enum MFontProperty): New member MFONT_SPACING.
732 (enum MFontSpacing): New enum.
733 (MFont): New members spacing and max_advance.
734 (mfont__ft_parse_name): Prototype adjusted.
735 (mfont__set_spec): Extern deleted.
736 (mfont__parse_name_into_font): Prototype adjusted.
738 2005-08-19 Kenichi Handa <handa@m17n.org>
740 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
742 * font.c (mfont_list): If FONT is null, use a temporary font.
743 (mfont_parse_name): Add const to the arg name.
745 2005-08-18 Kenichi Handa <handa@m17n.org>
747 * word-thai.c: Surround code by #ifdef and #endif to escape from
750 * font-ft.c: Mostly re-written.
752 * font-flt.c (FontLayoutCmdOTF): This type deleted.
753 (FontLayoutCmd): Type of the member otf changed..
754 (load_otf_command): Adjusted for the format change of otf command.
755 (load_command): Likewise.
756 (free_flt_command): Unref cmd->body.otf.
757 (run_otf): Ajusted for the type change of otf_cmd.
758 (run_command): Ajusted for the type change of otf_cmd. On
759 debugging, print ctx->combining_code.
760 (mfont__flt_run): Initialize ctx's members code_offset,
761 combining_code, and left_padding to 0.
763 * face.h (struct MRealizedFace): New member font.
764 (mface__realize): Prototype adjusted.
766 * face.c (find_realized_face): New arg font.
767 (find_realized_face): Adjusted for the change of MFont.
768 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
769 (mface__fini): Don't call mdebug__report_object.
770 (mface__realize): New arg font.
771 (mface__for_chars): Adjusted for the change of mfont__encode_char.
772 Optimize the latin case.
773 (mface__free_realized): Free rface->font.
774 (mface__update_frame_face): Adjusted for the change of mface__realize.
775 (mface_equal): New function.
777 * draw.c (Mcommon): New variable.
778 (visual_order): Args to mfont__encode_char changed.
779 (compose_glyph_string): Handle Mfont text property.
780 (layout_glyphs): Adjusted for the change of MFont.
781 (mdraw__init): Initialize Mcommon.
782 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
784 * font.h (enum MFontType): Members completely changed.
785 (enum MFontProperty): Move MFONT_SIZE to the tail.
786 (enum MFontSource): New enum.
787 (struct MFont): New members type, source, sizes, file, capability,
789 (struct MRealizedFont): Type of member font changed. Members
790 score, status, and encoding deleted.
791 (MFontScore): New type.
792 (MFontList): Member changed.
793 (struct MFontDriver): New member has_char. Types of members
795 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
796 (Mapple_roman): Extern them.
797 (OTF_Tag): Typedefed if not HAVE_OTF.
798 (enum MFontOpenTypeTable): New enum.
799 (MFontCapability): New type.
800 (mfont__ft_drive_otf): Prototype adjusted.
801 (mfont__score): Extern deleted.
802 (mfont__merge): Extern it.
803 (mfont__has_char): Extern it.
804 (mfont__encode_char): Prototype adjusted.
805 (mfont__open): Extern it.
806 (mfont__set_spec): Prototype adjusted.
807 (mfont__get_capability): Extern it.
809 * font.c: Include "fontset.h".
810 (M_font_capability, M_font_list, M_font_list_len): New variables.
811 (font_score_priority): Change order of initial elements.
812 (font_score_shift_bits): Fix array size.
813 (common_weight): Add "thin", "semibold", and "heavy".
814 (common_stretch): Add "ultracondensed", "extracondensed",
815 "extraexpanded", and "utltraexpand".
816 (font_weight_regular, font_weight_normal, font_weight_medium): New
818 (gen_font_name): This function deleted.
819 (find_encoding): Set font->encoding.
820 (OTF_tag): New function.
821 (otf_script_list): New variable.
822 (load_otf_script_list): New function.
823 (find_script_from_otf_tag): New function.
824 (xlfd_parse_name): Set font->type and font->source.
825 (mfont__free_realized): Free chains rfonts.
826 (font_score): Renamed from mfont__score.
827 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
828 (Mapple_roman): New variables.
829 (mfont__init): Initilize new variables. Initalize
830 default_encoding.encoding_name and
831 default_encoding.encoding_charset to Municode_full and
832 mcharset__unicode. Use SAFE* macros for allocating filepath
834 (mfont__fini): Free otf_script_list.
835 (mfont__id): New function.
836 (mfont__match_p): Check also capability member of MFont.
837 (mfont__merge): New funciton.
838 (mfont__set_spec_from_face): Set type and source members.
839 (mfont__set_spec_from_plist): Set capability and type members.
840 (mfont__select): Argument changed.
841 (mfont__available): New function.
842 (compare_font_score): New function.
843 (mfont__list): New function.
844 (mfont__open): Return a realized font.
845 (mfont__resize): Adjusted for the change of MFont.
846 (mfont__has_char): New function.
847 (mfont__encode_char): Argument changed.
848 (mfont__set_spec): Argument changed.
849 (free_font_capability): New function.
850 (mfont__get_capability): New function.
851 (MFontfile): New variable.
852 (mfont_get_prop): Adjusted for the change of MFont.
853 (mfont_put_prop): Likewise.
854 (mfont_set_selection_priority): Fix the way of setting
855 font_score_priority[].
856 (mfont_find): Use mfont__list instead of mfont__select.
857 (mfont_resize_ratio): Adjusted for the change of MFont.
858 (mfont_list): Use mfont__list.
859 (mfont_check): New function.
860 (font_score): Make it static.
862 * fontset.h (mfont__realize_fontset): Prototype adjusted.
863 (mfont__lookup_fontset): Likewise.
865 * fontset.c (struct MFontset): Delete member font_spec_list.
866 (struct MRealizedFontset): Type of member spec changed. New
868 (load_font_group): Arg spec_list deleted.
869 (load_fontset_contents): Adjusted for the change of fontset_def.
870 (free_fontset): Fix the way of freeing fontset elements.
871 (realize_fontset_elements): Argument changed.
872 (get_per_script): New function.
873 (free_realized_fontset_elements): Fix the way of feeing rfontset
875 (update_fontset_elements): Fix args to realize_fontset_elements.
876 (mfont__realize_fontset): New arg spec.
877 (try_font_list): New function.
878 (try_font_group): New arg request. Use try_font_list.
879 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
881 (mfontset): Adjusted for the change of MFontset.
882 (mfontset_copy): Likewise. Don't share plists.
883 (mfontset_modify_entry): Adjusted for the change of MFontset.
884 (mfontset_lookup): Call get_per_script.
885 (mdebug_dump_fontset): Print also the address of fonts.
887 * input.c (shift_state): Don't reset ic_info->vars.
888 (take_action_list): Call MDEBUG_PRINT fore calling
891 * internal-gui.h (MFontDriver): Don't typedef it here.
893 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
894 (MXFont): This type deleted.
896 (struct _MFontX): New struct.
897 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
898 (MDisplayInfo): Member base_font_list deleted.
899 (DEFAULT_FONT): Definition changed.
900 (FALLBACK_FONT): This maclr deleted.
901 (free_display_info): Adjusted for the change of MDisplayInfo.
902 (free_device): Argument to mfont__free_realized changed.
903 (xfont_driver): Adjusted for the change of MFontDriver.
904 (xfont_registry_list): Use MFontX instead of MXFont.
905 (MRealizedFontX): Renamed from MXFontInfo.
906 (xfont_select): Return the font found first.
907 (close_xfont): Change MXFontInfo to MRealizedFontX.
908 (xfont_open): Return the realized font.
909 (xfont_find_metric): Get xfont from rfont->fontp.
910 (xfont_has_char): New function.
911 (xfont_encode_char): Adjusted for the argument change.
912 (xfont_render): Get xfont from rfont->fontp.
913 (xfont_list): Adjusted for the argument change.
914 (MRealizedFontXft): Renamed from MXftFontInfo.
915 (xft_driver): Ajusted for the change of MFontDriver.
916 (close_xft): Change MXtfFontInfo to MRealizedFontXft
917 (xft_open_font): Argument changed.
918 (xft_open): Argument changed. Return the realized font.
919 (xft_find_metric): Get xft_font from rfont->fontp.
920 (xft_has_char, xft_encode_char): New functions.
921 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
922 font if not yet opened.
923 (device_open): Don't set frame->font.
925 * m17n-gd.c (gd_font_driver): Adjusted for the change of
927 (gd_font_open): New function.
928 (gd_render): Don't use the local variable ft_info.
929 (device_init): Adjusted for the change of gd_font_driver.
931 * textprop.c (mtext__prop_init): Initialize text_property_table.
932 Call M17N_OBJECT_ADD_ARRAY.
933 (mtext__prop_fini): Don't call mdebug__report_object.
935 * plist.c (mplist__init): Initialize plist_table.
936 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
937 (mplist__fini): Don't call mdebug__report_object.
939 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
940 (mtext__fini): Don't call mdebug__report_object.
941 (MTEXT_FORMAT_UTF_16): Correct type.
942 (mtext_data): New function.
943 (mtext_text): Fix calculation of limit and args to
946 * language.c: Include "plist.h".
947 (M_script_lang_list): New variable.
948 (mlang__init): Read languages and their information from m17n
950 (mlanguage__list): New function.
951 (Miso639_1, Miso639_2): New variables.
953 * language.h (mlanguage__list): Extern it.
955 * database.c (get_database_stream): Use SAFE_* macros for
956 allocating and freeing path.
957 (mdatabase__init): Likewise.
959 * symbol.c (msymbol__fini): Don't free symbols here.
960 (msymbol__free_table): New function.
961 (msymbol_is_managing_key): New function.
963 * symbol.h (msymbol__free_table): Extern it.
964 (msymbol__list): Extern it.
966 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
968 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
969 (struct _M17NObjectArray): New member name and next.
970 (mdebug__add_object_array): Extern it.
971 (M17N_OBJECT_ADD_ARRAY): New macro.
972 (mdebug__report_object): Don't extern it.
974 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
976 * m17n-gui.c (free_frame): Don't free frame->font.
977 (null_device_fini): Fix code for freeing
978 null_device.realized_font_list.
979 (m17n_fini_win): Free interface.
980 (mframe): Cast the return value of dlsym. Set frame->font here.
981 (mframe_get_prop): Check frame->rface->rfont before accessing the
984 * m17n-gui.h (Mfontfile): Extern it.
985 (mfont_check): Extern it.
986 (mface_equal): Extern it.
988 * m17n-core.c: Include "symbol.h".
989 (report_header_printed): This variable deleted.
990 (object_array_root): New variable.
991 (report_object_array): New function.
992 (mdebug__report_object): This function deleted.
993 (mdebug__add_object_array): New function.
994 (m17n_init_core): Call mchartable_init () before mtext_init ().
995 (m17n_fini_core): Call report_object_array (if necessary) and
996 msymbol__free_atable at the end.
998 * m17n-core.h (msymbol_is_managing_key): Extern it.
999 (mtext_data): Extern it.
1000 (MTEXT_FORMAT_UTF_16): Correct type.
1001 (M17NLIB_MINOR_VERSION): Changed to 3.
1002 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1004 * chartab.c (mchartable__init): Initalize chartable_table.count.
1005 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1006 mdebug__report_object.
1008 2005-05-26 Kenichi Handa <handa@m17n.org>
1010 * m17n.h (Miso639_1, Miso639_2): Extern them.
1012 * symbol.h (msymbol__list): Extern it.
1014 * symbol.c (msymbol__list): New function.
1016 2005-05-19 Kenichi Handa <handa@m17n.org>
1018 * input-gui.c (minput__win_init): Don't change the value of
1021 2005-05-16 Kenichi Handa <handa@m17n.org>
1023 * m17n-core.c (m17n_object): Be sure to initialize all members.
1025 * font-ft.c (fc_decode_prop): Fix args to msymbol.
1027 2005-05-09 Kenichi Handa <handa@m17n.org>
1029 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1031 2005-04-27 Kenichi Handa <handa@m17n.org>
1033 * language.c (mlang__init): Add "an" (Aragonese).
1035 * word-thai.c: Add support for libthai.
1036 (mtext__word_thai_init): Initialize wordseg library conditionaly.
1037 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1039 * mtext.c: Include "word-thai.h" conditionaly.
1040 (mtext__init): Call mtext__word_thai_init conditionaly.
1041 (mtext__fini): Call mtext__word_thai_fini conditionaly.
1043 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1044 not WORDCUT_LD_FLAGS.
1046 2005-04-19 Kenichi Handa <handa@m17n.org>
1048 * word-thai.c (wordseg_propertize): Always unref the attached
1050 (thai_wordseg): Don't unref the property.
1052 2005-04-18 Kenichi Handa <handa@m17n.org>
1054 * word-thai.c: Include stdlib.h.
1055 (wordseg_propertize): Add dummy function for the case that wordcut
1056 library doesn't exist.
1057 (wordseg_propertize): Fix for old wordcut library.
1059 2005-04-16 Kenichi Handa <handa@m17n.org>
1061 * word-thai.c: Include <stdio.h>.
1063 2005-04-15 Kenichi Handa <handa@m17n.org>
1065 * draw.c: Include mtext.h.
1066 (linebreak_table, M_break_at_space, M_break_at_word)
1067 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1068 (compose_glyph_string): Check POS before getting Mface text
1070 (truncate_gstring): Give correct TO arg to line_break function.
1071 (GET_LB_TYPE): New macro.
1072 (find_break_backward, find_break_forward): New functions.
1073 (mdraw__init): Initialize the above new variables.
1074 (mdraw__fini): Free linebreak_table.
1075 (mdraw_default_line_break): Use find_break_backward and
1078 * word-thai.c: New file.
1080 * word-thai.h: New file.
1082 * mtext.c: Include word-thai.h.
1083 (wordseg_func_table): New variable.
1084 (mtext__init): Initialize wordseg_func_table and call
1085 mtext__word_thai_init.
1086 (mtext__fini): Call mtext__word_thai_fini, free
1088 (MTextWordsegFunc): New type.
1089 (mtext__word_segment): New function.
1091 * mtext.h (wordseg_func_table): Extern it.
1092 (mtext__word_segment): Extern it.
1094 * m17n.c (m17n_init): Fix typo (== -> =).
1096 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1097 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1099 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1100 (MTEXTPROP_VAL): New macros.
1102 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1104 2005-04-07 Kenichi Handa <handa@m17n.org>
1106 * database.c (load_chartable): Fix pursing of symbol name.
1108 2005-03-24 Kenichi Handa <handa@m17n.org>
1110 * m17n.c (m17n_init): Fix typo (== -> =).
1112 2005-03-11 Kenichi Handa <handa@m17n.org>
1114 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1116 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1118 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1121 2005-03-09 handa <handa@m17n.org>
1123 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1124 calling m17n_init ().
1126 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1127 calling m17n_init_core ().
1129 2005-02-28 Kenichi Handa <handa@m17n.org>
1131 * font-flt.c (mfont__flt_run): Add resulting code sequence in
1134 2005-02-17 Kenichi Handa <handa@m17n.org>
1136 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1137 (M_description, M_command, M_variable): New variables.
1138 (load_im_info_keys): New variables.
1139 (load_im_info, check_command_keyseq, get_description_advance)
1140 (parse_command_list, get_command_list, parse_variable_list)
1141 (get_variable_list, input_method_hook): New functions.
1142 (command_list, variable_list): New variables.
1143 (minput__init): Put input_method_hook to Minput_method.
1144 Initialize M_description, M_command, M_variable, Mdetail_text,
1145 load_im_info_keys, command_list, variable_list.
1146 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1147 (Mdetail_text): New variable.
1148 (minput_get_description, minput_get_commands)
1149 (minput_assign_command_keys, minput_get_variables)
1150 (minput_set_variable): New functions.
1152 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1153 (minput_assign_command_keys, minput_get_variables)
1154 (minput_set_variable): Extern them.
1156 * plist.c (UNGETC): Just decrement st->p.
1157 (read_mtext_element): New arg skip.
1158 (read_integer_element): Likewise.
1159 (read_symbol_element): Likewise.
1160 (read_element): New arg KEYS.
1161 (mplist__from_plist): Don't increment ref-count of NULL object.
1162 (mplist__from_file): New arg KEYS.
1163 (mplist_put): Don't increment ref-count of NULL object.
1164 (mplist_add): Likewise.
1165 (mplist_push): Likewise.
1166 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
1168 * plist.h (mplist__from_file): Prototype adjusted.
1170 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1171 (get_database_stream): New function.
1172 (load_database): Use get_database_stream.
1173 (M_database_hook): New variable
1174 (mdatabase__init): Initialize M_database_hook.
1175 (mdatabase__load_for_keys): New function.
1176 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1178 (mdatabase_define): Free mdb->extra_info if necessary.
1180 * database.h (mdatabase__dir_list, M_database_hook)
1181 (mdatabase__load_for_keys): Extern them.
1182 (MDatabaseHookFunc): New type.
1184 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1186 2004-12-27 Kenichi Handa <handa@m17n.org>
1188 * Version 1.2.0 released.
1190 2004-12-27 Kenichi Handa <handa@m17n.org>
1192 * input.c (minput_filter): Don't reset ic->xxx_changed.
1194 * mtext.c (mtext_from_data): Fix documentation.
1196 2004-12-25 Kenichi Handa <handa@m17n.org>
1198 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1199 (M17NLIB_VERSION_NAME): Update to "1.2.".
1201 2004-12-24 Kenichi Handa <handa@m17n.org>
1203 * input.c (reset_ic): Set key_unhandled to 0.
1205 2004-12-21 Kenichi Handa <handa@m17n.org>
1207 * m17n-gui.h (mfont_from_spec): Delete extern.
1209 * input-gui.c (win_callback): Handle Minput_reset.
1210 (minput__win_init): Register reset_ic as a callback for
1213 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
1214 changed. At first, shift to the initial state.
1215 (minput__init): Initialize Minput_reset. Register reset_ic as a
1216 callback for Minput_reset.
1217 (Minput_reset): New variable.
1218 (minput_filter): Always set ic->xxx_changed to 0.
1219 (minput_reset_ic): New function.
1220 (integer_value): Fix typo ('>' -> '<') and calculation of length
1223 * m17n-core.c (merror_code): Change type to `int'.
1225 * m17n-misc.h (merror_code): Adjust type.
1227 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1229 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1230 (mtext_change_prop): Delete extern.
1232 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1233 to `int'. Move the documents to m17n-core.h.
1235 2004-12-13 Kenichi Handa <handa@m17n.org>
1237 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1238 (MTextProperty): Document it.
1240 2004-12-09 Kenichi Handa <handa@m17n.org>
1242 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1244 2004-12-03 Kenichi Handa <handa@m17n.org>
1246 * internal.h (m17n__core_initialized, m17n__shell_initialized,
1247 m17n__gui_initialized): New externs.
1249 * m17n-core.h (enum M17NStatus): New enum.
1250 (m17n_status): Extern it.
1252 * m17n-core.c (core_initialized): Delete this variable.
1253 (m17n__core_initialized, m17n__shell_initialized,
1254 m17n__gui_initialized): New variables.
1255 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1256 instead of core_initialized.
1257 (m17n_status): New function.
1259 * m17n.c (shell_initialized): Delete this variable.
1260 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1263 * m17n-gui.h (m17n_init_win): Adjust the prototype.
1265 * m17n-gui.c (win_initialized): Delete this variable.
1266 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1267 instead of gui_initialized.
1269 2004-11-19 Kenichi Handa <handa@m17n.org>
1271 * input.c (reset_ic): Check if ic_info->state is NULL.
1272 (filter): If ic_info->state is NULL, return 0.
1273 (load_input_method): Don't unref `maps' it it's not created.
1275 2004-11-15 Kenichi Handa <handa@m17n.org>
1277 * input.c (find_candidates_group): If INDEX is -1, find the last
1279 (take_action_list): If the previous of the first candidate is
1280 requested, select the last candidate.
1282 2004-11-08 Kenichi Handa <handa@m17n.org>
1284 * m17n-X.c (device_open): Try at most 32 fonts to find a
1285 non-autoscaled font.
1287 * font.c (xlfd_parse_name): Fix previous change.
1289 2004-11-05 Kenichi Handa <handa@m17n.org>
1291 * font.c: (commont_style): Include dummy elements "slanted" and
1292 "rslanted" to prefer "o" to "r" if "i" is requested.
1294 * font-ft.c (ft_to_prop): Fix "oblique" entry.
1296 2004-10-29 Kenichi Handa <handa@m17n.org>
1298 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1300 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1301 New members smallest and larger.
1302 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1303 (xfont_registry_list): Likewise.
1304 (xfont_select): Likewise.
1307 2004-10-28 Kenichi Handa <handa@m17n.org>
1309 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1310 font name comparison.
1311 (xfont_select): Fix logic for selecting a larger size font.
1313 2004-10-25 Kenichi Handa <handa@m17n.org>
1315 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1318 2004-10-22 Kenichi Handa <handa@m17n.org>
1320 * input.c (update_candidate): Renamed from udpate_candidate.
1321 (take_action_list): Show more debugging info on arithmetic commands.
1323 * m17n-X.c (device_open): Fix previous change.
1325 * draw.c (compose_glyph_string): Don't get face property at the
1328 2004-10-21 Kenichi Handa <handa@m17n.org>
1330 * draw.c (compose_glyph_string): Fix for the case of category
1333 2004-10-19 Kenichi Handa <handa@m17n.org>
1335 * input.c (mdebug_mask): New variable.
1336 (shift_state): Print debug information.
1337 (take_action_list): Likewise.
1338 (handle_key): Likewise.
1340 2004-10-14 Kenichi Handa <handa@m17n.org>
1342 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1344 2004-10-13 Kenichi Handa <handa@m17n.org>
1346 * m17n-X.c (device_open): Be sure to register at least one font
1349 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
1350 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1352 2004-10-12 Kenichi Handa <handa@m17n.org>
1354 * draw.c (alloc_gstring): Fix previous change.
1356 * font-ft.c (ft_list_generic): Fix for the case of not
1359 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1361 * font.c (mfont_list): If no font is found, return NULL.
1362 (load_font_encoding_table): Put entries of nil registry first.
1363 (find_encoding): Adjust for the above change.
1365 2004-10-11 Kenichi Handa <handa@m17n.org>
1367 * m17n-gui.h (mfont_list): Adjust prototype.
1369 * m17n-X.c (xfont_list): New arg maxnum.
1371 * font.h (struct MFontDriver): Change prototype of <list>.
1373 * font-ft.c (fc_generic_family_list): Delete it.
1374 (Mserif, Msans_serif, Mmonospace): Delete them.
1375 (M_generic_family_info): New variable.
1376 (enum GenericFamilyType): New enum.
1377 (struct GenericFamilyInfo): New struct.
1378 (generic_family_table): New variable.
1379 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1381 (add_font_info): Get style here.
1382 (ft_list_family): Don't initialize fc_config here. Don't list
1384 (ft_list_generic): New function.
1385 (ft_select): Pay attention to generic familes here.
1386 (ft_open): Fix calculation of ascent and descent.
1387 (ft_list): Pay attention to generic families.
1388 (mfont__ft_init): Initialize M_generic_family_info,
1389 generic_family_table, and fc_config..
1390 (mfont__ft_fini): Finalize generic_family_table.
1392 * draw.c (compose_glyph_string): Use more constant font for
1393 glyphs. Adjust for the member change in MGlyph.
1394 (layout_glyph_string): Adjust for the member change in MGlyph.
1395 (alloc_gstring): Intilize scracth_glyph to avoid
1396 compose_glyph_string on it.
1397 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1398 (mdraw_coordinates_position): Fix previous change.
1400 * internal-gui.h (glyph_category): New enum.
1401 (MGlyph): Change type of <category> to enum glyph_category.
1403 * face.c (mface__realize): Delete args langauge and charset.
1404 (mface__for_chars): Fix for the case that glyphs have different
1406 (mface__update_frame_face): Adjust for mface__realize change.
1408 * face.h (mface__realize): Adjust prototype.
1410 2004-10-05 Kenichi Handa <handa@m17n.org>
1412 * language.c (mlang__init): Add Akan.
1414 2004-10-04 Kenichi Handa <handa@m17n.org>
1416 * font-ft.c (add_font_info): Add instead of push the element.
1417 (ft_list_family): For generic fonts, try all
1418 substituted. families.
1420 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1421 (run_rule): Don't update cluster range here.
1422 (run_command): Update cluster range on appending a glyph.
1423 (run_otf): Update cluster range for glyphs generated by OTF.
1425 2004-10-02 Kenichi Handa <handa@m17n.org>
1427 * m17n-X.c (device_open): Handle Mfont key in PLIST.
1429 2004-09-30 Kenichi Handa <handa@m17n.org>
1431 * font-ft.c (ft_select): Ignore family on calling mfont__score.
1433 2004-09-30 Kenichi Handa <handa@m17n.org>
1435 * font.h: Include <fontconfig/fontconfig.h>.
1436 (MFTInfo): New member langset.
1437 (mfont__encoding_list): Extern it.
1439 * font.c (mfont__encoding_list): New function.
1440 (mdebug_dump_font_list): New function.
1442 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1443 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1445 (ft_family_list): New variable.
1446 (set_font_info): New arg basep. Callers changed.
1447 (fc_list): Check the return value of FcPatternGetString.
1448 (add_font_info): New arg plist. Callers changed. Update
1450 (ft_list_family): New function (merged fc_list and ft_list_all).
1451 (ft_select): Use ft_list_family.
1452 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
1454 (mfont__ft_init): Initialize above new variables.
1455 (mfont__ft_fini): Free ft_family_list.
1456 (STRDUP_LOWER): New macro.
1457 (set_font_info): Use STRDUP_LOWER.
1458 (ft_list_family): Avoid duplicate addition of font path. Use
1460 (fc_decode_prop): Fix typo.
1462 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1463 (xfont_registry_list): Change argument disp_info to frame.
1465 (xfont_list_all): New function.
1466 (xfont_list): If FONT is not NULL, check all fonts.
1468 2004-09-28 Kenichi Handa <handa@m17n.org>
1470 * m17n-X.c (MXFont, MXFontList): New types.
1471 (MDisplayInfo): Delete members font_registry_list,
1472 iso8859_1_family_list, iso10646_1_family_list, new members
1473 font_list, base_font_list.
1474 (free_display_info): Adusted for the change of MDisplayInfo.
1475 (xfont_driver): Initialize with xfont_list.
1476 (font_compare): New function.
1477 (build_font_list): Deleted.
1478 (xfont_registry_list): New function.
1479 (xfont_select): Use xfont_registry_list.
1480 (xfont_list): New function.
1481 (device_open): Adusted for the change of MDisplayInfo.
1483 * font-ft.c (add_font_info): New arg languages. Callers changed.
1484 (fc_list): Get languages from fonts..
1485 (ft_list_all): Renamed from ft_list. Callers changed.
1486 (ft_list): New function.
1487 (mfont__ft_driver): Initalize with ft_list.
1489 * font.c (mfont_list): New function.
1491 * font.h (struct MFontDriver): New member `list'.
1492 (MFTInfo): New member languages.
1494 * m17n-gui.h (mfont_list): Extern it.
1496 2004-09-27 Kenichi Handa <handa@m17n.org>
1498 * internal-gui.h (struct MGlyphString): Delete members mt,
1499 sub_width, sub_lbrearing, sub_rbearing, and region.
1501 * draw.c (MSubTextExtents): New type.
1502 (layout_glyphs): New arg extents. Set its members.
1503 (layout_glyph_string): Adjusted for the above change.
1504 (alloc_gstring): Don't set gstring->mt.
1505 (truncate_gstring): Call line_break function with mt instead of
1508 2004-09-22 Kenichi Handa <handa@m17n.org>
1510 * mtext.c (count_utf_16_chars): Count each code of invalid
1513 2004-09-19 Kenichi Handa <handa@m17n.org>
1515 * mtext.c (default_utf_16, default_utf_32): Rename them to
1516 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
1519 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1522 2004-09-13 Kenichi Handa <handa@m17n.org>
1524 * draw.c (Mlatin): Don't declare it here.
1525 (visual_order): Fix reordering of combining characters.
1526 (compose_glyph_string): Fix detection of script.
1527 (layout_glyphs): Don't fix reordering of combining characters
1529 (layout_glyph_string): Pay attention to
1530 control->disable_overlapping_adjustment.
1531 (truncate_gstring): Include at least on character in a line.
1532 (get_gstring): Always scan one full line.
1533 (mdraw__init): Don't initialize Mlatin here.
1534 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
1535 have a font, use ascent/descent of an ASCII font. Allow
1536 ink_array_return and logical_array_return to be NULL.
1537 (mdraw_coordinates_position): Fix iteration.
1539 * font-ft.c (MFTtoProp): Member completely changed.
1540 (ft_to_prop): Adjusted for the above change.
1541 (ft_to_prop_size): Likewise.
1542 (set_font_info): Adjusted for the change of MFTtoProp.
1543 (fc_generic_family_list): New variable.
1544 (fc_list): Add special handling of generic font names.
1545 (mfont__ft_init): Adjusted for the change of MFTtoProp.
1546 Initialize fc_generic_family_list.
1547 (mfont__ft_fini): Don't free ft_to_prop. Free
1548 fc_generic_family_list.
1549 (FC_vs_M17N_font_prop): New type.
1550 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1551 (fc_decode_prop, fc_encode_prop): New functions.
1552 (mfont__ft_parse_name): Use fc_decode_prop.
1553 (mfont__ft_unparse_name): Use fc_encode_prop.
1555 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1556 (MWDevice): Add member realized_font_list.
1557 (free_display_info): Don't free disp_info->realized_font_list.
1558 (free_device): Free device->realized_fontset_list.
1559 (xft_find_metric): Use gstring->frame instead of rfont->frame.
1560 (device_open): Don't initialize disp_info->realized_font_list.
1561 (device_open): Initialize device->realized_font_list and set it to
1562 frame->realized_font_list.
1564 * fontset.c (try_font_group): New function.
1565 (mfont__lookup_fontset): Use try_font_group.
1567 * font.c (common_weight): Change the order of "regular".
1569 * face.c (Mlatin): Don't make it static.
1570 (mface__realize): Be sure to set work_gstring.frame.
1571 (mface__for_chars): Likewise.
1573 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1576 * internal-gui.h (Mlatin): Extern it.
1578 * m17n-gui.h (MDrawControl): New member
1579 disable_overlapping_adjustment.
1581 2004-09-06 Kenichi Handa <handa@m17n.org>
1583 * font-flt.c (run_otf): Fix typo ('}'->']').
1585 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1586 (COMBINING_PRECOMPUTED_P): New macros.
1588 * draw.c (layout_glyphs): Handle precomputed combining code.
1590 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1591 precomupted combining code.
1593 2004-09-03 Kenichi Handa <handa@m17n.org>
1595 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1598 2004-08-27 Kenichi Handa <handa@m17n.org>
1600 * face.c (mface_put_prop): If the new value is the same as the
1601 current one, don't increment frame->tick.
1603 2004-08-25 Kenichi Handa <handa@m17n.org>
1605 * fontset.c (mfontset): Initialize font_spec_list member.
1606 (mfontset_copy): Load fontset if necessary.
1608 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1609 'metrics' to for C++.
1611 * draw.c (mdraw_glyph_info): Adjusted for the member name change
1614 2004-08-16 Kenichi Handa <handa@m17n.org>
1616 * Version 1.1.0 released.
1618 2004-08-13 Kenichi Handa <handa@m17n.org>
1620 * language.c (mlang__init): Add Dhivehi.
1622 * m17n-gui.c (Mx, Mfreetype): Delete it.
1623 (m17n_init_win): Don't initialize Mx and Mfreetype here.
1625 * m17n-gui.h (Mfreetype, Mxft): Extern them.
1626 (mfont_resize_ratio): Extern it.
1627 (MDrawGlyphInfo): New member logical_width;
1628 (MDrawGlyph): New type.
1629 (mdraw_glyph_list): Prototype adjusted.
1631 * m17n-X.c (xfont_open): Set type and fontp members.
1632 (xft_open): Likewise.
1634 * internal-gui.h (Mx, Mfreetype): Delete extern.
1636 * font.h (struct MRealizedFont): New member type and fontp.
1638 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1639 (Mx, Mfreetype): Declare here.
1640 (Mxft): New variable.
1641 (mfont_resize_ratio): New function.
1643 * font-ft.c (ft_open): Set type and fontp members.
1645 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
1648 2004-08-11 Kenichi Handa <handa@m17n.org>
1650 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1653 2004-08-06 Kenichi Handa <handa@m17n.org>
1655 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1658 * font-flt.c (run_otf): Print debugging information if necessary.
1660 2004-08-05 Kenichi Handa <handa@m17n.org>
1662 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
1663 positioning_type 5 and 6. Switch simplified.
1665 2004-08-04 Kenichi Handa <handa@m17n.org>
1667 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1669 2004-08-02 Kenichi Handa <handa@m17n.org>
1671 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1672 set val to 1 even if it is greater than 1.
1674 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1676 2004-07-29 Kenichi Handa <handa@m17n.org>
1678 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1679 debugging information.
1681 * internal.h (MDEBUG_PRINT5): New macro.
1683 * draw.c (layout_glyphs): Don't combine a zero width glyph with
1684 the previous one if the zero width glyph has left or right
1687 2004-07-26 Kenichi Handa <handa@m17n.org>
1689 * m17n-X.c (xft_render): Pay attention to members left_padding and
1690 right_padding of MGlyph.
1692 * draw.c (visual_order): Allocate one more elements for arrays as
1693 a workaround of fribidi bug.
1694 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1695 instead of MGlyph->bidi_sensitive.
1696 (layout_glyph_string): Pay attentinon to
1697 control->orientation_reversed when padding at the head or tail.
1698 Fix adjustment of space glyph width.
1699 (get_gstring): If cursor_width or cursor_bidi is changed, don't
1702 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1703 instead of MGlyph->bidi_sensitive.
1705 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1707 2004-07-26 Kenichi Handa <handa@m17n.org>
1709 * draw.c (visual_order): Don't treat combined glyphs specially.
1710 (layout_glyphs): Don't get metrics glyphs that are already ready.
1711 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
1712 width with the previous one.
1713 (draw_background): Fix bar cursor position on a r2l glyph.
1715 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1716 (run_rule): Fix place of updating cluster_begin_pos and
1717 cluster_end_pos here.
1718 (run_otf): Don't set left_padding.
1720 * font-ft.c (adjust_anchor): Type of argument `code' changed.
1722 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1723 Fix handling of GPOS.
1724 (mfont__ft_drive_gpos): Delete this function.
1726 * font.h (mfont__ft_drive_otf): Renamed back from
1727 mfont__ft_drive_gsub.
1728 (mfont__ft_drive_gpos): Delete extern.
1730 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1731 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1733 2004-07-23 Kenichi Handa <handa@m17n.org>
1735 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1736 the same bidi level.
1738 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1740 2004-07-22 Kenichi Handa <handa@m17n.org>
1742 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1744 2004-07-20 Kenichi Handa <handa@m17n.org>
1746 * draw.c (render_glyphs): Fix checking of g->code validity.
1748 * face.c (mface__realize): Set g.type.
1750 2004-07-18 Kenichi Handa <handa@m17n.org>
1752 * Makefile.am: Prepend ${top_srcdir} to all *.la in
1755 * m17n-gui.c (mframe): Print error message give by dlopen to
1758 2004-07-16 Kenichi Handa <handa@m17n.org>
1760 * draw.c (compose_glyph_string): Improve the way of deciding a
1761 script. For a character that doesn't have script property, use
1762 the last non-latin script.
1764 * font-ft.c (fc_list): Cancel previous change.
1765 (mfont__ft_init): Add more entries in ft_to_prop_name.
1767 2004-07-15 Kenichi Handa <handa@m17n.org>
1769 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1770 previous or next character glyphs.
1772 2004-07-14 Kenichi Handa <handa@m17n.org>
1774 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1775 of type GLYPH_SPACE.
1777 * fontset.c (mfont__lookup_fontset): If glyph type is
1778 GLYPH_SPACE, get codes for SPACE.
1780 * internal-gui.h (Mfont): Delete extern.
1782 * m17n-gui.h (Mfont): Delete duplicated extern.
1784 2004-07-13 Kenichi Handa <handa@m17n.org>
1786 * font-ft.c (DEVICE_DELTA): New macro.
1787 (adjust_anchor): New function.
1788 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
1790 (mfont__ft_drive_gpos): New function.
1792 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1793 (FontLayoutContext): Delete member `rfont'.
1794 (run_otf): Set g->otf_cmd. Call
1795 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
1796 only whne HAVE_OTF is defined.
1798 * fontset.c: Include "config.h".
1800 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1801 (MGlyph): New member otf_cmd.
1803 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1804 (mfont__ft_drive_gpos): Extern it.
1806 * face.c: Include "config.h".
1808 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1810 * input-gui.c: Include "config.h".
1812 * plist.c: Include "config.h".
1814 2004-07-06 Kenichi Handa <handa@m17n.org>
1816 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1817 internal-gui.h: Cancel previous changes.
1819 * m17n-gd.h: Delete it.
1821 * Makefile.am (libm17n_core_la_LIBADD): New variable.
1822 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1823 @XML2_LD_FLAGS@ to above.
1824 (libm17n_la_LIBADD): Add -ldl.
1825 (libm17n_la_LDFLAGS): Add -export-dynamic.
1826 (X_LD_FLAGS): Fix the order of linking.
1827 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1828 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1829 (libm17n_X_la_LDFLAGS): Add -module.
1830 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1831 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1832 (libm17n_gd_la_LDFLAGS): Add -module.
1833 (include_HEADERS): Delete m17n-gd.h.
1835 2004-06-30 Kenichi Handa <handa@m17n.org>
1837 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1838 (MDeviceLibraryInterface): Delete it.
1839 (register_device_library): Delete it.
1840 (m17n__device_library_list): Renamed from device_library_list.
1842 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1843 (m17n_init_win): Adjust prototype.
1845 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1846 (m17n_init_gd): New function.
1848 * m17n-gd.h: New file.
1850 * m17n-X.h: Include <m17n-gui.h>.
1851 (m17n_init_X): Extern it.
1852 (M17N_INIT): Redefine it.
1854 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1855 (m17n_init_X): New function.
1857 * internal-gui.h (m17n__device_library_list): Extern it.
1858 (struct MDeviceDriver): New members initialized, init, and fini.
1860 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1862 (libm17n_X_la_LIBADD): Delete aboves.
1863 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1864 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1865 (libm17n_gd_la_LDFLAGS): Delete it.
1866 (include_HEADERS): Add m17n-gd.h.
1868 2004-06-25 Kenichi Handa <handa@m17n.org>
1870 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1871 (libm17n_gd_la_LDFLAGS): Cancel previous change.
1873 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1875 * font-ft.c (fc_list): If FcFontList finds no font, try
1878 * draw.c (compose_glyph_string): Terminate the last loop after
1879 doing default combining if necessary.
1881 2004-06-24 Kenichi Handa <handa@m17n.org>
1883 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1885 * character.c (mchar_define_property): Add const to an arg.
1887 * charset.c (mchar_define_charset): Add const to an arg.
1889 * coding.c (MCodingSystem): Add const to an arg or decoder.
1890 (finish_decoding): Add const to an arg.
1891 (decode_coding_charset, decode_coding_utf_8)
1892 (decode_coding_utf_16, decode_coding_utf_32)
1893 (decode_coding_iso_2022, decode_coding_sjis)
1894 (mconv_define_coding): Likewise.
1896 * m17n-X.c (xft_find_metric): Delete unused variable.
1898 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1901 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1904 * mtext.c (count_utf_8_chars, count_utf_16_chars)
1905 (mtext__from_data, mtext_from_data): Add `const' to an arg.
1907 * mtext.h (mtext__from_data): Ajust prototype.
1909 2004-06-23 Kenichi Handa <handa@m17n.org>
1911 * draw.c (compose_glyph_string): Always get glyph codes by
1913 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1914 (mdraw_glyph_list): New function.
1916 * font-flt.c (mfont__flt_run): Be sure to call
1917 rfont->driver->encode_char.
1919 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1920 (ft_encode_char): Delete arg C.
1921 (ft_render): Don't call FT_Get_Char_Index.
1923 * font.c (mfont__encodable_p): Delete it.
1924 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1926 * font.h (struct MFontDriver): Delete arg C of encode_char.
1927 (mfont__encodable_p): Delete extern.
1929 * m17n-X.c (xfont_encode_char): Delete arg C.
1930 (xft_find_metric): Don't cal FT_Get_Char_Index.
1931 (xft_render): Likewise.
1933 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
1935 (mdraw_glyph_list): Extern it.
1937 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
1939 2004-06-22 Kenichi Handa <handa@m17n.org>
1941 * m17n-gui.h (mfontset_lookup): Extern it.
1943 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
1945 * fontset.c (realize_fontset_elements)
1946 (free_realized_fontset_elements, update_fontset_elements): New
1948 (mfont__realize_fontset): Call realize_fontset_elements.
1949 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
1950 (mfont__lookup_fontset): If a fontset was modified, update
1951 the realized fontset.
1952 (mfontset_modify_entry): Increment fontset->tick.
1953 (mfontset_lookup): New function.
1955 2004-06-21 Kenichi Handa <handa@m17n.org>
1957 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
1959 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
1960 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
1961 length of source text 0.
1963 2004-06-21 Kenichi Handa <handa@m17n.org>
1965 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
1966 (compare): Pay attention to format other than utf-8.
1967 (copy): Delete this function.
1968 (count_by_utf_8, count_by_utf_16, insert): New functions.
1969 (count_utf_16_chars): Fix handling of a surrogate pair.
1970 (find_char_forward, find_char_backward): Likewise.
1971 (mtext__from_data): Delete unnecessary check. Fix number of
1973 (mtext_from_data): Don't count items.
1974 (mtext_ref_char): Optimize the code.
1975 (mtext_set_char): Pay attention to format other than utf-8.
1976 (mtext_cat_char): Likewise.
1977 (mtext_dup): Don't call copy, instead do allocation here.
1978 (mtext_cat): Call insert instead of copy.
1979 (mtext_ncat): Likewise.
1980 (mtext_cpy): Delete character at first and call insert instead of
1982 (mtext_ncpy): Likewise.
1983 (mtext_copy): Likewise.
1984 (mtext_duplicate): Call insert instead of copy.
1985 (mtext_del): Pay attention to format other than utf-8.
1986 (mtext_ins): Simply call insert.
1987 (mtext_ins_char): Pay attention to format other than utf-8.
1988 (mtext_tok): Call insert instead of copy.
1989 (mtext_text): Call UNIT_BYTES.
1991 * textprop.c (mtext__adjust_plist_for_change): New function.
1993 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
1994 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
1995 (CHAR_UNITS_AT): Fix typo.
1996 (CHAR_UNITS_BY_HEAD): Fix typo.
1997 (STRING_CHAR_AND_UNITS): Fix typo.
1999 * internal.h (MTEXT_READ_ONLY_P): New macro.
2001 * mtext.h (mtext__replace): Delete the extern.
2002 (mtext__adjust_foramt): Adjust prototype.
2004 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2005 if possible. Otherwise make a copy of mmt.
2007 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2010 2004-06-18 Kenichi Handa <handa@m17n.org>
2012 * character.h (CHAR_STRING_UTF16): Fix syntax.
2014 2004-06-16 Kenichi Handa <handa@m17n.org>
2016 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2017 (libm17n_X_la_LIBADD): Delete it.
2018 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2020 * m17n-X.c (device_open): Add parens in `if' condition.
2022 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2023 (DEC_POSITION): Likewise.
2024 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2026 2004-06-15 Kenichi Handa <handa@m17n.org>
2028 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2031 * draw.c (compose_glyph_string): If langauge is specified, call
2032 mface__for_chars even if a text is all latin. Fix condition for
2033 setting non_ascii_found.
2035 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2037 * m17n.h (minput_char_to_key): Delete extern.
2039 * m17n-gui.h (minput_event_to_key): Cancel previous change.
2041 * m17n-gui.c (null_device_open): Set several members of frame.
2043 2004-06-14 Kenichi Handa <handa@m17n.org>
2045 * m17n-gui.h (minput_event_to_key): Delete extern.
2047 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2049 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2051 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2053 2004-06-08 Kenichi Handa <handa@m17n.org>
2055 * character.c (mchar_put_prop): Don't increment the ref-count of
2058 2004-06-04 Kenichi Handa <handa@m17n.org>
2060 * m17n-core.c (mdebug__register_object): New function.
2061 (mdebug__unregister_object): Likewise.
2063 * internal.h (mdebug__register_object, mdebug__unregister_object):
2065 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2068 * charset.c (mcharset__load_from_database): Don't call
2069 mconv__register_charset_coding here.
2071 * coding.c (find_coding): Get a real name from an element of
2072 coding_definition_list.
2073 (mconv__register_charset_coding): Set the real name at the top of
2075 (mcoding__load_from_database): Likewise.
2076 (mconv_list_codings): Adjusted for the above change.
2078 2004-06-03 Kenichi Handa <handa@m17n.org>
2080 * coding.c (find_coding): Find by canonicalized name. Don't have
2081 to modify the element of coding_definition_list by
2083 (mconv__define_coding_from_charset): Delete it.
2084 (mconv__register_charset_coding): Canonicalize sym.
2085 (mcoding__load_from_database): Register plist modified by
2088 * coding.h (mconv__define_coding_from_charset): Don't extern it.
2090 * font-ft.c (ft_open): Fix setting of rfont->descent.
2092 2004-06-02 Kenichi Handa <handa@m17n.org>
2094 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2095 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2096 (xlfd_unparse_name): Renamed from xfont_build_name.
2097 (mfont__init): Initialized Mfontconfig.
2098 (mfont__free_realized): Unconditionally unref rfont->info.
2099 (mfont__select): Free `this' if it's not best.
2100 (mfont__open): Don't check frame->realized_font_list.
2101 (mfont__parse_name_into_font): New function.
2102 (Mfontconfig): New variable.
2103 (mfont_from_name): Call mfont_parse_name.
2104 (mfont_name): Call mfont_unparse_name.
2105 (mdebug_dump_font): Likewise.
2107 * font.h (struct MFontDriver): Delete members parse_name and
2109 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2110 (mfont__parse_name_into_font): Extern it.
2112 * font-ft.c: Include "symbol.h".
2113 (close_ft): Unconditionally free filename and charmap_list of
2115 (ft_open): Duplicate base->filename. Increment ref-count of
2116 ft_info->charmap_list. Free ft_info->charmap_list and
2117 ft_info->filename on error.
2118 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2120 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2122 (enum xlfd_field_idx): Moved to font.c.
2123 (split_font_name, build_font_name): Likewise.
2124 (build_font_list): Call mfont__parse_name_info_font.
2125 (xfont_open): Call mfont__unparse_name. Free name.
2126 (xfont_parse_name, xfont_build_name): Moved to font.c
2127 (xft_select): Prototype deleted.
2128 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2129 Call mfont_pase_name.
2131 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2132 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2135 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2138 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2140 2004-06-01 Kenichi Handa <handa@m17n.org>
2142 * fontset.c (mfontset_modify_entry): Pay attention to the case
2143 that fontset->font_spec_list is NULL.
2145 2004-05-31 Kenichi Handa <handa@m17n.org>
2147 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2149 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2151 * font.c (mfont__select): Print score the a font for debugging.
2153 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2155 * coding.c (reset_coding_sjis): Check kanji and kana instead of
2156 kanji_sym and kana_sym.
2158 2004-05-28 Kenichi Handa <handa@m17n.org>
2160 * Makefile.am (VINFO): New variable.
2161 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2162 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2164 2004-05-27 Kenichi Handa <handa@m17n.org>
2166 The following chanages are to make device dependent functions
2167 accessible only from MDeviceDriver structure, and to add GD and
2168 null device drivers. Font drivers get also device dependent.
2170 * m17n.c (m17n_init): Increament shell_initialized.
2171 (m17n_fini): Decremented shell_initialized.
2173 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2175 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2176 (Mwidget, Mcolormap, Mx): Extern them.
2178 * m17n-gui.c: Include <dlfcn.h> and "config.h".
2179 (free_frame): Call frame->driver->close instead of
2181 (DLOPEN_SHLIB_EXT): New macro.
2182 (MDeviceLibraryInterface): New type.
2183 (device_library_list): New variable.
2184 (register_device_library): New function.
2185 (null_device): New variable.
2186 (null_device_close, null_device_get_prop)
2187 (null_device_realize_face, null_device_free_realized_face): New
2189 (null_driver): New variable.
2190 (null_device_init, null_device_fini, null_device_open): New
2192 (null_interface): New variable.
2193 (Mfreetype, Mdevice): Declare them.
2194 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
2195 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2196 Mwin__Close_Device. Register drivers for Mx and Mgd.
2197 (m17n_fini_win): Decremented win_initialized. Call "fini"
2198 function of all opened devices. Don't call mwin__fini.
2199 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2201 (mframe): Handle Mdevice key of PLIST.
2202 (mframe_get_prop): Call frame->device->get_prop instead of
2203 mwin__device_get_prop.
2205 * m17n-gd.c: New file.
2207 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2208 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2210 * m17n-core.c (m17n_init_core): Increate core_initialized.
2211 (m17n_fini_core): Decremented core_initialized.
2213 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2214 (Mcolormap): Don't extern them here.
2216 * m17n-X.c (FRAME_DEVICE): New macro.
2217 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2218 (free_display_info): Use MPLIST_DO.
2219 (free_device): Free rface->info.
2220 (xft_close): Delete it.
2221 (device_init): Renamed from mwin__init.
2222 (device_fini): Renamed from mwin__fini.
2223 (device_open): Renamed from mwin__open_device.
2224 (x_driver): New variable.
2225 (MXFontInfo): Delete member frame, add member display.
2226 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2227 Don't declare them here.
2229 * internal-gui.h (MDeviceType): New enum.
2230 (MWDefice): Delete it.
2231 (struct MFrame): Change type of device to void *. New members
2232 device_type, driver, font_driver_list.
2233 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2234 (MDeviceDriver): New type.
2235 (Mx, Mgd, Mfreetype): Extern them.
2236 (mwin__XXX): Delete all of them.
2238 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2240 (win_destroy_ic): Likewise.
2241 (adjust_window_and_draw): Likewise.
2242 (win_callback): Likewise.
2243 (Mxim): Declare it here.
2244 (minput_event_to_key): Call M_CHECK_READABLE.
2246 * fontset.c (mfont__lookup_fontset): Delete local variable
2249 * font.h (struct MFontDriver): Delete member close, add members
2250 parse_name and build_name.
2251 (mfont__driver_list): Delete extern.
2252 (mfont__close): Delete extern.
2254 * font.c (mfont__init): Don't set mfont__driver_list.
2255 (mfont__fini): Don't unref mfont__driver_list.
2256 (mfont__select): Try font drivers in frame->font_driver_list. Set
2257 driver member of a realized font.
2258 (mfont__close): Delete it.
2259 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2260 functions of the default frame.
2262 * font-ft.c (close_ft): Check ft_info->ft_face and work
2264 (add_font_info): Allocate ft_info by M17N_OBJECT.
2265 (ft_close): Delete it.
2266 (mfont__ft_driver): Don't set ft_close.
2267 (ft_select): Increment ref-count of best_font.
2268 (ft_open): Decremented ref-count of base. On error, call
2269 FT_Done_Face and free ft_info.
2270 (ft_find_metric): Always use XXX_MONO in load_flags.
2271 (ft_render): Fix setting of width. Call
2272 frame->driver->draw_points instead of mwin__draw_points.
2273 (ft_to_prop): Don't set mfont__driver_list.
2274 (mfont__ft_fini): Just unref ft_info.
2276 * face.c (mface__init): Exchange foreground and background of
2277 mface__default. Call mface_put_prop to set hline of
2279 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2280 (mface__free_realized): Don't call mwin__free_realized_face.
2282 * draw.c (Mdepth): Don't declare it here.
2283 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2284 (render_glyphs, render_glyph_string): Likewise.
2285 (mdraw__init): Don't set Mdepth.
2286 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2288 (mdraw_text_per_char_extents): Return 0 on success and -1 on
2290 (mdraw_text_items): Check FRAME is writable.
2291 (mdraw_per_char_extents): Implement body.
2293 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2295 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2296 (GUI_SOURCES): Delete it.
2297 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2298 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2299 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2300 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2301 (linkgui_LDADD): Set to libm17n-gui.la
2302 (linkgui_LDFLAGS): New target.
2303 (SRC): Include ${libm17n_gui_la_SOURCES} and
2304 ${libm17n_gd_la_SOURCES}.
2306 2004-05-24 Kenichi Handa <handa@m17n.org>
2308 * draw.c (draw_background): Don't draw background even if
2309 rface->face.property[MFACE_BACKGROUND] is not Mnil.
2311 2004-05-22 Kenichi Handa <handa@m17n.org>
2313 * m17n-X.c (xft_open_font): Fix anti_alias setting.
2315 2004-05-20 Kenichi Handa <handa@m17n.org>
2317 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2319 * m17n-gui.c: Include "plist.h".
2320 (mframe): If PLIST is NULL, initialize it to emply plist.
2322 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2323 (xft_driver): New variable.
2324 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2325 (xft_find_metric, xft_render): New function.
2326 (mwin__init): Adjusted for the new mfont__driver_list.
2327 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
2328 generated face to PARAM.
2329 (mwin__realize_face): Fix setting of box colors. Don't call hook
2331 (mwin__draw_hline): New function.
2332 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2333 (mwin__xft_render): Delete these function.
2335 * internal-gui.h (struct MFrame): New member tick.
2336 (struct MGlyphString): New member tick.
2337 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2338 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2339 (mwin__xft_render): Delete extern.
2341 * fontset.c (mfont__lookup_fontset): Make the code simpler.
2342 (mfontset): Always increment the reference count of returned
2345 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2346 (MFTInfo): Moved to font.h.
2347 (ft_iso8859_1_font_list): Delete this variable.
2348 (set_font_info): Don't set font->property[MFONT_TYPE].
2349 (set_font_info): Don't udpate ft_iso8859_1_font_list.
2350 (add_font_info): Change type to void.
2351 (fc_list): Change anme from xft_list. Caller changed. Include
2352 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2353 (mfont__ft_driver): Change name from ft_driver. Caller changed.
2354 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2355 (close_ft): Don't call mwin__xft_close. Unref
2356 ft_info->extra_info.
2357 (ft_open): Don't setup ft_info->fontname. Don't call
2359 (ft_find_metric): Don't call mwin__xft_get_metric.
2360 (ft_encode_char): Call rfont->driver->open instead of ft_open.
2361 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
2362 (mfont__ft_init): Adjusted for new mfont__driver_list.
2363 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2365 * font.c (mfont__driver_list): Make it MPlist.
2366 (mfont__init): Adjust initialization of mfont__driver_list.
2367 (mfont__fini): Free mfont__driver_list.
2368 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2369 (mfont__select): Adjusted for the new mfont__driver_list.
2371 * font.h (enum MFontProperty): Delete MFONT_TYPE.
2372 (mfont__drirver_list): Adjust prototype.
2373 (MFTInfo): Move to here from fron.c. Deleve member fontname.
2375 * face.h (struct MFace): Delete member realized_face_list, add
2377 (struct MRealizedFace): Delete member need_update
2378 andnofont_rface, add member non_ascii_list.
2379 (mface__update_frame_face): Extern it.
2381 * face.c (hline_prop_list, box_prop_list, noop_hook): New
2383 (get_hline_create, get_box_create): New functions.
2384 (find_realized_face): Cancel previous change. Arg RFONT deleted.
2386 (free_face): Cancep previous change. Free face->frame_list.
2387 (serialize_hline): Do nothing if hline->width is zero.
2388 (serialize_box): Do nothing if box->width is zero.
2389 (mface__init): Setup all properties of mface__default.
2390 (mface__fini): Free hline_prop_list and box_prop_list.
2391 (mface__realize): Cancel previous change. Update
2392 face->frame_list. Setup rface->non_ascii_list.
2393 (mface__for_chars): Update rface->non_ascii_list.
2394 (mface__free_realized): Free rface->non_ascii_list.
2395 (mface__update_frame_face): New function.
2396 (mface): Initialize face->frame_list.
2397 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
2399 (mface_merge): Likewise.
2400 (mface_put_prop): If key is Mhline or Mbox, get value by
2401 get_hline_create or get_box_create respectively.
2402 (mface_put_prop): Update frame->tick and call
2403 mface__update_frame_face if necessary.
2404 (mface_update): Do nothing if func is noop_hook.
2406 * draw.c (render_glyphs): If a font is not found, use
2407 mwin__draw_empty_boxes.
2408 (alloc_gstring): Initialize gstring->tick.
2409 (get_gstring): Check gstring->tick.
2411 2004-05-17 Kenichi Handa <handa@m17n.org>
2413 * face.c (find_realized_face): Return value changed. If RFONT is
2414 NULL, avoid unnecessary checking.
2415 (free_face): Free face->realized_face_list.
2416 (mface__realize): Adjusted for the change of find_realized_face.
2417 If it returns a realized face that needs update, free it and
2418 realize a new one. Push a new realized face to
2419 frame->realized_face_list instead of appending.
2420 (mface__for_chars): Adjusted for the change of find_realized_face.
2421 Short cut if the required font is in rface->ascii_rface.
2422 (mface_put_prop): Free old value if necessary. Set need_update
2423 member of realized faces to 1.
2425 * face.h (struct MFace): Delete member tick, add member
2427 (struct MRealizedFace): Delete member tick, add member
2430 2004-05-13 Kenichi Handa <handa@m17n.org>
2432 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2434 2004-05-12 Kenichi Handa <handa@m17n.org>
2436 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2438 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2439 parse it XftNameParse.
2441 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2442 (all_fonts_scaned): New variable.
2443 (set_font_info): FAMILY may be Mnil.
2444 (add_font_info): Argument changed.
2445 (xft_list): Call add_font_info in it.
2446 (ft_list): Likewise.
2447 (ft_select): Make it work in the case family is Mnil.
2448 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2449 (mfont__ft_fini): Set all_fonts_scaned to 0.
2451 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2452 that is failed to open.
2454 2004-05-10 Kenichi Handa <handa@m17n.org>
2456 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2457 device's depth is 1 (i.e. monochrome).
2459 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2460 to work around the problem of libtool.
2462 * font-ft.c: Include <freetype/ftbdf.h>.
2463 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2465 (mfont__ft_init): Initialize them.
2466 (ft_iso8859_1_font_list): New variable.
2467 (set_font_info): Detect a font containing iso8859-1 glyphs and
2468 register it in ft_iso8859_1_font_list. If the font is not
2469 scalable, assume it as BDF or PCF font and setup SIZE and RESY
2470 properties of the font from its properties.
2471 (add_font_list): If the font is not scalable, check if it is BDF
2472 or PCF font. If not, ignore it.
2473 (ft_select): If FAMILY is Mnil, return NULL only if the requested
2474 registry is not iso8859-1.
2475 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2476 ft_iso8859_1_font_list.
2477 (ft_find_metric): If the font is not scalable, assume it as BDF
2478 or PCF, and get a metric from its properties.
2479 (mfont__ft_fini): Free ft_iso8859_1_font_list.
2481 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
2483 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2484 (libm17n_la_LDFLAGS): Delete it.
2485 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2486 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2488 2004-05-06 Kenichi Handa <handa@m17n.org>
2490 * draw.c (compose_glyph_string): Fix previous change.
2492 2004-04-30 Kenichi Handa <handa@m17n.org>
2494 * font-ft.c (ft_list): Delete unused variable `result'.
2495 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2497 2004-04-27 Kenichi Handa <handa@m17n.org>
2499 * m17n-X.c: Include config.h
2500 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2501 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2502 (MWDevice) [HAVE_XFT2]: New member xft_draw.
2503 (FRAME_CMAP, FRAME_VISUAL): New macros.
2504 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2505 (xfont_driver): Make it static.
2506 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2507 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2508 info->xft_color_back.
2509 (MXftFontInfo) [HAVE_XFT2]: New type.
2510 (mwin__xft_close) [HAVE_XFT2]: New function.
2511 (mwin__xft_open) [HAVE_XFT2]: New function.
2512 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2513 (mwin__xft_render) [HAVE_XFT2]: New function.
2515 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2516 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2517 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2520 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2522 * font-ft.c: Don't include FT_FREETYPE_H here.
2523 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2524 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2525 (MFTInfo): New member charmap_index.
2526 (MFTInfo) [HAVE_XFT2]: New member xft_info.
2527 (check_otf_filename): Renamed from check_filename. Return value
2529 (ft_set_property): This function deleted.
2530 (set_font_info): New function.
2531 (add_font_list): Argument changed. Add multiple fonts.
2532 (xft_list) [HAVE_XFT2]: New function.
2533 (ft_list) [not HAVE_XFT2]: New function.
2534 (ft_select): Add code for Xft.
2535 (close_ft): Likewise.
2536 (ft_open): Likewise.
2537 (ft_find_metric): Likewise.
2538 (ft_encode_char): Likewise.
2539 (ft_render): Likewise.
2541 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2543 2004-04-26 Kenichi Handa <handa@m17n.org>
2545 * textprop.c (mtext_attach_property): Declare the return type as
2548 2004-04-21 Kenichi Handa <handa@m17n.org>
2550 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2552 2004-04-09 Kenichi Handa <handa@m17n.org>
2554 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2556 (load_command): Setup above members.
2558 2004-04-05 Kenichi Handa <handa@m17n.org>
2560 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2562 2004-03-30 Kenichi Handa <handa@m17n.org>
2564 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2567 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2568 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2570 2004-03-29 Kenichi Handa <handa@m17n.org>
2572 * Version 1.0 Patch Level 2 released.
2574 2004-03-29 Kenichi Handa <handa@m17n.org>
2576 * charset.c (make_charset): Set charset->fully_loaded and
2577 charset->simple correctly. Don't try to get charset->min_char and
2578 charset->max_char for a charset of method subset and superset.
2579 Don't load a mapping file here.
2580 (mcharset__init): Set unified_max.
2581 (mcharset__load_from_database): Free a working plist.
2583 * coding.c (mcoding__fini): Free all malloced data.
2585 * input-gui.c (win_create_ic): Set control.as_image for preediting
2588 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2589 `count') to initialize the array.
2591 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2594 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2596 (mwin__create_window): Fix bug of setting a background pixel of a
2598 (mwin__adjust_window): Clear the window before drawing.
2600 * m17n-core.c (mdebug__report_object): Free array->objectes if
2602 (m17n_init_core): Don't set report_header_printed to 0 here.
2603 Fix debugging information.
2604 (m17n_fini_core): Set report_header_printed to 0 here.
2606 * m17n-core.h (mplist_deserialize): Extern it.
2608 * m17n-gui.c (m17n_fini_win): Fix debugging information.
2610 * m17n.c (m17n_fini): Fix debugging information.
2612 * mtext.c (mtext__adjust_foramt): New function.
2614 * mtext.h (mtext__adjust_foramt): Extern it.
2616 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2618 * plist.h (mplist__deserialize): Don't extern it.
2620 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
2621 elements of symbol_table to NULL. Report about created and freed
2622 symbols if MDEBUG_FINI is set.
2624 2004-03-22 Kenichi Handa <handa@m17n.org>
2626 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2628 * m17n.c (m17n_init): Fix the way of checking merror_code.
2630 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2632 2004-03-22 Kenichi Handa <handa@m17n.org>
2634 * fontset.c (realize_font_group): Adjust the font size by
2635 mfont__resize before selecting a font.
2637 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2639 2004-03-19 Kenichi Handa <handa@m17n.org>
2641 * Version 1.0 Patch Level 1 released.
2643 2004-03-19 Kenichi Handa <handa@m17n.org>
2645 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2647 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2649 2004-03-19 Kenichi Handa <handa@m17n.org>
2651 Re-apply the changes forgotten in the released version.
2653 * charset.c (mcharset__load_from_database): Call
2654 mchar_define_charset.
2656 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2657 (mconv_encode_range): Put Mcoding text property.
2659 2004-03-18 Kenichi Handa <handa@m17n.org>
2661 * draw.c (Mdepth): New variable.
2662 (visual_order): Delete unused local var `pos'.
2663 (compose_glyph_string): Fix for the case that gstring->glyphs is
2664 realloced. Stop generating glyphs at TO. Fix handling of
2666 (layout_glyphs): Get metrics of all glyphs in advance. Set
2667 lbearing and rbearing of base of composition glyph correctly.
2668 Handle left-overhang glyphs correctly.
2669 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
2671 (dump_combining_code): Change the defualt off_x character to ".".
2672 (mdraw__init): Initialize Mdepth.
2674 * face.c (work_gstring): New variable
2675 (mface__init): Initialize work_gstring.
2676 (mface__fini): Free work_gstring.glyphs.
2677 (mface__realize): Don't handle videomode property here. Adjusted
2678 for the change of mfont__get_metric.
2679 (mface__for_chars): Adjusted for the change of mfont__get_metric.
2681 * face.h (enum face_gc): Moved to m17n-X.c.
2683 * font.h (struct MFontDriver): Arguments of find_metric changed.
2684 (mfont__select): Prototype adjusted.
2685 (mfont__get_metric): Likewise.
2686 (mfont__ft_drive_otf): Likewise.
2687 (mfont__flt_run): Likewise.
2689 * font.c (mfont__select): New argument layouter. If layouter is
2690 different in the registered font, make a new copy of realized
2692 (mfont__get_metric): Argument changed. Get metrics of multiple
2694 (mfont_find): Call mfont__select with layouter as Mnil.
2696 * font-flt.c (FontLayoutContext): New member rfont.
2697 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2698 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
2700 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
2702 (NUM_POINTS): New macro.
2703 (MPointTable): New type.
2704 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2705 (mfont__ft_drive_otf): New argument rfont.
2707 * fontset.c (realize_font_group): Adjusted for the changed of
2709 (check_fontset_element): This function deleted.
2711 * input-gui.c (adjust_window_and_draw): Locate a preedit window
2712 off the parent window if the preedit text is zero length.
2714 * internal-gui.h (struct MFrame): New members foreground,
2715 background, videomode, font.
2716 (struct MGlyphString): New member anti_alias.
2717 (MDrawPoint): New type.
2718 (mwin__draw_bitmap): Prototype deleted.
2719 (mwin__draw_points): Prototype added.
2721 * m17n-gui.h (MDrawControl): New member anti_alias.
2723 * m17n-gui.c (free_frame): Free frame->font.
2724 (mframe): Set the fontset of frame->face to the default fontset.
2726 * m17n-X.c (RGB_GC): New type.
2727 (enum gc_index): Renamed from enum face_gc. Member names changed.
2729 (struct MWDevice): Members foreground and background deleted. New
2730 member scratch_gc, gc_list.
2731 (DEFAULT_FONT, FALLBACK_FONT): New macros.
2732 (free_device): Free GCs in device->gc_list.
2733 (get_rgb_gc): New function.
2734 (get_gc): Renamed and argument changed from get_color.
2735 (get_gc_for_anti_alias): New function.
2736 (xfont_find_metric): Arguments changed. Get metrics of multiple
2738 (set_region): Argument changed. Caller changed.
2739 (xfont_render): Allways set a font in gc.
2740 (x_error_handler, x_io_error_handler): Define only if
2741 X_SET_ERROR_HANDLER is defined.
2742 (mwin__open_device): Create device->scratch_gc. Set members
2743 foreground, background, and videomode of frame. Call
2744 XSetErrorHandler and XSetIOErrorHandler only if
2745 X_SET_ERROR_HANDLER is defined.
2746 (struct gc_list): Deleted.
2747 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2748 (mwin__realize_face): Adjusted for the change of the format of
2749 rface->info and the charge of set_region.
2750 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2751 (mwin__draw_box): Likewise.
2752 (mwin__draw_bitmap): This function deleted.
2753 (mwin__draw_points): New function.
2754 (mwin__verify_region): Adjusted for the change of the format of
2755 rface->info and the charge of set_region.
2756 (mwin__create_window): Inherit backgound pixel from parent.
2757 (mwin__dump_gc): Adjusted for the change of the format of
2760 2004-03-16 Kenichi Handa <handa@m17n.org>
2762 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2764 * input.c (M_key_alias): New variable.
2765 (handle_key): Try M_key_alias property of a key too.
2766 (minput__init): Initialize M_key_alias. Give that property to
2767 symbols in one_char_symbol. Fix bug of initializing
2770 * draw.c (compose_glyph_string): Don't handle
2771 ignore_formatting_char here. Include formatting characters in the
2772 range processed by a FTL.
2773 (layout_glyph_string): Handle ignore_formatting_char here.
2775 2004-03-12 Kenichi Handa <handa@m17n.org>
2777 * input-gui.c (win_create_ic): Enable bidi in status control.
2779 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2781 2004-03-09 Kenichi Handa <handa@m17n.org>
2783 * input.c (load_input_method): If title is not specified, use the
2784 input method name as title.
2786 * m17n-X.c (get_color): Make it static.
2787 (xim_create_ic, xim_destroy_ic, x_error_handler)
2788 (x_io_error_handler): Likewise.
2790 2004-03-01 Kenichi Handa <handa@m17n.org>
2792 * Version 1.0 released.
2795 Copyright (C) 2003, 2004
2796 National Institute of Advanced Industrial Science and Technology (AIST)
2797 Registration Number H15PRO112
2799 This file is part of the m17n library.
2801 The m17n library is free software; you can redistribute it and/or
2802 modify it under the terms of the GNU Lesser General Public License
2803 as published by the Free Software Foundation; either version 2.1 of
2804 the License, or (at your option) any later version.
2806 The m17n library is distributed in the hope that it will be useful,
2807 but WITHOUT ANY WARRANTY; without even the implied warranty of
2808 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2809 Lesser General Public License for more details.
2811 You should have received a copy of the GNU Lesser General Public
2812 License along with the m17n library; if not, write to the Free
2813 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA