1 2006-02-06 Kenichi Handa <handa@m17n.org>
3 * Version 1.3.3 released.
5 2006-02-22 Kenichi Handa <handa@m17n.org>
7 * textprop.c: Fix some typos in documentation.
9 * plist.c: Fix some typos in documentation.
11 * m17n-core.h: Fix some typos in documentation.
12 (M17NLIB_PATCH_LEVEL): Updated to 3.
13 (M17NLIB_VERSION_NAME): Updated to "1.3.3".
15 * symbol.c: Fix some typos in documentation.
17 * mtext.c: Fix some typos in documentation.
19 * input.c: Fix several typos in documentation.
21 2006-02-06 Kenichi Handa <handa@m17n.org>
23 * Version 1.3.2 released.
25 2006-02-03 Kenichi Handa <handa@m17n.org>
27 * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 2.
28 (M17NLIB_VERSION_NAME): Updated to "1.3.2".
30 * font.c (xlfd_parse_name): Fix handling of the name "nil".
32 * draw.c (layout_glyphs): Fix handling left_padding of
35 * m17n-gd.c (read_rgb_txt): Support HTML 4.0 color names.
37 2006-02-02 Kenichi Handa <handa@m17n.org>
39 * Makefile.am (include_HEADERS): Add m17n-gui.h and m17n-X.h only
42 2006-01-25 Kenichi Handa <handa@m17n.org>
44 * input.c (resolve_expression): If the value of PLIST is a plist,
45 but the first element is not symbol, return 0.
47 2006-01-17 Kenichi Handa <handa@m17n.org>
49 * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha only if
50 HAVE_GD is 2 or the greater.
52 2006-01-16 Kenichi Handa <handa@m17n.org>
54 * Version 1.3.1 released.
56 2006-01-16 Kenichi Handa <handa@m17n.org>
58 * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha instead of
59 simulating anti-aliasing.
61 * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 1.
62 (M17NLIB_VERSION_NAME): Updated to "1.3.1".
64 2006-01-12 Kenichi Handa <handa@m17n.org>
66 * input.c (get_surrounding_text): Always pop ic->plist.
67 (reset_ic): Don't reset ic->plist.
69 2006-01-10 Kenichi Handa <handa@m17n.org>
71 * input.c (preedit_commit): For debugging, print only commiting
72 charactes. Don't set ic->candidate_show to 0.
73 (handle_key): Don't run branch-actions just by shifting to the
75 (reset_ic): Reset state_key_head and key_head of ic_info to 0.
78 2006-01-07 Kenichi Handa <handa@m17n.org>
80 * input.c (load_branch): Confirm that maps is not NULL.
82 2006-01-05 Kenichi Handa <handa@m17n.org>
84 * input-gui.c (win_filter): Try to convert arg to key only when
87 * plist.c (read_integer_element): If '#' and '-' are followed by
88 non-integer-constituent, read them as a part of a symbol.
89 (read_symbol_element): New arg C.
90 (read_element): Adjust args to read_symbol_element.
92 * input.c (load_macros): On overwriting a macro, free the old
94 (minput__init): Store Mmap in load_im_info_keys.
95 (minput_get_title_icon): If the input method has no title, be sure
97 (minput_get_description): If the input method has no description,
98 be sure to return NULL.
99 (minput_get_variables): Fix documentation.
100 (handle_key): Pay attention to the case that key is Mnil.
101 (filter): Likewise. Fix handling of such symbol as S-A.
103 2005-12-22 Kenichi Handa <handa@m17n.org>
105 * Version 1.3.0 released.
107 2005-12-22 Kenichi Handa <handa@m17n.org>
109 * font-ft.c (ft_list): If the specified font has no property,
112 2005-12-20 Kenichi Handa <handa@m17n.org>
114 * character.c (mchar_get_prop): Check char_prop_list.
115 (mchar_put_prop, mchar_get_prop_table): Likewise.
117 2005-12-18 Kenichi Handa <handa@m17n.org>
119 * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
120 file name sans language.
122 2005-12-16 TAKAHASHI Naoto <ntakahas@m17n.org>
124 * input.c: Fix typo in comments.
126 2005-12-14 Kenichi Handa <handa@m17n.org>
128 * input.c (minput_get_title_icon): Check the default icon for the
131 2005-12-13 Kenichi Handa <handa@m17n.org>
133 * input.c (Mless_equal, Mgreater_equal): New variables.
134 (parse_expression, resolve_expression, parse_action_list)
135 (take_action_list): Handle the aboves.
136 (filter): Treat key S-X as X.
137 (minput__init): Initialize Mless_equal and Mgreater_equal.
138 (minput_get_title_icon): New function.
140 * m17n.h (minput_get_title_icon): Extern it.
142 * database.c (get_database_filename): Return a filename instead of
144 (load_database): Adjusted for the above change.
145 (mdatabase__load_for_keys): Likewise.
146 (mdatabase__find_file): New function.
148 * database.h (mdatabase__find_file): Extern it.
150 * font.h (mfont__resize): Delete extern.
152 * font.c (mfont__list): Check resize ratio.
153 (mfont__resize): Delete it.
154 (mfont_resize_ratio): Include the code of mfont__resize.
156 * font-ft.c (ft_open): Check resize ratio.
158 * m17n-X.c (xfont_open): Check resize ratio.
159 (xft_open): Likewise.
161 2005-12-07 Kenichi Handa <handa@m17n.org>
163 * input.c (take_action_list): If take_action_list return -1,
165 (handle_key): Likewise.
167 * face.c (mface__for_chars): When font is specified and layouter
168 is found for it, if the layouter doesn't support one of a
169 character, use a face sans layouter for it.
171 2005-12-06 Kenichi Handa <handa@m17n.org>
173 * fontset.c (mfont__lookup_fontset): If only a fallback font is
174 found, don't use it for more than one character.
176 2005-12-05 Kenichi Handa <handa@m17n.org>
178 * face.c (mface__realize): Set rfont->layouter to Mnil.
179 (mface__for_chars): Fix handling of layouter.
181 * character.h (mchar__define_prop): Extern it.
183 * database.c (update_database_list): Call mchar__define_prop if
186 * character.c (mchar__init): Don't call mchar_define_property.
187 Instead just initialize property keys.
188 (mchar__fini): Free char_prop_list only if it's not NULL.
189 (mchar__define_prop): New function.
190 (mchar_define_property): Call mchar__define_prop.
192 * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
195 2005-12-02 Kenichi Handa <handa@m17n.org>
197 * language.c (mlang__init): Handle extra chars.
199 * m17n-gui.h (mfont_check): Adjust prototype.
201 * m17n-X.c (xfont_driver): Specify xfont_check_capability.
202 (xfont_check_capability): New function.
203 (xft_driver): Specify xft_check_capability.
204 (xft_check_capability): New function.
206 * font-ft.c (M0_3): Delete it.
208 (ft_get_charmaps): Refer to M0.
209 (fc_parse_pattern): Fix previous change.
210 (ft_list_language): Check also extra chars.
211 (ft_check_otf): Define it even if HAVE_OTF is undef.
212 (ft_check_lang): Check the result of FcLangSetHasLang against
213 FcLangDifferentLang. Check also extra chars.
214 (ft_list_capability): Delete ifdef HAVE_OTF.
215 (ft_select): Likewise.
216 (ft_open): Improve debug information.
217 (ft_check_capability): New function.
218 (mfont__ft_driver): Specify ft_check_capability.
219 (mfont__ft_init): Initialize M0.
221 * fontset.c (get_font_from_group): New function.
222 (mfontset__get_font): New function.
224 * fontset.h (mfontset__get_font): Extern it.
226 * font.c (OTF_tag): Define it if HAVE_OTF is undef.
227 (mfont__fini): Delete ifdef HAVE_OTF.
228 (free_font_capability): Likewise.
229 (mfont__get_capability): Likewise.
230 (mfont__check_capability): New function.
231 (mfont_check): Change the order of arguments. Use
234 * font.h (struct MFontDriver): New member check_capability.
235 (MFontCapability): Delete ifdef HAVE_OTF.
236 (mfont__check_capability): Extern it.
238 * face.c (mface__realize): Fix handling of FONT arg.
239 (mface__for_chars): Fix handling of explicitly specified font.
241 2005-11-25 Kenichi Handa <handa@m17n.org>
243 * font-flt.c (run_command): Print debug info for
246 * draw.c (layout_glyphs): Fix handling of left/right_padding.
248 * face.c (mface__for_chars): Check rfont before accessing the
251 2005-11-21 Kenichi Handa <handa@m17n.org>
253 * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
256 * fontset.c (fontset_table): New variable.
257 (free_fontset): Call M17N_OBJECT_UNREGISTER.
258 (mfont__fontset_init): Add fontset_table as an object array.
259 (mfont__realize_fontset): Ref FONTSET.
260 (mfont__free_realized_fontset): Unref REALIZED->fontset.
261 (mfontset): Call M17N_OBJECT_REGISTER.
262 (mfontset_copy): Likewise.
264 * input.c (handle_key): For debugging, print information about
266 (filter): Add an alias for Meta and Alt modifiers.
267 (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
269 (minput__init): Initialize them.
270 (parse_expression): New function.
271 (resolve_expression): New function.
272 (parse_action_list): Handle expressions by parse_expression.
273 (take_action_list): Handle expressions by resolve_expression.
274 (parse_nested_list_value): Fix previous change.
275 (resolve_command): Fix handling of the return value of
278 2005-11-18 Kenichi Handa <handa@m17n.org>
280 * font-ft.c (ft_check_otf, otf_script_list): Define only when
282 (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
284 (ft_select): Likewise.
286 * font.c (mfont_list): Fix for the case that FONT is NULL.
287 (OTF_tag): Delete it.
288 (load_otf_script_list): Define only when HAVE_OTF is defined.
289 (mfont__fini): Unref otf_script_list only when HAVE_OTF is
292 * draw.c (truncate_gstring): Be sure to truncate at
293 glapheme-cluster boundary.
295 2005-11-11 Kenichi Handa <handa@m17n.org>
297 * input.c (delete_surrounding_text): Clear cache if necessary.
299 2005-11-09 Kenichi Handa <handa@m17n.org>
301 * draw.c (compose_glyph_string): Update prev->rface->rfont if the
302 glyph prev is also supported by the current flt.
304 2005-11-08 Kenichi Handa <handa@m17n.org>
306 * m17n-X.c (xft_render): Cancel previous change.
308 2005-11-07 Kenichi Handa <handa@m17n.org>
310 * input.c: Include <stdlib.h>.
311 (get_surrounding_text, delete_surrounding_text)
312 (get_preceding_char, get_following_char): New functions.
313 (integer_value): New arg surrounding. If it is nonzero, try to
314 get a surrounding character. Callers changed.
315 (take_action_list): Check `value' before setting an element.
316 (destroy_ic): Unref ic_info->preceding_text and
317 ic_info->following_text.
318 (minput__init): Initialize Minput_get_surrounding_text and
319 Minput_delete_surrounding_text.
320 (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
322 (filter): Unref ic_info->preceding_text and
323 ic_info->following_text.
325 * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
328 * input.h (MInputContextInfo): New members preceding_text and
331 2005-11-04 Kenichi Handa <handa@m17n.org>
333 * input.c (parse_nested_list_value): Fix handling of the global
335 (get_nested_list): Get global definitions by load_partial_im_info.
336 (preedit_commit): Set ic->candidates_changed to bitwise or of enum
337 MInputCandidatesChanged.
338 (take_action_list): Likewise.
339 (reset_ic): Likewise.
340 (create_ic): Don't pay special attention to
341 Mcandidates_group_size.
342 (load_partial_im_info): Call mdatabase_find with correct 4th arg.
343 (minput_set_variable): Get a definition of varible by
344 mplist_find_by_value, not mplist_get.
346 * m17n.h (enum MInputCandidatesChanged): New enum.
348 2005-11-01 Kenichi Handa <handa@m17n.org>
350 * m17n-X.c (xft_render): Check xft_draw's drawable before changing
352 (mwin__destroy_window): If xft_draw's drawable is win, change it
353 to device->drawable before destroying win.
355 2005-10-31 Kenichi Handa <handa@m17n.org>
357 * input.c (load_im_info): Fix adding of state.
359 * m17n-core.c (m17n_fini_core): Fix reporting of module
362 * m17n.c (m17n_fini): Fix reporting of module finalization.
364 * m17n-gui.c (m17n_init_win): Fix reporting of module
367 2005-10-29 Kenichi Handa <handa@m17n.org>
369 * input.c (get_candidate_list): Fix the timing of referring plist.
371 2005-10-28 Kenichi Handa <handa@m17n.org>
373 * input.c (load_branch): Ignore an undefined map name.
374 (load_im_info): Set im_info->title from `name' only if it's not
376 (shift_state): Always update ic->status.
377 (adjust_candidates): Renamed from adjust_candidate_command.
378 Argument changed. Caller changed.
379 (get_candidate_list, regularize_action): New functions.
380 (take_action_list): Use them. On handling Munhandle, don't set
382 (handle_key): If KEY is not handled by MAP, and MAP has
383 branch_actions, perform them.
385 * database.c (mdatabase__fini): Free dir_info->filename;
387 2005-10-20 Kenichi Handa <handa@m17n.org>
389 * input.c (marker_code): Accept '@@'.
390 (integer_value): Handle '@@'.
391 (parse_action_list): Accept a symbol argument.
392 (take_action_list): Resolve the symbol argument. Handle the
395 2005-10-18 Kenichi Handa <handa@m17n.org>
397 * input.c: Include "charset.h".
398 (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
400 (MIMState): New member (M17NObject control).
401 (lookup_nested_list, set_nested_list, parse_nested_list_value)
402 (get_nested_list, resolve_variable): New functions.
403 (integer_value): New arg (MPlist **value). Set it to the plist
404 element containing the value.
405 (resolve_command): New function.
406 (load_translation): New arg (MPlist *map_actions).
407 (load_branch): New args language and name. If `keylist' is a
408 symbol, resolved that as a command name.
409 (free_map): New arg top. Free map->map_actions only if top is
411 (free_state): New function.
412 (load_state): New arg name.
413 (im_info_list): New variable.
414 (free_im_info, get_im_info_by_tags): New functions.
415 (load_im_info): Arg key changed to plist. Handle `include'.
416 Return (MInputMethodInfo *).
417 (preedit_commit): Ref ic->candidate_list.
418 (get_select_charset, adjust_candidate_command): New functions.
419 (take_action_list): Handle `include'. Adjust candidate action
420 properly. Handle control variables `candidates-charset' and
421 `candidates-group-size'.
422 (open_im): Use get_im_info.
423 (create_ic): Get global variables.
424 (load_partial_im_info): New function.
425 (get_im_info): New function.
426 (check_command_keyseq, check_command_list, check_variable_list):
428 (minput__init): Don't handle M_database_hook and Mdetail_text.
429 Initialize M_candidates, Mcandidates_group_size,
431 (parse_variable_list, get_variable_list, parse_command_list)
432 (get_command_list): Delete them.
433 (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
434 (minput__fini): Simply unref command_list and variable_list.
435 (minput_get_description): Adjusted for the new form of description.
436 (minput_get_commands): Use get_nested_list.
437 (minput_assign_command_keys): Likewise.
438 (minput_get_variables, minput_set_variable): Likewise.
440 * input.h (MInputMethodInfo): New members im and maps.
442 * database.h (M_database_hook): Delete extern.
443 (MDatabaseHookFunc): Delete extern.
444 (mdatabase__check): Extern it.
446 * database.c: Include <glob.h>.
447 (MAX_TIME): New macro.
448 (Masterisk): New variable.
449 (get_database_stream): Argument changed to (MDatabaseInfo *).
451 (get_dir_info): Renamed from duplicate_dirname. Callers changed.
452 (find_database): New function.
453 (update_database_list): New function.
454 (mdatabase__init): Initialize Masterisk. Setup mdb_list by
455 calling update_database_list.
456 (mdatabase__check): New function.
457 (mdatabase_find): Use update_database and find_database. Don't
458 handle MDatabaseHookFunc.
459 (mdatabase_list): Call update_database at first.
460 (mdatabase_define): Adjusted for the change of mdb->extra_info.
461 (MDatabaseList): New type.
463 * plist.h (mplist_conv, mplist__pop_unref): Extern them.
465 * m17n.h (Mdetail_text): Delete extern.
467 * m17n-core.h (mplist_conc): Delete extern.
469 * plist.c (mplist__conc): Renamed from mplist_conc. Don't ref
471 (mplist_conc): Renamed to mplist__conc.
472 (mplist__pop_unref): New function.
474 2005-10-14 Kenichi Handa <handa@m17n.org>
476 * plist.c (read_mtext_element): Ignore the sequence of '\\' and
478 (read_element): If keys is an empty plist, return any element
480 (dump_plist_element): Check if plist is nested.
481 (mplist_conc): Always ref tail.
482 (mplist_set): If key is a managing key, ref val in advance.
484 * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
485 (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
486 (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
489 * fontset.c (free_fontset): Unref fontset_list if necessary.
490 (mfont__fontset_fini): Don't free fontset_list. Unref
492 (mfont__realize_fontset): Initialize request.
493 (mfontset): Ref default_fontset or fontset only if necessary.
494 (mfontset_copy): Don't ref copy.
496 * draw.c (render_glyphs): Check gend->type before checking
499 * font-ft.c (mfont__ft_fini): Unref ft_default_list. Set all
500 unrefed plists to NULL.
502 2005-10-04 Kenichi Handa <handa@m17n.org>
504 * textprop.c (mtext_serialize): Be sure to make mt
505 MTEXT_FORMAT_UTF_8 and NULL terminated.
507 * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
509 * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
511 2005-10-03 Kenichi Handa <handa@m17n.org>
513 * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
514 is not at the beginning of line.
516 2005-09-22 Kenichi Handa <handa@m17n.org>
518 * input.c: Include <sys/stat.h> and <unistd.h>.
519 (Minclude, Mcommit, Munhandle): New variables.
520 (minput__init): Initialize them. Push only Mstate to
521 load_im_info_keys. Add aliases C-lowercase for C-uppercase.
522 (parse_action_list): Allow integer arg for undo. Handle Mcommit
524 (load_input_method): Handle "include" directive. If no states are
526 (shift_state): If state_name is Mt, shift back to the previous
527 state. Call preedit_commit to commit preedit text.
528 (preedit_commit): New function.
529 (take_action_list): Improve debug printing. Handle commit and
531 (handle_key): Check the return value of take_action_list. Don't
532 take branch_actions just after changing to the root map.
533 (reset_ic): Reset all ic_info members.
534 (filter): When a key is not handled, just move ic_info->keys
535 instead fo calling reset_ic.
536 (load_im_info): If key is not Mstate, push Mmap to
538 (MDatabaseStatList): New type.
539 (imdir_stat_list): New variable.
540 (input_method_hook): Don't cancel the hook. Check the
541 modification time of directories.
542 (minput__fini): Free imdir_stat_list;
544 * input.h (MInputContextInfo): New member prev_state.
546 * m17n-core.h (mplist_conc): Extern it.
548 * plist.c (mplist_conc): New function.
550 * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
552 * font.h (MRealizedFont): New member average_width.
554 * font-ft.c (ft_open): Set rface->average_width.
556 * font.c (xlfd_unparse_name): Print '*' before registry name.
558 * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
559 (xfont_open): Set rfont->average_width.
560 (xft_open): Likewise.
561 (device_open): Initialize disp_info->AVERAGE_WIDTH.
563 * internal-gui.h (struct MFrame): New member average_width.
565 * m17n-gui.c (mframe): Fix setting of frame->rfont.
566 (mframe_get_prop): Return the average_width of a font.
568 * face.c (mface__realize): Set rface->average_width.
569 (mface__update_frame_face): Set frame->average_width.
571 * face.h (MRealizedFace): New member average_width.
573 2005-09-19 Kenichi Handa <handa@m17n.org>
575 * font.c (xlfd_unparse_name): New arg full_xlfd.
576 (mfont__encode_char): Use shortcut only for X core fonts.
577 (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
578 (mfont_put_prop): Handle `language' property.
579 (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
580 Print file can capability info too.
582 * m17n-core.c (mdebug__output): New variable.
583 (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
584 (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
585 (m17n_fini_core): Close mdebug__output if it's not stderr.
587 * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
588 (xfont_open): Handle baseline_offset.
589 (xfont_find_metric): Likewise.
590 (xfont_render): Likewise.
591 (xft_open): Likewise.
592 (xft_render): Likewise.
594 * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
595 (mdebug__output): Extern it.
596 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
597 (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
598 (MDEBUG_DUMP): New macro.
599 (MDEBUG_PRINT_TIME): Print to medebug__output.
601 * font.h (MRealizedFont): New member baseline_offset.
603 * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
605 (fc_weight_table): Add FC_WEIGHT_REGULAR.
606 (ft_list_family): Check alias.
607 (ft_list_language): If language is "en", don't try to the second
609 (ft_default_list): New variable.
610 (ft_list_default): New function.
611 (ft_select): If family is not specified, try only the default
612 fonts. Treat the weights normal and medium same.
613 (ft_open): Fix debug message. If registry is not specified, try
614 unicode-bmp. Handle _MULE_BASELINE_OFFSET property of BDF fonts.
615 (ft_find_metric): Likewise.
616 (ft_render): Likewise.
617 (ft_list): Fix debug message. Accept the registring iso8859-1.
618 If family is not specified, try only the default fonts.
620 * face.c (mface__realize): Fix logic of opening a font.
622 2005-09-16 Kenichi Handa <handa@m17n.org>
624 * face.c (mface__realize):
626 * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
629 * input.c (shift_state): Fix the condition of taking init actions.
630 (take_action_list): Fix handling of pushback action.
631 (handle_key): Don't change key while checking its alias.
632 (minput__init): Initialize new variables.
633 (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
636 2005-09-12 Kenichi Handa <handa@m17n.org>
638 * mtext.c (mtext__uppercase): Add proper open/close parens.
639 (mtext_titlecase): Add proper casting.
641 * input.c (parse_action_list): Handle the case that the arg is a
642 key sequence (MText or MPlist).
643 (take_action_list): Likewise.
644 (shift_state): Shorter debug message.
645 (handle_key): Terminate a debug message by "\n".
646 (reset_ic): Don't take initial actions here.
647 (minput_open_im): Print a debug message.
648 (minput_close_im): Likewise.
649 (minput_create_ic): Likewise.
650 (minput_destroy_ic): Likewise.
652 2005-09-09 TAKAHASHI Naoto <ntakahas@m17n.org>
654 * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
657 2005-09-07 TAKAHASHI Naoto <ntakahas@m17n.org>
658 * character.c: Add "cased", "soft-dotted", and "case-mapping" in
661 * character.c: Add Japanese documentation for
662 mchar_get_prop_table ().
664 2005-09-06 TAKAHASHI Naoto <ntakahas@m17n.org>
666 * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
667 (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
668 (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
670 (init_case_conversion): New function.
671 (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
672 (uppercase_precheck, lowercase_precheck, final_sigma)
673 (after_soft_dotted, more_above, before_dot, after_i)
674 (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
676 2005-09-05 TAKAHASHI Naoto <ntakahas@m17n.org>
678 * plist.c (read_mtext_element): Fix previous change.
680 2005-09-05 Kenichi Handa <handa@m17n.org>
682 * plist.c (read_mtext_element): Handle \uXXXX notation.
684 * internal.h (MTABLE_MALLOC): Don't use a local variable.
685 (MTABLE_ALLOCA): Change the name of local variable.
687 * m17n-gd.c (device_open): Define it even if HAVE_GD nor
688 HAVE_FREETYPE are defined.
690 * m17n-X.c: Check HAVE_X11.
692 * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
693 directory listing libraries.
694 (noinst_PROGRAMS): Define it only in maintainer mode.
696 2005-09-02 Kenichi Handa <handa@m17n.org>
698 * m17n-gui.h (mdraw_line_break_option): Extern it.
700 * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
701 end of the first glyph.
702 (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
704 (mdraw_line_break_option): New variable.
705 (mdraw_default_line_break): Use mtext_line_break.
707 * mtext.h (wordseg_func_table): Don't extern it.
708 (mtext__wseg_fini): Extern it.
710 * mtext.c: Don't include word-thai.h.
711 (wordseg_func_table): Delete this variable.
712 (mtext__init): Don't initialize above. Don't call
713 mtext__word_thai_init.
714 (mtext__fini): Don't free wordseg_func_table. Call
715 mtext__wseg_fini instead fo mtext__word_thai_fini.
716 (MTextWordsegFunc): Don't typedef it.
717 (mtext__word_segment): Moved to mtext-wseg.c.
719 * m17n-core.h (enum MTextLineBreakOption): New enum.
720 (mtext_line_break): Extern it.
722 * mtext-wseg.c: New file.
724 * mtext-lbrk.c: New file.
726 * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
727 add mtext-lbrk.c and mtext-wseg.c.
729 * textprop.c (mtext__adjust_plist_for_change): Pay attention for
730 the case that head is NULL.
732 2005-09-01 Kenichi Handa <handa@m17n.org>
734 * word-thai.c (wordseg_propertize): If the property value is nil,
735 don't make the property no-merge.
736 (thai_wordseg): Don't require *from and *to are set a priori. Pay
737 attention to the case that they are NULL.
738 (mtext__word_thai_init): Make the name of Mthai_wordseg starts
741 * character.c (mchar_get_prop_table): New function.
743 * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
745 * m17n-core.h (mtext_insert, mtext_replace): Extern them.
746 (mchar_get_prop_table): Extern it.
748 * textprop.c (prepare_to_modify): New arg deleting. Callers changed.
749 (mtext__adjust_plist_for_change): Argument changed. Callers changed.
751 * internal.h (enum MTextCoverage): New enum.
752 (MText): New member coverage.
754 * mtext.c (FORMAT_COVERAGE): New macro.
755 (insert): Copy mt2->coverage.
756 (mtext__from_data): Initialize mt->coverage.
757 (mtext__adjust_format): Update mt->coverage.
758 (mtext): Initialize mt->coverage.
759 (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
760 Update mt->coverage if necessary.
761 (mtext_duplicate): Copy mt->coverage.
762 (mtext_insert, mtext_replace): New functions.
763 (mtext_dup): Use mtext_duplicate.
764 (mtext__word_segment): Don't set *from and *to if a word
765 segmentation funcion is not found.
766 (mtext_ins_char): Fix typo.
768 2005-08-25 Kenichi Handa <handa@m17n.org>
770 * font.h (MFont): New member for_full_width.
772 * font.c (compare_font_score): Prefer a font of not
775 * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
776 registry charset of a font is one of CJK charsets.
778 * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
779 supports some of CJK.
781 2005-08-24 Kenichi Handa <handa@m17n.org>
783 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
785 * m17n-gui.c (null_device_open): Check Mresolution param and set
788 * m17n-gd.c (device_open): Check Mresolution param and set
791 * m17n-X.c (MWDevice): New member resy.
792 (xfont_open): Set ascent, descent, and max_advance members of
794 (xft_open): Likewise.
795 (device_open): Compare also screen_num to find a device. Set
796 device->resy and frame->dpi.
798 * internal-gui.h (MFrame): New member dpi.
800 * font.h (MRealizedFont): New member max_advance.
802 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
803 (mfont__init): Don't initialize Mascent, Mdescent.
804 (Mascent, Mdescent): Delete these variables.
805 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
806 Mfont_descent instead of Mascent and Mdescent.
807 (mfont_put_prop): Allow negative size.
808 (mfont_find): Handle the case of spec->size < 0. Fix previous
810 (mfont_list): Handle the case of spec->size < 0.
811 (mfont_check): Likewise.
813 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
814 (fc_get_pattern): Handle the case of font->size < 0.
815 (ft_open): Set ascent, descent, and max_advance members of rfont.
816 (ft_find_metric): Improve rounding.
817 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
820 * face.c (mface__realize): Handle the case of font->size < 0.
822 2005-08-22 Kenichi Handa <handa@m17n.org>
824 * coding.c (MConverterStatus): Change the member buf to union.
825 (mconv_buffer_converter): Add const to the arg buf.
826 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
827 (mconv_decode): Adjusted for the change of MConverterStatus.
828 (mconv_encode_range): Likewise.
830 * m17n.h (mconv_buffer_converter): Prototype adjusted.
831 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
833 2005-08-20 Kenichi Handa <handa@m17n.org>
835 * m17n-gui.h (mfont_from_name): Prototype adjusted.
836 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
838 * m17n-X.c (xfont_open): Set members ascent, descent, and
839 max_advance of rfont.
840 (xft_open): Likewise.
842 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
844 (mfont__ft_parse_name): Add const to the arg name.
846 * font.c (xlfd_parse_name): Add const to the arg name. Call
847 mfont__set_property instead of mfont_set_spec. Set font->spacing.
848 (xlfd_unparse_name): Handle spacing.
849 (mfont__init): Initialize new variables.
850 (mfont__id): Handle spacing.
851 (mfont__merge): Likewise.
852 (mfont__set_spec): This function deleted.
853 (mfont__parse_name_into_font): Add const to the arg name. Fix the
854 condition of calling mfont__ft_parse_name.
855 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
856 (mfont_get_prop): Handle properties spacing, ascent, descent,
858 (mfont_find): Return a realized font.
859 (mfont_from_name): Add const to the arg name.
861 * font.h (enum MFontProperty): New member MFONT_SPACING.
862 (enum MFontSpacing): New enum.
863 (MFont): New members spacing and max_advance.
864 (mfont__ft_parse_name): Prototype adjusted.
865 (mfont__set_spec): Extern deleted.
866 (mfont__parse_name_into_font): Prototype adjusted.
868 2005-08-19 Kenichi Handa <handa@m17n.org>
870 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
872 * font.c (mfont_list): If FONT is null, use a temporary font.
873 (mfont_parse_name): Add const to the arg name.
875 2005-08-18 Kenichi Handa <handa@m17n.org>
877 * word-thai.c: Surround code by #ifdef and #endif to escape from
880 * font-ft.c: Mostly re-written.
882 * font-flt.c (FontLayoutCmdOTF): This type deleted.
883 (FontLayoutCmd): Type of the member otf changed..
884 (load_otf_command): Adjusted for the format change of otf command.
885 (load_command): Likewise.
886 (free_flt_command): Unref cmd->body.otf.
887 (run_otf): Ajusted for the type change of otf_cmd.
888 (run_command): Ajusted for the type change of otf_cmd. On
889 debugging, print ctx->combining_code.
890 (mfont__flt_run): Initialize ctx's members code_offset,
891 combining_code, and left_padding to 0.
893 * face.h (struct MRealizedFace): New member font.
894 (mface__realize): Prototype adjusted.
896 * face.c (find_realized_face): New arg font.
897 (find_realized_face): Adjusted for the change of MFont.
898 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
899 (mface__fini): Don't call mdebug__report_object.
900 (mface__realize): New arg font.
901 (mface__for_chars): Adjusted for the change of mfont__encode_char.
902 Optimize the latin case.
903 (mface__free_realized): Free rface->font.
904 (mface__update_frame_face): Adjusted for the change of mface__realize.
905 (mface_equal): New function.
907 * draw.c (Mcommon): New variable.
908 (visual_order): Args to mfont__encode_char changed.
909 (compose_glyph_string): Handle Mfont text property.
910 (layout_glyphs): Adjusted for the change of MFont.
911 (mdraw__init): Initialize Mcommon.
912 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
914 * font.h (enum MFontType): Members completely changed.
915 (enum MFontProperty): Move MFONT_SIZE to the tail.
916 (enum MFontSource): New enum.
917 (struct MFont): New members type, source, sizes, file, capability,
919 (struct MRealizedFont): Type of member font changed. Members
920 score, status, and encoding deleted.
921 (MFontScore): New type.
922 (MFontList): Member changed.
923 (struct MFontDriver): New member has_char. Types of members
925 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
926 (Mapple_roman): Extern them.
927 (OTF_Tag): Typedefed if not HAVE_OTF.
928 (enum MFontOpenTypeTable): New enum.
929 (MFontCapability): New type.
930 (mfont__ft_drive_otf): Prototype adjusted.
931 (mfont__score): Extern deleted.
932 (mfont__merge): Extern it.
933 (mfont__has_char): Extern it.
934 (mfont__encode_char): Prototype adjusted.
935 (mfont__open): Extern it.
936 (mfont__set_spec): Prototype adjusted.
937 (mfont__get_capability): Extern it.
939 * font.c: Include "fontset.h".
940 (M_font_capability, M_font_list, M_font_list_len): New variables.
941 (font_score_priority): Change order of initial elements.
942 (font_score_shift_bits): Fix array size.
943 (common_weight): Add "thin", "semibold", and "heavy".
944 (common_stretch): Add "ultracondensed", "extracondensed",
945 "extraexpanded", and "utltraexpand".
946 (font_weight_regular, font_weight_normal, font_weight_medium): New
948 (gen_font_name): This function deleted.
949 (find_encoding): Set font->encoding.
950 (OTF_tag): New function.
951 (otf_script_list): New variable.
952 (load_otf_script_list): New function.
953 (find_script_from_otf_tag): New function.
954 (xlfd_parse_name): Set font->type and font->source.
955 (mfont__free_realized): Free chains rfonts.
956 (font_score): Renamed from mfont__score.
957 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
958 (Mapple_roman): New variables.
959 (mfont__init): Initilize new variables. Initalize
960 default_encoding.encoding_name and
961 default_encoding.encoding_charset to Municode_full and
962 mcharset__unicode. Use SAFE* macros for allocating filepath
964 (mfont__fini): Free otf_script_list.
965 (mfont__id): New function.
966 (mfont__match_p): Check also capability member of MFont.
967 (mfont__merge): New funciton.
968 (mfont__set_spec_from_face): Set type and source members.
969 (mfont__set_spec_from_plist): Set capability and type members.
970 (mfont__select): Argument changed.
971 (mfont__available): New function.
972 (compare_font_score): New function.
973 (mfont__list): New function.
974 (mfont__open): Return a realized font.
975 (mfont__resize): Adjusted for the change of MFont.
976 (mfont__has_char): New function.
977 (mfont__encode_char): Argument changed.
978 (mfont__set_spec): Argument changed.
979 (free_font_capability): New function.
980 (mfont__get_capability): New function.
981 (MFontfile): New variable.
982 (mfont_get_prop): Adjusted for the change of MFont.
983 (mfont_put_prop): Likewise.
984 (mfont_set_selection_priority): Fix the way of setting
985 font_score_priority[].
986 (mfont_find): Use mfont__list instead of mfont__select.
987 (mfont_resize_ratio): Adjusted for the change of MFont.
988 (mfont_list): Use mfont__list.
989 (mfont_check): New function.
990 (font_score): Make it static.
992 * fontset.h (mfont__realize_fontset): Prototype adjusted.
993 (mfont__lookup_fontset): Likewise.
995 * fontset.c (struct MFontset): Delete member font_spec_list.
996 (struct MRealizedFontset): Type of member spec changed. New
998 (load_font_group): Arg spec_list deleted.
999 (load_fontset_contents): Adjusted for the change of fontset_def.
1000 (free_fontset): Fix the way of freeing fontset elements.
1001 (realize_fontset_elements): Argument changed.
1002 (get_per_script): New function.
1003 (free_realized_fontset_elements): Fix the way of feeing rfontset
1005 (update_fontset_elements): Fix args to realize_fontset_elements.
1006 (mfont__realize_fontset): New arg spec.
1007 (try_font_list): New function.
1008 (try_font_group): New arg request. Use try_font_list.
1009 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
1011 (mfontset): Adjusted for the change of MFontset.
1012 (mfontset_copy): Likewise. Don't share plists.
1013 (mfontset_modify_entry): Adjusted for the change of MFontset.
1014 (mfontset_lookup): Call get_per_script.
1015 (mdebug_dump_fontset): Print also the address of fonts.
1017 * input.c (shift_state): Don't reset ic_info->vars.
1018 (take_action_list): Call MDEBUG_PRINT fore calling
1021 * internal-gui.h (MFontDriver): Don't typedef it here.
1023 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
1024 (MXFont): This type deleted.
1026 (struct _MFontX): New struct.
1027 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
1028 (MDisplayInfo): Member base_font_list deleted.
1029 (DEFAULT_FONT): Definition changed.
1030 (FALLBACK_FONT): This maclr deleted.
1031 (free_display_info): Adjusted for the change of MDisplayInfo.
1032 (free_device): Argument to mfont__free_realized changed.
1033 (xfont_driver): Adjusted for the change of MFontDriver.
1034 (xfont_registry_list): Use MFontX instead of MXFont.
1035 (MRealizedFontX): Renamed from MXFontInfo.
1036 (xfont_select): Return the font found first.
1037 (close_xfont): Change MXFontInfo to MRealizedFontX.
1038 (xfont_open): Return the realized font.
1039 (xfont_find_metric): Get xfont from rfont->fontp.
1040 (xfont_has_char): New function.
1041 (xfont_encode_char): Adjusted for the argument change.
1042 (xfont_render): Get xfont from rfont->fontp.
1043 (xfont_list): Adjusted for the argument change.
1044 (MRealizedFontXft): Renamed from MXftFontInfo.
1045 (xft_driver): Ajusted for the change of MFontDriver.
1046 (close_xft): Change MXtfFontInfo to MRealizedFontXft
1047 (xft_open_font): Argument changed.
1048 (xft_open): Argument changed. Return the realized font.
1049 (xft_find_metric): Get xft_font from rfont->fontp.
1050 (xft_has_char, xft_encode_char): New functions.
1051 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
1052 font if not yet opened.
1053 (device_open): Don't set frame->font.
1055 * m17n-gd.c (gd_font_driver): Adjusted for the change of
1057 (gd_font_open): New function.
1058 (gd_render): Don't use the local variable ft_info.
1059 (device_init): Adjusted for the change of gd_font_driver.
1061 * textprop.c (mtext__prop_init): Initialize text_property_table.
1062 Call M17N_OBJECT_ADD_ARRAY.
1063 (mtext__prop_fini): Don't call mdebug__report_object.
1065 * plist.c (mplist__init): Initialize plist_table.
1066 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
1067 (mplist__fini): Don't call mdebug__report_object.
1069 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
1070 (mtext__fini): Don't call mdebug__report_object.
1071 (MTEXT_FORMAT_UTF_16): Correct type.
1072 (mtext_data): New function.
1073 (mtext_text): Fix calculation of limit and args to
1076 * language.c: Include "plist.h".
1077 (M_script_lang_list): New variable.
1078 (mlang__init): Read languages and their information from m17n
1080 (mlanguage__list): New function.
1081 (Miso639_1, Miso639_2): New variables.
1083 * language.h (mlanguage__list): Extern it.
1085 * database.c (get_database_stream): Use SAFE_* macros for
1086 allocating and freeing path.
1087 (mdatabase__init): Likewise.
1089 * symbol.c (msymbol__fini): Don't free symbols here.
1090 (msymbol__free_table): New function.
1091 (msymbol_is_managing_key): New function.
1093 * symbol.h (msymbol__free_table): Extern it.
1094 (msymbol__list): Extern it.
1096 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
1098 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
1099 (struct _M17NObjectArray): New member name and next.
1100 (mdebug__add_object_array): Extern it.
1101 (M17N_OBJECT_ADD_ARRAY): New macro.
1102 (mdebug__report_object): Don't extern it.
1104 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
1106 * m17n-gui.c (free_frame): Don't free frame->font.
1107 (null_device_fini): Fix code for freeing
1108 null_device.realized_font_list.
1109 (m17n_fini_win): Free interface.
1110 (mframe): Cast the return value of dlsym. Set frame->font here.
1111 (mframe_get_prop): Check frame->rface->rfont before accessing the
1114 * m17n-gui.h (Mfontfile): Extern it.
1115 (mfont_check): Extern it.
1116 (mface_equal): Extern it.
1118 * m17n-core.c: Include "symbol.h".
1119 (report_header_printed): This variable deleted.
1120 (object_array_root): New variable.
1121 (report_object_array): New function.
1122 (mdebug__report_object): This function deleted.
1123 (mdebug__add_object_array): New function.
1124 (m17n_init_core): Call mchartable_init () before mtext_init ().
1125 (m17n_fini_core): Call report_object_array (if necessary) and
1126 msymbol__free_atable at the end.
1128 * m17n-core.h (msymbol_is_managing_key): Extern it.
1129 (mtext_data): Extern it.
1130 (MTEXT_FORMAT_UTF_16): Correct type.
1131 (M17NLIB_MINOR_VERSION): Changed to 3.
1132 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1134 * chartab.c (mchartable__init): Initalize chartable_table.count.
1135 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1136 mdebug__report_object.
1138 2005-05-26 Kenichi Handa <handa@m17n.org>
1140 * m17n.h (Miso639_1, Miso639_2): Extern them.
1142 * symbol.h (msymbol__list): Extern it.
1144 * symbol.c (msymbol__list): New function.
1146 2005-05-19 Kenichi Handa <handa@m17n.org>
1148 * input-gui.c (minput__win_init): Don't change the value of
1151 2005-05-16 Kenichi Handa <handa@m17n.org>
1153 * m17n-core.c (m17n_object): Be sure to initialize all members.
1155 * font-ft.c (fc_decode_prop): Fix args to msymbol.
1157 2005-05-09 Kenichi Handa <handa@m17n.org>
1159 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1161 2005-04-27 Kenichi Handa <handa@m17n.org>
1163 * language.c (mlang__init): Add "an" (Aragonese).
1165 * word-thai.c: Add support for libthai.
1166 (mtext__word_thai_init): Initialize wordseg library conditionaly.
1167 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1169 * mtext.c: Include "word-thai.h" conditionaly.
1170 (mtext__init): Call mtext__word_thai_init conditionaly.
1171 (mtext__fini): Call mtext__word_thai_fini conditionaly.
1173 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1174 not WORDCUT_LD_FLAGS.
1176 2005-04-19 Kenichi Handa <handa@m17n.org>
1178 * word-thai.c (wordseg_propertize): Always unref the attached
1180 (thai_wordseg): Don't unref the property.
1182 2005-04-18 Kenichi Handa <handa@m17n.org>
1184 * word-thai.c: Include stdlib.h.
1185 (wordseg_propertize): Add dummy function for the case that wordcut
1186 library doesn't exist.
1187 (wordseg_propertize): Fix for old wordcut library.
1189 2005-04-16 Kenichi Handa <handa@m17n.org>
1191 * word-thai.c: Include <stdio.h>.
1193 2005-04-15 Kenichi Handa <handa@m17n.org>
1195 * draw.c: Include mtext.h.
1196 (linebreak_table, M_break_at_space, M_break_at_word)
1197 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1198 (compose_glyph_string): Check POS before getting Mface text
1200 (truncate_gstring): Give correct TO arg to line_break function.
1201 (GET_LB_TYPE): New macro.
1202 (find_break_backward, find_break_forward): New functions.
1203 (mdraw__init): Initialize the above new variables.
1204 (mdraw__fini): Free linebreak_table.
1205 (mdraw_default_line_break): Use find_break_backward and
1208 * word-thai.c: New file.
1210 * word-thai.h: New file.
1212 * mtext.c: Include word-thai.h.
1213 (wordseg_func_table): New variable.
1214 (mtext__init): Initialize wordseg_func_table and call
1215 mtext__word_thai_init.
1216 (mtext__fini): Call mtext__word_thai_fini, free
1218 (MTextWordsegFunc): New type.
1219 (mtext__word_segment): New function.
1221 * mtext.h (wordseg_func_table): Extern it.
1222 (mtext__word_segment): Extern it.
1224 * m17n.c (m17n_init): Fix typo (== -> =).
1226 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1227 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1229 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1230 (MTEXTPROP_VAL): New macros.
1232 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1234 2005-04-07 Kenichi Handa <handa@m17n.org>
1236 * database.c (load_chartable): Fix pursing of symbol name.
1238 2005-03-24 Kenichi Handa <handa@m17n.org>
1240 * m17n.c (m17n_init): Fix typo (== -> =).
1242 2005-03-11 Kenichi Handa <handa@m17n.org>
1244 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1246 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1248 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1251 2005-03-09 handa <handa@m17n.org>
1253 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1254 calling m17n_init ().
1256 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1257 calling m17n_init_core ().
1259 2005-02-28 Kenichi Handa <handa@m17n.org>
1261 * font-flt.c (mfont__flt_run): Add resulting code sequence in
1264 2005-02-17 Kenichi Handa <handa@m17n.org>
1266 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1267 (M_description, M_command, M_variable): New variables.
1268 (load_im_info_keys): New variables.
1269 (load_im_info, check_command_keyseq, get_description_advance)
1270 (parse_command_list, get_command_list, parse_variable_list)
1271 (get_variable_list, input_method_hook): New functions.
1272 (command_list, variable_list): New variables.
1273 (minput__init): Put input_method_hook to Minput_method.
1274 Initialize M_description, M_command, M_variable, Mdetail_text,
1275 load_im_info_keys, command_list, variable_list.
1276 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1277 (Mdetail_text): New variable.
1278 (minput_get_description, minput_get_commands)
1279 (minput_assign_command_keys, minput_get_variables)
1280 (minput_set_variable): New functions.
1282 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1283 (minput_assign_command_keys, minput_get_variables)
1284 (minput_set_variable): Extern them.
1286 * plist.c (UNGETC): Just decrement st->p.
1287 (read_mtext_element): New arg skip.
1288 (read_integer_element): Likewise.
1289 (read_symbol_element): Likewise.
1290 (read_element): New arg KEYS.
1291 (mplist__from_plist): Don't increment ref-count of NULL object.
1292 (mplist__from_file): New arg KEYS.
1293 (mplist_put): Don't increment ref-count of NULL object.
1294 (mplist_add): Likewise.
1295 (mplist_push): Likewise.
1296 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
1298 * plist.h (mplist__from_file): Prototype adjusted.
1300 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1301 (get_database_stream): New function.
1302 (load_database): Use get_database_stream.
1303 (M_database_hook): New variable
1304 (mdatabase__init): Initialize M_database_hook.
1305 (mdatabase__load_for_keys): New function.
1306 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1308 (mdatabase_define): Free mdb->extra_info if necessary.
1310 * database.h (mdatabase__dir_list, M_database_hook)
1311 (mdatabase__load_for_keys): Extern them.
1312 (MDatabaseHookFunc): New type.
1314 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1316 2004-12-27 Kenichi Handa <handa@m17n.org>
1318 * Version 1.2.0 released.
1320 2004-12-27 Kenichi Handa <handa@m17n.org>
1322 * input.c (minput_filter): Don't reset ic->xxx_changed.
1324 * mtext.c (mtext_from_data): Fix documentation.
1326 2004-12-25 Kenichi Handa <handa@m17n.org>
1328 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1329 (M17NLIB_VERSION_NAME): Update to "1.2.".
1331 2004-12-24 Kenichi Handa <handa@m17n.org>
1333 * input.c (reset_ic): Set key_unhandled to 0.
1335 2004-12-21 Kenichi Handa <handa@m17n.org>
1337 * m17n-gui.h (mfont_from_spec): Delete extern.
1339 * input-gui.c (win_callback): Handle Minput_reset.
1340 (minput__win_init): Register reset_ic as a callback for
1343 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
1344 changed. At first, shift to the initial state.
1345 (minput__init): Initialize Minput_reset. Register reset_ic as a
1346 callback for Minput_reset.
1347 (Minput_reset): New variable.
1348 (minput_filter): Always set ic->xxx_changed to 0.
1349 (minput_reset_ic): New function.
1350 (integer_value): Fix typo ('>' -> '<') and calculation of length
1353 * m17n-core.c (merror_code): Change type to `int'.
1355 * m17n-misc.h (merror_code): Adjust type.
1357 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1359 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1360 (mtext_change_prop): Delete extern.
1362 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1363 to `int'. Move the documents to m17n-core.h.
1365 2004-12-13 Kenichi Handa <handa@m17n.org>
1367 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1368 (MTextProperty): Document it.
1370 2004-12-09 Kenichi Handa <handa@m17n.org>
1372 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1374 2004-12-03 Kenichi Handa <handa@m17n.org>
1376 * internal.h (m17n__core_initialized, m17n__shell_initialized,
1377 m17n__gui_initialized): New externs.
1379 * m17n-core.h (enum M17NStatus): New enum.
1380 (m17n_status): Extern it.
1382 * m17n-core.c (core_initialized): Delete this variable.
1383 (m17n__core_initialized, m17n__shell_initialized,
1384 m17n__gui_initialized): New variables.
1385 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1386 instead of core_initialized.
1387 (m17n_status): New function.
1389 * m17n.c (shell_initialized): Delete this variable.
1390 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1393 * m17n-gui.h (m17n_init_win): Adjust the prototype.
1395 * m17n-gui.c (win_initialized): Delete this variable.
1396 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1397 instead of gui_initialized.
1399 2004-11-19 Kenichi Handa <handa@m17n.org>
1401 * input.c (reset_ic): Check if ic_info->state is NULL.
1402 (filter): If ic_info->state is NULL, return 0.
1403 (load_input_method): Don't unref `maps' it it's not created.
1405 2004-11-15 Kenichi Handa <handa@m17n.org>
1407 * input.c (find_candidates_group): If INDEX is -1, find the last
1409 (take_action_list): If the previous of the first candidate is
1410 requested, select the last candidate.
1412 2004-11-08 Kenichi Handa <handa@m17n.org>
1414 * m17n-X.c (device_open): Try at most 32 fonts to find a
1415 non-autoscaled font.
1417 * font.c (xlfd_parse_name): Fix previous change.
1419 2004-11-05 Kenichi Handa <handa@m17n.org>
1421 * font.c: (commont_style): Include dummy elements "slanted" and
1422 "rslanted" to prefer "o" to "r" if "i" is requested.
1424 * font-ft.c (ft_to_prop): Fix "oblique" entry.
1426 2004-10-29 Kenichi Handa <handa@m17n.org>
1428 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1430 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1431 New members smallest and larger.
1432 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1433 (xfont_registry_list): Likewise.
1434 (xfont_select): Likewise.
1437 2004-10-28 Kenichi Handa <handa@m17n.org>
1439 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1440 font name comparison.
1441 (xfont_select): Fix logic for selecting a larger size font.
1443 2004-10-25 Kenichi Handa <handa@m17n.org>
1445 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1448 2004-10-22 Kenichi Handa <handa@m17n.org>
1450 * input.c (update_candidate): Renamed from udpate_candidate.
1451 (take_action_list): Show more debugging info on arithmetic commands.
1453 * m17n-X.c (device_open): Fix previous change.
1455 * draw.c (compose_glyph_string): Don't get face property at the
1458 2004-10-21 Kenichi Handa <handa@m17n.org>
1460 * draw.c (compose_glyph_string): Fix for the case of category
1463 2004-10-19 Kenichi Handa <handa@m17n.org>
1465 * input.c (mdebug_mask): New variable.
1466 (shift_state): Print debug information.
1467 (take_action_list): Likewise.
1468 (handle_key): Likewise.
1470 2004-10-14 Kenichi Handa <handa@m17n.org>
1472 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1474 2004-10-13 Kenichi Handa <handa@m17n.org>
1476 * m17n-X.c (device_open): Be sure to register at least one font
1479 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
1480 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1482 2004-10-12 Kenichi Handa <handa@m17n.org>
1484 * draw.c (alloc_gstring): Fix previous change.
1486 * font-ft.c (ft_list_generic): Fix for the case of not
1489 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1491 * font.c (mfont_list): If no font is found, return NULL.
1492 (load_font_encoding_table): Put entries of nil registry first.
1493 (find_encoding): Adjust for the above change.
1495 2004-10-11 Kenichi Handa <handa@m17n.org>
1497 * m17n-gui.h (mfont_list): Adjust prototype.
1499 * m17n-X.c (xfont_list): New arg maxnum.
1501 * font.h (struct MFontDriver): Change prototype of <list>.
1503 * font-ft.c (fc_generic_family_list): Delete it.
1504 (Mserif, Msans_serif, Mmonospace): Delete them.
1505 (M_generic_family_info): New variable.
1506 (enum GenericFamilyType): New enum.
1507 (struct GenericFamilyInfo): New struct.
1508 (generic_family_table): New variable.
1509 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1511 (add_font_info): Get style here.
1512 (ft_list_family): Don't initialize fc_config here. Don't list
1514 (ft_list_generic): New function.
1515 (ft_select): Pay attention to generic familes here.
1516 (ft_open): Fix calculation of ascent and descent.
1517 (ft_list): Pay attention to generic families.
1518 (mfont__ft_init): Initialize M_generic_family_info,
1519 generic_family_table, and fc_config..
1520 (mfont__ft_fini): Finalize generic_family_table.
1522 * draw.c (compose_glyph_string): Use more constant font for
1523 glyphs. Adjust for the member change in MGlyph.
1524 (layout_glyph_string): Adjust for the member change in MGlyph.
1525 (alloc_gstring): Intilize scracth_glyph to avoid
1526 compose_glyph_string on it.
1527 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1528 (mdraw_coordinates_position): Fix previous change.
1530 * internal-gui.h (glyph_category): New enum.
1531 (MGlyph): Change type of <category> to enum glyph_category.
1533 * face.c (mface__realize): Delete args langauge and charset.
1534 (mface__for_chars): Fix for the case that glyphs have different
1536 (mface__update_frame_face): Adjust for mface__realize change.
1538 * face.h (mface__realize): Adjust prototype.
1540 2004-10-05 Kenichi Handa <handa@m17n.org>
1542 * language.c (mlang__init): Add Akan.
1544 2004-10-04 Kenichi Handa <handa@m17n.org>
1546 * font-ft.c (add_font_info): Add instead of push the element.
1547 (ft_list_family): For generic fonts, try all
1548 substituted. families.
1550 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1551 (run_rule): Don't update cluster range here.
1552 (run_command): Update cluster range on appending a glyph.
1553 (run_otf): Update cluster range for glyphs generated by OTF.
1555 2004-10-02 Kenichi Handa <handa@m17n.org>
1557 * m17n-X.c (device_open): Handle Mfont key in PLIST.
1559 2004-09-30 Kenichi Handa <handa@m17n.org>
1561 * font-ft.c (ft_select): Ignore family on calling mfont__score.
1563 2004-09-30 Kenichi Handa <handa@m17n.org>
1565 * font.h: Include <fontconfig/fontconfig.h>.
1566 (MFTInfo): New member langset.
1567 (mfont__encoding_list): Extern it.
1569 * font.c (mfont__encoding_list): New function.
1570 (mdebug_dump_font_list): New function.
1572 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1573 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1575 (ft_family_list): New variable.
1576 (set_font_info): New arg basep. Callers changed.
1577 (fc_list): Check the return value of FcPatternGetString.
1578 (add_font_info): New arg plist. Callers changed. Update
1580 (ft_list_family): New function (merged fc_list and ft_list_all).
1581 (ft_select): Use ft_list_family.
1582 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
1584 (mfont__ft_init): Initialize above new variables.
1585 (mfont__ft_fini): Free ft_family_list.
1586 (STRDUP_LOWER): New macro.
1587 (set_font_info): Use STRDUP_LOWER.
1588 (ft_list_family): Avoid duplicate addition of font path. Use
1590 (fc_decode_prop): Fix typo.
1592 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1593 (xfont_registry_list): Change argument disp_info to frame.
1595 (xfont_list_all): New function.
1596 (xfont_list): If FONT is not NULL, check all fonts.
1598 2004-09-28 Kenichi Handa <handa@m17n.org>
1600 * m17n-X.c (MXFont, MXFontList): New types.
1601 (MDisplayInfo): Delete members font_registry_list,
1602 iso8859_1_family_list, iso10646_1_family_list, new members
1603 font_list, base_font_list.
1604 (free_display_info): Adusted for the change of MDisplayInfo.
1605 (xfont_driver): Initialize with xfont_list.
1606 (font_compare): New function.
1607 (build_font_list): Deleted.
1608 (xfont_registry_list): New function.
1609 (xfont_select): Use xfont_registry_list.
1610 (xfont_list): New function.
1611 (device_open): Adusted for the change of MDisplayInfo.
1613 * font-ft.c (add_font_info): New arg languages. Callers changed.
1614 (fc_list): Get languages from fonts..
1615 (ft_list_all): Renamed from ft_list. Callers changed.
1616 (ft_list): New function.
1617 (mfont__ft_driver): Initalize with ft_list.
1619 * font.c (mfont_list): New function.
1621 * font.h (struct MFontDriver): New member `list'.
1622 (MFTInfo): New member languages.
1624 * m17n-gui.h (mfont_list): Extern it.
1626 2004-09-27 Kenichi Handa <handa@m17n.org>
1628 * internal-gui.h (struct MGlyphString): Delete members mt,
1629 sub_width, sub_lbrearing, sub_rbearing, and region.
1631 * draw.c (MSubTextExtents): New type.
1632 (layout_glyphs): New arg extents. Set its members.
1633 (layout_glyph_string): Adjusted for the above change.
1634 (alloc_gstring): Don't set gstring->mt.
1635 (truncate_gstring): Call line_break function with mt instead of
1638 2004-09-22 Kenichi Handa <handa@m17n.org>
1640 * mtext.c (count_utf_16_chars): Count each code of invalid
1643 2004-09-19 Kenichi Handa <handa@m17n.org>
1645 * mtext.c (default_utf_16, default_utf_32): Rename them to
1646 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
1649 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1652 2004-09-13 Kenichi Handa <handa@m17n.org>
1654 * draw.c (Mlatin): Don't declare it here.
1655 (visual_order): Fix reordering of combining characters.
1656 (compose_glyph_string): Fix detection of script.
1657 (layout_glyphs): Don't fix reordering of combining characters
1659 (layout_glyph_string): Pay attention to
1660 control->disable_overlapping_adjustment.
1661 (truncate_gstring): Include at least on character in a line.
1662 (get_gstring): Always scan one full line.
1663 (mdraw__init): Don't initialize Mlatin here.
1664 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
1665 have a font, use ascent/descent of an ASCII font. Allow
1666 ink_array_return and logical_array_return to be NULL.
1667 (mdraw_coordinates_position): Fix iteration.
1669 * font-ft.c (MFTtoProp): Member completely changed.
1670 (ft_to_prop): Adjusted for the above change.
1671 (ft_to_prop_size): Likewise.
1672 (set_font_info): Adjusted for the change of MFTtoProp.
1673 (fc_generic_family_list): New variable.
1674 (fc_list): Add special handling of generic font names.
1675 (mfont__ft_init): Adjusted for the change of MFTtoProp.
1676 Initialize fc_generic_family_list.
1677 (mfont__ft_fini): Don't free ft_to_prop. Free
1678 fc_generic_family_list.
1679 (FC_vs_M17N_font_prop): New type.
1680 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1681 (fc_decode_prop, fc_encode_prop): New functions.
1682 (mfont__ft_parse_name): Use fc_decode_prop.
1683 (mfont__ft_unparse_name): Use fc_encode_prop.
1685 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1686 (MWDevice): Add member realized_font_list.
1687 (free_display_info): Don't free disp_info->realized_font_list.
1688 (free_device): Free device->realized_fontset_list.
1689 (xft_find_metric): Use gstring->frame instead of rfont->frame.
1690 (device_open): Don't initialize disp_info->realized_font_list.
1691 (device_open): Initialize device->realized_font_list and set it to
1692 frame->realized_font_list.
1694 * fontset.c (try_font_group): New function.
1695 (mfont__lookup_fontset): Use try_font_group.
1697 * font.c (common_weight): Change the order of "regular".
1699 * face.c (Mlatin): Don't make it static.
1700 (mface__realize): Be sure to set work_gstring.frame.
1701 (mface__for_chars): Likewise.
1703 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1706 * internal-gui.h (Mlatin): Extern it.
1708 * m17n-gui.h (MDrawControl): New member
1709 disable_overlapping_adjustment.
1711 2004-09-06 Kenichi Handa <handa@m17n.org>
1713 * font-flt.c (run_otf): Fix typo ('}'->']').
1715 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1716 (COMBINING_PRECOMPUTED_P): New macros.
1718 * draw.c (layout_glyphs): Handle precomputed combining code.
1720 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1721 precomupted combining code.
1723 2004-09-03 Kenichi Handa <handa@m17n.org>
1725 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1728 2004-08-27 Kenichi Handa <handa@m17n.org>
1730 * face.c (mface_put_prop): If the new value is the same as the
1731 current one, don't increment frame->tick.
1733 2004-08-25 Kenichi Handa <handa@m17n.org>
1735 * fontset.c (mfontset): Initialize font_spec_list member.
1736 (mfontset_copy): Load fontset if necessary.
1738 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1739 'metrics' to for C++.
1741 * draw.c (mdraw_glyph_info): Adjusted for the member name change
1744 2004-08-16 Kenichi Handa <handa@m17n.org>
1746 * Version 1.1.0 released.
1748 2004-08-13 Kenichi Handa <handa@m17n.org>
1750 * language.c (mlang__init): Add Dhivehi.
1752 * m17n-gui.c (Mx, Mfreetype): Delete it.
1753 (m17n_init_win): Don't initialize Mx and Mfreetype here.
1755 * m17n-gui.h (Mfreetype, Mxft): Extern them.
1756 (mfont_resize_ratio): Extern it.
1757 (MDrawGlyphInfo): New member logical_width;
1758 (MDrawGlyph): New type.
1759 (mdraw_glyph_list): Prototype adjusted.
1761 * m17n-X.c (xfont_open): Set type and fontp members.
1762 (xft_open): Likewise.
1764 * internal-gui.h (Mx, Mfreetype): Delete extern.
1766 * font.h (struct MRealizedFont): New member type and fontp.
1768 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1769 (Mx, Mfreetype): Declare here.
1770 (Mxft): New variable.
1771 (mfont_resize_ratio): New function.
1773 * font-ft.c (ft_open): Set type and fontp members.
1775 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
1778 2004-08-11 Kenichi Handa <handa@m17n.org>
1780 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1783 2004-08-06 Kenichi Handa <handa@m17n.org>
1785 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1788 * font-flt.c (run_otf): Print debugging information if necessary.
1790 2004-08-05 Kenichi Handa <handa@m17n.org>
1792 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
1793 positioning_type 5 and 6. Switch simplified.
1795 2004-08-04 Kenichi Handa <handa@m17n.org>
1797 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1799 2004-08-02 Kenichi Handa <handa@m17n.org>
1801 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1802 set val to 1 even if it is greater than 1.
1804 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1806 2004-07-29 Kenichi Handa <handa@m17n.org>
1808 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1809 debugging information.
1811 * internal.h (MDEBUG_PRINT5): New macro.
1813 * draw.c (layout_glyphs): Don't combine a zero width glyph with
1814 the previous one if the zero width glyph has left or right
1817 2004-07-26 Kenichi Handa <handa@m17n.org>
1819 * m17n-X.c (xft_render): Pay attention to members left_padding and
1820 right_padding of MGlyph.
1822 * draw.c (visual_order): Allocate one more elements for arrays as
1823 a workaround of fribidi bug.
1824 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1825 instead of MGlyph->bidi_sensitive.
1826 (layout_glyph_string): Pay attentinon to
1827 control->orientation_reversed when padding at the head or tail.
1828 Fix adjustment of space glyph width.
1829 (get_gstring): If cursor_width or cursor_bidi is changed, don't
1832 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1833 instead of MGlyph->bidi_sensitive.
1835 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1837 2004-07-26 Kenichi Handa <handa@m17n.org>
1839 * draw.c (visual_order): Don't treat combined glyphs specially.
1840 (layout_glyphs): Don't get metrics glyphs that are already ready.
1841 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
1842 width with the previous one.
1843 (draw_background): Fix bar cursor position on a r2l glyph.
1845 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1846 (run_rule): Fix place of updating cluster_begin_pos and
1847 cluster_end_pos here.
1848 (run_otf): Don't set left_padding.
1850 * font-ft.c (adjust_anchor): Type of argument `code' changed.
1852 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1853 Fix handling of GPOS.
1854 (mfont__ft_drive_gpos): Delete this function.
1856 * font.h (mfont__ft_drive_otf): Renamed back from
1857 mfont__ft_drive_gsub.
1858 (mfont__ft_drive_gpos): Delete extern.
1860 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1861 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1863 2004-07-23 Kenichi Handa <handa@m17n.org>
1865 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1866 the same bidi level.
1868 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1870 2004-07-22 Kenichi Handa <handa@m17n.org>
1872 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1874 2004-07-20 Kenichi Handa <handa@m17n.org>
1876 * draw.c (render_glyphs): Fix checking of g->code validity.
1878 * face.c (mface__realize): Set g.type.
1880 2004-07-18 Kenichi Handa <handa@m17n.org>
1882 * Makefile.am: Prepend ${top_srcdir} to all *.la in
1885 * m17n-gui.c (mframe): Print error message give by dlopen to
1888 2004-07-16 Kenichi Handa <handa@m17n.org>
1890 * draw.c (compose_glyph_string): Improve the way of deciding a
1891 script. For a character that doesn't have script property, use
1892 the last non-latin script.
1894 * font-ft.c (fc_list): Cancel previous change.
1895 (mfont__ft_init): Add more entries in ft_to_prop_name.
1897 2004-07-15 Kenichi Handa <handa@m17n.org>
1899 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1900 previous or next character glyphs.
1902 2004-07-14 Kenichi Handa <handa@m17n.org>
1904 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1905 of type GLYPH_SPACE.
1907 * fontset.c (mfont__lookup_fontset): If glyph type is
1908 GLYPH_SPACE, get codes for SPACE.
1910 * internal-gui.h (Mfont): Delete extern.
1912 * m17n-gui.h (Mfont): Delete duplicated extern.
1914 2004-07-13 Kenichi Handa <handa@m17n.org>
1916 * font-ft.c (DEVICE_DELTA): New macro.
1917 (adjust_anchor): New function.
1918 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
1920 (mfont__ft_drive_gpos): New function.
1922 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1923 (FontLayoutContext): Delete member `rfont'.
1924 (run_otf): Set g->otf_cmd. Call
1925 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
1926 only whne HAVE_OTF is defined.
1928 * fontset.c: Include "config.h".
1930 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1931 (MGlyph): New member otf_cmd.
1933 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1934 (mfont__ft_drive_gpos): Extern it.
1936 * face.c: Include "config.h".
1938 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1940 * input-gui.c: Include "config.h".
1942 * plist.c: Include "config.h".
1944 2004-07-06 Kenichi Handa <handa@m17n.org>
1946 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1947 internal-gui.h: Cancel previous changes.
1949 * m17n-gd.h: Delete it.
1951 * Makefile.am (libm17n_core_la_LIBADD): New variable.
1952 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1953 @XML2_LD_FLAGS@ to above.
1954 (libm17n_la_LIBADD): Add -ldl.
1955 (libm17n_la_LDFLAGS): Add -export-dynamic.
1956 (X_LD_FLAGS): Fix the order of linking.
1957 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1958 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1959 (libm17n_X_la_LDFLAGS): Add -module.
1960 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1961 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1962 (libm17n_gd_la_LDFLAGS): Add -module.
1963 (include_HEADERS): Delete m17n-gd.h.
1965 2004-06-30 Kenichi Handa <handa@m17n.org>
1967 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1968 (MDeviceLibraryInterface): Delete it.
1969 (register_device_library): Delete it.
1970 (m17n__device_library_list): Renamed from device_library_list.
1972 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1973 (m17n_init_win): Adjust prototype.
1975 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1976 (m17n_init_gd): New function.
1978 * m17n-gd.h: New file.
1980 * m17n-X.h: Include <m17n-gui.h>.
1981 (m17n_init_X): Extern it.
1982 (M17N_INIT): Redefine it.
1984 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1985 (m17n_init_X): New function.
1987 * internal-gui.h (m17n__device_library_list): Extern it.
1988 (struct MDeviceDriver): New members initialized, init, and fini.
1990 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1992 (libm17n_X_la_LIBADD): Delete aboves.
1993 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1994 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1995 (libm17n_gd_la_LDFLAGS): Delete it.
1996 (include_HEADERS): Add m17n-gd.h.
1998 2004-06-25 Kenichi Handa <handa@m17n.org>
2000 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
2001 (libm17n_gd_la_LDFLAGS): Cancel previous change.
2003 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
2005 * font-ft.c (fc_list): If FcFontList finds no font, try
2008 * draw.c (compose_glyph_string): Terminate the last loop after
2009 doing default combining if necessary.
2011 2004-06-24 Kenichi Handa <handa@m17n.org>
2013 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
2015 * character.c (mchar_define_property): Add const to an arg.
2017 * charset.c (mchar_define_charset): Add const to an arg.
2019 * coding.c (MCodingSystem): Add const to an arg or decoder.
2020 (finish_decoding): Add const to an arg.
2021 (decode_coding_charset, decode_coding_utf_8)
2022 (decode_coding_utf_16, decode_coding_utf_32)
2023 (decode_coding_iso_2022, decode_coding_sjis)
2024 (mconv_define_coding): Likewise.
2026 * m17n-X.c (xft_find_metric): Delete unused variable.
2028 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
2031 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
2034 * mtext.c (count_utf_8_chars, count_utf_16_chars)
2035 (mtext__from_data, mtext_from_data): Add `const' to an arg.
2037 * mtext.h (mtext__from_data): Ajust prototype.
2039 2004-06-23 Kenichi Handa <handa@m17n.org>
2041 * draw.c (compose_glyph_string): Always get glyph codes by
2043 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
2044 (mdraw_glyph_list): New function.
2046 * font-flt.c (mfont__flt_run): Be sure to call
2047 rfont->driver->encode_char.
2049 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
2050 (ft_encode_char): Delete arg C.
2051 (ft_render): Don't call FT_Get_Char_Index.
2053 * font.c (mfont__encodable_p): Delete it.
2054 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
2056 * font.h (struct MFontDriver): Delete arg C of encode_char.
2057 (mfont__encodable_p): Delete extern.
2059 * m17n-X.c (xfont_encode_char): Delete arg C.
2060 (xft_find_metric): Don't cal FT_Get_Char_Index.
2061 (xft_render): Likewise.
2063 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
2065 (mdraw_glyph_list): Extern it.
2067 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
2069 2004-06-22 Kenichi Handa <handa@m17n.org>
2071 * m17n-gui.h (mfontset_lookup): Extern it.
2073 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
2075 * fontset.c (realize_fontset_elements)
2076 (free_realized_fontset_elements, update_fontset_elements): New
2078 (mfont__realize_fontset): Call realize_fontset_elements.
2079 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
2080 (mfont__lookup_fontset): If a fontset was modified, update
2081 the realized fontset.
2082 (mfontset_modify_entry): Increment fontset->tick.
2083 (mfontset_lookup): New function.
2085 2004-06-21 Kenichi Handa <handa@m17n.org>
2087 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
2089 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
2090 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
2091 length of source text 0.
2093 2004-06-21 Kenichi Handa <handa@m17n.org>
2095 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
2096 (compare): Pay attention to format other than utf-8.
2097 (copy): Delete this function.
2098 (count_by_utf_8, count_by_utf_16, insert): New functions.
2099 (count_utf_16_chars): Fix handling of a surrogate pair.
2100 (find_char_forward, find_char_backward): Likewise.
2101 (mtext__from_data): Delete unnecessary check. Fix number of
2103 (mtext_from_data): Don't count items.
2104 (mtext_ref_char): Optimize the code.
2105 (mtext_set_char): Pay attention to format other than utf-8.
2106 (mtext_cat_char): Likewise.
2107 (mtext_dup): Don't call copy, instead do allocation here.
2108 (mtext_cat): Call insert instead of copy.
2109 (mtext_ncat): Likewise.
2110 (mtext_cpy): Delete character at first and call insert instead of
2112 (mtext_ncpy): Likewise.
2113 (mtext_copy): Likewise.
2114 (mtext_duplicate): Call insert instead of copy.
2115 (mtext_del): Pay attention to format other than utf-8.
2116 (mtext_ins): Simply call insert.
2117 (mtext_ins_char): Pay attention to format other than utf-8.
2118 (mtext_tok): Call insert instead of copy.
2119 (mtext_text): Call UNIT_BYTES.
2121 * textprop.c (mtext__adjust_plist_for_change): New function.
2123 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
2124 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
2125 (CHAR_UNITS_AT): Fix typo.
2126 (CHAR_UNITS_BY_HEAD): Fix typo.
2127 (STRING_CHAR_AND_UNITS): Fix typo.
2129 * internal.h (MTEXT_READ_ONLY_P): New macro.
2131 * mtext.h (mtext__replace): Delete the extern.
2132 (mtext__adjust_foramt): Adjust prototype.
2134 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2135 if possible. Otherwise make a copy of mmt.
2137 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2140 2004-06-18 Kenichi Handa <handa@m17n.org>
2142 * character.h (CHAR_STRING_UTF16): Fix syntax.
2144 2004-06-16 Kenichi Handa <handa@m17n.org>
2146 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2147 (libm17n_X_la_LIBADD): Delete it.
2148 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2150 * m17n-X.c (device_open): Add parens in `if' condition.
2152 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2153 (DEC_POSITION): Likewise.
2154 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2156 2004-06-15 Kenichi Handa <handa@m17n.org>
2158 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2161 * draw.c (compose_glyph_string): If langauge is specified, call
2162 mface__for_chars even if a text is all latin. Fix condition for
2163 setting non_ascii_found.
2165 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2167 * m17n.h (minput_char_to_key): Delete extern.
2169 * m17n-gui.h (minput_event_to_key): Cancel previous change.
2171 * m17n-gui.c (null_device_open): Set several members of frame.
2173 2004-06-14 Kenichi Handa <handa@m17n.org>
2175 * m17n-gui.h (minput_event_to_key): Delete extern.
2177 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2179 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2181 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2183 2004-06-08 Kenichi Handa <handa@m17n.org>
2185 * character.c (mchar_put_prop): Don't increment the ref-count of
2188 2004-06-04 Kenichi Handa <handa@m17n.org>
2190 * m17n-core.c (mdebug__register_object): New function.
2191 (mdebug__unregister_object): Likewise.
2193 * internal.h (mdebug__register_object, mdebug__unregister_object):
2195 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2198 * charset.c (mcharset__load_from_database): Don't call
2199 mconv__register_charset_coding here.
2201 * coding.c (find_coding): Get a real name from an element of
2202 coding_definition_list.
2203 (mconv__register_charset_coding): Set the real name at the top of
2205 (mcoding__load_from_database): Likewise.
2206 (mconv_list_codings): Adjusted for the above change.
2208 2004-06-03 Kenichi Handa <handa@m17n.org>
2210 * coding.c (find_coding): Find by canonicalized name. Don't have
2211 to modify the element of coding_definition_list by
2213 (mconv__define_coding_from_charset): Delete it.
2214 (mconv__register_charset_coding): Canonicalize sym.
2215 (mcoding__load_from_database): Register plist modified by
2218 * coding.h (mconv__define_coding_from_charset): Don't extern it.
2220 * font-ft.c (ft_open): Fix setting of rfont->descent.
2222 2004-06-02 Kenichi Handa <handa@m17n.org>
2224 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2225 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2226 (xlfd_unparse_name): Renamed from xfont_build_name.
2227 (mfont__init): Initialized Mfontconfig.
2228 (mfont__free_realized): Unconditionally unref rfont->info.
2229 (mfont__select): Free `this' if it's not best.
2230 (mfont__open): Don't check frame->realized_font_list.
2231 (mfont__parse_name_into_font): New function.
2232 (Mfontconfig): New variable.
2233 (mfont_from_name): Call mfont_parse_name.
2234 (mfont_name): Call mfont_unparse_name.
2235 (mdebug_dump_font): Likewise.
2237 * font.h (struct MFontDriver): Delete members parse_name and
2239 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2240 (mfont__parse_name_into_font): Extern it.
2242 * font-ft.c: Include "symbol.h".
2243 (close_ft): Unconditionally free filename and charmap_list of
2245 (ft_open): Duplicate base->filename. Increment ref-count of
2246 ft_info->charmap_list. Free ft_info->charmap_list and
2247 ft_info->filename on error.
2248 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2250 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2252 (enum xlfd_field_idx): Moved to font.c.
2253 (split_font_name, build_font_name): Likewise.
2254 (build_font_list): Call mfont__parse_name_info_font.
2255 (xfont_open): Call mfont__unparse_name. Free name.
2256 (xfont_parse_name, xfont_build_name): Moved to font.c
2257 (xft_select): Prototype deleted.
2258 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2259 Call mfont_pase_name.
2261 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2262 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2265 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2268 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2270 2004-06-01 Kenichi Handa <handa@m17n.org>
2272 * fontset.c (mfontset_modify_entry): Pay attention to the case
2273 that fontset->font_spec_list is NULL.
2275 2004-05-31 Kenichi Handa <handa@m17n.org>
2277 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2279 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2281 * font.c (mfont__select): Print score the a font for debugging.
2283 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2285 * coding.c (reset_coding_sjis): Check kanji and kana instead of
2286 kanji_sym and kana_sym.
2288 2004-05-28 Kenichi Handa <handa@m17n.org>
2290 * Makefile.am (VINFO): New variable.
2291 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2292 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2294 2004-05-27 Kenichi Handa <handa@m17n.org>
2296 The following chanages are to make device dependent functions
2297 accessible only from MDeviceDriver structure, and to add GD and
2298 null device drivers. Font drivers get also device dependent.
2300 * m17n.c (m17n_init): Increament shell_initialized.
2301 (m17n_fini): Decremented shell_initialized.
2303 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2305 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2306 (Mwidget, Mcolormap, Mx): Extern them.
2308 * m17n-gui.c: Include <dlfcn.h> and "config.h".
2309 (free_frame): Call frame->driver->close instead of
2311 (DLOPEN_SHLIB_EXT): New macro.
2312 (MDeviceLibraryInterface): New type.
2313 (device_library_list): New variable.
2314 (register_device_library): New function.
2315 (null_device): New variable.
2316 (null_device_close, null_device_get_prop)
2317 (null_device_realize_face, null_device_free_realized_face): New
2319 (null_driver): New variable.
2320 (null_device_init, null_device_fini, null_device_open): New
2322 (null_interface): New variable.
2323 (Mfreetype, Mdevice): Declare them.
2324 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
2325 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2326 Mwin__Close_Device. Register drivers for Mx and Mgd.
2327 (m17n_fini_win): Decremented win_initialized. Call "fini"
2328 function of all opened devices. Don't call mwin__fini.
2329 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2331 (mframe): Handle Mdevice key of PLIST.
2332 (mframe_get_prop): Call frame->device->get_prop instead of
2333 mwin__device_get_prop.
2335 * m17n-gd.c: New file.
2337 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2338 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2340 * m17n-core.c (m17n_init_core): Increate core_initialized.
2341 (m17n_fini_core): Decremented core_initialized.
2343 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2344 (Mcolormap): Don't extern them here.
2346 * m17n-X.c (FRAME_DEVICE): New macro.
2347 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2348 (free_display_info): Use MPLIST_DO.
2349 (free_device): Free rface->info.
2350 (xft_close): Delete it.
2351 (device_init): Renamed from mwin__init.
2352 (device_fini): Renamed from mwin__fini.
2353 (device_open): Renamed from mwin__open_device.
2354 (x_driver): New variable.
2355 (MXFontInfo): Delete member frame, add member display.
2356 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2357 Don't declare them here.
2359 * internal-gui.h (MDeviceType): New enum.
2360 (MWDefice): Delete it.
2361 (struct MFrame): Change type of device to void *. New members
2362 device_type, driver, font_driver_list.
2363 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2364 (MDeviceDriver): New type.
2365 (Mx, Mgd, Mfreetype): Extern them.
2366 (mwin__XXX): Delete all of them.
2368 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2370 (win_destroy_ic): Likewise.
2371 (adjust_window_and_draw): Likewise.
2372 (win_callback): Likewise.
2373 (Mxim): Declare it here.
2374 (minput_event_to_key): Call M_CHECK_READABLE.
2376 * fontset.c (mfont__lookup_fontset): Delete local variable
2379 * font.h (struct MFontDriver): Delete member close, add members
2380 parse_name and build_name.
2381 (mfont__driver_list): Delete extern.
2382 (mfont__close): Delete extern.
2384 * font.c (mfont__init): Don't set mfont__driver_list.
2385 (mfont__fini): Don't unref mfont__driver_list.
2386 (mfont__select): Try font drivers in frame->font_driver_list. Set
2387 driver member of a realized font.
2388 (mfont__close): Delete it.
2389 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2390 functions of the default frame.
2392 * font-ft.c (close_ft): Check ft_info->ft_face and work
2394 (add_font_info): Allocate ft_info by M17N_OBJECT.
2395 (ft_close): Delete it.
2396 (mfont__ft_driver): Don't set ft_close.
2397 (ft_select): Increment ref-count of best_font.
2398 (ft_open): Decremented ref-count of base. On error, call
2399 FT_Done_Face and free ft_info.
2400 (ft_find_metric): Always use XXX_MONO in load_flags.
2401 (ft_render): Fix setting of width. Call
2402 frame->driver->draw_points instead of mwin__draw_points.
2403 (ft_to_prop): Don't set mfont__driver_list.
2404 (mfont__ft_fini): Just unref ft_info.
2406 * face.c (mface__init): Exchange foreground and background of
2407 mface__default. Call mface_put_prop to set hline of
2409 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2410 (mface__free_realized): Don't call mwin__free_realized_face.
2412 * draw.c (Mdepth): Don't declare it here.
2413 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2414 (render_glyphs, render_glyph_string): Likewise.
2415 (mdraw__init): Don't set Mdepth.
2416 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2418 (mdraw_text_per_char_extents): Return 0 on success and -1 on
2420 (mdraw_text_items): Check FRAME is writable.
2421 (mdraw_per_char_extents): Implement body.
2423 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2425 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2426 (GUI_SOURCES): Delete it.
2427 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2428 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2429 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2430 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2431 (linkgui_LDADD): Set to libm17n-gui.la
2432 (linkgui_LDFLAGS): New target.
2433 (SRC): Include ${libm17n_gui_la_SOURCES} and
2434 ${libm17n_gd_la_SOURCES}.
2436 2004-05-24 Kenichi Handa <handa@m17n.org>
2438 * draw.c (draw_background): Don't draw background even if
2439 rface->face.property[MFACE_BACKGROUND] is not Mnil.
2441 2004-05-22 Kenichi Handa <handa@m17n.org>
2443 * m17n-X.c (xft_open_font): Fix anti_alias setting.
2445 2004-05-20 Kenichi Handa <handa@m17n.org>
2447 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2449 * m17n-gui.c: Include "plist.h".
2450 (mframe): If PLIST is NULL, initialize it to emply plist.
2452 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2453 (xft_driver): New variable.
2454 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2455 (xft_find_metric, xft_render): New function.
2456 (mwin__init): Adjusted for the new mfont__driver_list.
2457 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
2458 generated face to PARAM.
2459 (mwin__realize_face): Fix setting of box colors. Don't call hook
2461 (mwin__draw_hline): New function.
2462 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2463 (mwin__xft_render): Delete these function.
2465 * internal-gui.h (struct MFrame): New member tick.
2466 (struct MGlyphString): New member tick.
2467 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2468 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2469 (mwin__xft_render): Delete extern.
2471 * fontset.c (mfont__lookup_fontset): Make the code simpler.
2472 (mfontset): Always increment the reference count of returned
2475 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2476 (MFTInfo): Moved to font.h.
2477 (ft_iso8859_1_font_list): Delete this variable.
2478 (set_font_info): Don't set font->property[MFONT_TYPE].
2479 (set_font_info): Don't udpate ft_iso8859_1_font_list.
2480 (add_font_info): Change type to void.
2481 (fc_list): Change anme from xft_list. Caller changed. Include
2482 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2483 (mfont__ft_driver): Change name from ft_driver. Caller changed.
2484 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2485 (close_ft): Don't call mwin__xft_close. Unref
2486 ft_info->extra_info.
2487 (ft_open): Don't setup ft_info->fontname. Don't call
2489 (ft_find_metric): Don't call mwin__xft_get_metric.
2490 (ft_encode_char): Call rfont->driver->open instead of ft_open.
2491 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
2492 (mfont__ft_init): Adjusted for new mfont__driver_list.
2493 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2495 * font.c (mfont__driver_list): Make it MPlist.
2496 (mfont__init): Adjust initialization of mfont__driver_list.
2497 (mfont__fini): Free mfont__driver_list.
2498 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2499 (mfont__select): Adjusted for the new mfont__driver_list.
2501 * font.h (enum MFontProperty): Delete MFONT_TYPE.
2502 (mfont__drirver_list): Adjust prototype.
2503 (MFTInfo): Move to here from fron.c. Deleve member fontname.
2505 * face.h (struct MFace): Delete member realized_face_list, add
2507 (struct MRealizedFace): Delete member need_update
2508 andnofont_rface, add member non_ascii_list.
2509 (mface__update_frame_face): Extern it.
2511 * face.c (hline_prop_list, box_prop_list, noop_hook): New
2513 (get_hline_create, get_box_create): New functions.
2514 (find_realized_face): Cancel previous change. Arg RFONT deleted.
2516 (free_face): Cancep previous change. Free face->frame_list.
2517 (serialize_hline): Do nothing if hline->width is zero.
2518 (serialize_box): Do nothing if box->width is zero.
2519 (mface__init): Setup all properties of mface__default.
2520 (mface__fini): Free hline_prop_list and box_prop_list.
2521 (mface__realize): Cancel previous change. Update
2522 face->frame_list. Setup rface->non_ascii_list.
2523 (mface__for_chars): Update rface->non_ascii_list.
2524 (mface__free_realized): Free rface->non_ascii_list.
2525 (mface__update_frame_face): New function.
2526 (mface): Initialize face->frame_list.
2527 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
2529 (mface_merge): Likewise.
2530 (mface_put_prop): If key is Mhline or Mbox, get value by
2531 get_hline_create or get_box_create respectively.
2532 (mface_put_prop): Update frame->tick and call
2533 mface__update_frame_face if necessary.
2534 (mface_update): Do nothing if func is noop_hook.
2536 * draw.c (render_glyphs): If a font is not found, use
2537 mwin__draw_empty_boxes.
2538 (alloc_gstring): Initialize gstring->tick.
2539 (get_gstring): Check gstring->tick.
2541 2004-05-17 Kenichi Handa <handa@m17n.org>
2543 * face.c (find_realized_face): Return value changed. If RFONT is
2544 NULL, avoid unnecessary checking.
2545 (free_face): Free face->realized_face_list.
2546 (mface__realize): Adjusted for the change of find_realized_face.
2547 If it returns a realized face that needs update, free it and
2548 realize a new one. Push a new realized face to
2549 frame->realized_face_list instead of appending.
2550 (mface__for_chars): Adjusted for the change of find_realized_face.
2551 Short cut if the required font is in rface->ascii_rface.
2552 (mface_put_prop): Free old value if necessary. Set need_update
2553 member of realized faces to 1.
2555 * face.h (struct MFace): Delete member tick, add member
2557 (struct MRealizedFace): Delete member tick, add member
2560 2004-05-13 Kenichi Handa <handa@m17n.org>
2562 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2564 2004-05-12 Kenichi Handa <handa@m17n.org>
2566 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2568 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2569 parse it XftNameParse.
2571 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2572 (all_fonts_scaned): New variable.
2573 (set_font_info): FAMILY may be Mnil.
2574 (add_font_info): Argument changed.
2575 (xft_list): Call add_font_info in it.
2576 (ft_list): Likewise.
2577 (ft_select): Make it work in the case family is Mnil.
2578 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2579 (mfont__ft_fini): Set all_fonts_scaned to 0.
2581 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2582 that is failed to open.
2584 2004-05-10 Kenichi Handa <handa@m17n.org>
2586 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2587 device's depth is 1 (i.e. monochrome).
2589 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2590 to work around the problem of libtool.
2592 * font-ft.c: Include <freetype/ftbdf.h>.
2593 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2595 (mfont__ft_init): Initialize them.
2596 (ft_iso8859_1_font_list): New variable.
2597 (set_font_info): Detect a font containing iso8859-1 glyphs and
2598 register it in ft_iso8859_1_font_list. If the font is not
2599 scalable, assume it as BDF or PCF font and setup SIZE and RESY
2600 properties of the font from its properties.
2601 (add_font_list): If the font is not scalable, check if it is BDF
2602 or PCF font. If not, ignore it.
2603 (ft_select): If FAMILY is Mnil, return NULL only if the requested
2604 registry is not iso8859-1.
2605 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2606 ft_iso8859_1_font_list.
2607 (ft_find_metric): If the font is not scalable, assume it as BDF
2608 or PCF, and get a metric from its properties.
2609 (mfont__ft_fini): Free ft_iso8859_1_font_list.
2611 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
2613 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2614 (libm17n_la_LDFLAGS): Delete it.
2615 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2616 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2618 2004-05-06 Kenichi Handa <handa@m17n.org>
2620 * draw.c (compose_glyph_string): Fix previous change.
2622 2004-04-30 Kenichi Handa <handa@m17n.org>
2624 * font-ft.c (ft_list): Delete unused variable `result'.
2625 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2627 2004-04-27 Kenichi Handa <handa@m17n.org>
2629 * m17n-X.c: Include config.h
2630 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2631 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2632 (MWDevice) [HAVE_XFT2]: New member xft_draw.
2633 (FRAME_CMAP, FRAME_VISUAL): New macros.
2634 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2635 (xfont_driver): Make it static.
2636 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2637 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2638 info->xft_color_back.
2639 (MXftFontInfo) [HAVE_XFT2]: New type.
2640 (mwin__xft_close) [HAVE_XFT2]: New function.
2641 (mwin__xft_open) [HAVE_XFT2]: New function.
2642 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2643 (mwin__xft_render) [HAVE_XFT2]: New function.
2645 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2646 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2647 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2650 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2652 * font-ft.c: Don't include FT_FREETYPE_H here.
2653 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2654 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2655 (MFTInfo): New member charmap_index.
2656 (MFTInfo) [HAVE_XFT2]: New member xft_info.
2657 (check_otf_filename): Renamed from check_filename. Return value
2659 (ft_set_property): This function deleted.
2660 (set_font_info): New function.
2661 (add_font_list): Argument changed. Add multiple fonts.
2662 (xft_list) [HAVE_XFT2]: New function.
2663 (ft_list) [not HAVE_XFT2]: New function.
2664 (ft_select): Add code for Xft.
2665 (close_ft): Likewise.
2666 (ft_open): Likewise.
2667 (ft_find_metric): Likewise.
2668 (ft_encode_char): Likewise.
2669 (ft_render): Likewise.
2671 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2673 2004-04-26 Kenichi Handa <handa@m17n.org>
2675 * textprop.c (mtext_attach_property): Declare the return type as
2678 2004-04-21 Kenichi Handa <handa@m17n.org>
2680 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2682 2004-04-09 Kenichi Handa <handa@m17n.org>
2684 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2686 (load_command): Setup above members.
2688 2004-04-05 Kenichi Handa <handa@m17n.org>
2690 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2692 2004-03-30 Kenichi Handa <handa@m17n.org>
2694 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2697 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2698 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2700 2004-03-29 Kenichi Handa <handa@m17n.org>
2702 * Version 1.0 Patch Level 2 released.
2704 2004-03-29 Kenichi Handa <handa@m17n.org>
2706 * charset.c (make_charset): Set charset->fully_loaded and
2707 charset->simple correctly. Don't try to get charset->min_char and
2708 charset->max_char for a charset of method subset and superset.
2709 Don't load a mapping file here.
2710 (mcharset__init): Set unified_max.
2711 (mcharset__load_from_database): Free a working plist.
2713 * coding.c (mcoding__fini): Free all malloced data.
2715 * input-gui.c (win_create_ic): Set control.as_image for preediting
2718 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2719 `count') to initialize the array.
2721 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2724 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2726 (mwin__create_window): Fix bug of setting a background pixel of a
2728 (mwin__adjust_window): Clear the window before drawing.
2730 * m17n-core.c (mdebug__report_object): Free array->objectes if
2732 (m17n_init_core): Don't set report_header_printed to 0 here.
2733 Fix debugging information.
2734 (m17n_fini_core): Set report_header_printed to 0 here.
2736 * m17n-core.h (mplist_deserialize): Extern it.
2738 * m17n-gui.c (m17n_fini_win): Fix debugging information.
2740 * m17n.c (m17n_fini): Fix debugging information.
2742 * mtext.c (mtext__adjust_foramt): New function.
2744 * mtext.h (mtext__adjust_foramt): Extern it.
2746 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2748 * plist.h (mplist__deserialize): Don't extern it.
2750 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
2751 elements of symbol_table to NULL. Report about created and freed
2752 symbols if MDEBUG_FINI is set.
2754 2004-03-22 Kenichi Handa <handa@m17n.org>
2756 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2758 * m17n.c (m17n_init): Fix the way of checking merror_code.
2760 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2762 2004-03-22 Kenichi Handa <handa@m17n.org>
2764 * fontset.c (realize_font_group): Adjust the font size by
2765 mfont__resize before selecting a font.
2767 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2769 2004-03-19 Kenichi Handa <handa@m17n.org>
2771 * Version 1.0 Patch Level 1 released.
2773 2004-03-19 Kenichi Handa <handa@m17n.org>
2775 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2777 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2779 2004-03-19 Kenichi Handa <handa@m17n.org>
2781 Re-apply the changes forgotten in the released version.
2783 * charset.c (mcharset__load_from_database): Call
2784 mchar_define_charset.
2786 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2787 (mconv_encode_range): Put Mcoding text property.
2789 2004-03-18 Kenichi Handa <handa@m17n.org>
2791 * draw.c (Mdepth): New variable.
2792 (visual_order): Delete unused local var `pos'.
2793 (compose_glyph_string): Fix for the case that gstring->glyphs is
2794 realloced. Stop generating glyphs at TO. Fix handling of
2796 (layout_glyphs): Get metrics of all glyphs in advance. Set
2797 lbearing and rbearing of base of composition glyph correctly.
2798 Handle left-overhang glyphs correctly.
2799 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
2801 (dump_combining_code): Change the defualt off_x character to ".".
2802 (mdraw__init): Initialize Mdepth.
2804 * face.c (work_gstring): New variable
2805 (mface__init): Initialize work_gstring.
2806 (mface__fini): Free work_gstring.glyphs.
2807 (mface__realize): Don't handle videomode property here. Adjusted
2808 for the change of mfont__get_metric.
2809 (mface__for_chars): Adjusted for the change of mfont__get_metric.
2811 * face.h (enum face_gc): Moved to m17n-X.c.
2813 * font.h (struct MFontDriver): Arguments of find_metric changed.
2814 (mfont__select): Prototype adjusted.
2815 (mfont__get_metric): Likewise.
2816 (mfont__ft_drive_otf): Likewise.
2817 (mfont__flt_run): Likewise.
2819 * font.c (mfont__select): New argument layouter. If layouter is
2820 different in the registered font, make a new copy of realized
2822 (mfont__get_metric): Argument changed. Get metrics of multiple
2824 (mfont_find): Call mfont__select with layouter as Mnil.
2826 * font-flt.c (FontLayoutContext): New member rfont.
2827 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2828 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
2830 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
2832 (NUM_POINTS): New macro.
2833 (MPointTable): New type.
2834 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2835 (mfont__ft_drive_otf): New argument rfont.
2837 * fontset.c (realize_font_group): Adjusted for the changed of
2839 (check_fontset_element): This function deleted.
2841 * input-gui.c (adjust_window_and_draw): Locate a preedit window
2842 off the parent window if the preedit text is zero length.
2844 * internal-gui.h (struct MFrame): New members foreground,
2845 background, videomode, font.
2846 (struct MGlyphString): New member anti_alias.
2847 (MDrawPoint): New type.
2848 (mwin__draw_bitmap): Prototype deleted.
2849 (mwin__draw_points): Prototype added.
2851 * m17n-gui.h (MDrawControl): New member anti_alias.
2853 * m17n-gui.c (free_frame): Free frame->font.
2854 (mframe): Set the fontset of frame->face to the default fontset.
2856 * m17n-X.c (RGB_GC): New type.
2857 (enum gc_index): Renamed from enum face_gc. Member names changed.
2859 (struct MWDevice): Members foreground and background deleted. New
2860 member scratch_gc, gc_list.
2861 (DEFAULT_FONT, FALLBACK_FONT): New macros.
2862 (free_device): Free GCs in device->gc_list.
2863 (get_rgb_gc): New function.
2864 (get_gc): Renamed and argument changed from get_color.
2865 (get_gc_for_anti_alias): New function.
2866 (xfont_find_metric): Arguments changed. Get metrics of multiple
2868 (set_region): Argument changed. Caller changed.
2869 (xfont_render): Allways set a font in gc.
2870 (x_error_handler, x_io_error_handler): Define only if
2871 X_SET_ERROR_HANDLER is defined.
2872 (mwin__open_device): Create device->scratch_gc. Set members
2873 foreground, background, and videomode of frame. Call
2874 XSetErrorHandler and XSetIOErrorHandler only if
2875 X_SET_ERROR_HANDLER is defined.
2876 (struct gc_list): Deleted.
2877 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2878 (mwin__realize_face): Adjusted for the change of the format of
2879 rface->info and the charge of set_region.
2880 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2881 (mwin__draw_box): Likewise.
2882 (mwin__draw_bitmap): This function deleted.
2883 (mwin__draw_points): New function.
2884 (mwin__verify_region): Adjusted for the change of the format of
2885 rface->info and the charge of set_region.
2886 (mwin__create_window): Inherit backgound pixel from parent.
2887 (mwin__dump_gc): Adjusted for the change of the format of
2890 2004-03-16 Kenichi Handa <handa@m17n.org>
2892 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2894 * input.c (M_key_alias): New variable.
2895 (handle_key): Try M_key_alias property of a key too.
2896 (minput__init): Initialize M_key_alias. Give that property to
2897 symbols in one_char_symbol. Fix bug of initializing
2900 * draw.c (compose_glyph_string): Don't handle
2901 ignore_formatting_char here. Include formatting characters in the
2902 range processed by a FTL.
2903 (layout_glyph_string): Handle ignore_formatting_char here.
2905 2004-03-12 Kenichi Handa <handa@m17n.org>
2907 * input-gui.c (win_create_ic): Enable bidi in status control.
2909 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2911 2004-03-09 Kenichi Handa <handa@m17n.org>
2913 * input.c (load_input_method): If title is not specified, use the
2914 input method name as title.
2916 * m17n-X.c (get_color): Make it static.
2917 (xim_create_ic, xim_destroy_ic, x_error_handler)
2918 (x_io_error_handler): Likewise.
2920 2004-03-01 Kenichi Handa <handa@m17n.org>
2922 * Version 1.0 released.
2925 Copyright (C) 2003, 2004
2926 National Institute of Advanced Industrial Science and Technology (AIST)
2927 Registration Number H15PRO112
2929 This file is part of the m17n library.
2931 The m17n library is free software; you can redistribute it and/or
2932 modify it under the terms of the GNU Lesser General Public License
2933 as published by the Free Software Foundation; either version 2.1 of
2934 the License, or (at your option) any later version.
2936 The m17n library is distributed in the hope that it will be useful,
2937 but WITHOUT ANY WARRANTY; without even the implied warranty of
2938 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2939 Lesser General Public License for more details.
2941 You should have received a copy of the GNU Lesser General Public
2942 License along with the m17n library; if not, write to the Free
2943 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA