1 2005-12-06 Kenichi Handa <handa@m17n.org>
3 * fontset.c (mfont__lookup_fontset): If only a fallback font is
4 found, don't use it for more than one character.
6 2005-12-05 Kenichi Handa <handa@m17n.org>
8 * face.c (mface__realize): Set rfont->layouter to Mnil.
9 (mface__for_chars): Fix handling of layouter.
11 * character.h (mchar__define_prop): Extern it.
13 * database.c (update_database_list): Call mchar__define_prop if
16 * character.c (mchar__init): Don't call mchar_define_property.
17 Instead just initialize property keys.
18 (mchar__fini): Free char_prop_list only if it's not NULL.
19 (mchar__define_prop): New function.
20 (mchar_define_property): Call mchar__define_prop.
22 * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
25 2005-12-02 Kenichi Handa <handa@m17n.org>
27 * language.c (mlang__init): Handle extra chars.
29 * m17n-gui.h (mfont_check): Adjust prototype.
31 * m17n-X.c (xfont_driver): Specify xfont_check_capability.
32 (xfont_check_capability): New function.
33 (xft_driver): Specify xft_check_capability.
34 (xft_check_capability): New function.
36 * font-ft.c (M0_3): Delete it.
38 (ft_get_charmaps): Refer to M0.
39 (fc_parse_pattern): Fix previous change.
40 (ft_list_language): Check also extra chars.
41 (ft_check_otf): Define it even if HAVE_OTF is undef.
42 (ft_check_lang): Check the result of FcLangSetHasLang against
43 FcLangDifferentLang. Check also extra chars.
44 (ft_list_capability): Delete ifdef HAVE_OTF.
45 (ft_select): Likewise.
46 (ft_open): Improve debug information.
47 (ft_check_capability): New function.
48 (mfont__ft_driver): Specify ft_check_capability.
49 (mfont__ft_init): Initialize M0.
51 * fontset.c (get_font_from_group): New function.
52 (mfontset__get_font): New function.
54 * fontset.h (mfontset__get_font): Extern it.
56 * font.c (OTF_tag): Define it if HAVE_OTF is undef.
57 (mfont__fini): Delete ifdef HAVE_OTF.
58 (free_font_capability): Likewise.
59 (mfont__get_capability): Likewise.
60 (mfont__check_capability): New function.
61 (mfont_check): Change the order of arguments. Use
64 * font.h (struct MFontDriver): New member check_capability.
65 (MFontCapability): Delete ifdef HAVE_OTF.
66 (mfont__check_capability): Extern it.
68 * face.c (mface__realize): Fix handling of FONT arg.
69 (mface__for_chars): Fix handling of explicitly specified font.
71 2005-11-25 Kenichi Handa <handa@m17n.org>
73 * font-flt.c (run_command): Print debug info for
76 * draw.c (layout_glyphs): Fix handling of left/right_padding.
78 * face.c (mface__for_chars): Check rfont before accessing the
81 2005-11-21 Kenichi Handa <handa@m17n.org>
83 * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
86 * fontset.c (fontset_table): New variable.
87 (free_fontset): Call M17N_OBJECT_UNREGISTER.
88 (mfont__fontset_init): Add fontset_table as an object array.
89 (mfont__realize_fontset): Ref FONTSET.
90 (mfont__free_realized_fontset): Unref REALIZED->fontset.
91 (mfontset): Call M17N_OBJECT_REGISTER.
92 (mfontset_copy): Likewise.
94 * input.c (handle_key): For debugging, print information about
96 (filter): Add an alias for Meta and Alt modifiers.
97 (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
99 (minput__init): Initialize them.
100 (parse_expression): New function.
101 (resolve_expression): New function.
102 (parse_action_list): Handle expressions by parse_expression.
103 (take_action_list): Handle expressions by resolve_expression.
104 (parse_nested_list_value): Fix previous change.
105 (resolve_command): Fix handling of the return value of
108 2005-11-18 Kenichi Handa <handa@m17n.org>
110 * font-ft.c (ft_check_otf, otf_script_list): Define only when
112 (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
114 (ft_select): Likewise.
116 * font.c (mfont_list): Fix for the case that FONT is NULL.
117 (OTF_tag): Delete it.
118 (load_otf_script_list): Define only when HAVE_OTF is defined.
119 (mfont__fini): Unref otf_script_list only when HAVE_OTF is
122 * draw.c (truncate_gstring): Be sure to truncate at
123 glapheme-cluster boundary.
125 2005-11-11 Kenichi Handa <handa@m17n.org>
127 * input.c (delete_surrounding_text): Clear cache if necessary.
129 2005-11-09 Kenichi Handa <handa@m17n.org>
131 * draw.c (compose_glyph_string): Update prev->rface->rfont if the
132 glyph prev is also supported by the current flt.
134 2005-11-08 Kenichi Handa <handa@m17n.org>
136 * m17n-X.c (xft_render): Cancel previous change.
138 2005-11-07 Kenichi Handa <handa@m17n.org>
140 * input.c: Include <stdlib.h>.
141 (get_surrounding_text, delete_surrounding_text)
142 (get_preceding_char, get_following_char): New functions.
143 (integer_value): New arg surrounding. If it is nonzero, try to
144 get a surrounding character. Callers changed.
145 (take_action_list): Check `value' before setting an element.
146 (destroy_ic): Unref ic_info->preceding_text and
147 ic_info->following_text.
148 (minput__init): Initialize Minput_get_surrounding_text and
149 Minput_delete_surrounding_text.
150 (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
152 (filter): Unref ic_info->preceding_text and
153 ic_info->following_text.
155 * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
158 * input.h (MInputContextInfo): New members preceding_text and
161 2005-11-04 Kenichi Handa <handa@m17n.org>
163 * input.c (parse_nested_list_value): Fix handling of the global
165 (get_nested_list): Get global definitions by load_partial_im_info.
166 (preedit_commit): Set ic->candidates_changed to bitwise or of enum
167 MInputCandidatesChanged.
168 (take_action_list): Likewise.
169 (reset_ic): Likewise.
170 (create_ic): Don't pay special attention to
171 Mcandidates_group_size.
172 (load_partial_im_info): Call mdatabase_find with correct 4th arg.
173 (minput_set_variable): Get a definition of varible by
174 mplist_find_by_value, not mplist_get.
176 * m17n.h (enum MInputCandidatesChanged): New enum.
178 2005-11-01 Kenichi Handa <handa@m17n.org>
180 * m17n-X.c (xft_render): Check xft_draw's drawable before changing
182 (mwin__destroy_window): If xft_draw's drawable is win, change it
183 to device->drawable before destroying win.
185 2005-10-31 Kenichi Handa <handa@m17n.org>
187 * input.c (load_im_info): Fix adding of state.
189 * m17n-core.c (m17n_fini_core): Fix reporting of module
192 * m17n.c (m17n_fini): Fix reporting of module finalization.
194 * m17n-gui.c (m17n_init_win): Fix reporting of module
197 2005-10-29 Kenichi Handa <handa@m17n.org>
199 * input.c (get_candidate_list): Fix the timing of referring plist.
201 2005-10-28 Kenichi Handa <handa@m17n.org>
203 * input.c (load_branch): Ignore an undefined map name.
204 (load_im_info): Set im_info->title from `name' only if it's not
206 (shift_state): Always update ic->status.
207 (adjust_candidates): Renamed from adjust_candidate_command.
208 Argument changed. Caller changed.
209 (get_candidate_list, regularize_action): New functions.
210 (take_action_list): Use them. On handling Munhandle, don't set
212 (handle_key): If KEY is not handled by MAP, and MAP has
213 branch_actions, perform them.
215 * database.c (mdatabase__fini): Free dir_info->filename;
217 2005-10-20 Kenichi Handa <handa@m17n.org>
219 * input.c (marker_code): Accept '@@'.
220 (integer_value): Handle '@@'.
221 (parse_action_list): Accept a symbol argument.
222 (take_action_list): Resolve the symbol argument. Handle the
225 2005-10-18 Kenichi Handa <handa@m17n.org>
227 * input.c: Include "charset.h".
228 (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
230 (MIMState): New member (M17NObject control).
231 (lookup_nested_list, set_nested_list, parse_nested_list_value)
232 (get_nested_list, resolve_variable): New functions.
233 (integer_value): New arg (MPlist **value). Set it to the plist
234 element containing the value.
235 (resolve_command): New function.
236 (load_translation): New arg (MPlist *map_actions).
237 (load_branch): New args language and name. If `keylist' is a
238 symbol, resolved that as a command name.
239 (free_map): New arg top. Free map->map_actions only if top is
241 (free_state): New function.
242 (load_state): New arg name.
243 (im_info_list): New variable.
244 (free_im_info, get_im_info_by_tags): New functions.
245 (load_im_info): Arg key changed to plist. Handle `include'.
246 Return (MInputMethodInfo *).
247 (preedit_commit): Ref ic->candidate_list.
248 (get_select_charset, adjust_candidate_command): New functions.
249 (take_action_list): Handle `include'. Adjust candidate action
250 properly. Handle control variables `candidates-charset' and
251 `candidates-group-size'.
252 (open_im): Use get_im_info.
253 (create_ic): Get global variables.
254 (load_partial_im_info): New function.
255 (get_im_info): New function.
256 (check_command_keyseq, check_command_list, check_variable_list):
258 (minput__init): Don't handle M_database_hook and Mdetail_text.
259 Initialize M_candidates, Mcandidates_group_size,
261 (parse_variable_list, get_variable_list, parse_command_list)
262 (get_command_list): Delete them.
263 (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
264 (minput__fini): Simply unref command_list and variable_list.
265 (minput_get_description): Adjusted for the new form of description.
266 (minput_get_commands): Use get_nested_list.
267 (minput_assign_command_keys): Likewise.
268 (minput_get_variables, minput_set_variable): Likewise.
270 * input.h (MInputMethodInfo): New members im and maps.
272 * database.h (M_database_hook): Delete extern.
273 (MDatabaseHookFunc): Delete extern.
274 (mdatabase__check): Extern it.
276 * database.c: Include <glob.h>.
277 (MAX_TIME): New macro.
278 (Masterisk): New variable.
279 (get_database_stream): Argument changed to (MDatabaseInfo *).
281 (get_dir_info): Renamed from duplicate_dirname. Callers changed.
282 (find_database): New function.
283 (update_database_list): New function.
284 (mdatabase__init): Initialize Masterisk. Setup mdb_list by
285 calling update_database_list.
286 (mdatabase__check): New function.
287 (mdatabase_find): Use update_database and find_database. Don't
288 handle MDatabaseHookFunc.
289 (mdatabase_list): Call update_database at first.
290 (mdatabase_define): Adjusted for the change of mdb->extra_info.
291 (MDatabaseList): New type.
293 * plist.h (mplist_conv, mplist__pop_unref): Extern them.
295 * m17n.h (Mdetail_text): Delete extern.
297 * m17n-core.h (mplist_conc): Delete extern.
299 * plist.c (mplist__conc): Renamed from mplist_conc. Don't ref
301 (mplist_conc): Renamed to mplist__conc.
302 (mplist__pop_unref): New function.
304 2005-10-14 Kenichi Handa <handa@m17n.org>
306 * plist.c (read_mtext_element): Ignore the sequence of '\\' and
308 (read_element): If keys is an empty plist, return any element
310 (dump_plist_element): Check if plist is nested.
311 (mplist_conc): Always ref tail.
312 (mplist_set): If key is a managing key, ref val in advance.
314 * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
315 (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
316 (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
319 * fontset.c (free_fontset): Unref fontset_list if necessary.
320 (mfont__fontset_fini): Don't free fontset_list. Unref
322 (mfont__realize_fontset): Initialize request.
323 (mfontset): Ref default_fontset or fontset only if necessary.
324 (mfontset_copy): Don't ref copy.
326 * draw.c (render_glyphs): Check gend->type before checking
329 * font-ft.c (mfont__ft_fini): Unref ft_default_list. Set all
330 unrefed plists to NULL.
332 2005-10-04 Kenichi Handa <handa@m17n.org>
334 * textprop.c (mtext_serialize): Be sure to make mt
335 MTEXT_FORMAT_UTF_8 and NULL terminated.
337 * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
339 * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
341 2005-10-03 Kenichi Handa <handa@m17n.org>
343 * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
344 is not at the beginning of line.
346 2005-09-22 Kenichi Handa <handa@m17n.org>
348 * input.c: Include <sys/stat.h> and <unistd.h>.
349 (Minclude, Mcommit, Munhandle): New variables.
350 (minput__init): Initialize them. Push only Mstate to
351 load_im_info_keys. Add aliases C-lowercase for C-uppercase.
352 (parse_action_list): Allow integer arg for undo. Handle Mcommit
354 (load_input_method): Handle "include" directive. If no states are
356 (shift_state): If state_name is Mt, shift back to the previous
357 state. Call preedit_commit to commit preedit text.
358 (preedit_commit): New function.
359 (take_action_list): Improve debug printing. Handle commit and
361 (handle_key): Check the return value of take_action_list. Don't
362 take branch_actions just after changing to the root map.
363 (reset_ic): Reset all ic_info members.
364 (filter): When a key is not handled, just move ic_info->keys
365 instead fo calling reset_ic.
366 (load_im_info): If key is not Mstate, push Mmap to
368 (MDatabaseStatList): New type.
369 (imdir_stat_list): New variable.
370 (input_method_hook): Don't cancel the hook. Check the
371 modification time of directories.
372 (minput__fini): Free imdir_stat_list;
374 * input.h (MInputContextInfo): New member prev_state.
376 * m17n-core.h (mplist_conc): Extern it.
378 * plist.c (mplist_conc): New function.
380 * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
382 * font.h (MRealizedFont): New member average_width.
384 * font-ft.c (ft_open): Set rface->average_width.
386 * font.c (xlfd_unparse_name): Print '*' before registry name.
388 * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
389 (xfont_open): Set rfont->average_width.
390 (xft_open): Likewise.
391 (device_open): Initialize disp_info->AVERAGE_WIDTH.
393 * internal-gui.h (struct MFrame): New member average_width.
395 * m17n-gui.c (mframe): Fix setting of frame->rfont.
396 (mframe_get_prop): Return the average_width of a font.
398 * face.c (mface__realize): Set rface->average_width.
399 (mface__update_frame_face): Set frame->average_width.
401 * face.h (MRealizedFace): New member average_width.
403 2005-09-19 Kenichi Handa <handa@m17n.org>
405 * font.c (xlfd_unparse_name): New arg full_xlfd.
406 (mfont__encode_char): Use shortcut only for X core fonts.
407 (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
408 (mfont_put_prop): Handle `language' property.
409 (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
410 Print file can capability info too.
412 * m17n-core.c (mdebug__output): New variable.
413 (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
414 (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
415 (m17n_fini_core): Close mdebug__output if it's not stderr.
417 * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
418 (xfont_open): Handle baseline_offset.
419 (xfont_find_metric): Likewise.
420 (xfont_render): Likewise.
421 (xft_open): Likewise.
422 (xft_render): Likewise.
424 * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
425 (mdebug__output): Extern it.
426 (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
427 (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
428 (MDEBUG_DUMP): New macro.
429 (MDEBUG_PRINT_TIME): Print to medebug__output.
431 * font.h (MRealizedFont): New member baseline_offset.
433 * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
435 (fc_weight_table): Add FC_WEIGHT_REGULAR.
436 (ft_list_family): Check alias.
437 (ft_list_language): If language is "en", don't try to the second
439 (ft_default_list): New variable.
440 (ft_list_default): New function.
441 (ft_select): If family is not specified, try only the default
442 fonts. Treat the weights normal and medium same.
443 (ft_open): Fix debug message. If registry is not specified, try
444 unicode-bmp. Handle _MULE_BASELINE_OFFSET property of BDF fonts.
445 (ft_find_metric): Likewise.
446 (ft_render): Likewise.
447 (ft_list): Fix debug message. Accept the registring iso8859-1.
448 If family is not specified, try only the default fonts.
450 * face.c (mface__realize): Fix logic of opening a font.
452 2005-09-16 Kenichi Handa <handa@m17n.org>
454 * face.c (mface__realize):
456 * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
459 * input.c (shift_state): Fix the condition of taking init actions.
460 (take_action_list): Fix handling of pushback action.
461 (handle_key): Don't change key while checking its alias.
462 (minput__init): Initialize new variables.
463 (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
466 2005-09-12 Kenichi Handa <handa@m17n.org>
468 * mtext.c (mtext__uppercase): Add proper open/close parens.
469 (mtext_titlecase): Add proper casting.
471 * input.c (parse_action_list): Handle the case that the arg is a
472 key sequence (MText or MPlist).
473 (take_action_list): Likewise.
474 (shift_state): Shorter debug message.
475 (handle_key): Terminate a debug message by "\n".
476 (reset_ic): Don't take initial actions here.
477 (minput_open_im): Print a debug message.
478 (minput_close_im): Likewise.
479 (minput_create_ic): Likewise.
480 (minput_destroy_ic): Likewise.
482 2005-09-09 TAKAHASHI Naoto <ntakahas@m17n.org>
484 * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
487 2005-09-07 TAKAHASHI Naoto <ntakahas@m17n.org>
488 * character.c: Add "cased", "soft-dotted", and "case-mapping" in
491 * character.c: Add Japanese documentation for
492 mchar_get_prop_table ().
494 2005-09-06 TAKAHASHI Naoto <ntakahas@m17n.org>
496 * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
497 (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
498 (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
500 (init_case_conversion): New function.
501 (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
502 (uppercase_precheck, lowercase_precheck, final_sigma)
503 (after_soft_dotted, more_above, before_dot, after_i)
504 (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
506 2005-09-05 TAKAHASHI Naoto <ntakahas@m17n.org>
508 * plist.c (read_mtext_element): Fix previous change.
510 2005-09-05 Kenichi Handa <handa@m17n.org>
512 * plist.c (read_mtext_element): Handle \uXXXX notation.
514 * internal.h (MTABLE_MALLOC): Don't use a local variable.
515 (MTABLE_ALLOCA): Change the name of local variable.
517 * m17n-gd.c (device_open): Define it even if HAVE_GD nor
518 HAVE_FREETYPE are defined.
520 * m17n-X.c: Check HAVE_X11.
522 * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
523 directory listing libraries.
524 (noinst_PROGRAMS): Define it only in maintainer mode.
526 2005-09-02 Kenichi Handa <handa@m17n.org>
528 * m17n-gui.h (mdraw_line_break_option): Extern it.
530 * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
531 end of the first glyph.
532 (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
534 (mdraw_line_break_option): New variable.
535 (mdraw_default_line_break): Use mtext_line_break.
537 * mtext.h (wordseg_func_table): Don't extern it.
538 (mtext__wseg_fini): Extern it.
540 * mtext.c: Don't include word-thai.h.
541 (wordseg_func_table): Delete this variable.
542 (mtext__init): Don't initialize above. Don't call
543 mtext__word_thai_init.
544 (mtext__fini): Don't free wordseg_func_table. Call
545 mtext__wseg_fini instead fo mtext__word_thai_fini.
546 (MTextWordsegFunc): Don't typedef it.
547 (mtext__word_segment): Moved to mtext-wseg.c.
549 * m17n-core.h (enum MTextLineBreakOption): New enum.
550 (mtext_line_break): Extern it.
552 * mtext-wseg.c: New file.
554 * mtext-lbrk.c: New file.
556 * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
557 add mtext-lbrk.c and mtext-wseg.c.
559 * textprop.c (mtext__adjust_plist_for_change): Pay attention for
560 the case that head is NULL.
562 2005-09-01 Kenichi Handa <handa@m17n.org>
564 * word-thai.c (wordseg_propertize): If the property value is nil,
565 don't make the property no-merge.
566 (thai_wordseg): Don't require *from and *to are set a priori. Pay
567 attention to the case that they are NULL.
568 (mtext__word_thai_init): Make the name of Mthai_wordseg starts
571 * character.c (mchar_get_prop_table): New function.
573 * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
575 * m17n-core.h (mtext_insert, mtext_replace): Extern them.
576 (mchar_get_prop_table): Extern it.
578 * textprop.c (prepare_to_modify): New arg deleting. Callers changed.
579 (mtext__adjust_plist_for_change): Argument changed. Callers changed.
581 * internal.h (enum MTextCoverage): New enum.
582 (MText): New member coverage.
584 * mtext.c (FORMAT_COVERAGE): New macro.
585 (insert): Copy mt2->coverage.
586 (mtext__from_data): Initialize mt->coverage.
587 (mtext__adjust_format): Update mt->coverage.
588 (mtext): Initialize mt->coverage.
589 (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
590 Update mt->coverage if necessary.
591 (mtext_duplicate): Copy mt->coverage.
592 (mtext_insert, mtext_replace): New functions.
593 (mtext_dup): Use mtext_duplicate.
594 (mtext__word_segment): Don't set *from and *to if a word
595 segmentation funcion is not found.
596 (mtext_ins_char): Fix typo.
598 2005-08-25 Kenichi Handa <handa@m17n.org>
600 * font.h (MFont): New member for_full_width.
602 * font.c (compare_font_score): Prefer a font of not
605 * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
606 registry charset of a font is one of CJK charsets.
608 * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
609 supports some of CJK.
611 2005-08-24 Kenichi Handa <handa@m17n.org>
613 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
615 * m17n-gui.c (null_device_open): Check Mresolution param and set
618 * m17n-gd.c (device_open): Check Mresolution param and set
621 * m17n-X.c (MWDevice): New member resy.
622 (xfont_open): Set ascent, descent, and max_advance members of
624 (xft_open): Likewise.
625 (device_open): Compare also screen_num to find a device. Set
626 device->resy and frame->dpi.
628 * internal-gui.h (MFrame): New member dpi.
630 * font.h (MRealizedFont): New member max_advance.
632 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
633 (mfont__init): Don't initialize Mascent, Mdescent.
634 (Mascent, Mdescent): Delete these variables.
635 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
636 Mfont_descent instead of Mascent and Mdescent.
637 (mfont_put_prop): Allow negative size.
638 (mfont_find): Handle the case of spec->size < 0. Fix previous
640 (mfont_list): Handle the case of spec->size < 0.
641 (mfont_check): Likewise.
643 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
644 (fc_get_pattern): Handle the case of font->size < 0.
645 (ft_open): Set ascent, descent, and max_advance members of rfont.
646 (ft_find_metric): Improve rounding.
647 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
650 * face.c (mface__realize): Handle the case of font->size < 0.
652 2005-08-22 Kenichi Handa <handa@m17n.org>
654 * coding.c (MConverterStatus): Change the member buf to union.
655 (mconv_buffer_converter): Add const to the arg buf.
656 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
657 (mconv_decode): Adjusted for the change of MConverterStatus.
658 (mconv_encode_range): Likewise.
660 * m17n.h (mconv_buffer_converter): Prototype adjusted.
661 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
663 2005-08-20 Kenichi Handa <handa@m17n.org>
665 * m17n-gui.h (mfont_from_name): Prototype adjusted.
666 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
668 * m17n-X.c (xfont_open): Set members ascent, descent, and
669 max_advance of rfont.
670 (xft_open): Likewise.
672 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
674 (mfont__ft_parse_name): Add const to the arg name.
676 * font.c (xlfd_parse_name): Add const to the arg name. Call
677 mfont__set_property instead of mfont_set_spec. Set font->spacing.
678 (xlfd_unparse_name): Handle spacing.
679 (mfont__init): Initialize new variables.
680 (mfont__id): Handle spacing.
681 (mfont__merge): Likewise.
682 (mfont__set_spec): This function deleted.
683 (mfont__parse_name_into_font): Add const to the arg name. Fix the
684 condition of calling mfont__ft_parse_name.
685 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
686 (mfont_get_prop): Handle properties spacing, ascent, descent,
688 (mfont_find): Return a realized font.
689 (mfont_from_name): Add const to the arg name.
691 * font.h (enum MFontProperty): New member MFONT_SPACING.
692 (enum MFontSpacing): New enum.
693 (MFont): New members spacing and max_advance.
694 (mfont__ft_parse_name): Prototype adjusted.
695 (mfont__set_spec): Extern deleted.
696 (mfont__parse_name_into_font): Prototype adjusted.
698 2005-08-19 Kenichi Handa <handa@m17n.org>
700 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
702 * font.c (mfont_list): If FONT is null, use a temporary font.
703 (mfont_parse_name): Add const to the arg name.
705 2005-08-18 Kenichi Handa <handa@m17n.org>
707 * word-thai.c: Surround code by #ifdef and #endif to escape from
710 * font-ft.c: Mostly re-written.
712 * font-flt.c (FontLayoutCmdOTF): This type deleted.
713 (FontLayoutCmd): Type of the member otf changed..
714 (load_otf_command): Adjusted for the format change of otf command.
715 (load_command): Likewise.
716 (free_flt_command): Unref cmd->body.otf.
717 (run_otf): Ajusted for the type change of otf_cmd.
718 (run_command): Ajusted for the type change of otf_cmd. On
719 debugging, print ctx->combining_code.
720 (mfont__flt_run): Initialize ctx's members code_offset,
721 combining_code, and left_padding to 0.
723 * face.h (struct MRealizedFace): New member font.
724 (mface__realize): Prototype adjusted.
726 * face.c (find_realized_face): New arg font.
727 (find_realized_face): Adjusted for the change of MFont.
728 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
729 (mface__fini): Don't call mdebug__report_object.
730 (mface__realize): New arg font.
731 (mface__for_chars): Adjusted for the change of mfont__encode_char.
732 Optimize the latin case.
733 (mface__free_realized): Free rface->font.
734 (mface__update_frame_face): Adjusted for the change of mface__realize.
735 (mface_equal): New function.
737 * draw.c (Mcommon): New variable.
738 (visual_order): Args to mfont__encode_char changed.
739 (compose_glyph_string): Handle Mfont text property.
740 (layout_glyphs): Adjusted for the change of MFont.
741 (mdraw__init): Initialize Mcommon.
742 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
744 * font.h (enum MFontType): Members completely changed.
745 (enum MFontProperty): Move MFONT_SIZE to the tail.
746 (enum MFontSource): New enum.
747 (struct MFont): New members type, source, sizes, file, capability,
749 (struct MRealizedFont): Type of member font changed. Members
750 score, status, and encoding deleted.
751 (MFontScore): New type.
752 (MFontList): Member changed.
753 (struct MFontDriver): New member has_char. Types of members
755 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
756 (Mapple_roman): Extern them.
757 (OTF_Tag): Typedefed if not HAVE_OTF.
758 (enum MFontOpenTypeTable): New enum.
759 (MFontCapability): New type.
760 (mfont__ft_drive_otf): Prototype adjusted.
761 (mfont__score): Extern deleted.
762 (mfont__merge): Extern it.
763 (mfont__has_char): Extern it.
764 (mfont__encode_char): Prototype adjusted.
765 (mfont__open): Extern it.
766 (mfont__set_spec): Prototype adjusted.
767 (mfont__get_capability): Extern it.
769 * font.c: Include "fontset.h".
770 (M_font_capability, M_font_list, M_font_list_len): New variables.
771 (font_score_priority): Change order of initial elements.
772 (font_score_shift_bits): Fix array size.
773 (common_weight): Add "thin", "semibold", and "heavy".
774 (common_stretch): Add "ultracondensed", "extracondensed",
775 "extraexpanded", and "utltraexpand".
776 (font_weight_regular, font_weight_normal, font_weight_medium): New
778 (gen_font_name): This function deleted.
779 (find_encoding): Set font->encoding.
780 (OTF_tag): New function.
781 (otf_script_list): New variable.
782 (load_otf_script_list): New function.
783 (find_script_from_otf_tag): New function.
784 (xlfd_parse_name): Set font->type and font->source.
785 (mfont__free_realized): Free chains rfonts.
786 (font_score): Renamed from mfont__score.
787 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
788 (Mapple_roman): New variables.
789 (mfont__init): Initilize new variables. Initalize
790 default_encoding.encoding_name and
791 default_encoding.encoding_charset to Municode_full and
792 mcharset__unicode. Use SAFE* macros for allocating filepath
794 (mfont__fini): Free otf_script_list.
795 (mfont__id): New function.
796 (mfont__match_p): Check also capability member of MFont.
797 (mfont__merge): New funciton.
798 (mfont__set_spec_from_face): Set type and source members.
799 (mfont__set_spec_from_plist): Set capability and type members.
800 (mfont__select): Argument changed.
801 (mfont__available): New function.
802 (compare_font_score): New function.
803 (mfont__list): New function.
804 (mfont__open): Return a realized font.
805 (mfont__resize): Adjusted for the change of MFont.
806 (mfont__has_char): New function.
807 (mfont__encode_char): Argument changed.
808 (mfont__set_spec): Argument changed.
809 (free_font_capability): New function.
810 (mfont__get_capability): New function.
811 (MFontfile): New variable.
812 (mfont_get_prop): Adjusted for the change of MFont.
813 (mfont_put_prop): Likewise.
814 (mfont_set_selection_priority): Fix the way of setting
815 font_score_priority[].
816 (mfont_find): Use mfont__list instead of mfont__select.
817 (mfont_resize_ratio): Adjusted for the change of MFont.
818 (mfont_list): Use mfont__list.
819 (mfont_check): New function.
820 (font_score): Make it static.
822 * fontset.h (mfont__realize_fontset): Prototype adjusted.
823 (mfont__lookup_fontset): Likewise.
825 * fontset.c (struct MFontset): Delete member font_spec_list.
826 (struct MRealizedFontset): Type of member spec changed. New
828 (load_font_group): Arg spec_list deleted.
829 (load_fontset_contents): Adjusted for the change of fontset_def.
830 (free_fontset): Fix the way of freeing fontset elements.
831 (realize_fontset_elements): Argument changed.
832 (get_per_script): New function.
833 (free_realized_fontset_elements): Fix the way of feeing rfontset
835 (update_fontset_elements): Fix args to realize_fontset_elements.
836 (mfont__realize_fontset): New arg spec.
837 (try_font_list): New function.
838 (try_font_group): New arg request. Use try_font_list.
839 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
841 (mfontset): Adjusted for the change of MFontset.
842 (mfontset_copy): Likewise. Don't share plists.
843 (mfontset_modify_entry): Adjusted for the change of MFontset.
844 (mfontset_lookup): Call get_per_script.
845 (mdebug_dump_fontset): Print also the address of fonts.
847 * input.c (shift_state): Don't reset ic_info->vars.
848 (take_action_list): Call MDEBUG_PRINT fore calling
851 * internal-gui.h (MFontDriver): Don't typedef it here.
853 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
854 (MXFont): This type deleted.
856 (struct _MFontX): New struct.
857 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
858 (MDisplayInfo): Member base_font_list deleted.
859 (DEFAULT_FONT): Definition changed.
860 (FALLBACK_FONT): This maclr deleted.
861 (free_display_info): Adjusted for the change of MDisplayInfo.
862 (free_device): Argument to mfont__free_realized changed.
863 (xfont_driver): Adjusted for the change of MFontDriver.
864 (xfont_registry_list): Use MFontX instead of MXFont.
865 (MRealizedFontX): Renamed from MXFontInfo.
866 (xfont_select): Return the font found first.
867 (close_xfont): Change MXFontInfo to MRealizedFontX.
868 (xfont_open): Return the realized font.
869 (xfont_find_metric): Get xfont from rfont->fontp.
870 (xfont_has_char): New function.
871 (xfont_encode_char): Adjusted for the argument change.
872 (xfont_render): Get xfont from rfont->fontp.
873 (xfont_list): Adjusted for the argument change.
874 (MRealizedFontXft): Renamed from MXftFontInfo.
875 (xft_driver): Ajusted for the change of MFontDriver.
876 (close_xft): Change MXtfFontInfo to MRealizedFontXft
877 (xft_open_font): Argument changed.
878 (xft_open): Argument changed. Return the realized font.
879 (xft_find_metric): Get xft_font from rfont->fontp.
880 (xft_has_char, xft_encode_char): New functions.
881 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
882 font if not yet opened.
883 (device_open): Don't set frame->font.
885 * m17n-gd.c (gd_font_driver): Adjusted for the change of
887 (gd_font_open): New function.
888 (gd_render): Don't use the local variable ft_info.
889 (device_init): Adjusted for the change of gd_font_driver.
891 * textprop.c (mtext__prop_init): Initialize text_property_table.
892 Call M17N_OBJECT_ADD_ARRAY.
893 (mtext__prop_fini): Don't call mdebug__report_object.
895 * plist.c (mplist__init): Initialize plist_table.
896 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
897 (mplist__fini): Don't call mdebug__report_object.
899 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
900 (mtext__fini): Don't call mdebug__report_object.
901 (MTEXT_FORMAT_UTF_16): Correct type.
902 (mtext_data): New function.
903 (mtext_text): Fix calculation of limit and args to
906 * language.c: Include "plist.h".
907 (M_script_lang_list): New variable.
908 (mlang__init): Read languages and their information from m17n
910 (mlanguage__list): New function.
911 (Miso639_1, Miso639_2): New variables.
913 * language.h (mlanguage__list): Extern it.
915 * database.c (get_database_stream): Use SAFE_* macros for
916 allocating and freeing path.
917 (mdatabase__init): Likewise.
919 * symbol.c (msymbol__fini): Don't free symbols here.
920 (msymbol__free_table): New function.
921 (msymbol_is_managing_key): New function.
923 * symbol.h (msymbol__free_table): Extern it.
924 (msymbol__list): Extern it.
926 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
928 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
929 (struct _M17NObjectArray): New member name and next.
930 (mdebug__add_object_array): Extern it.
931 (M17N_OBJECT_ADD_ARRAY): New macro.
932 (mdebug__report_object): Don't extern it.
934 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
936 * m17n-gui.c (free_frame): Don't free frame->font.
937 (null_device_fini): Fix code for freeing
938 null_device.realized_font_list.
939 (m17n_fini_win): Free interface.
940 (mframe): Cast the return value of dlsym. Set frame->font here.
941 (mframe_get_prop): Check frame->rface->rfont before accessing the
944 * m17n-gui.h (Mfontfile): Extern it.
945 (mfont_check): Extern it.
946 (mface_equal): Extern it.
948 * m17n-core.c: Include "symbol.h".
949 (report_header_printed): This variable deleted.
950 (object_array_root): New variable.
951 (report_object_array): New function.
952 (mdebug__report_object): This function deleted.
953 (mdebug__add_object_array): New function.
954 (m17n_init_core): Call mchartable_init () before mtext_init ().
955 (m17n_fini_core): Call report_object_array (if necessary) and
956 msymbol__free_atable at the end.
958 * m17n-core.h (msymbol_is_managing_key): Extern it.
959 (mtext_data): Extern it.
960 (MTEXT_FORMAT_UTF_16): Correct type.
961 (M17NLIB_MINOR_VERSION): Changed to 3.
962 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
964 * chartab.c (mchartable__init): Initalize chartable_table.count.
965 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
966 mdebug__report_object.
968 2005-05-26 Kenichi Handa <handa@m17n.org>
970 * m17n.h (Miso639_1, Miso639_2): Extern them.
972 * symbol.h (msymbol__list): Extern it.
974 * symbol.c (msymbol__list): New function.
976 2005-05-19 Kenichi Handa <handa@m17n.org>
978 * input-gui.c (minput__win_init): Don't change the value of
981 2005-05-16 Kenichi Handa <handa@m17n.org>
983 * m17n-core.c (m17n_object): Be sure to initialize all members.
985 * font-ft.c (fc_decode_prop): Fix args to msymbol.
987 2005-05-09 Kenichi Handa <handa@m17n.org>
989 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
991 2005-04-27 Kenichi Handa <handa@m17n.org>
993 * language.c (mlang__init): Add "an" (Aragonese).
995 * word-thai.c: Add support for libthai.
996 (mtext__word_thai_init): Initialize wordseg library conditionaly.
997 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
999 * mtext.c: Include "word-thai.h" conditionaly.
1000 (mtext__init): Call mtext__word_thai_init conditionaly.
1001 (mtext__fini): Call mtext__word_thai_fini conditionaly.
1003 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1004 not WORDCUT_LD_FLAGS.
1006 2005-04-19 Kenichi Handa <handa@m17n.org>
1008 * word-thai.c (wordseg_propertize): Always unref the attached
1010 (thai_wordseg): Don't unref the property.
1012 2005-04-18 Kenichi Handa <handa@m17n.org>
1014 * word-thai.c: Include stdlib.h.
1015 (wordseg_propertize): Add dummy function for the case that wordcut
1016 library doesn't exist.
1017 (wordseg_propertize): Fix for old wordcut library.
1019 2005-04-16 Kenichi Handa <handa@m17n.org>
1021 * word-thai.c: Include <stdio.h>.
1023 2005-04-15 Kenichi Handa <handa@m17n.org>
1025 * draw.c: Include mtext.h.
1026 (linebreak_table, M_break_at_space, M_break_at_word)
1027 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1028 (compose_glyph_string): Check POS before getting Mface text
1030 (truncate_gstring): Give correct TO arg to line_break function.
1031 (GET_LB_TYPE): New macro.
1032 (find_break_backward, find_break_forward): New functions.
1033 (mdraw__init): Initialize the above new variables.
1034 (mdraw__fini): Free linebreak_table.
1035 (mdraw_default_line_break): Use find_break_backward and
1038 * word-thai.c: New file.
1040 * word-thai.h: New file.
1042 * mtext.c: Include word-thai.h.
1043 (wordseg_func_table): New variable.
1044 (mtext__init): Initialize wordseg_func_table and call
1045 mtext__word_thai_init.
1046 (mtext__fini): Call mtext__word_thai_fini, free
1048 (MTextWordsegFunc): New type.
1049 (mtext__word_segment): New function.
1051 * mtext.h (wordseg_func_table): Extern it.
1052 (mtext__word_segment): Extern it.
1054 * m17n.c (m17n_init): Fix typo (== -> =).
1056 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1057 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1059 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1060 (MTEXTPROP_VAL): New macros.
1062 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1064 2005-04-07 Kenichi Handa <handa@m17n.org>
1066 * database.c (load_chartable): Fix pursing of symbol name.
1068 2005-03-24 Kenichi Handa <handa@m17n.org>
1070 * m17n.c (m17n_init): Fix typo (== -> =).
1072 2005-03-11 Kenichi Handa <handa@m17n.org>
1074 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1076 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1078 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1081 2005-03-09 handa <handa@m17n.org>
1083 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1084 calling m17n_init ().
1086 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1087 calling m17n_init_core ().
1089 2005-02-28 Kenichi Handa <handa@m17n.org>
1091 * font-flt.c (mfont__flt_run): Add resulting code sequence in
1094 2005-02-17 Kenichi Handa <handa@m17n.org>
1096 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1097 (M_description, M_command, M_variable): New variables.
1098 (load_im_info_keys): New variables.
1099 (load_im_info, check_command_keyseq, get_description_advance)
1100 (parse_command_list, get_command_list, parse_variable_list)
1101 (get_variable_list, input_method_hook): New functions.
1102 (command_list, variable_list): New variables.
1103 (minput__init): Put input_method_hook to Minput_method.
1104 Initialize M_description, M_command, M_variable, Mdetail_text,
1105 load_im_info_keys, command_list, variable_list.
1106 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1107 (Mdetail_text): New variable.
1108 (minput_get_description, minput_get_commands)
1109 (minput_assign_command_keys, minput_get_variables)
1110 (minput_set_variable): New functions.
1112 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1113 (minput_assign_command_keys, minput_get_variables)
1114 (minput_set_variable): Extern them.
1116 * plist.c (UNGETC): Just decrement st->p.
1117 (read_mtext_element): New arg skip.
1118 (read_integer_element): Likewise.
1119 (read_symbol_element): Likewise.
1120 (read_element): New arg KEYS.
1121 (mplist__from_plist): Don't increment ref-count of NULL object.
1122 (mplist__from_file): New arg KEYS.
1123 (mplist_put): Don't increment ref-count of NULL object.
1124 (mplist_add): Likewise.
1125 (mplist_push): Likewise.
1126 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
1128 * plist.h (mplist__from_file): Prototype adjusted.
1130 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1131 (get_database_stream): New function.
1132 (load_database): Use get_database_stream.
1133 (M_database_hook): New variable
1134 (mdatabase__init): Initialize M_database_hook.
1135 (mdatabase__load_for_keys): New function.
1136 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1138 (mdatabase_define): Free mdb->extra_info if necessary.
1140 * database.h (mdatabase__dir_list, M_database_hook)
1141 (mdatabase__load_for_keys): Extern them.
1142 (MDatabaseHookFunc): New type.
1144 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1146 2004-12-27 Kenichi Handa <handa@m17n.org>
1148 * Version 1.2.0 released.
1150 2004-12-27 Kenichi Handa <handa@m17n.org>
1152 * input.c (minput_filter): Don't reset ic->xxx_changed.
1154 * mtext.c (mtext_from_data): Fix documentation.
1156 2004-12-25 Kenichi Handa <handa@m17n.org>
1158 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1159 (M17NLIB_VERSION_NAME): Update to "1.2.".
1161 2004-12-24 Kenichi Handa <handa@m17n.org>
1163 * input.c (reset_ic): Set key_unhandled to 0.
1165 2004-12-21 Kenichi Handa <handa@m17n.org>
1167 * m17n-gui.h (mfont_from_spec): Delete extern.
1169 * input-gui.c (win_callback): Handle Minput_reset.
1170 (minput__win_init): Register reset_ic as a callback for
1173 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
1174 changed. At first, shift to the initial state.
1175 (minput__init): Initialize Minput_reset. Register reset_ic as a
1176 callback for Minput_reset.
1177 (Minput_reset): New variable.
1178 (minput_filter): Always set ic->xxx_changed to 0.
1179 (minput_reset_ic): New function.
1180 (integer_value): Fix typo ('>' -> '<') and calculation of length
1183 * m17n-core.c (merror_code): Change type to `int'.
1185 * m17n-misc.h (merror_code): Adjust type.
1187 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1189 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1190 (mtext_change_prop): Delete extern.
1192 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1193 to `int'. Move the documents to m17n-core.h.
1195 2004-12-13 Kenichi Handa <handa@m17n.org>
1197 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1198 (MTextProperty): Document it.
1200 2004-12-09 Kenichi Handa <handa@m17n.org>
1202 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1204 2004-12-03 Kenichi Handa <handa@m17n.org>
1206 * internal.h (m17n__core_initialized, m17n__shell_initialized,
1207 m17n__gui_initialized): New externs.
1209 * m17n-core.h (enum M17NStatus): New enum.
1210 (m17n_status): Extern it.
1212 * m17n-core.c (core_initialized): Delete this variable.
1213 (m17n__core_initialized, m17n__shell_initialized,
1214 m17n__gui_initialized): New variables.
1215 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1216 instead of core_initialized.
1217 (m17n_status): New function.
1219 * m17n.c (shell_initialized): Delete this variable.
1220 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1223 * m17n-gui.h (m17n_init_win): Adjust the prototype.
1225 * m17n-gui.c (win_initialized): Delete this variable.
1226 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1227 instead of gui_initialized.
1229 2004-11-19 Kenichi Handa <handa@m17n.org>
1231 * input.c (reset_ic): Check if ic_info->state is NULL.
1232 (filter): If ic_info->state is NULL, return 0.
1233 (load_input_method): Don't unref `maps' it it's not created.
1235 2004-11-15 Kenichi Handa <handa@m17n.org>
1237 * input.c (find_candidates_group): If INDEX is -1, find the last
1239 (take_action_list): If the previous of the first candidate is
1240 requested, select the last candidate.
1242 2004-11-08 Kenichi Handa <handa@m17n.org>
1244 * m17n-X.c (device_open): Try at most 32 fonts to find a
1245 non-autoscaled font.
1247 * font.c (xlfd_parse_name): Fix previous change.
1249 2004-11-05 Kenichi Handa <handa@m17n.org>
1251 * font.c: (commont_style): Include dummy elements "slanted" and
1252 "rslanted" to prefer "o" to "r" if "i" is requested.
1254 * font-ft.c (ft_to_prop): Fix "oblique" entry.
1256 2004-10-29 Kenichi Handa <handa@m17n.org>
1258 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1260 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1261 New members smallest and larger.
1262 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1263 (xfont_registry_list): Likewise.
1264 (xfont_select): Likewise.
1267 2004-10-28 Kenichi Handa <handa@m17n.org>
1269 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1270 font name comparison.
1271 (xfont_select): Fix logic for selecting a larger size font.
1273 2004-10-25 Kenichi Handa <handa@m17n.org>
1275 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1278 2004-10-22 Kenichi Handa <handa@m17n.org>
1280 * input.c (update_candidate): Renamed from udpate_candidate.
1281 (take_action_list): Show more debugging info on arithmetic commands.
1283 * m17n-X.c (device_open): Fix previous change.
1285 * draw.c (compose_glyph_string): Don't get face property at the
1288 2004-10-21 Kenichi Handa <handa@m17n.org>
1290 * draw.c (compose_glyph_string): Fix for the case of category
1293 2004-10-19 Kenichi Handa <handa@m17n.org>
1295 * input.c (mdebug_mask): New variable.
1296 (shift_state): Print debug information.
1297 (take_action_list): Likewise.
1298 (handle_key): Likewise.
1300 2004-10-14 Kenichi Handa <handa@m17n.org>
1302 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1304 2004-10-13 Kenichi Handa <handa@m17n.org>
1306 * m17n-X.c (device_open): Be sure to register at least one font
1309 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
1310 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1312 2004-10-12 Kenichi Handa <handa@m17n.org>
1314 * draw.c (alloc_gstring): Fix previous change.
1316 * font-ft.c (ft_list_generic): Fix for the case of not
1319 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1321 * font.c (mfont_list): If no font is found, return NULL.
1322 (load_font_encoding_table): Put entries of nil registry first.
1323 (find_encoding): Adjust for the above change.
1325 2004-10-11 Kenichi Handa <handa@m17n.org>
1327 * m17n-gui.h (mfont_list): Adjust prototype.
1329 * m17n-X.c (xfont_list): New arg maxnum.
1331 * font.h (struct MFontDriver): Change prototype of <list>.
1333 * font-ft.c (fc_generic_family_list): Delete it.
1334 (Mserif, Msans_serif, Mmonospace): Delete them.
1335 (M_generic_family_info): New variable.
1336 (enum GenericFamilyType): New enum.
1337 (struct GenericFamilyInfo): New struct.
1338 (generic_family_table): New variable.
1339 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1341 (add_font_info): Get style here.
1342 (ft_list_family): Don't initialize fc_config here. Don't list
1344 (ft_list_generic): New function.
1345 (ft_select): Pay attention to generic familes here.
1346 (ft_open): Fix calculation of ascent and descent.
1347 (ft_list): Pay attention to generic families.
1348 (mfont__ft_init): Initialize M_generic_family_info,
1349 generic_family_table, and fc_config..
1350 (mfont__ft_fini): Finalize generic_family_table.
1352 * draw.c (compose_glyph_string): Use more constant font for
1353 glyphs. Adjust for the member change in MGlyph.
1354 (layout_glyph_string): Adjust for the member change in MGlyph.
1355 (alloc_gstring): Intilize scracth_glyph to avoid
1356 compose_glyph_string on it.
1357 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1358 (mdraw_coordinates_position): Fix previous change.
1360 * internal-gui.h (glyph_category): New enum.
1361 (MGlyph): Change type of <category> to enum glyph_category.
1363 * face.c (mface__realize): Delete args langauge and charset.
1364 (mface__for_chars): Fix for the case that glyphs have different
1366 (mface__update_frame_face): Adjust for mface__realize change.
1368 * face.h (mface__realize): Adjust prototype.
1370 2004-10-05 Kenichi Handa <handa@m17n.org>
1372 * language.c (mlang__init): Add Akan.
1374 2004-10-04 Kenichi Handa <handa@m17n.org>
1376 * font-ft.c (add_font_info): Add instead of push the element.
1377 (ft_list_family): For generic fonts, try all
1378 substituted. families.
1380 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1381 (run_rule): Don't update cluster range here.
1382 (run_command): Update cluster range on appending a glyph.
1383 (run_otf): Update cluster range for glyphs generated by OTF.
1385 2004-10-02 Kenichi Handa <handa@m17n.org>
1387 * m17n-X.c (device_open): Handle Mfont key in PLIST.
1389 2004-09-30 Kenichi Handa <handa@m17n.org>
1391 * font-ft.c (ft_select): Ignore family on calling mfont__score.
1393 2004-09-30 Kenichi Handa <handa@m17n.org>
1395 * font.h: Include <fontconfig/fontconfig.h>.
1396 (MFTInfo): New member langset.
1397 (mfont__encoding_list): Extern it.
1399 * font.c (mfont__encoding_list): New function.
1400 (mdebug_dump_font_list): New function.
1402 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1403 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1405 (ft_family_list): New variable.
1406 (set_font_info): New arg basep. Callers changed.
1407 (fc_list): Check the return value of FcPatternGetString.
1408 (add_font_info): New arg plist. Callers changed. Update
1410 (ft_list_family): New function (merged fc_list and ft_list_all).
1411 (ft_select): Use ft_list_family.
1412 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
1414 (mfont__ft_init): Initialize above new variables.
1415 (mfont__ft_fini): Free ft_family_list.
1416 (STRDUP_LOWER): New macro.
1417 (set_font_info): Use STRDUP_LOWER.
1418 (ft_list_family): Avoid duplicate addition of font path. Use
1420 (fc_decode_prop): Fix typo.
1422 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1423 (xfont_registry_list): Change argument disp_info to frame.
1425 (xfont_list_all): New function.
1426 (xfont_list): If FONT is not NULL, check all fonts.
1428 2004-09-28 Kenichi Handa <handa@m17n.org>
1430 * m17n-X.c (MXFont, MXFontList): New types.
1431 (MDisplayInfo): Delete members font_registry_list,
1432 iso8859_1_family_list, iso10646_1_family_list, new members
1433 font_list, base_font_list.
1434 (free_display_info): Adusted for the change of MDisplayInfo.
1435 (xfont_driver): Initialize with xfont_list.
1436 (font_compare): New function.
1437 (build_font_list): Deleted.
1438 (xfont_registry_list): New function.
1439 (xfont_select): Use xfont_registry_list.
1440 (xfont_list): New function.
1441 (device_open): Adusted for the change of MDisplayInfo.
1443 * font-ft.c (add_font_info): New arg languages. Callers changed.
1444 (fc_list): Get languages from fonts..
1445 (ft_list_all): Renamed from ft_list. Callers changed.
1446 (ft_list): New function.
1447 (mfont__ft_driver): Initalize with ft_list.
1449 * font.c (mfont_list): New function.
1451 * font.h (struct MFontDriver): New member `list'.
1452 (MFTInfo): New member languages.
1454 * m17n-gui.h (mfont_list): Extern it.
1456 2004-09-27 Kenichi Handa <handa@m17n.org>
1458 * internal-gui.h (struct MGlyphString): Delete members mt,
1459 sub_width, sub_lbrearing, sub_rbearing, and region.
1461 * draw.c (MSubTextExtents): New type.
1462 (layout_glyphs): New arg extents. Set its members.
1463 (layout_glyph_string): Adjusted for the above change.
1464 (alloc_gstring): Don't set gstring->mt.
1465 (truncate_gstring): Call line_break function with mt instead of
1468 2004-09-22 Kenichi Handa <handa@m17n.org>
1470 * mtext.c (count_utf_16_chars): Count each code of invalid
1473 2004-09-19 Kenichi Handa <handa@m17n.org>
1475 * mtext.c (default_utf_16, default_utf_32): Rename them to
1476 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
1479 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1482 2004-09-13 Kenichi Handa <handa@m17n.org>
1484 * draw.c (Mlatin): Don't declare it here.
1485 (visual_order): Fix reordering of combining characters.
1486 (compose_glyph_string): Fix detection of script.
1487 (layout_glyphs): Don't fix reordering of combining characters
1489 (layout_glyph_string): Pay attention to
1490 control->disable_overlapping_adjustment.
1491 (truncate_gstring): Include at least on character in a line.
1492 (get_gstring): Always scan one full line.
1493 (mdraw__init): Don't initialize Mlatin here.
1494 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
1495 have a font, use ascent/descent of an ASCII font. Allow
1496 ink_array_return and logical_array_return to be NULL.
1497 (mdraw_coordinates_position): Fix iteration.
1499 * font-ft.c (MFTtoProp): Member completely changed.
1500 (ft_to_prop): Adjusted for the above change.
1501 (ft_to_prop_size): Likewise.
1502 (set_font_info): Adjusted for the change of MFTtoProp.
1503 (fc_generic_family_list): New variable.
1504 (fc_list): Add special handling of generic font names.
1505 (mfont__ft_init): Adjusted for the change of MFTtoProp.
1506 Initialize fc_generic_family_list.
1507 (mfont__ft_fini): Don't free ft_to_prop. Free
1508 fc_generic_family_list.
1509 (FC_vs_M17N_font_prop): New type.
1510 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1511 (fc_decode_prop, fc_encode_prop): New functions.
1512 (mfont__ft_parse_name): Use fc_decode_prop.
1513 (mfont__ft_unparse_name): Use fc_encode_prop.
1515 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1516 (MWDevice): Add member realized_font_list.
1517 (free_display_info): Don't free disp_info->realized_font_list.
1518 (free_device): Free device->realized_fontset_list.
1519 (xft_find_metric): Use gstring->frame instead of rfont->frame.
1520 (device_open): Don't initialize disp_info->realized_font_list.
1521 (device_open): Initialize device->realized_font_list and set it to
1522 frame->realized_font_list.
1524 * fontset.c (try_font_group): New function.
1525 (mfont__lookup_fontset): Use try_font_group.
1527 * font.c (common_weight): Change the order of "regular".
1529 * face.c (Mlatin): Don't make it static.
1530 (mface__realize): Be sure to set work_gstring.frame.
1531 (mface__for_chars): Likewise.
1533 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1536 * internal-gui.h (Mlatin): Extern it.
1538 * m17n-gui.h (MDrawControl): New member
1539 disable_overlapping_adjustment.
1541 2004-09-06 Kenichi Handa <handa@m17n.org>
1543 * font-flt.c (run_otf): Fix typo ('}'->']').
1545 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1546 (COMBINING_PRECOMPUTED_P): New macros.
1548 * draw.c (layout_glyphs): Handle precomputed combining code.
1550 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1551 precomupted combining code.
1553 2004-09-03 Kenichi Handa <handa@m17n.org>
1555 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1558 2004-08-27 Kenichi Handa <handa@m17n.org>
1560 * face.c (mface_put_prop): If the new value is the same as the
1561 current one, don't increment frame->tick.
1563 2004-08-25 Kenichi Handa <handa@m17n.org>
1565 * fontset.c (mfontset): Initialize font_spec_list member.
1566 (mfontset_copy): Load fontset if necessary.
1568 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1569 'metrics' to for C++.
1571 * draw.c (mdraw_glyph_info): Adjusted for the member name change
1574 2004-08-16 Kenichi Handa <handa@m17n.org>
1576 * Version 1.1.0 released.
1578 2004-08-13 Kenichi Handa <handa@m17n.org>
1580 * language.c (mlang__init): Add Dhivehi.
1582 * m17n-gui.c (Mx, Mfreetype): Delete it.
1583 (m17n_init_win): Don't initialize Mx and Mfreetype here.
1585 * m17n-gui.h (Mfreetype, Mxft): Extern them.
1586 (mfont_resize_ratio): Extern it.
1587 (MDrawGlyphInfo): New member logical_width;
1588 (MDrawGlyph): New type.
1589 (mdraw_glyph_list): Prototype adjusted.
1591 * m17n-X.c (xfont_open): Set type and fontp members.
1592 (xft_open): Likewise.
1594 * internal-gui.h (Mx, Mfreetype): Delete extern.
1596 * font.h (struct MRealizedFont): New member type and fontp.
1598 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1599 (Mx, Mfreetype): Declare here.
1600 (Mxft): New variable.
1601 (mfont_resize_ratio): New function.
1603 * font-ft.c (ft_open): Set type and fontp members.
1605 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
1608 2004-08-11 Kenichi Handa <handa@m17n.org>
1610 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1613 2004-08-06 Kenichi Handa <handa@m17n.org>
1615 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1618 * font-flt.c (run_otf): Print debugging information if necessary.
1620 2004-08-05 Kenichi Handa <handa@m17n.org>
1622 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
1623 positioning_type 5 and 6. Switch simplified.
1625 2004-08-04 Kenichi Handa <handa@m17n.org>
1627 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1629 2004-08-02 Kenichi Handa <handa@m17n.org>
1631 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1632 set val to 1 even if it is greater than 1.
1634 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1636 2004-07-29 Kenichi Handa <handa@m17n.org>
1638 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1639 debugging information.
1641 * internal.h (MDEBUG_PRINT5): New macro.
1643 * draw.c (layout_glyphs): Don't combine a zero width glyph with
1644 the previous one if the zero width glyph has left or right
1647 2004-07-26 Kenichi Handa <handa@m17n.org>
1649 * m17n-X.c (xft_render): Pay attention to members left_padding and
1650 right_padding of MGlyph.
1652 * draw.c (visual_order): Allocate one more elements for arrays as
1653 a workaround of fribidi bug.
1654 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1655 instead of MGlyph->bidi_sensitive.
1656 (layout_glyph_string): Pay attentinon to
1657 control->orientation_reversed when padding at the head or tail.
1658 Fix adjustment of space glyph width.
1659 (get_gstring): If cursor_width or cursor_bidi is changed, don't
1662 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1663 instead of MGlyph->bidi_sensitive.
1665 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1667 2004-07-26 Kenichi Handa <handa@m17n.org>
1669 * draw.c (visual_order): Don't treat combined glyphs specially.
1670 (layout_glyphs): Don't get metrics glyphs that are already ready.
1671 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
1672 width with the previous one.
1673 (draw_background): Fix bar cursor position on a r2l glyph.
1675 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1676 (run_rule): Fix place of updating cluster_begin_pos and
1677 cluster_end_pos here.
1678 (run_otf): Don't set left_padding.
1680 * font-ft.c (adjust_anchor): Type of argument `code' changed.
1682 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1683 Fix handling of GPOS.
1684 (mfont__ft_drive_gpos): Delete this function.
1686 * font.h (mfont__ft_drive_otf): Renamed back from
1687 mfont__ft_drive_gsub.
1688 (mfont__ft_drive_gpos): Delete extern.
1690 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1691 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1693 2004-07-23 Kenichi Handa <handa@m17n.org>
1695 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1696 the same bidi level.
1698 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1700 2004-07-22 Kenichi Handa <handa@m17n.org>
1702 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1704 2004-07-20 Kenichi Handa <handa@m17n.org>
1706 * draw.c (render_glyphs): Fix checking of g->code validity.
1708 * face.c (mface__realize): Set g.type.
1710 2004-07-18 Kenichi Handa <handa@m17n.org>
1712 * Makefile.am: Prepend ${top_srcdir} to all *.la in
1715 * m17n-gui.c (mframe): Print error message give by dlopen to
1718 2004-07-16 Kenichi Handa <handa@m17n.org>
1720 * draw.c (compose_glyph_string): Improve the way of deciding a
1721 script. For a character that doesn't have script property, use
1722 the last non-latin script.
1724 * font-ft.c (fc_list): Cancel previous change.
1725 (mfont__ft_init): Add more entries in ft_to_prop_name.
1727 2004-07-15 Kenichi Handa <handa@m17n.org>
1729 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1730 previous or next character glyphs.
1732 2004-07-14 Kenichi Handa <handa@m17n.org>
1734 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1735 of type GLYPH_SPACE.
1737 * fontset.c (mfont__lookup_fontset): If glyph type is
1738 GLYPH_SPACE, get codes for SPACE.
1740 * internal-gui.h (Mfont): Delete extern.
1742 * m17n-gui.h (Mfont): Delete duplicated extern.
1744 2004-07-13 Kenichi Handa <handa@m17n.org>
1746 * font-ft.c (DEVICE_DELTA): New macro.
1747 (adjust_anchor): New function.
1748 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
1750 (mfont__ft_drive_gpos): New function.
1752 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1753 (FontLayoutContext): Delete member `rfont'.
1754 (run_otf): Set g->otf_cmd. Call
1755 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
1756 only whne HAVE_OTF is defined.
1758 * fontset.c: Include "config.h".
1760 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1761 (MGlyph): New member otf_cmd.
1763 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1764 (mfont__ft_drive_gpos): Extern it.
1766 * face.c: Include "config.h".
1768 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1770 * input-gui.c: Include "config.h".
1772 * plist.c: Include "config.h".
1774 2004-07-06 Kenichi Handa <handa@m17n.org>
1776 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1777 internal-gui.h: Cancel previous changes.
1779 * m17n-gd.h: Delete it.
1781 * Makefile.am (libm17n_core_la_LIBADD): New variable.
1782 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1783 @XML2_LD_FLAGS@ to above.
1784 (libm17n_la_LIBADD): Add -ldl.
1785 (libm17n_la_LDFLAGS): Add -export-dynamic.
1786 (X_LD_FLAGS): Fix the order of linking.
1787 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1788 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1789 (libm17n_X_la_LDFLAGS): Add -module.
1790 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1791 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1792 (libm17n_gd_la_LDFLAGS): Add -module.
1793 (include_HEADERS): Delete m17n-gd.h.
1795 2004-06-30 Kenichi Handa <handa@m17n.org>
1797 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1798 (MDeviceLibraryInterface): Delete it.
1799 (register_device_library): Delete it.
1800 (m17n__device_library_list): Renamed from device_library_list.
1802 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1803 (m17n_init_win): Adjust prototype.
1805 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1806 (m17n_init_gd): New function.
1808 * m17n-gd.h: New file.
1810 * m17n-X.h: Include <m17n-gui.h>.
1811 (m17n_init_X): Extern it.
1812 (M17N_INIT): Redefine it.
1814 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1815 (m17n_init_X): New function.
1817 * internal-gui.h (m17n__device_library_list): Extern it.
1818 (struct MDeviceDriver): New members initialized, init, and fini.
1820 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1822 (libm17n_X_la_LIBADD): Delete aboves.
1823 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1824 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1825 (libm17n_gd_la_LDFLAGS): Delete it.
1826 (include_HEADERS): Add m17n-gd.h.
1828 2004-06-25 Kenichi Handa <handa@m17n.org>
1830 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1831 (libm17n_gd_la_LDFLAGS): Cancel previous change.
1833 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1835 * font-ft.c (fc_list): If FcFontList finds no font, try
1838 * draw.c (compose_glyph_string): Terminate the last loop after
1839 doing default combining if necessary.
1841 2004-06-24 Kenichi Handa <handa@m17n.org>
1843 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1845 * character.c (mchar_define_property): Add const to an arg.
1847 * charset.c (mchar_define_charset): Add const to an arg.
1849 * coding.c (MCodingSystem): Add const to an arg or decoder.
1850 (finish_decoding): Add const to an arg.
1851 (decode_coding_charset, decode_coding_utf_8)
1852 (decode_coding_utf_16, decode_coding_utf_32)
1853 (decode_coding_iso_2022, decode_coding_sjis)
1854 (mconv_define_coding): Likewise.
1856 * m17n-X.c (xft_find_metric): Delete unused variable.
1858 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1861 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1864 * mtext.c (count_utf_8_chars, count_utf_16_chars)
1865 (mtext__from_data, mtext_from_data): Add `const' to an arg.
1867 * mtext.h (mtext__from_data): Ajust prototype.
1869 2004-06-23 Kenichi Handa <handa@m17n.org>
1871 * draw.c (compose_glyph_string): Always get glyph codes by
1873 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1874 (mdraw_glyph_list): New function.
1876 * font-flt.c (mfont__flt_run): Be sure to call
1877 rfont->driver->encode_char.
1879 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1880 (ft_encode_char): Delete arg C.
1881 (ft_render): Don't call FT_Get_Char_Index.
1883 * font.c (mfont__encodable_p): Delete it.
1884 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1886 * font.h (struct MFontDriver): Delete arg C of encode_char.
1887 (mfont__encodable_p): Delete extern.
1889 * m17n-X.c (xfont_encode_char): Delete arg C.
1890 (xft_find_metric): Don't cal FT_Get_Char_Index.
1891 (xft_render): Likewise.
1893 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
1895 (mdraw_glyph_list): Extern it.
1897 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
1899 2004-06-22 Kenichi Handa <handa@m17n.org>
1901 * m17n-gui.h (mfontset_lookup): Extern it.
1903 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
1905 * fontset.c (realize_fontset_elements)
1906 (free_realized_fontset_elements, update_fontset_elements): New
1908 (mfont__realize_fontset): Call realize_fontset_elements.
1909 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
1910 (mfont__lookup_fontset): If a fontset was modified, update
1911 the realized fontset.
1912 (mfontset_modify_entry): Increment fontset->tick.
1913 (mfontset_lookup): New function.
1915 2004-06-21 Kenichi Handa <handa@m17n.org>
1917 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
1919 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
1920 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
1921 length of source text 0.
1923 2004-06-21 Kenichi Handa <handa@m17n.org>
1925 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
1926 (compare): Pay attention to format other than utf-8.
1927 (copy): Delete this function.
1928 (count_by_utf_8, count_by_utf_16, insert): New functions.
1929 (count_utf_16_chars): Fix handling of a surrogate pair.
1930 (find_char_forward, find_char_backward): Likewise.
1931 (mtext__from_data): Delete unnecessary check. Fix number of
1933 (mtext_from_data): Don't count items.
1934 (mtext_ref_char): Optimize the code.
1935 (mtext_set_char): Pay attention to format other than utf-8.
1936 (mtext_cat_char): Likewise.
1937 (mtext_dup): Don't call copy, instead do allocation here.
1938 (mtext_cat): Call insert instead of copy.
1939 (mtext_ncat): Likewise.
1940 (mtext_cpy): Delete character at first and call insert instead of
1942 (mtext_ncpy): Likewise.
1943 (mtext_copy): Likewise.
1944 (mtext_duplicate): Call insert instead of copy.
1945 (mtext_del): Pay attention to format other than utf-8.
1946 (mtext_ins): Simply call insert.
1947 (mtext_ins_char): Pay attention to format other than utf-8.
1948 (mtext_tok): Call insert instead of copy.
1949 (mtext_text): Call UNIT_BYTES.
1951 * textprop.c (mtext__adjust_plist_for_change): New function.
1953 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
1954 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
1955 (CHAR_UNITS_AT): Fix typo.
1956 (CHAR_UNITS_BY_HEAD): Fix typo.
1957 (STRING_CHAR_AND_UNITS): Fix typo.
1959 * internal.h (MTEXT_READ_ONLY_P): New macro.
1961 * mtext.h (mtext__replace): Delete the extern.
1962 (mtext__adjust_foramt): Adjust prototype.
1964 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
1965 if possible. Otherwise make a copy of mmt.
1967 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
1970 2004-06-18 Kenichi Handa <handa@m17n.org>
1972 * character.h (CHAR_STRING_UTF16): Fix syntax.
1974 2004-06-16 Kenichi Handa <handa@m17n.org>
1976 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
1977 (libm17n_X_la_LIBADD): Delete it.
1978 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
1980 * m17n-X.c (device_open): Add parens in `if' condition.
1982 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
1983 (DEC_POSITION): Likewise.
1984 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
1986 2004-06-15 Kenichi Handa <handa@m17n.org>
1988 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
1991 * draw.c (compose_glyph_string): If langauge is specified, call
1992 mface__for_chars even if a text is all latin. Fix condition for
1993 setting non_ascii_found.
1995 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
1997 * m17n.h (minput_char_to_key): Delete extern.
1999 * m17n-gui.h (minput_event_to_key): Cancel previous change.
2001 * m17n-gui.c (null_device_open): Set several members of frame.
2003 2004-06-14 Kenichi Handa <handa@m17n.org>
2005 * m17n-gui.h (minput_event_to_key): Delete extern.
2007 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2009 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2011 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2013 2004-06-08 Kenichi Handa <handa@m17n.org>
2015 * character.c (mchar_put_prop): Don't increment the ref-count of
2018 2004-06-04 Kenichi Handa <handa@m17n.org>
2020 * m17n-core.c (mdebug__register_object): New function.
2021 (mdebug__unregister_object): Likewise.
2023 * internal.h (mdebug__register_object, mdebug__unregister_object):
2025 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2028 * charset.c (mcharset__load_from_database): Don't call
2029 mconv__register_charset_coding here.
2031 * coding.c (find_coding): Get a real name from an element of
2032 coding_definition_list.
2033 (mconv__register_charset_coding): Set the real name at the top of
2035 (mcoding__load_from_database): Likewise.
2036 (mconv_list_codings): Adjusted for the above change.
2038 2004-06-03 Kenichi Handa <handa@m17n.org>
2040 * coding.c (find_coding): Find by canonicalized name. Don't have
2041 to modify the element of coding_definition_list by
2043 (mconv__define_coding_from_charset): Delete it.
2044 (mconv__register_charset_coding): Canonicalize sym.
2045 (mcoding__load_from_database): Register plist modified by
2048 * coding.h (mconv__define_coding_from_charset): Don't extern it.
2050 * font-ft.c (ft_open): Fix setting of rfont->descent.
2052 2004-06-02 Kenichi Handa <handa@m17n.org>
2054 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2055 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2056 (xlfd_unparse_name): Renamed from xfont_build_name.
2057 (mfont__init): Initialized Mfontconfig.
2058 (mfont__free_realized): Unconditionally unref rfont->info.
2059 (mfont__select): Free `this' if it's not best.
2060 (mfont__open): Don't check frame->realized_font_list.
2061 (mfont__parse_name_into_font): New function.
2062 (Mfontconfig): New variable.
2063 (mfont_from_name): Call mfont_parse_name.
2064 (mfont_name): Call mfont_unparse_name.
2065 (mdebug_dump_font): Likewise.
2067 * font.h (struct MFontDriver): Delete members parse_name and
2069 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2070 (mfont__parse_name_into_font): Extern it.
2072 * font-ft.c: Include "symbol.h".
2073 (close_ft): Unconditionally free filename and charmap_list of
2075 (ft_open): Duplicate base->filename. Increment ref-count of
2076 ft_info->charmap_list. Free ft_info->charmap_list and
2077 ft_info->filename on error.
2078 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2080 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2082 (enum xlfd_field_idx): Moved to font.c.
2083 (split_font_name, build_font_name): Likewise.
2084 (build_font_list): Call mfont__parse_name_info_font.
2085 (xfont_open): Call mfont__unparse_name. Free name.
2086 (xfont_parse_name, xfont_build_name): Moved to font.c
2087 (xft_select): Prototype deleted.
2088 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2089 Call mfont_pase_name.
2091 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2092 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2095 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2098 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2100 2004-06-01 Kenichi Handa <handa@m17n.org>
2102 * fontset.c (mfontset_modify_entry): Pay attention to the case
2103 that fontset->font_spec_list is NULL.
2105 2004-05-31 Kenichi Handa <handa@m17n.org>
2107 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2109 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2111 * font.c (mfont__select): Print score the a font for debugging.
2113 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2115 * coding.c (reset_coding_sjis): Check kanji and kana instead of
2116 kanji_sym and kana_sym.
2118 2004-05-28 Kenichi Handa <handa@m17n.org>
2120 * Makefile.am (VINFO): New variable.
2121 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2122 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2124 2004-05-27 Kenichi Handa <handa@m17n.org>
2126 The following chanages are to make device dependent functions
2127 accessible only from MDeviceDriver structure, and to add GD and
2128 null device drivers. Font drivers get also device dependent.
2130 * m17n.c (m17n_init): Increament shell_initialized.
2131 (m17n_fini): Decremented shell_initialized.
2133 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2135 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2136 (Mwidget, Mcolormap, Mx): Extern them.
2138 * m17n-gui.c: Include <dlfcn.h> and "config.h".
2139 (free_frame): Call frame->driver->close instead of
2141 (DLOPEN_SHLIB_EXT): New macro.
2142 (MDeviceLibraryInterface): New type.
2143 (device_library_list): New variable.
2144 (register_device_library): New function.
2145 (null_device): New variable.
2146 (null_device_close, null_device_get_prop)
2147 (null_device_realize_face, null_device_free_realized_face): New
2149 (null_driver): New variable.
2150 (null_device_init, null_device_fini, null_device_open): New
2152 (null_interface): New variable.
2153 (Mfreetype, Mdevice): Declare them.
2154 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
2155 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2156 Mwin__Close_Device. Register drivers for Mx and Mgd.
2157 (m17n_fini_win): Decremented win_initialized. Call "fini"
2158 function of all opened devices. Don't call mwin__fini.
2159 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2161 (mframe): Handle Mdevice key of PLIST.
2162 (mframe_get_prop): Call frame->device->get_prop instead of
2163 mwin__device_get_prop.
2165 * m17n-gd.c: New file.
2167 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2168 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2170 * m17n-core.c (m17n_init_core): Increate core_initialized.
2171 (m17n_fini_core): Decremented core_initialized.
2173 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2174 (Mcolormap): Don't extern them here.
2176 * m17n-X.c (FRAME_DEVICE): New macro.
2177 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2178 (free_display_info): Use MPLIST_DO.
2179 (free_device): Free rface->info.
2180 (xft_close): Delete it.
2181 (device_init): Renamed from mwin__init.
2182 (device_fini): Renamed from mwin__fini.
2183 (device_open): Renamed from mwin__open_device.
2184 (x_driver): New variable.
2185 (MXFontInfo): Delete member frame, add member display.
2186 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2187 Don't declare them here.
2189 * internal-gui.h (MDeviceType): New enum.
2190 (MWDefice): Delete it.
2191 (struct MFrame): Change type of device to void *. New members
2192 device_type, driver, font_driver_list.
2193 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2194 (MDeviceDriver): New type.
2195 (Mx, Mgd, Mfreetype): Extern them.
2196 (mwin__XXX): Delete all of them.
2198 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2200 (win_destroy_ic): Likewise.
2201 (adjust_window_and_draw): Likewise.
2202 (win_callback): Likewise.
2203 (Mxim): Declare it here.
2204 (minput_event_to_key): Call M_CHECK_READABLE.
2206 * fontset.c (mfont__lookup_fontset): Delete local variable
2209 * font.h (struct MFontDriver): Delete member close, add members
2210 parse_name and build_name.
2211 (mfont__driver_list): Delete extern.
2212 (mfont__close): Delete extern.
2214 * font.c (mfont__init): Don't set mfont__driver_list.
2215 (mfont__fini): Don't unref mfont__driver_list.
2216 (mfont__select): Try font drivers in frame->font_driver_list. Set
2217 driver member of a realized font.
2218 (mfont__close): Delete it.
2219 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2220 functions of the default frame.
2222 * font-ft.c (close_ft): Check ft_info->ft_face and work
2224 (add_font_info): Allocate ft_info by M17N_OBJECT.
2225 (ft_close): Delete it.
2226 (mfont__ft_driver): Don't set ft_close.
2227 (ft_select): Increment ref-count of best_font.
2228 (ft_open): Decremented ref-count of base. On error, call
2229 FT_Done_Face and free ft_info.
2230 (ft_find_metric): Always use XXX_MONO in load_flags.
2231 (ft_render): Fix setting of width. Call
2232 frame->driver->draw_points instead of mwin__draw_points.
2233 (ft_to_prop): Don't set mfont__driver_list.
2234 (mfont__ft_fini): Just unref ft_info.
2236 * face.c (mface__init): Exchange foreground and background of
2237 mface__default. Call mface_put_prop to set hline of
2239 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2240 (mface__free_realized): Don't call mwin__free_realized_face.
2242 * draw.c (Mdepth): Don't declare it here.
2243 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2244 (render_glyphs, render_glyph_string): Likewise.
2245 (mdraw__init): Don't set Mdepth.
2246 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2248 (mdraw_text_per_char_extents): Return 0 on success and -1 on
2250 (mdraw_text_items): Check FRAME is writable.
2251 (mdraw_per_char_extents): Implement body.
2253 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2255 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2256 (GUI_SOURCES): Delete it.
2257 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2258 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2259 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2260 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2261 (linkgui_LDADD): Set to libm17n-gui.la
2262 (linkgui_LDFLAGS): New target.
2263 (SRC): Include ${libm17n_gui_la_SOURCES} and
2264 ${libm17n_gd_la_SOURCES}.
2266 2004-05-24 Kenichi Handa <handa@m17n.org>
2268 * draw.c (draw_background): Don't draw background even if
2269 rface->face.property[MFACE_BACKGROUND] is not Mnil.
2271 2004-05-22 Kenichi Handa <handa@m17n.org>
2273 * m17n-X.c (xft_open_font): Fix anti_alias setting.
2275 2004-05-20 Kenichi Handa <handa@m17n.org>
2277 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2279 * m17n-gui.c: Include "plist.h".
2280 (mframe): If PLIST is NULL, initialize it to emply plist.
2282 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2283 (xft_driver): New variable.
2284 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2285 (xft_find_metric, xft_render): New function.
2286 (mwin__init): Adjusted for the new mfont__driver_list.
2287 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
2288 generated face to PARAM.
2289 (mwin__realize_face): Fix setting of box colors. Don't call hook
2291 (mwin__draw_hline): New function.
2292 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2293 (mwin__xft_render): Delete these function.
2295 * internal-gui.h (struct MFrame): New member tick.
2296 (struct MGlyphString): New member tick.
2297 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2298 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2299 (mwin__xft_render): Delete extern.
2301 * fontset.c (mfont__lookup_fontset): Make the code simpler.
2302 (mfontset): Always increment the reference count of returned
2305 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2306 (MFTInfo): Moved to font.h.
2307 (ft_iso8859_1_font_list): Delete this variable.
2308 (set_font_info): Don't set font->property[MFONT_TYPE].
2309 (set_font_info): Don't udpate ft_iso8859_1_font_list.
2310 (add_font_info): Change type to void.
2311 (fc_list): Change anme from xft_list. Caller changed. Include
2312 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2313 (mfont__ft_driver): Change name from ft_driver. Caller changed.
2314 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2315 (close_ft): Don't call mwin__xft_close. Unref
2316 ft_info->extra_info.
2317 (ft_open): Don't setup ft_info->fontname. Don't call
2319 (ft_find_metric): Don't call mwin__xft_get_metric.
2320 (ft_encode_char): Call rfont->driver->open instead of ft_open.
2321 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
2322 (mfont__ft_init): Adjusted for new mfont__driver_list.
2323 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2325 * font.c (mfont__driver_list): Make it MPlist.
2326 (mfont__init): Adjust initialization of mfont__driver_list.
2327 (mfont__fini): Free mfont__driver_list.
2328 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2329 (mfont__select): Adjusted for the new mfont__driver_list.
2331 * font.h (enum MFontProperty): Delete MFONT_TYPE.
2332 (mfont__drirver_list): Adjust prototype.
2333 (MFTInfo): Move to here from fron.c. Deleve member fontname.
2335 * face.h (struct MFace): Delete member realized_face_list, add
2337 (struct MRealizedFace): Delete member need_update
2338 andnofont_rface, add member non_ascii_list.
2339 (mface__update_frame_face): Extern it.
2341 * face.c (hline_prop_list, box_prop_list, noop_hook): New
2343 (get_hline_create, get_box_create): New functions.
2344 (find_realized_face): Cancel previous change. Arg RFONT deleted.
2346 (free_face): Cancep previous change. Free face->frame_list.
2347 (serialize_hline): Do nothing if hline->width is zero.
2348 (serialize_box): Do nothing if box->width is zero.
2349 (mface__init): Setup all properties of mface__default.
2350 (mface__fini): Free hline_prop_list and box_prop_list.
2351 (mface__realize): Cancel previous change. Update
2352 face->frame_list. Setup rface->non_ascii_list.
2353 (mface__for_chars): Update rface->non_ascii_list.
2354 (mface__free_realized): Free rface->non_ascii_list.
2355 (mface__update_frame_face): New function.
2356 (mface): Initialize face->frame_list.
2357 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
2359 (mface_merge): Likewise.
2360 (mface_put_prop): If key is Mhline or Mbox, get value by
2361 get_hline_create or get_box_create respectively.
2362 (mface_put_prop): Update frame->tick and call
2363 mface__update_frame_face if necessary.
2364 (mface_update): Do nothing if func is noop_hook.
2366 * draw.c (render_glyphs): If a font is not found, use
2367 mwin__draw_empty_boxes.
2368 (alloc_gstring): Initialize gstring->tick.
2369 (get_gstring): Check gstring->tick.
2371 2004-05-17 Kenichi Handa <handa@m17n.org>
2373 * face.c (find_realized_face): Return value changed. If RFONT is
2374 NULL, avoid unnecessary checking.
2375 (free_face): Free face->realized_face_list.
2376 (mface__realize): Adjusted for the change of find_realized_face.
2377 If it returns a realized face that needs update, free it and
2378 realize a new one. Push a new realized face to
2379 frame->realized_face_list instead of appending.
2380 (mface__for_chars): Adjusted for the change of find_realized_face.
2381 Short cut if the required font is in rface->ascii_rface.
2382 (mface_put_prop): Free old value if necessary. Set need_update
2383 member of realized faces to 1.
2385 * face.h (struct MFace): Delete member tick, add member
2387 (struct MRealizedFace): Delete member tick, add member
2390 2004-05-13 Kenichi Handa <handa@m17n.org>
2392 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2394 2004-05-12 Kenichi Handa <handa@m17n.org>
2396 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2398 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2399 parse it XftNameParse.
2401 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2402 (all_fonts_scaned): New variable.
2403 (set_font_info): FAMILY may be Mnil.
2404 (add_font_info): Argument changed.
2405 (xft_list): Call add_font_info in it.
2406 (ft_list): Likewise.
2407 (ft_select): Make it work in the case family is Mnil.
2408 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2409 (mfont__ft_fini): Set all_fonts_scaned to 0.
2411 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2412 that is failed to open.
2414 2004-05-10 Kenichi Handa <handa@m17n.org>
2416 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2417 device's depth is 1 (i.e. monochrome).
2419 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2420 to work around the problem of libtool.
2422 * font-ft.c: Include <freetype/ftbdf.h>.
2423 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2425 (mfont__ft_init): Initialize them.
2426 (ft_iso8859_1_font_list): New variable.
2427 (set_font_info): Detect a font containing iso8859-1 glyphs and
2428 register it in ft_iso8859_1_font_list. If the font is not
2429 scalable, assume it as BDF or PCF font and setup SIZE and RESY
2430 properties of the font from its properties.
2431 (add_font_list): If the font is not scalable, check if it is BDF
2432 or PCF font. If not, ignore it.
2433 (ft_select): If FAMILY is Mnil, return NULL only if the requested
2434 registry is not iso8859-1.
2435 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2436 ft_iso8859_1_font_list.
2437 (ft_find_metric): If the font is not scalable, assume it as BDF
2438 or PCF, and get a metric from its properties.
2439 (mfont__ft_fini): Free ft_iso8859_1_font_list.
2441 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
2443 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2444 (libm17n_la_LDFLAGS): Delete it.
2445 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2446 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2448 2004-05-06 Kenichi Handa <handa@m17n.org>
2450 * draw.c (compose_glyph_string): Fix previous change.
2452 2004-04-30 Kenichi Handa <handa@m17n.org>
2454 * font-ft.c (ft_list): Delete unused variable `result'.
2455 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2457 2004-04-27 Kenichi Handa <handa@m17n.org>
2459 * m17n-X.c: Include config.h
2460 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2461 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2462 (MWDevice) [HAVE_XFT2]: New member xft_draw.
2463 (FRAME_CMAP, FRAME_VISUAL): New macros.
2464 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2465 (xfont_driver): Make it static.
2466 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2467 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2468 info->xft_color_back.
2469 (MXftFontInfo) [HAVE_XFT2]: New type.
2470 (mwin__xft_close) [HAVE_XFT2]: New function.
2471 (mwin__xft_open) [HAVE_XFT2]: New function.
2472 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2473 (mwin__xft_render) [HAVE_XFT2]: New function.
2475 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2476 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2477 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2480 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2482 * font-ft.c: Don't include FT_FREETYPE_H here.
2483 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2484 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2485 (MFTInfo): New member charmap_index.
2486 (MFTInfo) [HAVE_XFT2]: New member xft_info.
2487 (check_otf_filename): Renamed from check_filename. Return value
2489 (ft_set_property): This function deleted.
2490 (set_font_info): New function.
2491 (add_font_list): Argument changed. Add multiple fonts.
2492 (xft_list) [HAVE_XFT2]: New function.
2493 (ft_list) [not HAVE_XFT2]: New function.
2494 (ft_select): Add code for Xft.
2495 (close_ft): Likewise.
2496 (ft_open): Likewise.
2497 (ft_find_metric): Likewise.
2498 (ft_encode_char): Likewise.
2499 (ft_render): Likewise.
2501 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2503 2004-04-26 Kenichi Handa <handa@m17n.org>
2505 * textprop.c (mtext_attach_property): Declare the return type as
2508 2004-04-21 Kenichi Handa <handa@m17n.org>
2510 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2512 2004-04-09 Kenichi Handa <handa@m17n.org>
2514 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2516 (load_command): Setup above members.
2518 2004-04-05 Kenichi Handa <handa@m17n.org>
2520 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2522 2004-03-30 Kenichi Handa <handa@m17n.org>
2524 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2527 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2528 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2530 2004-03-29 Kenichi Handa <handa@m17n.org>
2532 * Version 1.0 Patch Level 2 released.
2534 2004-03-29 Kenichi Handa <handa@m17n.org>
2536 * charset.c (make_charset): Set charset->fully_loaded and
2537 charset->simple correctly. Don't try to get charset->min_char and
2538 charset->max_char for a charset of method subset and superset.
2539 Don't load a mapping file here.
2540 (mcharset__init): Set unified_max.
2541 (mcharset__load_from_database): Free a working plist.
2543 * coding.c (mcoding__fini): Free all malloced data.
2545 * input-gui.c (win_create_ic): Set control.as_image for preediting
2548 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2549 `count') to initialize the array.
2551 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2554 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2556 (mwin__create_window): Fix bug of setting a background pixel of a
2558 (mwin__adjust_window): Clear the window before drawing.
2560 * m17n-core.c (mdebug__report_object): Free array->objectes if
2562 (m17n_init_core): Don't set report_header_printed to 0 here.
2563 Fix debugging information.
2564 (m17n_fini_core): Set report_header_printed to 0 here.
2566 * m17n-core.h (mplist_deserialize): Extern it.
2568 * m17n-gui.c (m17n_fini_win): Fix debugging information.
2570 * m17n.c (m17n_fini): Fix debugging information.
2572 * mtext.c (mtext__adjust_foramt): New function.
2574 * mtext.h (mtext__adjust_foramt): Extern it.
2576 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2578 * plist.h (mplist__deserialize): Don't extern it.
2580 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
2581 elements of symbol_table to NULL. Report about created and freed
2582 symbols if MDEBUG_FINI is set.
2584 2004-03-22 Kenichi Handa <handa@m17n.org>
2586 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2588 * m17n.c (m17n_init): Fix the way of checking merror_code.
2590 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2592 2004-03-22 Kenichi Handa <handa@m17n.org>
2594 * fontset.c (realize_font_group): Adjust the font size by
2595 mfont__resize before selecting a font.
2597 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2599 2004-03-19 Kenichi Handa <handa@m17n.org>
2601 * Version 1.0 Patch Level 1 released.
2603 2004-03-19 Kenichi Handa <handa@m17n.org>
2605 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2607 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2609 2004-03-19 Kenichi Handa <handa@m17n.org>
2611 Re-apply the changes forgotten in the released version.
2613 * charset.c (mcharset__load_from_database): Call
2614 mchar_define_charset.
2616 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2617 (mconv_encode_range): Put Mcoding text property.
2619 2004-03-18 Kenichi Handa <handa@m17n.org>
2621 * draw.c (Mdepth): New variable.
2622 (visual_order): Delete unused local var `pos'.
2623 (compose_glyph_string): Fix for the case that gstring->glyphs is
2624 realloced. Stop generating glyphs at TO. Fix handling of
2626 (layout_glyphs): Get metrics of all glyphs in advance. Set
2627 lbearing and rbearing of base of composition glyph correctly.
2628 Handle left-overhang glyphs correctly.
2629 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
2631 (dump_combining_code): Change the defualt off_x character to ".".
2632 (mdraw__init): Initialize Mdepth.
2634 * face.c (work_gstring): New variable
2635 (mface__init): Initialize work_gstring.
2636 (mface__fini): Free work_gstring.glyphs.
2637 (mface__realize): Don't handle videomode property here. Adjusted
2638 for the change of mfont__get_metric.
2639 (mface__for_chars): Adjusted for the change of mfont__get_metric.
2641 * face.h (enum face_gc): Moved to m17n-X.c.
2643 * font.h (struct MFontDriver): Arguments of find_metric changed.
2644 (mfont__select): Prototype adjusted.
2645 (mfont__get_metric): Likewise.
2646 (mfont__ft_drive_otf): Likewise.
2647 (mfont__flt_run): Likewise.
2649 * font.c (mfont__select): New argument layouter. If layouter is
2650 different in the registered font, make a new copy of realized
2652 (mfont__get_metric): Argument changed. Get metrics of multiple
2654 (mfont_find): Call mfont__select with layouter as Mnil.
2656 * font-flt.c (FontLayoutContext): New member rfont.
2657 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2658 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
2660 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
2662 (NUM_POINTS): New macro.
2663 (MPointTable): New type.
2664 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2665 (mfont__ft_drive_otf): New argument rfont.
2667 * fontset.c (realize_font_group): Adjusted for the changed of
2669 (check_fontset_element): This function deleted.
2671 * input-gui.c (adjust_window_and_draw): Locate a preedit window
2672 off the parent window if the preedit text is zero length.
2674 * internal-gui.h (struct MFrame): New members foreground,
2675 background, videomode, font.
2676 (struct MGlyphString): New member anti_alias.
2677 (MDrawPoint): New type.
2678 (mwin__draw_bitmap): Prototype deleted.
2679 (mwin__draw_points): Prototype added.
2681 * m17n-gui.h (MDrawControl): New member anti_alias.
2683 * m17n-gui.c (free_frame): Free frame->font.
2684 (mframe): Set the fontset of frame->face to the default fontset.
2686 * m17n-X.c (RGB_GC): New type.
2687 (enum gc_index): Renamed from enum face_gc. Member names changed.
2689 (struct MWDevice): Members foreground and background deleted. New
2690 member scratch_gc, gc_list.
2691 (DEFAULT_FONT, FALLBACK_FONT): New macros.
2692 (free_device): Free GCs in device->gc_list.
2693 (get_rgb_gc): New function.
2694 (get_gc): Renamed and argument changed from get_color.
2695 (get_gc_for_anti_alias): New function.
2696 (xfont_find_metric): Arguments changed. Get metrics of multiple
2698 (set_region): Argument changed. Caller changed.
2699 (xfont_render): Allways set a font in gc.
2700 (x_error_handler, x_io_error_handler): Define only if
2701 X_SET_ERROR_HANDLER is defined.
2702 (mwin__open_device): Create device->scratch_gc. Set members
2703 foreground, background, and videomode of frame. Call
2704 XSetErrorHandler and XSetIOErrorHandler only if
2705 X_SET_ERROR_HANDLER is defined.
2706 (struct gc_list): Deleted.
2707 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2708 (mwin__realize_face): Adjusted for the change of the format of
2709 rface->info and the charge of set_region.
2710 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2711 (mwin__draw_box): Likewise.
2712 (mwin__draw_bitmap): This function deleted.
2713 (mwin__draw_points): New function.
2714 (mwin__verify_region): Adjusted for the change of the format of
2715 rface->info and the charge of set_region.
2716 (mwin__create_window): Inherit backgound pixel from parent.
2717 (mwin__dump_gc): Adjusted for the change of the format of
2720 2004-03-16 Kenichi Handa <handa@m17n.org>
2722 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2724 * input.c (M_key_alias): New variable.
2725 (handle_key): Try M_key_alias property of a key too.
2726 (minput__init): Initialize M_key_alias. Give that property to
2727 symbols in one_char_symbol. Fix bug of initializing
2730 * draw.c (compose_glyph_string): Don't handle
2731 ignore_formatting_char here. Include formatting characters in the
2732 range processed by a FTL.
2733 (layout_glyph_string): Handle ignore_formatting_char here.
2735 2004-03-12 Kenichi Handa <handa@m17n.org>
2737 * input-gui.c (win_create_ic): Enable bidi in status control.
2739 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2741 2004-03-09 Kenichi Handa <handa@m17n.org>
2743 * input.c (load_input_method): If title is not specified, use the
2744 input method name as title.
2746 * m17n-X.c (get_color): Make it static.
2747 (xim_create_ic, xim_destroy_ic, x_error_handler)
2748 (x_io_error_handler): Likewise.
2750 2004-03-01 Kenichi Handa <handa@m17n.org>
2752 * Version 1.0 released.
2755 Copyright (C) 2003, 2004
2756 National Institute of Advanced Industrial Science and Technology (AIST)
2757 Registration Number H15PRO112
2759 This file is part of the m17n library.
2761 The m17n library is free software; you can redistribute it and/or
2762 modify it under the terms of the GNU Lesser General Public License
2763 as published by the Free Software Foundation; either version 2.1 of
2764 the License, or (at your option) any later version.
2766 The m17n library is distributed in the hope that it will be useful,
2767 but WITHOUT ANY WARRANTY; without even the implied warranty of
2768 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2769 Lesser General Public License for more details.
2771 You should have received a copy of the GNU Lesser General Public
2772 License along with the m17n library; if not, write to the Free
2773 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA